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