dnl Process this file with autoconf to produce a configure script AC_INIT(Singular/matpol.h) AC_PREFIX_DEFAULT(`pwd`) dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl Version business -- should be the same as in Singular subdir dnl SINGULAR_MAJOR_VERSION=1 SINGULAR_MINOR_VERSION=1 SINGULAR_SUB_VERSION=8 VERSION_DATE="April 1998" AC_SUBST(SINGULAR_MAJOR_VERSION) AC_SUBST(SINGULAR_MINOR_VERSION) AC_SUBST(SINGULAR_SUB_VERSION) AC_CANONICAL_HOST AC_SUBST(host) dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl those are needed to check for libs and headers, later on dnl AC_PROG_CC AC_PROG_CPP AC_AIX dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure if test "$libdir" = '${exec_prefix}/lib'; then if test "x$exec_prefix" = xNONE; then if test "x$prefix" = xNONE; then LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" ac_configure_args="$ac_configure_args --libdir=${ac_default_prefix}/lib" else LDFLAGS="-L${prefix}/lib ${LDFLAGS}" ac_configure_args="$ac_configure_args --libdir=${prefix}/lib" fi else LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" ac_configure_args="$ac_configure_args --libdir=${exec_prefix}/lib" fi else LDFLAGS="-L${libdir} ${LDFLAGS}" fi if test "$includedir" = '${prefix}/include'; then if test "x$prefix" = xNONE; then CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" ac_configure_args="$ac_configure_args --includedir=${ac_default_prefix}/include" else CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" ac_configure_args="$ac_configure_args --includedir=${prefix}/include" fi else CPPFLAGS="-I${includedir} ${CPPFLAGS}" fi dnl pass default prefix on to subdirs, if not explicitely given as an option if test "x$prefix" = xNONE; then ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" fi AC_MSG_CHECKING(whether _AIX is defined) AC_CACHE_VAL(ac_cv_is_aix, AC_EGREP_CPP(yes, [#ifdef _AIX yes #endif ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) if test "$ac_cv_is_aix" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl check for various libraries and headers dnl AC_CHECK_LIB(m, atof) AC_CHECK_LIB(bsd, socket) AC_CHECK_LIB(socket, listen) AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(gmp, mpq_init) AC_CHECK_LIB(smallgmp, mpz_init) AC_CHECK_LIB(MP, IMP_PutGmpInt) AC_CHECK_LIB(MPT, MPT_GetTree) AC_CHECK_LIB(singcf, atof) AC_CHECK_LIB(singfac, atof) AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h MPT.h factory.h factor.h) if test "$ac_cv_lib_gmp_mpq_init" = yes && \ test "$ac_cv_header_gmp_h" = yes; then ac_gmp_ok=yes fi if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \ test "$ac_cv_header_smallgmp_h" = yes && \ test "$ac_cv_header_gmp_h" = yes; then ac_smallgmp_ok=yes fi if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ test "$ac_cv_lib_MPT_MPT_GetTree" && \ test "$ac_cv_header_MP_h" = yes && \ test "$ac_cv_header_MPT_h" = yes; then ac_MP_ok=yes fi if test "$ac_cv_lib_singcf_atof" = yes && \ test "$ac_cv_header_factory_h" = yes; then ac_factory_ok=yes fi if test "$ac_cv_lib_singfac_atof" = yes && \ test "$ac_cv_header_factor_h" = yes; then ac_libfac_ok=yes fi dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl Check whether or not to built various packages dnl AC_ARG_ENABLE(smallgmp, \ [ --enable-PACKAGE configure and build PACKAGE --disable-PACKAGE do not configure and build PACKAGE where PACKAGE can be: smallgmp minimal version of gmp written in C only]) AC_ARG_ENABLE(MP, \ [ MP Multi Protocol library]) AC_ARG_ENABLE(factory, \ [ factory polynomial factorization library]) AC_ARG_ENABLE(libfac, \ [ libfac char set and modp poly factorization library]) AC_ARG_ENABLE(sgroup, \ [ sgroup numerical semigroup computations]) AC_ARG_ENABLE(Singular, \ [ Singular CAS for commutative algebra]) AC_ARG_WITH(MP,\ [ --with-PACKAGE use PACKAGE, provide dependent functionality --without-PACKAGE do not use PACKAGE, disable dependent functionality where PACKAGE can be: MP Multi Protocol library]) AC_ARG_WITH(factory, \ [ factory polynomial factorization library]) AC_ARG_WITH(libfac, \ [ libfac char set and modp poly factorization library]) AC_ARG_WITH(gmp, \ [ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic where PACKAGE can be gmp, smallgmp, or buildin]) AC_MSG_CHECKING(whether to configure and build smallgmp lib) if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then if test "$ac_smallgmp_ok" != yes && \ test "$ac_gmp_ok" != yes && \ (test "$with_apint" = smallgmp || test "${with_apint+set}" != set); then enable_smallgmp=yes else enable_smallgmp=no fi fi if test "$enable_smallgmp" = yes && test -d smallgmp; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp" enable_smallgmp=yes ac_will_have_gmp=yes else AC_MSG_RESULT(no) if test "$enable_smallgmp" = yes && test ! -d smallgmp; then AC_MSG_WARN(Did not find smallgmp subdir) fi enable_smallgmp=no fi if test "$ac_gmp_ok" != yes && \ test "$ac_smallgmp_ok" != yes && \ test "$enable_smallgmp" != yes; then AC_MSG_WARN(Would rather have gmp or smallgmp to build libs and Singular) ac_configure_args="$ac_configure_args --disable-gmp" else ac_configure_args="$ac_configure_args --enable-gmp" fi AC_MSG_CHECKING(whether to configure and build MP lib) if test "$enable_MP" != yes && test "$enable_MP" != no; then if test "$with_MP" != no && test "$ac_MP_ok" != yes; then enable_MP=yes else enable_MP=no fi fi if test "$enable_MP" = yes && test -d MP; then if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" ac_configure_args="$ac_configure_args --enable-MP" else AC_MSG_RESULT(no) AC_MSG_WARN(Can not build MP without having gmp) enabl_MP=no ac_configure_args="$ac_configure_args --disable-MP" fi else AC_MSG_RESULT(no) if test "$enable_MP" = yes && test ! -d MP; then AC_MSG_WARN(Did not find MP subdirectory) fi enable_MP=no ac_configure_args="$ac_configure_args --disable-MP" fi AC_MSG_CHECKING(whether to configure and build factory lib) if test "$enable_factory" != yes && test "$enable_factory" != no; then if test "$with_factory" != no && test "$ac_factory_ok" != yes; then enable_factory=yes else enable_factory=no fi fi if test "$enable_factory" = yes && test -d factory; then if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" ac_configure_args="$ac_configure_args --enable-factory" else AC_MSG_RESULT(no) AC_MSG_WARN(Can not build factory without having gmp) enable_factory=no ac_configure_args="$ac_configure_args --disable-factory" fi else AC_MSG_RESULT(no) if test "$enable_factory" = yes && test ! -d factory; then AC_MSG_WARN(Did not find factory subdirectory) fi enable_factory=no ac_configure_args="$ac_configure_args --disable-factory" fi AC_MSG_CHECKING(whether to configure and build libfac lib) if test "$enable_libfac" != yes && test "$enable_libfac" != no; then if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then enable_libfac=yes else enable_libfac=no fi fi if test "$enable_libfac" = yes && test -d libfac; then if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" ac_configure_args="$ac_configure_args --enable-libfac" else AC_MSG_RESULT(no) AC_MSG_WARN(Can not build libfac without factory) enable_libfac=no ac_configure_args="$ac_configure_args --disable-libfac" fi else AC_MSG_RESULT(no) if test "$enable_libfac" = yes && test ! -d libfac; then AC_MSG_WARN(Did not find libfac subdirectory) fi enable_libfac=no ac_configure_args="$ac_configure_args --disable-libfac" fi AC_MSG_CHECKING(whether to configure and build sgroup) if test "$enable_sgroup" != no; then enable_sgroup=yes fi if test "$enable_sgroup" = yes && test -d sgroup; then if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then if test "$enable_MP" != no || test "$ac_MP_ok" = yes; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup" ac_configure_args="$ac_configure_args --enable-sgroup" else AC_MSG_RESULT(no) AC_MSG_WARN(Can not build sgroup without having MP) enable_sgroup=no ac_configure_args="$ac_configure_args --disable-sgroup" fi else AC_MSG_RESULT(no) AC_MSG_WARN(Can not build sgroup without having gmp) enable_sgroup=no ac_configure_args="$ac_configure_args --disable-sgroup" fi else AC_MSG_RESULT(no) if test "$enable_sgroup" = yes && test ! -d sgroup; then AC_MSG_WARN(Did not find sgroup subdirectory) fi enable_sgroup=no ac_configure_args="$ac_configure_args --disable-sgroup" fi AC_MSG_CHECKING(whether to configure and build Singular) if test "$enable_Singular" != yes && test "$enable_Singular" != no; then if test "$with_Singular" != no; then enable_Singular=yes else enable_Singular=no fi fi if test "$enable_Singular" = yes && test -d Singular; then AC_MSG_RESULT(yes) CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" ac_configure_args="$ac_configure_args --enable-Singular" else AC_MSG_RESULT(no) if test "$enable_Singular" = yes && test ! -d Singular; then AC_MSG_WARN(Did not find Singular subdirectory) fi enable_Singular=no ac_configure_args="$ac_configure_args --disable-Singular" fi dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl Check whether or not to use various packages dnl AC_MSG_CHECKING(wich apint package to use) if test "$with_apint" != gmp && \ test "$with_apint" != smallgmp && \ test "$with_apint" != buildin; then if test "$ac_gmp_ok" = yes; then with_apint=gmp elif test "$ac_enable_smallgmp" = yes; then with_apint=smallgmp else with_apint=buildin fi ac_configure_args="$ac_configure_args --with-apint=$with_apint" fi AC_MSG_RESULT(${with_apint}) AC_MSG_CHECKING(whether to use with MP) if test "$with_MP" != no && test "$with_MP" != yes; then if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then with_MP=yes else with_MP=no fi ac_configure_args="$ac_configure_args --with-MP=$with_MP" fi if test "$with_MP" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi if test "$enable_MP" = yes; then if test "${with_apint}" = smallgmp; then ac_configure_args="$ac_configure_args --with-default_apreal=none" elif test "${with_apint}" = buildin; then ac_configure_args="$ac_configure_args --with-default_apreal=none --with-default-apint=none" fi fi AC_MSG_CHECKING(whether to use with factory) if test "$with_factory" != no && test "$with_factory" != yes; then if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then with_factory=yes else with_factory=no fi ac_configure_args="$ac_configure_args --with-factory=$with_factory" fi if test "$with_factory" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether to use with libfac) if test "$with_libfac" != no && test "$with_libfac" != yes; then if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then with_libfac=yes else with_libfac=no fi ac_configure_args="$ac_configure_args --with-libfac=$with_libfac" fi if test "$with_libfac" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether to use with Singular) if test "$with_Singular" != no && test "$with_Singular" != yes; then if test "$enable_Singular" = yes; then with_Singular=yes else with_Singular=no fi ac_configure_args="$ac_configure_args --with-Singular=$with_Singular" fi if test "$with_Singular" != no; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl Check for known subdirs dnl if test -d smallgmp; then SUBDIRS="smallgmp" fi if test -d MP; then SUBDIRS="$SUBDIRS MP" fi if test -d factory; then SUBDIRS="$SUBDIRS factory" fi if test -d libfac; then SUBDIRS="$SUBDIRS libfac" fi if test -d Singular; then SUBDIRS="$SUBDIRS Singular" fi dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl Enough --wrap it up dnl AC_PROG_MAKE_SET AC_SUBST(SUBDIRS) AC_SUBST(CONFIG_SUBDIRS) AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) AC_OUTPUT(Makefile)