dnl dnl Process this file with autoconf to produce a configure script. dnl dnl dnl Initialisation dnl AC_INIT(factor.h) AC_CONFIG_HEADER(factor/version.h) dnl dnl Set up variables for Makefile.in dnl dnl Change libfac variables here: libfac_name="\"Factorization and characteristic sets library\"" AC_SUBST(libfac_name) libfac_version="3.1.3" AC_DEFINE_UNQUOTED(LIBFAC_VERSION,"$libfac_version") AC_SUBST(libfac_version) libfac_date="\"March 2011\"" AC_DEFINE_UNQUOTED(LIBFAC_DATE,$libfac_date) AC_SUBST(libfac_date) libfac_author="\"M. Messollen\"" AC_SUBST(libfac_author) AC_SUBST(libfac) libfac="libfac" AC_SUBST(libfac_g) libfac_g="libfac-g" AC_SUBST(libsingfac) libsingfac="libsingfac" AC_SUBST(libsingfac_g) libsingfac_g="libsingfac-g" AC_SUBST(factorH) factorH="factor.h" AC_SUBST(targetname) dnl dnl Parse options dnl AC_ARG_WITH( debug, [ --with-debug build with debugging options turned on]) targetname="libsingfac" AC_ARG_WITH( NOSTREAMIO, [ --with-NOSTREAMIO : do not require iostream include nor library]) if test "$with_NOSTREAMIO" = yes; then AC_DEFINE(NOSTREAMIO) fi dnl dnl add to -I and -L, if necessary dnl if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \ test "${ac_default_prefix}" != "/usr/local" || \ test "${includedir}" != '${prefix}/include'; then CPPFLAGS="-I${includedir} ${CPPFLAGS}" fi CPPFLAGS="-I./factor ${CPPFLAGS}" if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \ test "${ac_default_prefix}" != "/usr/local" || \ test "${libdir}" != '${prefix}/lib'; then LDFLAGS="-L${libdir} ${LDFLAGS}" fi LDFLAGS="-L. ${LDFLAGS}" if test "${CXXFLAGS+set}" != set; then ac_cxxflags_set=no if test "$with_debug" = yes; then CXXFLAGS="-g" else CXXFLAGS="-O" AC_DEFINE(NDEBUG) fi fi dnl dnl Checks for programs. dnl AC_LANG_CPLUSPLUS AC_PROG_CXX AC_REQUIRE_CPP AC_PROG_MAKE_SET AC_PROG_RANLIB AC_CHECK_PROG(AR,ar,ar) if test -z "$AR"; then AC_MSG_ERROR(Need ar) fi dnl dnl programs for installation dnl dnl ac_save_path=${PATH} dnl PATH="$PATH:.." dnl AC_PROG_INSTALL dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p) dnl PATH="$ac_save_path" dnl dnl Checks for header files. dnl AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!)) dnl dnl Checks for libraries. dnl dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl dnl dnl Last, but not least, customize CFLAGS dnl if test x${GXX} = xyes; then if test "$ac_cxxflags_set" = no; then if test "$with_debug" = yes; then CXXFLAGS="-O -g" else CXXFLAGS="-O3 " fi # check whether CXX accepts -fno-rtti AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING(whether gcc accepts -fno-rtti) tmp_flags=${CXXFLAGS} CXXFLAGS="${CXXFLAGS} -fno-rtti" AC_CACHE_VAL(ac_cv_cxx_have_rtti, AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no) ) AC_MSG_RESULT(${ac_cv_cxx_have_rtti}) CXXFLAGS=$tmp_flags if test "${ac_cv_cxx_have_rtti}" = yes; then CXXFLAGS="$CXXFLAGS -fno-rtti" fi AC_MSG_CHECKING(whether gcc accepts -fno-exceptions) tmp_flags=${CXXFLAGS} CXXFLAGS="${CXXFLAGS} -fno-exceptions" AC_CACHE_VAL(ac_cv_cxx_have_exceptions, AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no) ) AC_MSG_RESULT(${ac_cv_cxx_have_exceptions}) CXXFLAGS=$tmp_flags if test "${ac_cv_cxx_have_exceptions}" = yes; then CXXFLAGS="$CXXFLAGS -fno-exceptions" fi AC_LANG_RESTORE fi CXXTEMPLFLAGS="-fno-implicit-templates" else CXXTEMPFLAGS="" fi AC_SUBST(CXXTEMPLFLAGS) AC_OUTPUT(Makefile)