dnl dnl Process this file with autoconf to produce a configure script. dnl dnl dnl Initialisation dnl AC_INIT(factor.h) dnl dnl Set up variables for Makefile.in dnl dnl Change libfac variables here: AC_SUBST(libfac_name) libfac_name="\"Factorization and characteristic sets library\"" AC_SUBST(libfac_version) libfac_version="0.3.0" AC_SUBST(libfac_date) libfac_date="\"Sep 11 1997\"" AC_SUBST(libfac_author) libfac_author="\"M. Messollen\"" 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]) AC_ARG_WITH( Singular, [ --with-Singular build for use with Singular]) if test "$with_Singular" = yes; then AC_DEFINE(SINGULAR) AC_DEFINE(NOSTREAMIO) if test "$with_debug" = yes; then targetname="libsingfac-g" else targetname="libsingfac" fi else if test "$with_debug" = yes; then targetname="libfac-g" else targetname="libfac" fi 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 AC_C_CONST AC_C_INLINE dnl dnl Last, but not least, customize CFLAGS dnl if test ${GXX} = yes; then # check whether CXX accepts --no-rtti AC_MSG_CHECKING(whether gcc accepts --no-rtti) tmp_flags=${CXXFLAGS} CXXFLAGS="${CXXFLAGS} --no-rtti" AC_LANG_SAVE AC_LANG_CPLUSPLUS 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}) if test "${ac_cv_cxx_have_rtti}" != yes; then CXXFLAGS=$temp_flags else CXX="${CXX} --no-rtti" fi # check whether gcc accepts --no-exceptions AC_MSG_CHECKING(whether gcc accepts --no-exceptions) CXXFLAGS="${CXXFLAGS} --no-exceptions" AC_CACHE_VAL(ac_cv_cxx_have_exceptions, AC_TRY_COMPILE(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no) ) AC_MSG_RESULT(${ac_cv_cxx_have_exceptions}) if test "${ac_cv_cxx_have_exceptions}" != yes; then CXXFLAGS=$temp_flags else CXX="${CXX} --no-exceptions" fi AC_LANG_RESTORE CXXFLAGS=$temp_flags fi if test "$ac_cxxflags_set" = no; then if test "$with_debug" = yes; then CXXFLAGS="-O -g" else CXXFLAGS="-O3 " fi fi CXXTEMPLFLAGS="-fno-implicit-templates" else CXXTEMPFLAGS="" fi AC_SUBST(CXXTEMPLFLAGS) AC_OUTPUT(Makefile) dnl dnl Plans: dnl 1) look for libraries (warn if not found) for building testprog dnl 1) search for perl