[6afd7c] | 1 | dnl Process this file with autoconf to produce a configure script |
---|
| 2 | AC_INIT(Singular/matpol.h) |
---|
| 3 | AC_PREFIX_DEFAULT(`pwd`) |
---|
| 4 | |
---|
[4c001a] | 5 | AC_CANONICAL_HOST |
---|
| 6 | AC_SUBST(host) |
---|
[6afd7c] | 7 | |
---|
| 8 | |
---|
| 9 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 10 | dnl those are needed to check for libs and headers, later on |
---|
| 11 | dnl |
---|
| 12 | AC_PROG_CC |
---|
| 13 | AC_PROG_CPP |
---|
| 14 | AC_AIX |
---|
| 15 | |
---|
| 16 | dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure |
---|
| 17 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
| 18 | if test "x$exec_prefix" = xNONE; then |
---|
| 19 | if test "x$prefix" = xNONE; then |
---|
| 20 | LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" |
---|
[5615cd9] | 21 | ac_configure_args="$ac_configure_args --libdir=${ac_default_prefix}/lib" |
---|
[6afd7c] | 22 | else |
---|
| 23 | LDFLAGS="-L${prefix}/lib ${LDFLAGS}" |
---|
[5615cd9] | 24 | ac_configure_args="$ac_configure_args --libdir=${prefix}/lib" |
---|
[6afd7c] | 25 | fi |
---|
| 26 | else |
---|
| 27 | LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" |
---|
[5615cd9] | 28 | ac_configure_args="$ac_configure_args --libdir=${exec_prefix}/lib" |
---|
[6afd7c] | 29 | fi |
---|
| 30 | else |
---|
| 31 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
| 32 | fi |
---|
| 33 | |
---|
| 34 | if test "$includedir" = '${prefix}/include'; then |
---|
| 35 | if test "x$prefix" = xNONE; then |
---|
| 36 | CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" |
---|
[5615cd9] | 37 | ac_configure_args="$ac_configure_args --includedir=${ac_default_prefix}/include" |
---|
[6afd7c] | 38 | else |
---|
| 39 | CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" |
---|
[5615cd9] | 40 | ac_configure_args="$ac_configure_args --includedir=${prefix}/include" |
---|
[6afd7c] | 41 | fi |
---|
| 42 | else |
---|
| 43 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
| 44 | fi |
---|
| 45 | |
---|
| 46 | dnl pass default prefix on to subdirs, if not explicitely given as an option |
---|
| 47 | if test "x$prefix" = xNONE; then |
---|
| 48 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
| 49 | fi |
---|
| 50 | |
---|
[dc32d42] | 51 | AC_MSG_CHECKING(whether _AIX is defined) |
---|
| 52 | AC_CACHE_VAL(ac_cv_is_aix, |
---|
| 53 | AC_EGREP_CPP(yes, |
---|
| 54 | [#ifdef _AIX |
---|
| 55 | yes |
---|
| 56 | #endif |
---|
| 57 | ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) |
---|
| 58 | if test "$ac_cv_is_aix" = yes; then |
---|
| 59 | AC_MSG_RESULT(yes) |
---|
| 60 | else |
---|
| 61 | AC_MSG_RESULT(no) |
---|
| 62 | fi |
---|
[6afd7c] | 63 | |
---|
| 64 | |
---|
| 65 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 66 | dnl check for various libraries and headers |
---|
| 67 | dnl |
---|
| 68 | AC_CHECK_LIB(m, atof) |
---|
[78364c] | 69 | AC_CHECK_LIB(gmp, mpq_init) |
---|
| 70 | AC_CHECK_LIB(smallgmp, mpz_init) |
---|
[6afd7c] | 71 | AC_CHECK_LIB(MP, IMP_PutGmpInt) |
---|
| 72 | AC_CHECK_LIB(MPT, MPT_GetTree) |
---|
| 73 | AC_CHECK_LIB(singcf, atof) |
---|
| 74 | AC_CHECK_LIB(singfac, atof) |
---|
| 75 | |
---|
[78364c] | 76 | AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h MPT.h factory.h factor.h) |
---|
[6afd7c] | 77 | |
---|
[78364c] | 78 | if test "$ac_cv_lib_gmp_mpq_init" = yes && \ |
---|
[6afd7c] | 79 | test "$ac_cv_header_gmp_h" = yes; then |
---|
| 80 | ac_gmp_ok=yes |
---|
| 81 | fi |
---|
| 82 | |
---|
[78364c] | 83 | if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \ |
---|
| 84 | test "$ac_cv_header_smallgmp_h" = yes && \ |
---|
| 85 | test "$ac_cv_header_gmp_h" = yes; then |
---|
| 86 | ac_smallgmp_ok=yes |
---|
| 87 | fi |
---|
| 88 | |
---|
[6afd7c] | 89 | if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ |
---|
| 90 | test "$ac_cv_lib_MPT_MPT_GetTree" && \ |
---|
| 91 | test "$ac_cv_header_MP_h" = yes && \ |
---|
| 92 | test "$ac_cv_header_MPT_h" = yes; then |
---|
| 93 | ac_MP_ok=yes |
---|
| 94 | fi |
---|
| 95 | |
---|
[4c001a] | 96 | if test "$ac_cv_lib_singcf_atof" = yes && \ |
---|
[6afd7c] | 97 | test "$ac_cv_header_factory_h" = yes; then |
---|
| 98 | ac_factory_ok=yes |
---|
| 99 | fi |
---|
| 100 | |
---|
[4c001a] | 101 | if test "$ac_cv_lib_singfac_atof" = yes && \ |
---|
[6afd7c] | 102 | test "$ac_cv_header_factor_h" = yes; then |
---|
| 103 | ac_libfac_ok=yes |
---|
| 104 | fi |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 109 | dnl Check whether or not to built various packages |
---|
| 110 | dnl |
---|
[78364c] | 111 | AC_ARG_ENABLE(smallgmp, \ |
---|
[6afd7c] | 112 | [ --enable-PACKAGE configure and build PACKAGE |
---|
| 113 | --disable-PACKAGE do not configure and build PACKAGE |
---|
| 114 | where PACKAGE can be: |
---|
[78364c] | 115 | smallgmp minimal version of gmp written in C only]) |
---|
[6afd7c] | 116 | AC_ARG_ENABLE(MP, \ |
---|
| 117 | [ MP Multi Protocol library]) |
---|
| 118 | AC_ARG_ENABLE(factory, \ |
---|
| 119 | [ factory polynomial factorization library]) |
---|
| 120 | AC_ARG_ENABLE(libfac, \ |
---|
| 121 | [ libfac char set and modp poly factorization library]) |
---|
| 122 | AC_ARG_ENABLE(Singular, \ |
---|
[78364c] | 123 | [ Singular CAS for commutative algebra]) |
---|
[6afd7c] | 124 | |
---|
[78364c] | 125 | AC_ARG_WITH(MP,\ |
---|
| 126 | [ --with-PACKAGE use PACKAGE, provide dependent functionality |
---|
| 127 | --without-PACKAGE do not use PACKAGE, disable dependent functionality |
---|
| 128 | where PACKAGE can be: |
---|
[9f226d] | 129 | MP Multi Protocol library]) |
---|
[78364c] | 130 | AC_ARG_WITH(factory, \ |
---|
| 131 | [ factory polynomial factorization library]) |
---|
| 132 | AC_ARG_WITH(libfac, \ |
---|
| 133 | [ libfac char set and modp poly factorization library]) |
---|
| 134 | AC_ARG_WITH(gmp, \ |
---|
| 135 | [ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic |
---|
| 136 | where PACKAGE can be gmp, smallgmp, or buildin]) |
---|
| 137 | |
---|
| 138 | AC_MSG_CHECKING(whether to configure and build smallgmp lib) |
---|
| 139 | if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then |
---|
| 140 | if test "$ac_smallgmp_ok" != yes && \ |
---|
| 141 | test "$ac_gmp_ok" != yes && \ |
---|
| 142 | (test "$with_apint" = smallgmp || test "${with_apint+set}" != set); then |
---|
| 143 | enable_smallgmp=yes |
---|
[6afd7c] | 144 | else |
---|
[78364c] | 145 | enable_smallgmp=no |
---|
[6afd7c] | 146 | fi |
---|
| 147 | fi |
---|
[78364c] | 148 | if test "$enable_smallgmp" = yes && test -d smallgmp; then |
---|
| 149 | AC_MSG_RESULT(yes) |
---|
| 150 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp" |
---|
| 151 | enable_smallgmp=yes |
---|
| 152 | ac_will_have_gmp=yes |
---|
[6afd7c] | 153 | else |
---|
| 154 | AC_MSG_RESULT(no) |
---|
[78364c] | 155 | if test "$enable_smallgmp" = yes && test ! -d smallgmp; then |
---|
| 156 | AC_MSG_WARN(Did not find smallgmp subdir) |
---|
[6afd7c] | 157 | fi |
---|
[78364c] | 158 | enable_smallgmp=no |
---|
| 159 | fi |
---|
| 160 | if test "$ac_gmp_ok" != yes && \ |
---|
| 161 | test "$ac_smallgmp_ok" != yes && \ |
---|
| 162 | test "$enable_smallgmp" != yes; then |
---|
| 163 | AC_MSG_WARN(Would rather have gmp or smallgmp to build libs and Singular) |
---|
| 164 | ac_configure_args="$ac_configure_args --disable-gmp" |
---|
| 165 | else |
---|
| 166 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
[6afd7c] | 167 | fi |
---|
| 168 | |
---|
| 169 | AC_MSG_CHECKING(whether to configure and build MP lib) |
---|
| 170 | if test "$enable_MP" != yes && test "$enable_MP" != no; then |
---|
| 171 | if test "$with_MP" != no && test "$ac_MP_ok" != yes; then |
---|
| 172 | enable_MP=yes |
---|
| 173 | else |
---|
| 174 | enable_MP=no |
---|
| 175 | fi |
---|
| 176 | fi |
---|
| 177 | if test "$enable_MP" = yes && test -d MP; then |
---|
[78364c] | 178 | if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
[dc32d42] | 179 | AC_MSG_RESULT(yes) |
---|
| 180 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
| 181 | ac_configure_args="$ac_configure_args --enable-MP" |
---|
| 182 | else |
---|
| 183 | AC_MSG_RESULT(no) |
---|
[78364c] | 184 | AC_MSG_WARN(Can not build MP without having gmp) |
---|
| 185 | enabl_MP=no |
---|
[dc32d42] | 186 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
| 187 | fi |
---|
[6afd7c] | 188 | else |
---|
| 189 | AC_MSG_RESULT(no) |
---|
| 190 | if test "$enable_MP" = yes && test ! -d MP; then |
---|
| 191 | AC_MSG_WARN(Did not find MP subdirectory) |
---|
| 192 | fi |
---|
| 193 | enable_MP=no |
---|
| 194 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
| 195 | fi |
---|
| 196 | |
---|
| 197 | AC_MSG_CHECKING(whether to configure and build factory lib) |
---|
| 198 | if test "$enable_factory" != yes && test "$enable_factory" != no; then |
---|
| 199 | if test "$with_factory" != no && test "$ac_factory_ok" != yes; then |
---|
| 200 | enable_factory=yes |
---|
| 201 | else |
---|
| 202 | enable_factory=no |
---|
| 203 | fi |
---|
| 204 | fi |
---|
| 205 | if test "$enable_factory" = yes && test -d factory; then |
---|
[78364c] | 206 | if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
| 207 | AC_MSG_RESULT(yes) |
---|
| 208 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" |
---|
| 209 | ac_configure_args="$ac_configure_args --enable-factory" |
---|
[dc32d42] | 210 | else |
---|
| 211 | AC_MSG_RESULT(no) |
---|
| 212 | AC_MSG_WARN(Can not build factory without having gmp) |
---|
| 213 | enable_factory=no |
---|
| 214 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
| 215 | fi |
---|
[6afd7c] | 216 | else |
---|
| 217 | AC_MSG_RESULT(no) |
---|
| 218 | if test "$enable_factory" = yes && test ! -d factory; then |
---|
| 219 | AC_MSG_WARN(Did not find factory subdirectory) |
---|
| 220 | fi |
---|
| 221 | enable_factory=no |
---|
| 222 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
| 223 | fi |
---|
| 224 | |
---|
| 225 | AC_MSG_CHECKING(whether to configure and build libfac lib) |
---|
| 226 | if test "$enable_libfac" != yes && test "$enable_libfac" != no; then |
---|
| 227 | if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then |
---|
| 228 | enable_libfac=yes |
---|
| 229 | else |
---|
| 230 | enable_libfac=no |
---|
| 231 | fi |
---|
| 232 | fi |
---|
| 233 | if test "$enable_libfac" = yes && test -d libfac; then |
---|
[dc32d42] | 234 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
[6afd7c] | 235 | AC_MSG_RESULT(yes) |
---|
| 236 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" |
---|
| 237 | ac_configure_args="$ac_configure_args --enable-libfac" |
---|
[dc32d42] | 238 | else |
---|
| 239 | AC_MSG_RESULT(no) |
---|
| 240 | AC_MSG_WARN(Can not build libfac without factory) |
---|
| 241 | enable_libfac=no |
---|
| 242 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
| 243 | fi |
---|
[6afd7c] | 244 | else |
---|
| 245 | AC_MSG_RESULT(no) |
---|
| 246 | if test "$enable_libfac" = yes && test ! -d libfac; then |
---|
| 247 | AC_MSG_WARN(Did not find libfac subdirectory) |
---|
| 248 | fi |
---|
| 249 | enable_libfac=no |
---|
| 250 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
| 251 | fi |
---|
| 252 | |
---|
| 253 | AC_MSG_CHECKING(whether to configure and build Singular) |
---|
| 254 | if test "$enable_Singular" != yes && test "$enable_Singular" != no; then |
---|
[dc32d42] | 255 | if test "$with_Singular" != no; then |
---|
[6afd7c] | 256 | enable_Singular=yes |
---|
| 257 | else |
---|
| 258 | enable_Singular=no |
---|
| 259 | fi |
---|
| 260 | fi |
---|
| 261 | if test "$enable_Singular" = yes && test -d Singular; then |
---|
| 262 | AC_MSG_RESULT(yes) |
---|
| 263 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" |
---|
| 264 | ac_configure_args="$ac_configure_args --enable-Singular" |
---|
| 265 | else |
---|
| 266 | AC_MSG_RESULT(no) |
---|
| 267 | if test "$enable_Singular" = yes && test ! -d Singular; then |
---|
| 268 | AC_MSG_WARN(Did not find Singular subdirectory) |
---|
| 269 | fi |
---|
| 270 | enable_Singular=no |
---|
| 271 | ac_configure_args="$ac_configure_args --disable-Singular" |
---|
| 272 | fi |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 276 | dnl Check whether or not to use various packages |
---|
| 277 | dnl |
---|
[78364c] | 278 | AC_MSG_CHECKING(wich apint package to use) |
---|
| 279 | if test "$with_apint" != gmp && \ |
---|
| 280 | test "$with_apint" != smallgmp && \ |
---|
| 281 | test "$with_apint" != buildin; then |
---|
| 282 | if test "$ac_gmp_ok" = yes; then |
---|
| 283 | with_apint=gmp |
---|
| 284 | elif test "$ac_enable_smallgmp" = yes; then |
---|
| 285 | with_apint=smallgmp |
---|
| 286 | else |
---|
| 287 | with_apint=buildin |
---|
| 288 | fi |
---|
| 289 | ac_configure_args="$ac_configure_args --with-apint=$with_apint" |
---|
| 290 | fi |
---|
| 291 | AC_MSG_RESULT(${with_apint}) |
---|
[6afd7c] | 292 | |
---|
[dc32d42] | 293 | AC_MSG_CHECKING(whether to use with MP) |
---|
| 294 | if test "$with_MP" != no && test "$with_MP" != yes; then |
---|
| 295 | if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
| 296 | with_MP=yes |
---|
[6afd7c] | 297 | else |
---|
| 298 | with_MP=no |
---|
| 299 | fi |
---|
[dc32d42] | 300 | ac_configure_args="$ac_configure_args --with-MP=$with_MP" |
---|
[6afd7c] | 301 | fi |
---|
[dc32d42] | 302 | if test "$with_MP" = yes; then |
---|
[6afd7c] | 303 | AC_MSG_RESULT(yes) |
---|
| 304 | else |
---|
| 305 | AC_MSG_RESULT(no) |
---|
| 306 | fi |
---|
| 307 | |
---|
[78364c] | 308 | if test "$enable_MP" = yes; then |
---|
| 309 | if test "${with_apint}" = smallgmp; then |
---|
| 310 | ac_configure_args="$ac_configure_args --with-default_apreal=none" |
---|
| 311 | elif test "${with_apint}" = buildin; then |
---|
| 312 | ac_configure_args="$ac_configure_args --with-default_apreal=none --with-default-apint=none" |
---|
| 313 | fi |
---|
| 314 | fi |
---|
| 315 | |
---|
[dc32d42] | 316 | AC_MSG_CHECKING(whether to use with factory) |
---|
| 317 | if test "$with_factory" != no && test "$with_factory" != yes; then |
---|
| 318 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
| 319 | with_factory=yes |
---|
[6afd7c] | 320 | else |
---|
| 321 | with_factory=no |
---|
| 322 | fi |
---|
[dc32d42] | 323 | ac_configure_args="$ac_configure_args --with-factory=$with_factory" |
---|
[6afd7c] | 324 | fi |
---|
[dc32d42] | 325 | if test "$with_factory" = yes; then |
---|
[6afd7c] | 326 | AC_MSG_RESULT(yes) |
---|
| 327 | else |
---|
| 328 | AC_MSG_RESULT(no) |
---|
| 329 | fi |
---|
[dc32d42] | 330 | |
---|
| 331 | AC_MSG_CHECKING(whether to use with libfac) |
---|
| 332 | if test "$with_libfac" != no && test "$with_libfac" != yes; then |
---|
| 333 | if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then |
---|
| 334 | with_libfac=yes |
---|
[6afd7c] | 335 | else |
---|
| 336 | with_libfac=no |
---|
| 337 | fi |
---|
[dc32d42] | 338 | ac_configure_args="$ac_configure_args --with-libfac=$with_libfac" |
---|
[6afd7c] | 339 | fi |
---|
[dc32d42] | 340 | if test "$with_libfac" = yes; then |
---|
[6afd7c] | 341 | AC_MSG_RESULT(yes) |
---|
| 342 | else |
---|
| 343 | AC_MSG_RESULT(no) |
---|
| 344 | fi |
---|
| 345 | |
---|
[dc32d42] | 346 | AC_MSG_CHECKING(whether to use with Singular) |
---|
| 347 | if test "$with_Singular" != no && test "$with_Singular" != yes; then |
---|
[6afd7c] | 348 | if test "$enable_Singular" = yes; then |
---|
[dc32d42] | 349 | with_Singular=yes |
---|
[6afd7c] | 350 | else |
---|
| 351 | with_Singular=no |
---|
| 352 | fi |
---|
[dc32d42] | 353 | ac_configure_args="$ac_configure_args --with-Singular=$with_Singular" |
---|
[6afd7c] | 354 | fi |
---|
[dc32d42] | 355 | |
---|
[6afd7c] | 356 | if test "$with_Singular" != no; then |
---|
| 357 | AC_MSG_RESULT(yes) |
---|
| 358 | else |
---|
| 359 | AC_MSG_RESULT(no) |
---|
| 360 | fi |
---|
| 361 | |
---|
| 362 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 363 | dnl Check for known subdirs |
---|
| 364 | dnl |
---|
[78364c] | 365 | if test -d smallgmp; then |
---|
| 366 | SUBDIRS="smallgmp" |
---|
[6afd7c] | 367 | fi |
---|
| 368 | if test -d MP; then |
---|
| 369 | SUBDIRS="$SUBDIRS MP" |
---|
| 370 | fi |
---|
| 371 | if test -d factory; then |
---|
| 372 | SUBDIRS="$SUBDIRS factory" |
---|
| 373 | fi |
---|
| 374 | if test -d libfac; then |
---|
| 375 | SUBDIRS="$SUBDIRS libfac" |
---|
| 376 | fi |
---|
| 377 | if test -d Singular; then |
---|
| 378 | SUBDIRS="$SUBDIRS Singular" |
---|
| 379 | fi |
---|
| 380 | |
---|
| 381 | |
---|
| 382 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
| 383 | dnl Enough --wrap it up |
---|
| 384 | dnl |
---|
| 385 | AC_PROG_MAKE_SET |
---|
| 386 | AC_SUBST(SUBDIRS) |
---|
| 387 | AC_SUBST(CONFIG_SUBDIRS) |
---|
| 388 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
| 389 | |
---|
| 390 | AC_OUTPUT(Makefile) |
---|