[76b37c] | 1 | dnl Process this file with autoconf to produce a configure script. |
---|
| 2 | AC_INIT(tesths.cc) |
---|
| 3 | AC_CONFIG_HEADER(mod2.h) |
---|
| 4 | AC_CONFIG_HEADER(../kernel/mod2.h) |
---|
| 5 | |
---|
| 6 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 7 | dnl check for python (see AC_PYTHON_DEVEL in newer autoconf versions) |
---|
| 8 | dnl |
---|
| 9 | AC_DEFUN([AC_PYTHON_DEVEL_SINGULAR],[ |
---|
| 10 | # |
---|
| 11 | # Allow the use of a (user set) custom python version |
---|
| 12 | # |
---|
| 13 | PYTHON_VERSION="$1" |
---|
| 14 | PYTHON="$2" |
---|
| 15 | |
---|
| 16 | # |
---|
| 17 | # Check for a version of Python >= 2.1.0 |
---|
| 18 | # |
---|
| 19 | AC_MSG_CHECKING([for a version of Python >= '2.1.0']) |
---|
| 20 | ac_supports_python_ver=`$PYTHON -c "import sys, string; \ |
---|
| 21 | ver = string.split(sys.version)[[0]]; \ |
---|
| 22 | print ver >= '2.1.0'"` |
---|
| 23 | if test "$ac_supports_python_ver" != "True"; then |
---|
| 24 | if test -z "$PYTHON_NOVERSIONCHECK"; then |
---|
| 25 | AC_MSG_RESULT([no]) |
---|
| 26 | AC_MSG_ERROR([ |
---|
| 27 | This version of the AC@&t@_PYTHON_DEVEL macro |
---|
| 28 | doesn't work properly with versions of Python before |
---|
| 29 | 2.1.0. You may need to re-run configure, setting the |
---|
| 30 | variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, |
---|
| 31 | PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. |
---|
| 32 | Moreover, to disable this check, set PYTHON_NOVERSIONCHECK |
---|
| 33 | to something else than an empty string. |
---|
| 34 | ]) |
---|
| 35 | else |
---|
| 36 | AC_MSG_RESULT([skip at user request]) |
---|
| 37 | fi |
---|
| 38 | else |
---|
| 39 | AC_MSG_RESULT([yes]) |
---|
| 40 | fi |
---|
| 41 | |
---|
| 42 | # |
---|
| 43 | # if the macro parameter ``version'' is set, honour it |
---|
| 44 | # |
---|
| 45 | if test -n "$1"; then |
---|
| 46 | AC_MSG_CHECKING([for a version of Python $1]) |
---|
| 47 | ac_supports_python_ver=`$PYTHON -c "import sys, string; \ |
---|
| 48 | ver = string.split(sys.version)[[0]]; print ver $1"` |
---|
| 49 | if test "$ac_supports_python_ver" = "True"; then |
---|
| 50 | AC_MSG_RESULT([yes]) |
---|
| 51 | else |
---|
| 52 | AC_MSG_RESULT([no]) |
---|
| 53 | AC_MSG_ERROR([this package requires Python $1. |
---|
| 54 | If you have it installed, but it isn't the default Python |
---|
| 55 | interpreter in your system path, please pass the PYTHON_VERSION |
---|
| 56 | variable to configure. See ``configure --help'' for reference. |
---|
| 57 | ]) |
---|
| 58 | PYTHON_VERSION="" |
---|
| 59 | fi |
---|
| 60 | fi |
---|
| 61 | |
---|
| 62 | # |
---|
| 63 | # Check if you have distutils, else fail |
---|
| 64 | # |
---|
| 65 | AC_MSG_CHECKING([for the distutils Python package]) |
---|
| 66 | ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` |
---|
| 67 | if test -z "$ac_distutils_result"; then |
---|
| 68 | AC_MSG_RESULT([yes]) |
---|
| 69 | else |
---|
| 70 | AC_MSG_RESULT([no]) |
---|
| 71 | AC_MSG_ERROR([cannot import Python module "distutils". |
---|
| 72 | Please check your Python installation. The error was: |
---|
| 73 | $ac_distutils_result]) |
---|
| 74 | PYTHON_VERSION="" |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | # |
---|
| 78 | # Check for Python include path |
---|
| 79 | # |
---|
| 80 | AC_MSG_CHECKING([for Python include path]) |
---|
| 81 | if test -z "$PYTHON_CPPFLAGS"; then |
---|
| 82 | python_path=`$PYTHON -c "import distutils.sysconfig; \ |
---|
| 83 | print distutils.sysconfig.get_python_inc();"` |
---|
| 84 | if test -n "${python_path}"; then |
---|
| 85 | python_path="-I$python_path" |
---|
| 86 | fi |
---|
| 87 | PYTHON_CPPFLAGS=$python_path |
---|
| 88 | fi |
---|
| 89 | AC_MSG_RESULT([$PYTHON_CPPFLAGS]) |
---|
| 90 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
| 91 | |
---|
| 92 | # |
---|
| 93 | # Check for Python library path |
---|
| 94 | # |
---|
| 95 | AC_MSG_CHECKING([for Python library path]) |
---|
| 96 | if test -z "$PYTHON_LDFLAGS"; then |
---|
| 97 | # (makes two attempts to ensure we've got a version number |
---|
| 98 | # from the interpreter) |
---|
| 99 | py_version=`$PYTHON -c "from distutils.sysconfig import *; \ |
---|
| 100 | from string import join; \ |
---|
| 101 | print join(get_config_vars('VERSION'))"` |
---|
| 102 | if test "$py_version" == "[None]"; then |
---|
| 103 | if test -n "$PYTHON_VERSION"; then |
---|
| 104 | py_version=$PYTHON_VERSION |
---|
| 105 | else |
---|
| 106 | py_version=`$PYTHON -c "import sys; \ |
---|
| 107 | print sys.version[[:3]]"` |
---|
| 108 | fi |
---|
| 109 | fi |
---|
| 110 | |
---|
| 111 | PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ |
---|
| 112 | from string import join; \ |
---|
| 113 | from os import path; \ |
---|
| 114 | print '-L' + get_python_lib(0,1), \ |
---|
| 115 | '-L' + path.dirname(get_python_lib(0,1)), \ |
---|
| 116 | '-lpython';"`$py_version |
---|
| 117 | fi |
---|
| 118 | AC_MSG_RESULT([$PYTHON_LDFLAGS]) |
---|
| 119 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
| 120 | |
---|
| 121 | # |
---|
| 122 | # Check for site packages |
---|
| 123 | # |
---|
| 124 | AC_MSG_CHECKING([for Python site-packages path]) |
---|
| 125 | if test -z "$PYTHON_SITE_PKG"; then |
---|
| 126 | PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ |
---|
| 127 | print distutils.sysconfig.get_python_lib(0,0);"` |
---|
| 128 | fi |
---|
| 129 | AC_MSG_RESULT([$PYTHON_SITE_PKG]) |
---|
| 130 | AC_SUBST([PYTHON_SITE_PKG]) |
---|
| 131 | |
---|
| 132 | # |
---|
| 133 | # libraries which must be linked in when embedding |
---|
| 134 | # |
---|
| 135 | AC_MSG_CHECKING(python extra libraries) |
---|
| 136 | if test -z "$PYTHON_EXTRA_LIBS"; then |
---|
| 137 | PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ |
---|
| 138 | conf = distutils.sysconfig.get_config_var; \ |
---|
| 139 | print conf('LOCALMODLIBS'), conf('LIBS')"` |
---|
| 140 | fi |
---|
| 141 | AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) |
---|
| 142 | AC_SUBST(PYTHON_EXTRA_LIBS) |
---|
| 143 | |
---|
| 144 | # |
---|
| 145 | # linking flags needed when embedding |
---|
| 146 | # |
---|
| 147 | AC_MSG_CHECKING(python extra linking flags) |
---|
| 148 | if test -z "$PYTHON_EXTRA_LDFLAGS"; then |
---|
| 149 | PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ |
---|
| 150 | conf = distutils.sysconfig.get_config_var; \ |
---|
| 151 | print conf('LINKFORSHARED')"` |
---|
| 152 | fi |
---|
| 153 | AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) |
---|
| 154 | AC_SUBST(PYTHON_EXTRA_LDFLAGS) |
---|
| 155 | |
---|
| 156 | # |
---|
| 157 | # final check to see if everything compiles alright |
---|
| 158 | # |
---|
| 159 | AC_MSG_CHECKING([consistency of all components of python development environment]) |
---|
| 160 | # AC_LANG_PUSH([C]) |
---|
| 161 | # save current global flags |
---|
| 162 | ac_save_LIBS_for_python="${LIBS}" |
---|
| 163 | LIBS="$ac_save_LIBS $PYTHON_LDFLAGS" |
---|
| 164 | ac_save_CPPFLAGS_for_python="${CPPFLAGS}" |
---|
| 165 | CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" |
---|
| 166 | AC_TRY_LINK([ |
---|
| 167 | #include <Python.h> |
---|
| 168 | ],[ |
---|
| 169 | Py_Initialize(); |
---|
| 170 | ],[pythonexists=yes],[pythonexists=no]) |
---|
| 171 | |
---|
| 172 | AC_MSG_RESULT([$pythonexists]) |
---|
| 173 | |
---|
| 174 | if test ! "$pythonexists" = "yes"; then |
---|
[c880c17] | 175 | AC_MSG_RESULT([ |
---|
[76b37c] | 176 | Could not link test program to Python. Maybe the main Python library has been |
---|
| 177 | installed in some non-standard library path. If so, pass it to configure, |
---|
| 178 | via the LDFLAGS environment variable. |
---|
| 179 | Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" |
---|
| 180 | ============================================================================ |
---|
| 181 | ERROR! |
---|
| 182 | You probably have to install the development version of the Python package |
---|
| 183 | for your distribution. The exact name of this package varies among them. |
---|
| 184 | ============================================================================ |
---|
| 185 | ]) |
---|
| 186 | PYTHON_VERSION="" |
---|
[c880c17] | 187 | pythonexists=no |
---|
[76b37c] | 188 | else |
---|
| 189 | AC_DEFINE(HAVE_PYTHON) |
---|
| 190 | HAVE_PYTHON_VALUE=1 |
---|
| 191 | AC_SUBST(HAVE_PYTHON_VALUE) |
---|
| 192 | fi |
---|
| 193 | |
---|
| 194 | # AC_LANG_POP |
---|
| 195 | # turn back to default flags |
---|
| 196 | CPPFLAGS="$ac_save_CPPFLAGS_for_python" |
---|
| 197 | LIBS="$ac_save_LIBS_for_python" |
---|
| 198 | |
---|
| 199 | # |
---|
| 200 | # all done! |
---|
| 201 | # |
---|
| 202 | ]) |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 206 | dnl check whethe python-based module can be build statically |
---|
| 207 | dnl |
---|
| 208 | AC_DEFUN([AC_PYTHON_TEST_STATIC],[ |
---|
| 209 | ac_save_LIBS_for_python="${LIBS}" |
---|
| 210 | ac_save_CPPFLAGS_for_python="${CPPFLAGS}" |
---|
| 211 | |
---|
| 212 | AC_MSG_CHECKING([${try_python_shared_static_flags} for linking \ |
---|
| 213 | python statically]) |
---|
| 214 | all_cppflags="${ac_save_CPPFLAGS} ${PYTHON_CPPFLAGS}" |
---|
| 215 | |
---|
| 216 | CPPFLAGS="-static ${all_cppflags}" |
---|
| 217 | LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS -lc -lm $PYTHON_EXTRA_LDFLAGS" |
---|
| 218 | |
---|
| 219 | AC_TRY_LINK([ |
---|
| 220 | #include <Python.h> |
---|
| 221 | ],[ |
---|
| 222 | Py_Initialize(); |
---|
| 223 | ],[pythonstaticexists=yes],[pythonstaticexists=no]) |
---|
| 224 | |
---|
| 225 | AC_MSG_RESULT([$pythonstaticexists]) |
---|
| 226 | |
---|
| 227 | if test "$pythonstaticexists" == yes ; then |
---|
| 228 | AC_DEFINE(HAVE_STATIC_PYTHON) |
---|
| 229 | PYTHON_STATIC_LIBS="$PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS" |
---|
| 230 | AC_SUBST(PYTHON_STATIC_LIBS) |
---|
| 231 | |
---|
| 232 | try_flags="-Xlinker -static -nodefaultlibs" |
---|
| 233 | CPPFLAGS="-shared -fPIC ${try_flags} ${all_cppflags}" |
---|
| 234 | AC_MSG_CHECKING([$try_flags for linking python module statically]) |
---|
| 235 | AC_TRY_LINK([ |
---|
| 236 | #include <Python.h> |
---|
| 237 | ],[ |
---|
| 238 | Py_Initialize(); |
---|
| 239 | ],[pythonsharedstaticexists=yes],[pythonsharedstaticexists=no]) |
---|
| 240 | AC_MSG_RESULT([$pythonsharedstaticexists]) |
---|
| 241 | |
---|
| 242 | if test "$pythonsharedstaticexists" = yes; then |
---|
| 243 | PYTHON_MODULE_FLAGS="${try_flags}" |
---|
| 244 | fi |
---|
| 245 | fi |
---|
| 246 | |
---|
| 247 | AC_SUBST(PYTHON_MODULE_FLAGS) |
---|
| 248 | CPPFLAGS="$ac_save_CPPFLAGS_for_python" |
---|
| 249 | LIBS="$ac_save_LIBS_for_python" |
---|
| 250 | ]) |
---|
| 251 | |
---|
| 252 | |
---|
| 253 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 254 | dnl determine singuname |
---|
| 255 | dnl |
---|
| 256 | |
---|
| 257 | AC_MSG_CHECKING(CPU for singular) |
---|
| 258 | ac_cv_singcpuname=`uname -m` |
---|
| 259 | AC_MSG_RESULT($ac_cv_singcpuname) |
---|
| 260 | |
---|
| 261 | AC_MSG_CHECKING(uname for singular) |
---|
| 262 | AC_CACHE_VAL(ac_cv_singuname, |
---|
| 263 | ac_cv_singuname="unknown" |
---|
| 264 | if test -r "singuname.sh"; then |
---|
| 265 | if (/bin/sh singuname.sh >/dev/null 2>&1) then |
---|
| 266 | ac_cv_singuname=`/bin/sh singuname.sh` |
---|
| 267 | fi |
---|
| 268 | fi |
---|
| 269 | if test "$ac_cv_singuname" = unknown && test -r "../singuname.sh"; then |
---|
| 270 | if (/bin/sh ../singuname.sh >/dev/null 2>&1) then |
---|
| 271 | ac_cv_singuname=`/bin/sh ../singuname.sh` |
---|
| 272 | fi |
---|
| 273 | fi |
---|
| 274 | ) |
---|
| 275 | AC_MSG_RESULT($ac_cv_singuname) |
---|
| 276 | if test "$ac_cv_singuname" = unknown; then |
---|
| 277 | AC_MSG_WARN(Unknown architecture: Check singuname.sh) |
---|
| 278 | ac_cv_singuname="unknown" |
---|
| 279 | fi |
---|
| 280 | AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname") |
---|
| 281 | SINGUNAME=$ac_cv_singuname |
---|
| 282 | AC_SUBST(SINGUNAME) |
---|
| 283 | |
---|
| 284 | if test "$ac_cv_singuname" = ix86-Win; then |
---|
| 285 | EXEC_EXT=".exe" |
---|
| 286 | AC_DEFINE(SI_CPU_I386) |
---|
| 287 | AC_SUBST(SI_CPU_I386) |
---|
| 288 | AC_MSG_RESULT(SI_CPU_I386) |
---|
| 289 | fi |
---|
| 290 | AC_SUBST(EXEC_EXT) |
---|
| 291 | if test "$ac_cv_singuname" = x86_64-Linux; then |
---|
| 292 | AC_DEFINE(SI_CPU_X86_64) |
---|
| 293 | AC_SUBST(SI_CPU_X86_64) |
---|
| 294 | AC_MSG_RESULT(SI_CPU_X86_64) |
---|
| 295 | fi |
---|
| 296 | if test "$ac_cv_singuname" = ix86-Linux; then |
---|
| 297 | AC_DEFINE(SI_CPU_I386) |
---|
| 298 | AC_SUBST(SI_CPU_I386) |
---|
| 299 | AC_MSG_RESULT(SI_CPU_I386) |
---|
| 300 | fi |
---|
| 301 | if test "$ac_cv_singuname" = IA64-Linux; then |
---|
| 302 | AC_DEFINE(SI_CPU_IA64) |
---|
| 303 | AC_SUBST(SI_CPU_IA64) |
---|
| 304 | AC_MSG_RESULT(SI_CPU_IA64) |
---|
| 305 | fi |
---|
| 306 | if test "$ac_cv_singuname" = ppc-Linux; then |
---|
| 307 | AC_DEFINE(SI_CPU_PPC) |
---|
| 308 | AC_SUBST(SI_CPU_PPC) |
---|
| 309 | AC_MSG_RESULT(SI_CPU_PPC) |
---|
| 310 | fi |
---|
| 311 | if test "$ac_cv_singuname" = ppcMac-darwin; then |
---|
| 312 | AC_DEFINE(SI_CPU_PPC) |
---|
| 313 | AC_SUBST(SI_CPU_PPC) |
---|
| 314 | AC_MSG_RESULT(SI_CPU_PPC) |
---|
| 315 | fi |
---|
| 316 | # test again with CPU names |
---|
| 317 | if test "$ac_cv_singcpuname" = i386; then |
---|
| 318 | AC_DEFINE(SI_CPU_I386) |
---|
| 319 | AC_SUBST(SI_CPU_I386) |
---|
| 320 | AC_MSG_RESULT(SI_CPU_I386) |
---|
| 321 | fi |
---|
| 322 | if test "$ac_cv_singcpuname" = i686; then |
---|
| 323 | AC_DEFINE(SI_CPU_I386) |
---|
| 324 | AC_SUBST(SI_CPU_I386) |
---|
| 325 | AC_MSG_RESULT(SI_CPU_I386) |
---|
| 326 | fi |
---|
| 327 | if test "$ac_cv_singcpuname" = x86_64; then |
---|
| 328 | AC_DEFINE(SI_CPU_X86_64) |
---|
| 329 | AC_SUBST(SI_CPU_X86_64) |
---|
| 330 | AC_MSG_RESULT(SI_CPU_X86_64) |
---|
| 331 | fi |
---|
| 332 | if test "$ac_cv_singcpuname" = ia64; then |
---|
| 333 | AC_DEFINE(SI_CPU_IA64) |
---|
| 334 | AC_SUBST(SI_CPU_IA64) |
---|
| 335 | AC_MSG_RESULT(SI_CPU_IA64) |
---|
| 336 | fi |
---|
| 337 | if test "$ac_cv_singcpuname" = sparc; then |
---|
| 338 | AC_DEFINE(SI_CPU_SPARC) |
---|
| 339 | AC_SUBST(SI_CPU_SPARC) |
---|
| 340 | AC_MSG_RESULT(SI_CPU_SPARC) |
---|
| 341 | fi |
---|
| 342 | if test "$ac_cv_singcpuname" = ppc; then |
---|
| 343 | AC_DEFINE(SI_CPU_PPC) |
---|
| 344 | AC_SUBST(SI_CPU_PPC) |
---|
| 345 | AC_MSG_RESULT(SI_CPU_PPC) |
---|
| 346 | fi |
---|
| 347 | |
---|
| 348 | SING_UNAME=`echo $SINGUNAME | tr '-' '_' ` |
---|
| 349 | AC_SUBST(SING_UNAME) |
---|
| 350 | |
---|
| 351 | # stupid Win programs do not like dots in their pathnames |
---|
| 352 | VERSION_SEP="-" |
---|
| 353 | |
---|
| 354 | dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 355 | dnl version stuff -- should be set in ../configure.in |
---|
| 356 | dnl |
---|
| 357 | dnl here are some defaults |
---|
| 358 | |
---|
| 359 | SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-3} |
---|
| 360 | SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-1} |
---|
| 361 | SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-2} |
---|
| 362 | SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}" |
---|
| 363 | VERSION_DATE=${VERSION_DATE:-"Oct 2010"} |
---|
| 364 | |
---|
| 365 | dnl pass them on into the Makefiles |
---|
| 366 | AC_SUBST(SINGULAR_VERSION) |
---|
| 367 | AC_SUBST(VERSION_DATE) |
---|
| 368 | AC_SUBST(SINGULAR_MAJOR_VERSION) |
---|
| 369 | AC_SUBST(SINGULAR_MINOR_VERSION) |
---|
| 370 | AC_SUBST(SINGULAR_SUB_VERSION) |
---|
| 371 | AC_DEFINE_UNQUOTED(SINGULAR_MAJOR_VERSION, ${SINGULAR_MAJOR_VERSION}) |
---|
| 372 | AC_DEFINE_UNQUOTED(SINGULAR_MINOR_VERSION, ${SINGULAR_MINOR_VERSION}) |
---|
| 373 | AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION}) |
---|
| 374 | AC_DEFINE_UNQUOTED(S_VERSION1, "${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}") |
---|
| 375 | AC_DEFINE_UNQUOTED(S_VERSION2, "${VERSION_DATE}") |
---|
| 376 | AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION}) |
---|
| 377 | |
---|
| 378 | |
---|
| 379 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 380 | dnl compiler stuff |
---|
| 381 | dnl is needed to check for libs and headers, later on |
---|
| 382 | dnl |
---|
| 383 | dnl we do not want to have "-g -O" for CFLAGS |
---|
| 384 | if test "${CXXFLAGS+set}" != set; then |
---|
| 385 | ac_cxxflags_set=no |
---|
| 386 | CXXFLAGS="-O" |
---|
| 387 | fi |
---|
| 388 | if test "${CFLAGS+set}" != set; then |
---|
| 389 | CFLAGS="-O" |
---|
| 390 | ac_cflags_set=no |
---|
| 391 | fi |
---|
| 392 | |
---|
| 393 | # check whether CXX was set by user as env variable |
---|
| 394 | if test "${CXX+set}" != set; then |
---|
| 395 | ac_cxx_set=no |
---|
| 396 | else |
---|
| 397 | ac_cxx_set=yes |
---|
| 398 | fi |
---|
| 399 | AC_PROG_CC |
---|
| 400 | AC_PROG_CPP |
---|
| 401 | AC_PROG_CXX |
---|
| 402 | AC_PROG_INSTALL |
---|
| 403 | AC_AIX |
---|
| 404 | |
---|
| 405 | # test for gcc-version: gcc2: prefer CC=gcc, CXX=gcc (if not with boost) |
---|
| 406 | # gcc3: CC=gcc CXX=g++ |
---|
| 407 | # other: CC=cc CXX=c++ |
---|
| 408 | AC_MSG_CHECKING(gcc version) |
---|
| 409 | AC_CACHE_VAL(ac_cv_c_cpp, |
---|
| 410 | ac_cv_c_cp="unknown" |
---|
| 411 | if test -r "gccversion.sh"; then |
---|
| 412 | ac_cv_c_cpp=`/bin/sh gccversion.sh` |
---|
| 413 | fi |
---|
| 414 | ) |
---|
| 415 | AC_MSG_RESULT($ac_cv_c_cpp) |
---|
| 416 | |
---|
| 417 | # we prefer using gcc for compiling C++ files, provided the user did |
---|
| 418 | # not overwrite it explicitely |
---|
| 419 | if test "${GXX}" = yes && test "${ac_cxx_set}" = no; then |
---|
| 420 | if test "${ac_cv_c_cpp}" = gcc2; then |
---|
| 421 | CXX=g++ |
---|
| 422 | elif test "${ac_cv_c_cpp}" = gcc3; then |
---|
| 423 | CXX=g++ |
---|
| 424 | fi |
---|
| 425 | temp_flags="${CXXFLAGS}" |
---|
| 426 | AC_LANG_SAVE |
---|
| 427 | AC_LANG_CPLUSPLUS |
---|
| 428 | # check whether gcc accepts --no-rtti |
---|
| 429 | AC_MSG_CHECKING(whether gcc accepts --no-rtti) |
---|
| 430 | CXXFLAGS="${CXXFLAGS} --no-rtti" |
---|
| 431 | AC_CACHE_VAL(ac_cv_cxx_have_rtti, |
---|
| 432 | AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no) |
---|
| 433 | ) |
---|
| 434 | AC_MSG_RESULT(${ac_cv_cxx_have_rtti}) |
---|
| 435 | if test "${ac_cv_cxx_have_rtti}" != yes; then |
---|
| 436 | CXXFLAGS="$temp_flags" |
---|
| 437 | else |
---|
| 438 | CXXFLAGS="${temp_flags} --no-rtti" |
---|
| 439 | temp_flags="${CXXFLAGS}" |
---|
| 440 | fi |
---|
| 441 | |
---|
| 442 | # check whether gcc accepts --no-exceptions |
---|
| 443 | AC_MSG_CHECKING(whether gcc accepts --no-exceptions) |
---|
| 444 | CXXFLAGS="${CXXFLAGS} --no-exceptions" |
---|
| 445 | AC_CACHE_VAL(ac_cv_cxx_have_exceptions, |
---|
| 446 | AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no) |
---|
| 447 | ) |
---|
| 448 | AC_MSG_RESULT(${ac_cv_cxx_have_exceptions}) |
---|
| 449 | if test "${ac_cv_cxx_have_exceptions}" != yes; then |
---|
| 450 | CXXFLAGS="$temp_flags" |
---|
| 451 | else |
---|
| 452 | CXXFLAGS="${temp_flags} --no-exceptions" |
---|
| 453 | temp_flags="${CXXFLAGS}" |
---|
| 454 | fi |
---|
| 455 | |
---|
| 456 | AC_LANG_RESTORE |
---|
| 457 | CXXFLAGS="$temp_flags" |
---|
| 458 | #here is broking something |
---|
| 459 | #uncommented breaks CXXFLAGS variable set |
---|
| 460 | #only pipes would remain then in CXXFLAGS |
---|
| 461 | fi |
---|
| 462 | |
---|
| 463 | # check whether the compiler accepts -pipe |
---|
| 464 | if test x$ac_cv_c_cpp = xgcc2 -o x$ac_cv_c_cpp = xgcc3 |
---|
| 465 | then |
---|
| 466 | AC_MSG_CHECKING(whether compiler accepts -pipe) |
---|
| 467 | temp_cflags="${CFLAGS}" |
---|
| 468 | CFLAGS="${CFLAGS} -pipe" |
---|
| 469 | AC_CACHE_VAL(ac_cv_cxx_have_pipe, |
---|
| 470 | AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)) |
---|
| 471 | AC_MSG_RESULT(${ac_cv_cxx_have_pipe}) |
---|
| 472 | CFLAGS=${temp_cflags} |
---|
| 473 | else |
---|
| 474 | ac_cv_cxx_have_pipe="no" |
---|
| 475 | fi |
---|
| 476 | |
---|
| 477 | if test "${ac_cv_cxx_have_pipe}" != yes; then |
---|
| 478 | PIPE= |
---|
| 479 | else |
---|
| 480 | PIPE="-pipe" |
---|
| 481 | fi |
---|
| 482 | AC_SUBST(PIPE) |
---|
| 483 | |
---|
| 484 | # Customize CFLAGS |
---|
| 485 | AC_MSG_CHECKING(whether _AIX is defined) |
---|
| 486 | AC_CACHE_VAL(ac_cv_is_aix, |
---|
| 487 | AC_EGREP_CPP(yes, |
---|
| 488 | [#ifdef _AIX |
---|
| 489 | yes |
---|
| 490 | #endif |
---|
| 491 | ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) |
---|
| 492 | if test "$ac_cv_is_aix" = yes; then |
---|
| 493 | AC_MSG_RESULT(yes) |
---|
| 494 | else |
---|
| 495 | AC_MSG_RESULT(no) |
---|
| 496 | fi |
---|
| 497 | |
---|
| 498 | # we know best when compiling with gcc |
---|
| 499 | if test "${GXX}" = yes; then |
---|
| 500 | if test "$ac_cxxflags_set" = no; then |
---|
| 501 | CXXFLAGS="-O3 -w -fomit-frame-pointer" |
---|
| 502 | fi |
---|
| 503 | temp_flags="${CXXFLAGS}" |
---|
| 504 | if test "${ac_cv_cxx_have_rtti}" = yes; then |
---|
| 505 | CXXFLAGS="${temp_flags} --no-rtti" |
---|
| 506 | fi |
---|
| 507 | temp_flags="${CXXFLAGS}" |
---|
| 508 | CXXTEMPLFLAGS="-fno-implicit-templates" |
---|
| 509 | if test "${ac_cv_cxx_have_exceptions}" = yes; then |
---|
| 510 | CXXTEMPLFLAGS="${CXXTEMPLFLAGS} --no-exceptions" |
---|
| 511 | fi |
---|
| 512 | if test "$ac_cv_is_aix" = yes; then |
---|
| 513 | CXXNOOPTFLAGS="-w" |
---|
| 514 | else |
---|
| 515 | CXXNOOPTFLAGS=$CXXFLAGS |
---|
| 516 | fi |
---|
| 517 | STATIC_LDFLAGS="-static" |
---|
| 518 | else |
---|
| 519 | CXXTEMPFLAGS="" |
---|
| 520 | CXXNOOPTFLAGS=$CXXFLAGS |
---|
| 521 | STATIC_LDFLAGS="" |
---|
| 522 | fi |
---|
| 523 | AC_SUBST(CXXTEMPLFLAGS) |
---|
| 524 | AC_SUBST(CXXNOOPTFLAGS) |
---|
| 525 | AC_SUBST(STATIC_LDFLAGS) |
---|
| 526 | |
---|
| 527 | if test "${GCC}" = yes && test "$ac_cflags_set" = no ; then |
---|
| 528 | CFLAGS="-O3 -w -fomit-frame-pointer" |
---|
| 529 | fi |
---|
| 530 | |
---|
| 531 | AC_PROG_MAKE_SET |
---|
| 532 | |
---|
| 533 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 534 | dnl path stuff |
---|
| 535 | dnl |
---|
| 536 | AC_PREFIX_DEFAULT(`pwd`/..) |
---|
| 537 | |
---|
| 538 | dnl set exec_prefix, bindir, libdir, includedir to some sensible values |
---|
| 539 | dnl if they are not yet already set |
---|
| 540 | |
---|
| 541 | # expand prefix |
---|
| 542 | test "x$prefix" = xNONE && prefix=$ac_default_prefix |
---|
| 543 | if test "${with_rootdir+set}" != set; then |
---|
| 544 | AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${prefix}") |
---|
| 545 | else |
---|
| 546 | AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${with_rootdir}") |
---|
| 547 | fi |
---|
| 548 | |
---|
| 549 | # expand exec_prefixad |
---|
| 550 | if test "x$exec_prefix" = xNONE; then |
---|
| 551 | exec_prefix=${prefix}/${ac_cv_singuname} |
---|
| 552 | fi |
---|
| 553 | |
---|
| 554 | # expand bindir |
---|
| 555 | test "x$bindir" = 'x${exec_prefix}/bin' && bindir="${exec_prefix}" |
---|
| 556 | SINGULAR=${SINGULAR:-$bindir/Singular-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION} |
---|
| 557 | AC_SUBST(SINGULAR) |
---|
| 558 | AC_DEFINE_UNQUOTED(S_BIN_DIR, "${bindir}") |
---|
| 559 | |
---|
| 560 | # expand libdir |
---|
| 561 | test "x$libdir" = 'x${exec_prefix}/lib'&& libdir="${exec_prefix}/lib" |
---|
| 562 | |
---|
| 563 | # expand includedir |
---|
| 564 | test "x$includedir" = 'x${prefix}/include' && includedir="${exec_prefix}/include" |
---|
| 565 | |
---|
| 566 | # add to -I to CPPFLAGS and and -L to LDFLAGS, just to be sure |
---|
| 567 | if test "$ac_cv_c_cpp" = gcc3 ; then |
---|
| 568 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
| 569 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
| 570 | else |
---|
| 571 | LDFLAGS="-L${libdir} ${LDFLAGS} -L/usr/local/lib" |
---|
| 572 | CPPFLAGS="-I${includedir} ${CPPFLAGS} -I/usr/local/include" |
---|
| 573 | fi |
---|
| 574 | |
---|
| 575 | # this is a work-around to include the right term.h |
---|
| 576 | if test "$ac_cv_singuname" = SunOS-5; then |
---|
| 577 | CPPFLAGS="-I/usr/xpg4/include ${CPPFLAGS}" |
---|
| 578 | fi |
---|
| 579 | |
---|
| 580 | |
---|
| 581 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 582 | dnl Checks for programs. |
---|
| 583 | dnl |
---|
| 584 | |
---|
| 585 | # lex |
---|
| 586 | if test "${with_lex+set}" != set; then |
---|
| 587 | AC_MSG_CHECKING(for flex) |
---|
| 588 | changequote(<<,>>)dnl |
---|
| 589 | cmd="egrep [2-9]\.[5-9]" |
---|
| 590 | changequote([,])dnl |
---|
| 591 | AC_CACHE_VAL(ac_cv_prog_flex, |
---|
| 592 | if (flex --version >/dev/null 2>&1) |
---|
| 593 | then |
---|
| 594 | if (flex --version | $cmd >/dev/null 2>&1 ) |
---|
| 595 | then |
---|
| 596 | ac_cv_prog_flex=flex |
---|
| 597 | fi |
---|
| 598 | fi |
---|
| 599 | ) |
---|
| 600 | dnl changequote([,])dnl |
---|
| 601 | if test "${ac_cv_prog_flex+set}" = set; then |
---|
| 602 | AC_MSG_RESULT(flex) |
---|
| 603 | LEX=flex |
---|
| 604 | AC_SUBST(LEX) |
---|
| 605 | else |
---|
| 606 | AC_MSG_WARN(can not find flex with version 2.4.5-2.5.4) |
---|
| 607 | fi |
---|
| 608 | elif test "${with_lex}" = no; then |
---|
| 609 | AC_MSG_WARN(building without lex -- make might fail) |
---|
| 610 | else |
---|
| 611 | unset LEX |
---|
| 612 | unset ac_cv_prog_LEX |
---|
| 613 | AC_CHECK_PROGS(LEX, ${with_lex}) |
---|
| 614 | if test "x${LEX}" = x; then |
---|
| 615 | AC_MSG_WARN(building without lex -- make might fail) |
---|
| 616 | fi |
---|
| 617 | fi |
---|
| 618 | |
---|
| 619 | # bison |
---|
| 620 | AC_CHECK_PROGS(BISON, bison) |
---|
| 621 | if test "${BISON+set}" != set; then |
---|
| 622 | AC_MSG_WARN(did not find bison -- make might fail) |
---|
| 623 | fi |
---|
| 624 | |
---|
| 625 | # ln -s |
---|
| 626 | AC_PROG_LN_S |
---|
| 627 | |
---|
| 628 | AC_CHECK_PROGS(PERL, perl5 perl) |
---|
| 629 | |
---|
| 630 | # python |
---|
| 631 | dnl Default values here! |
---|
| 632 | python_exe_name="no" |
---|
| 633 | PYTHON_PLUGIN="module" |
---|
| 634 | PYTHON_LINKAGE="static" |
---|
| 635 | |
---|
| 636 | if test "${with_python+set}" == set; then |
---|
| 637 | case "${with_python}" in |
---|
| 638 | yes|static*|dynamic*|shared*|module*|embed*) |
---|
| 639 | python_exe_name="python" |
---|
| 640 | ;; |
---|
| 641 | *) |
---|
| 642 | python_exe_name="${with_python%%,*}" |
---|
| 643 | ;; |
---|
| 644 | esac |
---|
| 645 | |
---|
| 646 | case ",${with_python}," in |
---|
| 647 | *,dynamic,*|*,shared,*) |
---|
| 648 | PYTHON_LINKAGE="dynamic" |
---|
| 649 | ;; |
---|
| 650 | *,static,*) |
---|
| 651 | PYTHON_LINKAGE="static" |
---|
| 652 | ;; |
---|
| 653 | esac |
---|
| 654 | |
---|
| 655 | case ",${with_python}," in |
---|
| 656 | *,embed,*|*,embedded,*) |
---|
| 657 | PYTHON_PLUGIN="embed" |
---|
| 658 | ;; |
---|
| 659 | *,static,*) |
---|
| 660 | PYTHON_PLUGIN="module" |
---|
| 661 | ;; |
---|
| 662 | esac |
---|
| 663 | fi |
---|
| 664 | |
---|
| 665 | PYTHON_EXE=`basename "${python_exe_name}"` |
---|
| 666 | PYTHON_PATH=`dirname "${python_exe_name}"` |
---|
| 667 | |
---|
| 668 | if test "${PYTHON_EXE}" = no; then |
---|
| 669 | AC_MSG_WARN(building without python support) |
---|
| 670 | else |
---|
| 671 | AC_PATH_PROG([PYTHON],[$PYTHON_EXE],, "$PYTHON_PATH:$PATH") |
---|
| 672 | if test -z "$PYTHON"; then |
---|
| 673 | AC_MSG_WARN([Cannot find $PYTHON_EXE in your system path - skipping python support]) |
---|
| 674 | else |
---|
| 675 | AC_PYTHON_DEVEL_SINGULAR(>= '2.4', "${PYTHON}") |
---|
| 676 | AC_PYTHON_TEST_STATIC() |
---|
| 677 | |
---|
| 678 | if test "${PYTHON_PLUGIN}" = embed; then |
---|
| 679 | AC_DEFINE(EMBED_PYTHON) |
---|
| 680 | EMBED_PYTHON_VALUE=1 |
---|
| 681 | |
---|
| 682 | PYTHON_EMBED_LIBS="$PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS" |
---|
| 683 | AC_SUBST(PYTHON_EMBED_LIBS) |
---|
| 684 | fi |
---|
| 685 | |
---|
| 686 | fi |
---|
| 687 | fi |
---|
| 688 | AC_SUBST(EMBED_PYTHON_VALUE) |
---|
| 689 | |
---|
| 690 | |
---|
| 691 | dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 692 | dnl check for general libraries, header files, typedefs, etc |
---|
| 693 | dnl |
---|
| 694 | # lib checks |
---|
| 695 | # under cygwin, we should not explicitly link with -lm, except for |
---|
| 696 | # it really is the last thing to link with |
---|
| 697 | if test "$ac_cv_singuname" != ix86-Win; then |
---|
| 698 | AC_CHECK_LIB(m, atof) |
---|
| 699 | fi |
---|
| 700 | AC_CHECK_LIB(nsl) |
---|
| 701 | AC_CHECK_LIB(socket) |
---|
| 702 | SAVE_LIBS=${LIBS} |
---|
| 703 | LIBS= |
---|
| 704 | |
---|
| 705 | dnl I'm not sure what they are for |
---|
| 706 | AC_CHECK_LIB(bsd, setenv) |
---|
| 707 | dnl i386-SunOS needs nsl and socket |
---|
| 708 | AC_CHECK_LIB(socket, listen) |
---|
| 709 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
| 710 | dnl AC_CHECK_LIB(ucb, index) |
---|
| 711 | MP_LIBS=${LIBS} |
---|
| 712 | # check for dl lib |
---|
| 713 | case "$ac_cv_singuname" in |
---|
| 714 | HPUX*) |
---|
| 715 | AC_CHECK_LIB(dld, shl_load) |
---|
| 716 | if test "$ac_cv_lib_dld_shl_load" = yes; then |
---|
| 717 | LD_DYN_FLAGS="-ldld -Xlinker -E" |
---|
| 718 | SFLAGS="-fpic -fPIC -DPIC" |
---|
| 719 | SLDFLAGS="-fPIC -DPIC -shared" |
---|
| 720 | if test "${LD+set}" != set; then |
---|
| 721 | LD=gcc |
---|
| 722 | fi |
---|
| 723 | ac_lib_dl=yes |
---|
| 724 | fi |
---|
| 725 | ;; |
---|
| 726 | *Linux*) |
---|
| 727 | AC_CHECK_LIB(dl, dlopen) |
---|
| 728 | if test "$ac_cv_lib_dl_dlopen" = yes; then |
---|
| 729 | LD_DYN_FLAGS="-ldl -rdynamic" |
---|
| 730 | SFLAGS="-fpic -DPIC" |
---|
| 731 | SLDFLAGS=-shared |
---|
| 732 | if test "${LD+set}" != set; then |
---|
| 733 | LD=ld |
---|
| 734 | fi |
---|
| 735 | ac_lib_dl=yes |
---|
| 736 | fi |
---|
| 737 | ;; |
---|
| 738 | IRIX-6) |
---|
| 739 | LD_DYN_FLAGS="-lc" |
---|
| 740 | SFLAGS="-fPIC -DPIC" |
---|
| 741 | SLDFLAGS="-w -no_unresolved -_SYSTYPE_SVR4 -n32 -shared" |
---|
| 742 | if test "${LD+set}" != set; then |
---|
| 743 | LD=ld |
---|
| 744 | fi |
---|
| 745 | ac_lib_dl=yes |
---|
| 746 | ;; |
---|
| 747 | SunOS-5) |
---|
| 748 | AC_CHECK_LIB(dl, dlopen) |
---|
| 749 | if test "$ac_cv_lib_dl_dlopen" = yes; then |
---|
| 750 | LD_DYN_FLAGS="-ldl" |
---|
| 751 | SFLAGS="-fpic -DPIC" |
---|
| 752 | SLDFLAGS=-shared |
---|
| 753 | if test "${LD+set}" != set; then |
---|
| 754 | LD=$CC |
---|
| 755 | fi |
---|
| 756 | ac_lib_dl=yes |
---|
| 757 | fi |
---|
| 758 | ;; |
---|
| 759 | #use export MACOSX_DEPLOYMENT_TARGET=10.3 |
---|
| 760 | ppcMac-darwin) |
---|
| 761 | AC_CHECK_LIB(dl, dlopen) |
---|
| 762 | if test "$ac_cv_lib_dl_dlopen" = yes; then |
---|
| 763 | LD_DYN_FLAGS="-ldl -dynamic" |
---|
| 764 | SFLAGS="-fpic -DPIC" |
---|
| 765 | SLDFLAGS="-dynamic -twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup" |
---|
| 766 | if test "${LD+set}" != set; then |
---|
| 767 | LD=libtool |
---|
| 768 | fi |
---|
| 769 | ac_lib_dl=yes |
---|
| 770 | fi |
---|
| 771 | ;; |
---|
| 772 | ix86Mac-darwin) |
---|
| 773 | AC_CHECK_LIB(dl, dlopen) |
---|
| 774 | if test "$ac_cv_lib_dl_dlopen" = yes; then |
---|
| 775 | LD_DYN_FLAGS="-ldl -dynamic" |
---|
| 776 | SFLAGS="-fpic -DPIC" |
---|
| 777 | SLDFLAGS="-dynamic -twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup" |
---|
| 778 | if test "${LD+set}" != set; then |
---|
| 779 | LD=libtool |
---|
| 780 | fi |
---|
| 781 | ac_lib_dl=yes |
---|
| 782 | fi |
---|
| 783 | ;; |
---|
| 784 | ix86-freebsd) |
---|
| 785 | AC_CHECK_LIB(c, dlopen) |
---|
| 786 | if test "$ac_cv_lib_c_dlopen" = yes; then |
---|
| 787 | LD_DYN_FLAGS="-Xlinker -E" |
---|
| 788 | SFLAGS="-fpic -DPIC" |
---|
| 789 | SLDFLAGS=-shared |
---|
| 790 | if test "${LD+set}" != set; then |
---|
| 791 | LD=ld |
---|
| 792 | fi |
---|
| 793 | ac_lib_dl=yes |
---|
| 794 | fi |
---|
| 795 | ;; |
---|
| 796 | esac |
---|
| 797 | AC_SUBST(LD_DYN_FLAGS) |
---|
| 798 | AC_SUBST(SFLAGS) |
---|
| 799 | AC_SUBST(SLDFLAGS) |
---|
| 800 | AC_SUBST(LD) |
---|
| 801 | LIBS="${SAVE_LIBS} ${MP_LIBS}" |
---|
| 802 | |
---|
| 803 | |
---|
| 804 | # heder file checks |
---|
| 805 | AC_HEADER_STDC |
---|
| 806 | AC_CHECK_HEADERS(limits.h unistd.h,, |
---|
| 807 | AC_MSG_ERROR(Can not compile without limits.h unistd.h)) |
---|
| 808 | |
---|
| 809 | AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/times.h sys/types.h \ |
---|
| 810 | sys/stat.h fcntl.h sys/param.h pwd.h asm/sigcontext.h pwd.h termcap.h \ |
---|
| 811 | termios.h term.h readline/readline.h) |
---|
| 812 | |
---|
| 813 | # typedefs, structures |
---|
| 814 | AC_C_CONST |
---|
| 815 | AC_C_INLINE |
---|
| 816 | AC_TYPE_SIZE_T |
---|
| 817 | AC_STRUCT_TM |
---|
| 818 | AC_HEADER_TIME |
---|
| 819 | |
---|
| 820 | # library functions. |
---|
| 821 | AC_FUNC_ALLOCA |
---|
| 822 | AC_PROG_GCC_TRADITIONAL |
---|
| 823 | AC_FUNC_MMAP |
---|
| 824 | AC_TYPE_SIGNAL |
---|
| 825 | AC_FUNC_VPRINTF |
---|
| 826 | AC_SEARCH_LIBS(setenv, bsd) |
---|
| 827 | AC_CHECK_FUNCS(gettimeofday atexit bcopy getcwd getwd vsnprintf readlink \ |
---|
| 828 | sleep usleep getpwnam popen setenv siginterrupt sysconf) |
---|
| 829 | |
---|
| 830 | |
---|
| 831 | dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 832 | dnl Find out more about particularity of the system |
---|
| 833 | dnl |
---|
| 834 | |
---|
| 835 | # arithmetic shifts |
---|
| 836 | #AC_MSG_CHECKING(whether your machine has correct arithmetic shifts) |
---|
| 837 | #AC_CACHE_VAL(ac_cv_shift, AC_TRY_RUN( |
---|
| 838 | # [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ], |
---|
| 839 | # ac_cv_shift=yes, |
---|
| 840 | # ac_cv_shift=no, |
---|
| 841 | # if test "$ac_c_cross_dos" = yes; then |
---|
| 842 | # ac_cv_shift=yes; |
---|
| 843 | # else |
---|
| 844 | # AC_MSG_RESULT(no) |
---|
| 845 | # AC_MSG_ERROR(cross compilation without default value) |
---|
| 846 | # fi)) |
---|
| 847 | # |
---|
| 848 | #if test "$ac_cv_shift" = yes; then |
---|
| 849 | # AC_MSG_RESULT(yes) |
---|
| 850 | #else |
---|
| 851 | # AC_MSG_RESULT(no) |
---|
| 852 | # AC_MSG_ERROR(need -2 >> 1 == -1) |
---|
| 853 | #fi |
---|
| 854 | |
---|
| 855 | |
---|
| 856 | # check for a peculiar constructor initialization |
---|
| 857 | AC_MSG_CHECKING(whether explicit C++ constructor calls are allowed) |
---|
| 858 | AC_LANG_SAVE |
---|
| 859 | AC_LANG_CPLUSPLUS |
---|
| 860 | AC_CACHE_VAL(ac_cv_explicit_const,AC_TRY_COMPILE(, |
---|
| 861 | class testclass |
---|
| 862 | { |
---|
| 863 | public: |
---|
| 864 | int value; |
---|
| 865 | testclass() : value(0) {} |
---|
| 866 | testclass( int i ) : value(i) {} |
---|
| 867 | ~testclass() { value = 0; } |
---|
| 868 | }; |
---|
| 869 | |
---|
| 870 | testclass ptr; |
---|
| 871 | ptr.testclass(1); |
---|
| 872 | , ac_cv_explicit_const=yes, ac_cv_explicit_const=no)) |
---|
| 873 | AC_LANG_RESTORE |
---|
| 874 | AC_MSG_RESULT($ac_cv_explicit_const) |
---|
| 875 | if test "$ac_cv_explicit_const" = yes; then |
---|
| 876 | AC_DEFINE(HAVE_EXPLICIT_CONSTR) |
---|
| 877 | fi |
---|
| 878 | |
---|
| 879 | # sprintf returns number of printed chars |
---|
| 880 | AC_MSG_CHECKING(whether vsprintf returns number of printed chars) |
---|
| 881 | AC_CACHE_VAL(ac_cv_returns_n_of_chars, AC_TRY_RUN( |
---|
| 882 | [#include <stdio.h> |
---|
| 883 | main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }], |
---|
| 884 | ac_cv_returns_n_of_chars=yes, |
---|
| 885 | ac_cv_returns_n_of_chars=no, |
---|
| 886 | ac_cv_returns_n_of_chars=no)) |
---|
| 887 | if test "$ac_cv_returns_n_of_chars" = yes; then |
---|
| 888 | AC_MSG_RESULT(yes) |
---|
| 889 | else |
---|
| 890 | AC_MSG_RESULT(no) |
---|
| 891 | AC_DEFINE(BSD_SPRINTF) |
---|
| 892 | fi |
---|
| 893 | |
---|
| 894 | # determine ALIGN_8 |
---|
| 895 | AC_CHECK_SIZEOF(char,1) |
---|
| 896 | AC_CHECK_SIZEOF(short,2) |
---|
| 897 | AC_CHECK_SIZEOF(int,4) |
---|
| 898 | AC_CHECK_SIZEOF(long,4) |
---|
| 899 | AC_CHECK_SIZEOF(void*,4) |
---|
| 900 | AC_CHECK_SIZEOF(double, 8) |
---|
| 901 | AC_C_BIGENDIAN |
---|
| 902 | if test "$ac_cv_sizeof_int" != 4; then |
---|
| 903 | AC_MSG_ERROR(need int to be four bytes long) |
---|
| 904 | fi |
---|
| 905 | if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then |
---|
| 906 | AC_MSG_ERROR(need equal sizes for long and void*) |
---|
| 907 | fi |
---|
| 908 | if test "$ac_cv_sizeof_double" != 8; then |
---|
| 909 | AC_MSG_ERROR(need double to b 8 bytes long) |
---|
| 910 | fi |
---|
| 911 | if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then |
---|
| 912 | AC_MSG_ERROR(need void* to be 4 or 8 bytes long) |
---|
| 913 | fi |
---|
| 914 | if test "$ac_cv_sizeof_voidp" != 4; then |
---|
| 915 | DEFS="-UOM_NDEBUG" |
---|
| 916 | AC_SUBST(DEFS) |
---|
| 917 | fi |
---|
| 918 | |
---|
| 919 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 920 | dnl help for configure |
---|
| 921 | dnl |
---|
| 922 | AC_ARG_WITH( |
---|
| 923 | rootdir, |
---|
| 924 | [ --with-rootdir=DIR use DIR ass compiled-in root directory |
---|
| 925 | (default is PREFIX)]) |
---|
| 926 | AC_ARG_WITH( |
---|
| 927 | lex, |
---|
| 928 | [ --with-lex=[LEX,no] uses LEX as lex program, default is flex]) |
---|
| 929 | AC_ARG_WITH( |
---|
| 930 | readline, |
---|
| 931 | [ --with-readline=[dynamic,static,no] |
---|
| 932 | do use dynamic/static/no readline for fancy display]) |
---|
| 933 | AC_ARG_WITH( |
---|
| 934 | python, |
---|
| 935 | [ --with-python[=PYTHON[,embed|module[,static|dynamic]]] |
---|
| 936 | uses PYTHON as python executable, default is python; |
---|
| 937 | optionally set plug-in and linkage type]) |
---|
| 938 | AC_ARG_WITH( |
---|
| 939 | Boost, |
---|
| 940 | [ --without-Boost do not use Boost ]) |
---|
| 941 | AC_ARG_WITH( |
---|
| 942 | stdvec, |
---|
| 943 | [ --with-stdvec use std::vector ]) |
---|
| 944 | AC_ARG_WITH( |
---|
| 945 | MP, |
---|
| 946 | [ --without-MP do not use MP (no MP links)]) |
---|
| 947 | AC_ARG_WITH( |
---|
| 948 | dbm, |
---|
| 949 | [ --without-dbm do not use dbm (no DBM links)]) |
---|
| 950 | AC_ARG_WITH( |
---|
| 951 | factory, |
---|
| 952 | [ --without-factory do not use factory (no poly factorization)]) |
---|
| 953 | AC_ARG_WITH( |
---|
| 954 | libfac, |
---|
| 955 | [ --without-libfac do not use libfac (no primary decompositions)]) |
---|
| 956 | AC_ARG_WITH( |
---|
| 957 | dl, |
---|
| 958 | [ --without-dl do not use dynamic linking, modules, and kernel]) |
---|
| 959 | AC_ARG_WITH( |
---|
| 960 | dynamic-modules, |
---|
| 961 | [ --with-dynamic-modules do compile with dynamic modules support]) |
---|
| 962 | AC_ARG_WITH( |
---|
| 963 | dynamic-kernel, |
---|
| 964 | [ --without-dynamic-kernel |
---|
| 965 | do not compile with dynamic kernel parts]) |
---|
| 966 | AC_ARG_WITH(apint, |
---|
| 967 | [ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic]) |
---|
| 968 | AC_ARG_WITH(svd, |
---|
| 969 | [ --with-svd use libsvd]) |
---|
| 970 | AC_ARG_WITH( |
---|
| 971 | Plural, |
---|
| 972 | [ --without-Plural do compile without Plural support]) |
---|
| 973 | AC_ARG_WITH( |
---|
| 974 | NTL, |
---|
| 975 | [ --with-NTL build for use with NTL.], |
---|
| 976 | , |
---|
| 977 | with_NTL=yes) |
---|
| 978 | AC_ARG_WITH( |
---|
| 979 | RatGB, |
---|
| 980 | [ --with-ratGB do compile with ratGB support (experimental)]) |
---|
| 981 | |
---|
| 982 | dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 983 | dnl check for packages we need |
---|
| 984 | dnl for gmp, MP, factory and libfac, we built them in, even if the libs |
---|
| 985 | dnl and headers were not found under the condition that the respective |
---|
| 986 | dnl --enable argument was given |
---|
| 987 | dnl |
---|
| 988 | |
---|
| 989 | |
---|
| 990 | AC_MSG_CHECKING(whether to use dynamic linking) |
---|
| 991 | if test "$with_dl" != no && test "$ac_lib_dl" = yes; then |
---|
| 992 | AC_DEFINE(HAVE_DL) |
---|
| 993 | ac_have_dl=yes |
---|
| 994 | AC_MSG_RESULT(yes) |
---|
| 995 | else |
---|
| 996 | AC_MSG_RESULT(no) |
---|
| 997 | fi |
---|
| 998 | |
---|
| 999 | AC_CHECK_LIB(ncurses,tgetent,,\ |
---|
| 1000 | AC_CHECK_LIB(curses,tgetent,,\ |
---|
| 1001 | AC_CHECK_LIB(termcap,tgetent))) |
---|
| 1002 | |
---|
| 1003 | # readline |
---|
| 1004 | if test "$with_readline" = dynamic && test "$ac_have_dl" != yes; then |
---|
| 1005 | AC_MSG_WARN(can not build dynamic readline without dynamic linking) |
---|
| 1006 | with_readline=static |
---|
| 1007 | fi |
---|
| 1008 | |
---|
| 1009 | |
---|
| 1010 | if test "$with_readline" != dynamic && test "$with_readline" != no; then |
---|
| 1011 | AC_LANG_SAVE |
---|
| 1012 | AC_LANG_CPLUSPLUS |
---|
| 1013 | AC_CHECK_LIB(readline, rl_abort) |
---|
| 1014 | AC_CHECK_HEADERS(readline/readline.h readline/history.h) |
---|
| 1015 | if test "$ac_cv_lib_readline_rl_abort" = yes && \ |
---|
| 1016 | test "$ac_cv_header_readline_readline_h" = yes; then |
---|
| 1017 | AC_MSG_CHECKING(whether readline.h is ok) |
---|
| 1018 | AC_CACHE_VAL(ac_cv_header_readline_readline_h_ok, |
---|
| 1019 | AC_TRY_LINK( |
---|
| 1020 | #include<unistd.h> |
---|
| 1021 | #include<stdio.h> |
---|
| 1022 | #include<readline/readline.h> |
---|
| 1023 | #ifdef HAVE_READLINE_HISTORY_H |
---|
| 1024 | #include<readline/history.h> |
---|
| 1025 | #endif |
---|
| 1026 | , |
---|
| 1027 | , |
---|
| 1028 | ac_cv_header_readline_readline_h_ok="yes", |
---|
| 1029 | ac_cv_header_readline_readline_h_ok="no", |
---|
| 1030 | )) |
---|
| 1031 | AC_MSG_RESULT($ac_cv_header_readline_readline_h_ok) |
---|
| 1032 | if test "$ac_cv_header_readline_readline_h_ok" != yes; then |
---|
| 1033 | #not ok -- try once more with explicitly declaring everything |
---|
| 1034 | AC_MSG_CHECKING(whether or not we nevertheless can use readline) |
---|
| 1035 | AC_CACHE_VAL(ac_cv_have_readline, |
---|
| 1036 | AC_TRY_LINK( |
---|
| 1037 | #include <stdio.h> |
---|
| 1038 | extern "C" |
---|
| 1039 | { |
---|
| 1040 | extern char * rl_readline_name; |
---|
| 1041 | extern char *rl_line_buffer; |
---|
| 1042 | char *filename_completion_function(); |
---|
| 1043 | typedef char **CPPFunction (); |
---|
| 1044 | extern char ** completion_matches (); |
---|
| 1045 | extern CPPFunction * rl_attempted_completion_function; |
---|
| 1046 | extern FILE * rl_outstream; |
---|
| 1047 | char * readline (); |
---|
| 1048 | void add_history (); |
---|
| 1049 | int write_history (); |
---|
| 1050 | int read_history(); |
---|
| 1051 | } |
---|
| 1052 | #ifndef NULL |
---|
| 1053 | #define NULL 0 |
---|
| 1054 | #endif |
---|
| 1055 | , |
---|
| 1056 | rl_readline_name=NULL; |
---|
| 1057 | *rl_line_buffer=1; |
---|
| 1058 | completion_matches(NULL, filename_completion_function); |
---|
| 1059 | rl_attempted_completion_function = (CPPFunction *) NULL; |
---|
| 1060 | rl_outstream=NULL; |
---|
| 1061 | readline(NULL); |
---|
| 1062 | add_history(NULL); |
---|
| 1063 | read_history(NULL); |
---|
| 1064 | write_history(NULL); |
---|
| 1065 | , |
---|
| 1066 | ac_cv_have_readline="yes" |
---|
| 1067 | , |
---|
| 1068 | ac_cv_have_readline="no" |
---|
| 1069 | )) |
---|
| 1070 | AC_MSG_RESULT($ac_cv_have_readline) |
---|
| 1071 | else |
---|
| 1072 | AC_DEFINE(READLINE_READLINE_H_OK) |
---|
| 1073 | ac_cv_have_readline="yes" |
---|
| 1074 | fi |
---|
| 1075 | fi |
---|
| 1076 | if test "$ac_cv_have_readline" = yes; then |
---|
| 1077 | AC_DEFINE(HAVE_READLINE) |
---|
| 1078 | fi |
---|
| 1079 | AC_LANG_RESTORE |
---|
| 1080 | fi |
---|
| 1081 | |
---|
| 1082 | AC_MSG_CHECKING(which readline to use) |
---|
| 1083 | if test "$ac_cv_with_readline" = dynamic; then |
---|
| 1084 | AC_MSG_RESULT(dynamic) |
---|
| 1085 | AC_DEFINE(HAVE_DYN_RL) |
---|
| 1086 | elif test "$ac_cv_have_readline" = yes; then |
---|
| 1087 | AC_MSG_RESULT(static) |
---|
| 1088 | elif test "$ac_cv_singuname" = PowerMacintosh-darwin; then |
---|
| 1089 | AC_MSG_ERROR(building without readline impossible on PowerMacintosh-darwin) |
---|
| 1090 | else |
---|
| 1091 | AC_MSG_RESULT(none) |
---|
| 1092 | AC_MSG_WARN(building without readline: disabling fancy display) |
---|
| 1093 | fi |
---|
| 1094 | |
---|
| 1095 | NEED_LIBS=$LIBS |
---|
| 1096 | |
---|
| 1097 | # gmp, MP, MPT, factory, libfac |
---|
| 1098 | AC_CHECK_LIB(gmp, main) |
---|
| 1099 | SAVE_LIBS=$LIBS |
---|
| 1100 | AC_CHECK_LIB(MP, IMP_PutGmpInt,,,$MP_LIBS) |
---|
| 1101 | AC_CHECK_LIB(MPT, MPT_GetTree,,,$MP_LIBS) |
---|
| 1102 | LIBS=$SAVE_LIBS |
---|
| 1103 | AC_CHECK_LIB(singcf, atof) |
---|
| 1104 | AC_CHECK_LIB(singfac, atof) |
---|
| 1105 | AC_CHECK_LIB(omalloc, omTestAddr) |
---|
| 1106 | AC_CHECK_LIB(omalloc_ndebug, main) |
---|
| 1107 | AC_CHECK_LIB(ntl,main) |
---|
| 1108 | |
---|
| 1109 | AC_CHECK_HEADERS(gmp.h MP.h MPT.h factory.h factor.h omalloc.h \ |
---|
| 1110 | omalloc.c) |
---|
| 1111 | |
---|
| 1112 | AC_MSG_CHECKING(whether to use Boost) |
---|
| 1113 | if test "$with_Boost" != no; then |
---|
| 1114 | AC_MSG_RESULT(yes) |
---|
| 1115 | AC_LANG_SAVE |
---|
| 1116 | AC_LANG_CPLUSPLUS |
---|
| 1117 | AC_CHECK_HEADERS(boost/dynamic_bitset.hpp) |
---|
| 1118 | AC_LANG_RESTORE |
---|
| 1119 | else |
---|
| 1120 | AC_MSG_RESULT(no) |
---|
| 1121 | AC_MSG_CHECKING(whether to use std::vector) |
---|
| 1122 | if test "$with_stdvec" != yes; then |
---|
| 1123 | AC_MSG_RESULT(no) |
---|
| 1124 | else |
---|
| 1125 | AC_MSG_RESULT(yes) |
---|
| 1126 | AC_DEFINE(USE_STDVECBOOL) |
---|
| 1127 | USE_STDVECBOOL=1 |
---|
| 1128 | fi |
---|
| 1129 | fi |
---|
| 1130 | AC_SUBST(USE_STDVECBOOL) |
---|
| 1131 | |
---|
| 1132 | if test "$ac_cv_lib_gmp_main" = yes && \ |
---|
| 1133 | test "$ac_cv_header_gmp_h" = yes; then |
---|
| 1134 | ac_gmp_ok=yes |
---|
| 1135 | fi |
---|
| 1136 | |
---|
| 1137 | if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ |
---|
| 1138 | test "$ac_cv_lib_MPT_MPT_GetTree" && \ |
---|
| 1139 | test "$ac_cv_header_MP_h" = yes && \ |
---|
| 1140 | test "$ac_cv_header_MPT_h" = yes; then |
---|
| 1141 | ac_MP_ok=yes |
---|
| 1142 | fi |
---|
| 1143 | |
---|
| 1144 | if test "$ac_cv_lib_singcf_atof" = yes && \ |
---|
| 1145 | test "$ac_cv_header_factory_h" = yes; then |
---|
| 1146 | ac_factory_ok=yes |
---|
| 1147 | fi |
---|
| 1148 | |
---|
| 1149 | if test "$ac_cv_lib_singfac_atof" = yes && \ |
---|
| 1150 | test "$ac_cv_header_factor_h" = yes; then |
---|
| 1151 | ac_libfac_ok=yes |
---|
| 1152 | fi |
---|
| 1153 | |
---|
| 1154 | if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \ |
---|
| 1155 | test "$ac_cv_lib_omalloc_ndebug_main" = yes && \ |
---|
| 1156 | test "$ac_cv_header_omalloc_c" = yes && \ |
---|
| 1157 | test "$ac_cv_header_omalloc_h" = yes; then |
---|
| 1158 | ac_cv_omalloc_ok=yes |
---|
| 1159 | fi |
---|
| 1160 | |
---|
| 1161 | if test "$ac_cv_lib_ntl_main" = yes; then |
---|
| 1162 | ac_cv_ntl_ok=yes |
---|
| 1163 | fi |
---|
| 1164 | |
---|
| 1165 | SAVE_LIBS=$LIBS |
---|
| 1166 | AC_CHECK_LIB(c_nonshared,__stack_chk_fail_local,GLIBC_DYN_FIX="-lc_nonshared",GLIBC_DYN_FIX="") |
---|
| 1167 | LIBS=$SAVE_LIBS |
---|
| 1168 | AC_SUBST(GLIBC_DYN_FIX) |
---|
| 1169 | |
---|
| 1170 | |
---|
| 1171 | # evaluate results |
---|
| 1172 | dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 1173 | dnl make sure that omalloc is there |
---|
| 1174 | dnl |
---|
| 1175 | if test "$ac_cv_omalloc_ok" != yes && test "$enable_omalloc" != yes; then |
---|
| 1176 | AC_MSG_ERROR(can not build without omalloc) |
---|
| 1177 | fi |
---|
| 1178 | |
---|
| 1179 | AC_MSG_CHECKING(which apint package to use) |
---|
| 1180 | if test "${with_apint}" != gmp; then |
---|
| 1181 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
| 1182 | AC_MSG_RESULT(gmp) |
---|
| 1183 | will_have_gmp=yes |
---|
| 1184 | NEED_LIBS="-lgmp ${NEED_LIBS}" |
---|
| 1185 | else |
---|
| 1186 | AC_MSG_RESULT(none) |
---|
| 1187 | AC_MSG_ERROR(can not build without gmp) |
---|
| 1188 | fi |
---|
| 1189 | else |
---|
| 1190 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
| 1191 | AC_MSG_RESULT(gmp) |
---|
| 1192 | will_have_gmp=yes |
---|
| 1193 | NEED_LIBS="-lgmp ${NEED_LIBS}" |
---|
| 1194 | else |
---|
| 1195 | AC_MSG_RESULT(none) |
---|
| 1196 | AC_MSG_ERROR(can not build with gmp) |
---|
| 1197 | fi |
---|
| 1198 | fi |
---|
| 1199 | |
---|
| 1200 | AC_MSG_CHECKING(gfanlib) |
---|
| 1201 | if test "$enable_gfanlib" = yes; then |
---|
| 1202 | AC_MSG_RESULT(yes) |
---|
| 1203 | NEED_LIBS="${NEED_LIBS} -lgfan -lcddgmp" |
---|
| 1204 | else |
---|
| 1205 | AC_MSG_RESULT(can not build with gfan lib) |
---|
| 1206 | fi |
---|
| 1207 | |
---|
| 1208 | AC_MSG_CHECKING(whether to use libsvd) |
---|
| 1209 | if test "$with_svd" = yes; then |
---|
| 1210 | AC_MSG_RESULT(yes) |
---|
| 1211 | AC_DEFINE(HAVE_SVD) |
---|
| 1212 | NEED_LIBS="-lsvd -lmpfr ${NEED_LIBS}" |
---|
| 1213 | else |
---|
| 1214 | AC_MSG_RESULT(no) |
---|
| 1215 | fi |
---|
| 1216 | AC_SUBST(HAVE_SVD) |
---|
| 1217 | |
---|
| 1218 | # |
---|
| 1219 | AC_MSG_CHECKING(whether to have MP) |
---|
| 1220 | if test "${with_MP}" != yes && test "${with_MP}" != no; then |
---|
| 1221 | if (test "${will_have_gmp}" = yes) && \ |
---|
| 1222 | (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then |
---|
| 1223 | AC_MSG_RESULT(yes) |
---|
| 1224 | AC_DEFINE(HAVE_MPSR) |
---|
| 1225 | HAVE_MPSR=1 |
---|
| 1226 | MP_LIBS="-lMPT -lMP ${MP_LIBS}" |
---|
| 1227 | else |
---|
| 1228 | AC_MSG_RESULT(no) |
---|
| 1229 | fi |
---|
| 1230 | elif test "${with_MP}" = yes; then |
---|
| 1231 | if (test "${will_have_gmp}" = yes) && \ |
---|
| 1232 | (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then |
---|
| 1233 | AC_MSG_RESULT(yes) |
---|
| 1234 | AC_DEFINE(HAVE_MPSR) |
---|
| 1235 | HAVE_MPSR=1 |
---|
| 1236 | MP_LIBS="-lMPT -lMP ${MP_LIBS}" |
---|
| 1237 | else |
---|
| 1238 | AC_MSG_RESULT(no) |
---|
| 1239 | AC_MSG_ERROR(can not build with MP) |
---|
| 1240 | fi |
---|
| 1241 | else |
---|
| 1242 | AC_MSG_RESULT(no) |
---|
| 1243 | fi |
---|
| 1244 | AC_SUBST(HAVE_MPSR) |
---|
| 1245 | AC_SUBST(MP_LIBS) |
---|
| 1246 | |
---|
| 1247 | AC_MSG_CHECKING(whether to have NTL) |
---|
| 1248 | if test "${with_NTL}" = yes ; then |
---|
| 1249 | AC_MSG_RESULT(yes) |
---|
| 1250 | NEED_LIBS="-lntl ${NEED_LIBS}" |
---|
| 1251 | else |
---|
| 1252 | AC_MSG_RESULT(no) |
---|
| 1253 | fi |
---|
| 1254 | |
---|
| 1255 | AC_MSG_CHECKING(whether to have factory) |
---|
| 1256 | if test "${with_factory}" != yes && test "${with_factory}" != no; then |
---|
| 1257 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
| 1258 | AC_MSG_RESULT(yes) |
---|
| 1259 | AC_DEFINE(HAVE_FACTORY) |
---|
| 1260 | will_have_factory=yes |
---|
| 1261 | NEED_LIBS="-lsingcf ${NEED_LIBS}" |
---|
| 1262 | else |
---|
| 1263 | AC_MSG_RESULT(no) |
---|
| 1264 | fi |
---|
| 1265 | elif test "${with_factory}" = yes; then |
---|
| 1266 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
| 1267 | AC_MSG_RESULT(yes) |
---|
| 1268 | AC_DEFINE(HAVE_FACTORY) |
---|
| 1269 | will_have_factory=yes |
---|
| 1270 | NEED_LIBS="-lsingcf ${NEED_LIBS}" |
---|
| 1271 | else |
---|
| 1272 | AC_MSG_RESULT(no) |
---|
| 1273 | AC_MSG_ERROR(can not build with factory) |
---|
| 1274 | fi |
---|
| 1275 | else |
---|
| 1276 | AC_MSG_RESULT(no) |
---|
| 1277 | fi |
---|
| 1278 | |
---|
| 1279 | AC_MSG_CHECKING(whether to have libfac) |
---|
| 1280 | if test "${with_libfac}" != yes && test "${with_libfac}" != no; then |
---|
| 1281 | if (test "${will_have_factory}" = yes) && \ |
---|
| 1282 | (test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes); then |
---|
| 1283 | AC_MSG_RESULT(yes) |
---|
| 1284 | NEED_LIBS="-lsingfac ${NEED_LIBS}" |
---|
| 1285 | else |
---|
| 1286 | AC_MSG_RESULT(no) |
---|
| 1287 | AC_MSG_ERROR(can not build without libfac) |
---|
| 1288 | fi |
---|
| 1289 | elif test "${with_libfac}" = yes; then |
---|
| 1290 | if (test "${will_have_factory}" = yes) && \ |
---|
| 1291 | (test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes); then |
---|
| 1292 | AC_MSG_RESULT(yes) |
---|
| 1293 | NEED_LIBS="-lsingfac ${NEED_LIBS}" |
---|
| 1294 | else |
---|
| 1295 | AC_MSG_RESULT(no) |
---|
| 1296 | AC_MSG_ERROR(can not build with libfac) |
---|
| 1297 | fi |
---|
| 1298 | else |
---|
| 1299 | AC_MSG_RESULT(no) |
---|
| 1300 | fi |
---|
| 1301 | |
---|
| 1302 | NEED_LIBSG="${NEED_LIBS}" |
---|
| 1303 | if test "$ac_cv_sizeof_voidp" != 4; then |
---|
| 1304 | NEED_LIBS="${NEED_LIBS} -lomalloc" |
---|
| 1305 | else |
---|
| 1306 | NEED_LIBS="${NEED_LIBS} -lomalloc_ndebug" |
---|
| 1307 | fi |
---|
| 1308 | |
---|
| 1309 | |
---|
| 1310 | AC_SUBST(NEED_LIBS) |
---|
| 1311 | AC_SUBST(NEED_LIBSG) |
---|
| 1312 | |
---|
| 1313 | AC_MSG_CHECKING(whether to have dbm links) |
---|
| 1314 | if test "$with_dbm" != no; then |
---|
| 1315 | AC_DEFINE(HAVE_DBM) |
---|
| 1316 | AC_MSG_RESULT(yes) |
---|
| 1317 | else |
---|
| 1318 | AC_MSG_RESULT(no) |
---|
| 1319 | fi |
---|
| 1320 | |
---|
| 1321 | AC_MSG_CHECKING(whether to have dynamic modules) |
---|
| 1322 | if test "$with_dynamic_modules" = no || test "$ac_have_dl" != yes; then |
---|
| 1323 | AC_MSG_RESULT(no) |
---|
| 1324 | else |
---|
| 1325 | AC_DEFINE(HAVE_DYNAMIC_LOADING) |
---|
| 1326 | AC_MSG_RESULT(yes) |
---|
| 1327 | fi |
---|
| 1328 | |
---|
| 1329 | AC_MSG_CHECKING(whether to have dynamic kernel) |
---|
| 1330 | if test "$with_dynamic_kernel" != no && test "$ac_lib_dl" = yes; then |
---|
| 1331 | DL_KERNEL=1 |
---|
| 1332 | AC_SUBST(DL_KERNEL) |
---|
| 1333 | AC_MSG_RESULT(yes) |
---|
| 1334 | else |
---|
| 1335 | AC_MSG_RESULT(no) |
---|
| 1336 | fi |
---|
| 1337 | |
---|
| 1338 | AC_MSG_CHECKING(whether to have Plural) |
---|
| 1339 | if test "$with_Plural" != no && test "$enable_Plural" != no; then |
---|
| 1340 | AC_DEFINE(HAVE_PLURAL) |
---|
| 1341 | AC_MSG_RESULT(yes) |
---|
| 1342 | PLURAL=1 |
---|
| 1343 | AC_SUBST(PLURAL) |
---|
| 1344 | else |
---|
| 1345 | AC_MSG_RESULT(no) |
---|
| 1346 | fi |
---|
| 1347 | |
---|
| 1348 | AC_MSG_CHECKING(whether to have ratGB) |
---|
| 1349 | if test "$with_ratGB" != yes && test "$enable_ratGB" != yes; then |
---|
| 1350 | AC_MSG_RESULT(no) |
---|
| 1351 | else |
---|
| 1352 | AC_DEFINE(HAVE_RATGRING) |
---|
| 1353 | AC_MSG_RESULT(yes) |
---|
| 1354 | fi |
---|
| 1355 | |
---|
| 1356 | |
---|
| 1357 | OUTPUT_MAKEFILES="Makefile ../kernel/Makefile" |
---|
| 1358 | |
---|
| 1359 | if test "$ac_cv_singuname" = "ix86-Win"; then |
---|
| 1360 | OUTPUT_MAKEFILES="${OUTPUT_MAKEFILES} Singular.rc" |
---|
| 1361 | fi |
---|
| 1362 | |
---|
| 1363 | AC_OUTPUT(${OUTPUT_MAKEFILES}, \ |
---|
| 1364 | cp mod2.h ../kernel/mod2.h; \ |
---|
| 1365 | if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi) |
---|