[444bcf] | 1 | AC_INIT([singular],[3.1.3.sw]) |
---|
[715936] | 2 | |
---|
[429497] | 3 | _AC_SRCDIRS(["$ac_dir"]) |
---|
| 4 | |
---|
[3aea08] | 5 | AC_CONFIG_MACRO_DIR([m4]) |
---|
[9634a6] | 6 | AC_CONFIG_AUX_DIR([.]) |
---|
[715936] | 7 | |
---|
[3aea08] | 8 | AC_CONFIG_SRCDIR([Singular/tesths.cc]) |
---|
| 9 | |
---|
| 10 | AC_CONFIG_HEADER([config.h]) |
---|
| 11 | |
---|
[ea0001] | 12 | AM_MAINTAINER_MODE |
---|
[24a77fb] | 13 | AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules |
---|
[2e984a] | 14 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) |
---|
[280286e] | 15 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
---|
[2e984a] | 16 | |
---|
[3aea08] | 17 | |
---|
| 18 | dnl Check if build env is sane |
---|
| 19 | AM_SANITY_CHECK |
---|
| 20 | |
---|
[f86531] | 21 | # |
---|
| 22 | # - Check for CC and CXX but be careful about CFLAGS. |
---|
| 23 | # |
---|
[3aea08] | 24 | |
---|
[f86531] | 25 | test "${CFLAGS+set}" = set || cflags_expl_set=no |
---|
[9634a6] | 26 | AC_PROG_CC |
---|
[f86531] | 27 | test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no |
---|
[9634a6] | 28 | AC_PROG_CXX |
---|
[f86531] | 29 | if test "x$GCC" != xyes && test "x$GXX" != xyes; then |
---|
| 30 | AC_MSG_WARN(you better use gcc to compile Factory) |
---|
| 31 | else |
---|
| 32 | if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then |
---|
| 33 | AC_MSG_WARN([we use \`' as default for \`CXXFLAGS' |
---|
| 34 | (instead of the configure default \`-g -O')]) |
---|
| 35 | fi |
---|
| 36 | if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then |
---|
| 37 | AC_MSG_WARN([we use \`' as default for \`CFLAGS' |
---|
| 38 | (instead of the configure default \`-g -O')]) |
---|
| 39 | fi |
---|
| 40 | fi |
---|
| 41 | |
---|
[8fee84] | 42 | |
---|
| 43 | AC_HEADER_STDC |
---|
[76f3a18] | 44 | AC_CHECK_HEADERS(unistd.h iostream.h) |
---|
[8fee84] | 45 | |
---|
[eb2d25] | 46 | AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv) |
---|
[8fee84] | 47 | |
---|
| 48 | |
---|
[f86531] | 49 | AC_PROG_CPP |
---|
| 50 | AC_PROG_CXXCPP |
---|
[897139] | 51 | AM_PROG_CC_C_O |
---|
[7c7495] | 52 | ### AM_PROG_LEX |
---|
[3aea08] | 53 | AC_PROG_LN_S |
---|
| 54 | AC_PROG_INSTALL |
---|
[b9cf41] | 55 | |
---|
[380d25] | 56 | AC_CHECK_PROGS([DOXYGEN], [doxygen]) |
---|
| 57 | if test -z "$DOXYGEN"; |
---|
| 58 | then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) |
---|
| 59 | fi |
---|
| 60 | AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) |
---|
| 61 | |
---|
[80c102] | 62 | LT_INIT |
---|
[81384b] | 63 | |
---|
[897139] | 64 | # Checks for libraries. |
---|
[f5127cb] | 65 | AC_CHECK_LIB(rt,clock_gettime) |
---|
| 66 | AC_CHECK_LIB(pthread,pthread_create) |
---|
| 67 | |
---|
[897139] | 68 | LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)])) |
---|
| 69 | LB_CHECK_NTL(5.0,,AC_MSG_WARN([Unable to find NTL (which is strongly recommended) on your machine: please use --with-ntl=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)])) |
---|
[286be1f] | 70 | LB_CHECK_FLINT(2.3,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)])) |
---|
[6b61be] | 71 | |
---|
[cca8b3] | 72 | AX_PYTHON_DEFAULT() |
---|
[7b9d49] | 73 | AX_PYTHON_WITH_VERSION([2.4]) |
---|
| 74 | |
---|
[b3cd39] | 75 | |
---|
[3aea08] | 76 | AC_FUNC_ERROR_AT_LINE |
---|
| 77 | AC_FUNC_MALLOC |
---|
| 78 | |
---|
| 79 | SING_CHECK_PIPE |
---|
| 80 | |
---|
| 81 | # check for cpu properties |
---|
| 82 | AC_CHECK_SIZEOF(long,4) |
---|
| 83 | SING_CHECK_CPU |
---|
| 84 | |
---|
| 85 | #check for host: |
---|
| 86 | AC_CANONICAL_HOST |
---|
| 87 | case $host_os in |
---|
| 88 | *cygwin* ) LIBPREFIX="-Xlinker -Bdynamic";; |
---|
| 89 | * ) LIBPREFIX="";; |
---|
| 90 | esac |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | SING_CHECK_P_PROCS |
---|
| 94 | SING_CHECK_FACTORY |
---|
[d56ad87] | 95 | SING_CHECK_READLINE |
---|
[b7cad8c] | 96 | SING_CHECK_DBM |
---|
[81384b] | 97 | SING_CHECK_GFANLIB |
---|
[f86531] | 98 | |
---|
| 99 | # CFLAGS |
---|
| 100 | if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then |
---|
| 101 | CFLAGS="" |
---|
| 102 | fi |
---|
| 103 | |
---|
| 104 | # CXXFLAGS |
---|
| 105 | if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then |
---|
| 106 | CXXFLAGS="" |
---|
| 107 | fi |
---|
| 108 | |
---|
[113ed4] | 109 | AC_DEFINE_UNQUOTED([CC],"$CC",[CC]) |
---|
| 110 | AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX]) |
---|
| 111 | AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS]) |
---|
| 112 | AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS",[CXXFLAGS]) |
---|
| 113 | AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS]) |
---|
| 114 | |
---|
[eeae6e3] | 115 | ### the following is needed due to the use of om_sing_opt_show_mem in misc_ip.cc... |
---|
| 116 | #ac_configure_args="$ac_configure_args --with-external-config_h=../Singular/omSingularConfig.h" |
---|
[715936] | 117 | |
---|
[461f40] | 118 | AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--disable-omalloc], [do NOT use omalloc within the factory]), |
---|
| 119 | [if test "x$enableval" = "xyes"; then |
---|
| 120 | ENABLE_OMALLOC=yes |
---|
| 121 | fi], ENABLE_OMALLOC=add) |
---|
[429497] | 122 | |
---|
[461f40] | 123 | ENABLE_OMALLOC_ARG="--with-omalloc-dir=$ac_abs_top_srcdir --with-omalloc-extra-dir=$ac_abs_top_builddir --enable-omalloc-trust" |
---|
[429497] | 124 | |
---|
[461f40] | 125 | if test "x$ENABLE_OMALLOC" = xadd; then |
---|
| 126 | ENABLE_OMALLOC=yes |
---|
| 127 | ENABLE_OMALLOC_ARG="--enable-omalloc $ENABLE_OMALLOC_ARG" |
---|
| 128 | fi |
---|
| 129 | |
---|
| 130 | if test "x$ENABLE_FACTORY" = xyes; then |
---|
| 131 | AC_MSG_CHECKING(whether to use omalloc in factory) |
---|
| 132 | if test "x$ENABLE_OMALLOC" = xyes; then |
---|
[429497] | 133 | AC_MSG_RESULT(yes) |
---|
[461f40] | 134 | ac_configure_args="$ac_configure_args $ENABLE_OMALLOC_ARG" |
---|
| 135 | else |
---|
[429497] | 136 | AC_MSG_RESULT(no) |
---|
[461f40] | 137 | fi |
---|
[429497] | 138 | fi |
---|
| 139 | |
---|
[f284db] | 140 | AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [build the debugging version of the libraries]), |
---|
[2b43ac] | 141 | [if test "x$enableval" = "xyes"; then |
---|
| 142 | ENABLE_DEBUG=yes |
---|
| 143 | fi], ENABLE_DEBUG=no) |
---|
| 144 | |
---|
| 145 | AM_CONDITIONAL(WANT_DEBUG, test x"${ENABLE_DEBUG}" == xyes) |
---|
| 146 | |
---|
[d1fbbf] | 147 | AC_ARG_ENABLE(countedref, AS_HELP_STRING([--enable-countedref], [Enable autoloading of reference counted types]), |
---|
| 148 | [if test "x$enableval" = "xyes"; then |
---|
| 149 | ENABLE_COUNTEDREF_AUTOLOAD=yes |
---|
| 150 | fi], ENABLE_COUNTEDREF_AUTOLOAD=no) |
---|
| 151 | |
---|
| 152 | if test x"${ENABLE_COUNTEDREF_AUTOLOAD}" == xyes; then |
---|
| 153 | AC_DEFINE([SI_COUNTEDREF_AUTOLOAD],1,[Enable autoloading of reference counted types]) |
---|
| 154 | AC_SUBST(SI_COUNTEDREF_AUTOLOAD) |
---|
| 155 | fi |
---|
| 156 | |
---|
[b56249] | 157 | dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however |
---|
| 158 | dnl AM_COND_IF is new to Automake 1.11. To use it on new Automake without |
---|
| 159 | dnl requiring same, a fallback implementation for older Autoconf is provided. |
---|
| 160 | dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code |
---|
| 161 | dnl is correct only in terms of m4sh generated script. |
---|
| 162 | m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [ |
---|
| 163 | if test -z "$$1_TRUE"; then : |
---|
| 164 | m4_n([$2])[]dnl |
---|
| 165 | m4_ifval([$3], |
---|
| 166 | [else |
---|
| 167 | $3 |
---|
| 168 | ])dnl |
---|
| 169 | fi[]dnl |
---|
| 170 | ])]) |
---|
| 171 | |
---|
| 172 | |
---|
[380d25] | 173 | AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([dox/Doxyfile])]) |
---|
| 174 | AC_CONFIG_FILES([dox/Makefile]) |
---|
| 175 | |
---|
[81384b] | 176 | AC_CONFIG_SUBDIRS([findexec]) |
---|
[461f40] | 177 | AC_CONFIG_SUBDIRS([omalloc]) |
---|
[715936] | 178 | |
---|
[461f40] | 179 | if test "x$ENABLE_FACTORY" = xyes; then |
---|
| 180 | AC_CONFIG_SUBDIRS([factory]) |
---|
[6b61be] | 181 | fi |
---|
[715936] | 182 | |
---|
[461f40] | 183 | AC_CONFIG_SUBDIRS([libpolys]) |
---|
[5417ff] | 184 | |
---|
[715936] | 185 | AC_CONFIG_FILES([Makefile]) |
---|
[3aea08] | 186 | AC_CONFIG_FILES([kernel/Makefile]) |
---|
[b9cf41] | 187 | AC_CONFIG_FILES([numeric/Makefile]) |
---|
[151a06] | 188 | AC_CONFIG_FILES([Singular/Makefile]) |
---|
[1114d2] | 189 | AC_CONFIG_FILES([dyn_modules/Makefile]) |
---|
| 190 | AC_CONFIG_FILES([dyn_modules/bigintm/Makefile]) |
---|
| 191 | AC_CONFIG_FILES([dyn_modules/syzextra/Makefile]) |
---|
[5417ff] | 192 | AC_CONFIG_FILES([dyn_modules/callgfanlib/Makefile]) |
---|
| 193 | AC_CONFIG_FILES([IntegerProgramming/Makefile]) |
---|
[584f6b0] | 194 | AC_CONFIG_FILES([libsingular-config]) |
---|
[5417ff] | 195 | AC_CONFIG_SUBDIRS([gfanlib]) |
---|
[b9cf41] | 196 | |
---|
[9dfcc6e] | 197 | AC_CONFIG_FILES([redhat/singular.spec]) |
---|
[72aae3] | 198 | AC_CONFIG_FILES([desktop/Singular.desktop]) |
---|
| 199 | AC_CONFIG_FILES([desktop/Singular-manual.desktop]) |
---|
[2816dca] | 200 | |
---|
[9634a6] | 201 | AC_OUTPUT |
---|