[3824e90] | 1 | onl |
---|
[7adb502] | 2 | dnl Written by Olaf Bachmann (obachman@mathematik.uni-kl.de) |
---|
[678cfd] | 3 | dnl |
---|
| 4 | dnl configure.in for MP |
---|
| 5 | dnl Process this file with autoconf to produce a configure script. |
---|
| 6 | AC_INIT(MP/MP_Put.c) |
---|
| 7 | AC_CONFIG_HEADER(MP/MP_Config.h:MP/h/MP_Config.h.in) |
---|
| 8 | |
---|
| 9 | PRODUCT=MP |
---|
[ae6370] | 10 | VERSION=1.1.2.1 |
---|
[678cfd] | 11 | AC_SUBST(PRODUCT) |
---|
| 12 | AC_SUBST(VERSION) |
---|
| 13 | AC_DEFINE_UNQUOTED(MP_VERSION, "$VERSION") |
---|
| 14 | AC_CANONICAL_SYSTEM |
---|
| 15 | |
---|
| 16 | AC_PREFIX_DEFAULT(`pwd`) |
---|
| 17 | |
---|
[7adb502] | 18 | dnl The "philosophy" is this: |
---|
| 19 | dnl 1) by default the libraries are stored in ${prefix}/lib/${ARCH} |
---|
| 20 | dnl 2) the user can override this by setting either --exec-prefix |
---|
| 21 | dnl or --libdir |
---|
| 22 | dnl 3) If --libdir is given, then libraries are put exactly there |
---|
| 23 | dnl 4) If --libdir is not given, and --exec-dir is given, then |
---|
| 24 | dnl libraries are put into $exec_prefix/lib (as is standard) |
---|
| 25 | dnl 5) The same thing applies to bindir |
---|
| 26 | |
---|
| 27 | AC_MSG_CHECKING(for architecture identifier) |
---|
| 28 | AC_CACHE_VAL(ac_cv_arch,ac_cv_arch=`./pvmgetarch`) |
---|
| 29 | AC_MSG_RESULT($ac_cv_arch) |
---|
| 30 | |
---|
| 31 | if test "$libdir" = '${exec_prefix}/lib' && test "$exec_prefix" = "NONE"; then |
---|
| 32 | libdir='${prefix}/lib/'$ac_cv_arch |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | if test "$bindir" = '${exec_prefix}/bin' && test "$exec_prefix" = "NONE"; then |
---|
| 36 | bindir='${prefix}/bin/'$ac_cv_arch |
---|
| 37 | fi |
---|
| 38 | |
---|
[678cfd] | 39 | dnl Check for programs |
---|
| 40 | AC_PROG_RANLIB |
---|
| 41 | AC_CHECK_PROG(AR, ar, ar, :) |
---|
| 42 | if test "$ac_cv_prog_AR" != ar; then |
---|
| 43 | AC_MSG_ERROR(*** ar program not found) |
---|
| 44 | fi |
---|
| 45 | |
---|
| 46 | dnl compiler stuff |
---|
| 47 | dnl we do not want to have "-g -O" for CFLAGS |
---|
| 48 | |
---|
| 49 | if test "$with_debug" = yes; then |
---|
| 50 | if test "${CFLAGS+set}" != set; then |
---|
| 51 | CFLAGS="-g" |
---|
[ae6370] | 52 | ac_cv_cflags_not_set=yes |
---|
[678cfd] | 53 | fi |
---|
| 54 | AC_DEFINE(MPT_DEBUG) |
---|
| 55 | else |
---|
| 56 | if test "${CFLAGS+set}" != set; then |
---|
| 57 | CFLAGS="-O" |
---|
[ae6370] | 58 | ac_cv_cflags_not_set=yes |
---|
[678cfd] | 59 | fi |
---|
| 60 | AC_DEFINE(NO_LOGGING) |
---|
| 61 | fi |
---|
| 62 | |
---|
| 63 | AC_PROG_CC |
---|
| 64 | AC_PROG_CPP |
---|
[296946] | 65 | AC_PROG_CXX |
---|
[678cfd] | 66 | AC_AIX |
---|
| 67 | |
---|
| 68 | dnl compiler/system specific options |
---|
| 69 | if test "${GCC}" != yes; then |
---|
| 70 | echo not using gcc, so checking for special flags and defines |
---|
| 71 | case "$target" in |
---|
| 72 | hppa1*) |
---|
| 73 | if test "$ac_cv_prog_CC" = cc; then |
---|
| 74 | echo Using HPUX native compiler with -Aa and -D_HPUX_SOURCE |
---|
| 75 | CFLAGS="$CFLAGS -Aa " |
---|
| 76 | AC_DEFUN(_HPUX_SOURCE) |
---|
| 77 | fi |
---|
| 78 | esac |
---|
| 79 | fi |
---|
| 80 | |
---|
| 81 | dnl add to CPPFLAGS and LDFLAGS so that ${includedir} and ${libdir} |
---|
| 82 | dnl are in there |
---|
| 83 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
| 84 | if test "x$exec_prefix" = xNONE; then |
---|
| 85 | if test "x$prefix" = xNONE; then |
---|
| 86 | LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" |
---|
| 87 | else |
---|
| 88 | LDFLAGS="-L${prefix}/lib ${LDFLAGS}" |
---|
| 89 | fi |
---|
| 90 | else |
---|
| 91 | LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" |
---|
| 92 | fi |
---|
[7adb502] | 93 | elif test "$libdir" = '${prefix}/lib/'$ac_cv_arch ; then |
---|
| 94 | if test "x$prefix" = xNONE; then |
---|
| 95 | LDFLAGS="-L${ac_default_prefix}/lib/$ac_cv_arch ${LDFLAGS}" |
---|
| 96 | else |
---|
| 97 | LDFLAGS="-L${prefix}/lib/$ac_cv_arch ${LDFLAGS}" |
---|
| 98 | fi |
---|
[678cfd] | 99 | else |
---|
| 100 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
| 101 | fi |
---|
| 102 | |
---|
| 103 | if test "$includedir" = '${prefix}/include'; then |
---|
| 104 | if test "x$prefix" = xNONE; then |
---|
| 105 | CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" |
---|
| 106 | else |
---|
| 107 | CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" |
---|
| 108 | fi |
---|
| 109 | else |
---|
| 110 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
| 111 | fi |
---|
| 112 | |
---|
[7adb502] | 113 | dnl add to CPPFLAGS and LDFLAGS if PVM_ROOT and PVM_ARCH are set |
---|
| 114 | if test "${PVM_ROOT+set}" = set; then |
---|
| 115 | if test "$enable_mppvm" = yes || test "$with_pvm" = yes; then |
---|
| 116 | CPPFLAGS="${CPPFLAGS} -I${PVM_ROOT}/include" |
---|
[ae6370] | 117 | if test "${PVM_ARCH+set}" = set; then |
---|
[7adb502] | 118 | LDFLAGS="${LDFLAGS} -L{PVM_ROOT}/lib/${PVM_ARCH}" |
---|
| 119 | fi |
---|
| 120 | fi |
---|
[678cfd] | 121 | fi |
---|
| 122 | |
---|
| 123 | AC_SET_MAKE |
---|
| 124 | AC_FUNC_VFORK |
---|
| 125 | |
---|
| 126 | dnl |
---|
| 127 | dnl Lib checks --depend on enable/disable options |
---|
| 128 | dnl |
---|
| 129 | AC_ARG_ENABLE(MPT, \ |
---|
| 130 | [ --disable-MPT disable building of MPT library]) |
---|
| 131 | |
---|
| 132 | AC_ARG_ENABLE(gmp, \ |
---|
[7adb502] | 133 | [ --disable-gmp configure and build without gmp library]) |
---|
[678cfd] | 134 | |
---|
| 135 | AC_ARG_ENABLE(tests, \ |
---|
| 136 | [ --enable-example enable building of example programs]) |
---|
| 137 | |
---|
| 138 | AC_ARG_ENABLE(mpviewer, \ |
---|
| 139 | [ --enable-mpviewer enable building of mpviewer program]) |
---|
| 140 | |
---|
| 141 | AC_ARG_ENABLE(mppvm, \ |
---|
[7adb502] | 142 | [ --enable-mppvm enable building of mppvm routines]) |
---|
[678cfd] | 143 | |
---|
[0e5dde] | 144 | |
---|
[678cfd] | 145 | if test "$enable_gmp" != no && test -d gmp; then |
---|
| 146 | CONFIG_SUBDIRS="gmp" |
---|
| 147 | enable_gmp=yes |
---|
| 148 | fi |
---|
| 149 | BUILD_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
| 150 | |
---|
| 151 | if test "$enable_MPT" != no && test -d MPT; then |
---|
| 152 | BUILD_SUBDIRS="${BUILD_SUBDIRS} MPT" |
---|
| 153 | fi |
---|
| 154 | |
---|
| 155 | if test "$enable_examples" = yes && test -d examples; then |
---|
| 156 | BUILD_SUBDIRS="${BUILD_SUBDIRS} examples" |
---|
| 157 | ac_check_prog=yes |
---|
| 158 | fi |
---|
| 159 | |
---|
| 160 | if test "$enable_mpviewer" = yes && test -d mpviewer; then |
---|
| 161 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mpviewer" |
---|
| 162 | ac_check_prog=yes |
---|
| 163 | fi |
---|
| 164 | |
---|
| 165 | if test "$enable_mppvm" = yes && test -d mp-pvm3; then |
---|
| 166 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mp-pvm3" |
---|
| 167 | ac_check_prog=yes |
---|
[7adb502] | 168 | with_pvm=yes |
---|
[678cfd] | 169 | fi |
---|
[7adb502] | 170 | |
---|
[678cfd] | 171 | AC_SUBST(BUILD_SUBDIRS) |
---|
| 172 | AC_SUBST(CONFIG_SUBDIRS) |
---|
[89eb77] | 173 | AC_CHECK_FUNCS(gethostbyname) |
---|
[678cfd] | 174 | |
---|
| 175 | if test "$ac_check_prog" = yes; then |
---|
| 176 | AC_CHECK_LIB(m, atof) |
---|
| 177 | AC_CHECK_LIB(bsd, socket) |
---|
| 178 | AC_CHECK_LIB(gmp, mpz_init) |
---|
| 179 | |
---|
[b1525cd] | 180 | if test "$ac_cv_lib_gmp_mpz_init" != yes || "$enable_gmp" != no; then |
---|
[678cfd] | 181 | AC_MSG_WARN(Did not find gmp library: Linking programs with MP will fail) |
---|
| 182 | NEED_LIBS=$LIBS |
---|
[b1525cd] | 183 | else |
---|
| 184 | NEED_LIBS="-lgmp $LIBS" |
---|
[678cfd] | 185 | fi |
---|
| 186 | |
---|
[a50f02] | 187 | AC_CHECK_FUNCS(select socket gethostname gethostbyname strtol strstr) |
---|
[678cfd] | 188 | if test "$ac_cv_func_select" != yes; then |
---|
| 189 | AC_MSG_WARN(Did not find library containing function select) |
---|
| 190 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
| 191 | fi |
---|
| 192 | if test "$ac_cv_func_gethostname" != yes; then |
---|
| 193 | AC_MSG_WARN(Did not find library containing gethostname) |
---|
| 194 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
| 195 | fi |
---|
[7adb502] | 196 | |
---|
| 197 | if test "$ac_cv_func_gethostbyname" != yes; then |
---|
| 198 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
| 199 | if test "$ac_cv_lib_nsl_gethostbyname" != yes; then |
---|
[89eb77] | 200 | AC_MSG_WARN(Did not find library containing gethostbyname) |
---|
[7adb502] | 201 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
| 202 | fi |
---|
| 203 | fi |
---|
| 204 | |
---|
| 205 | if test "$ac_cv_func_socket" != yes; then |
---|
| 206 | AC_CHECK_LIB(socket, socket) |
---|
| 207 | if test "$ac_cv_lib_socket_socket" != yes; then |
---|
| 208 | AC_MSG_WARN(Did not find library containing socket) |
---|
| 209 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
| 210 | fi |
---|
| 211 | fi |
---|
[678cfd] | 212 | fi |
---|
| 213 | AC_SUBST(NEED_LIBS) |
---|
| 214 | |
---|
| 215 | dnl Do the header checks now |
---|
| 216 | AC_HEADER_STDC |
---|
| 217 | AC_HEADER_CHECK(arpa/inet.h,:, echo "*** no arpa/inet.h";exit) |
---|
| 218 | AC_HEADER_CHECK(assert.h,:, echo "*** no assert.h";exit) |
---|
| 219 | AC_HEADER_CHECK(ctype.h,:, echo "*** no ctype.h";exit) |
---|
| 220 | AC_HEADER_CHECK(errno.h,:, echo "*** no errno.h";exit) |
---|
| 221 | AC_HEADER_CHECK(netdb.h,:, echo "*** no netdb.h";exit) |
---|
| 222 | AC_HEADER_CHECK(netinet/in.h,:, echo "*** no netinet/in.h";exit) |
---|
| 223 | AC_HEADER_CHECK(netinet/tcp.h,:, echo "*** no netinet/tcp.h";exit) |
---|
| 224 | AC_HEADER_CHECK(signal.h,:, echo "*** no sihnal.h";exit) |
---|
| 225 | AC_HEADER_CHECK(stdarg.h,:, echo "*** no stdarg.h";exit) |
---|
| 226 | AC_HEADER_CHECK(stdio.h,:, echo "*** no stdio.h";exit) |
---|
| 227 | AC_HEADER_CHECK(stdlib.h,:, echo "*** no stdlib.h";exit) |
---|
| 228 | AC_HEADER_CHECK(string.h,:, echo "*** no string.h";exit) |
---|
| 229 | AC_HEADER_CHECK(stddef.h,:, echo "*** no stddef.h";exit) |
---|
[f0a718] | 230 | |
---|
| 231 | dnl Wrong preprocessor statement in /usr/include/values.h causes |
---|
| 232 | dnl problems on FreeBSD |
---|
[3824e90] | 233 | AC_HEADER_CHECK(values.h, freebsd_problem=no |
---|
| 234 | no_values_h=no, |
---|
| 235 | AC_CHECK_FILE(/usr/include/values.h, |
---|
| 236 | freebsd_problem=yes |
---|
| 237 | no_values_h=no, |
---|
| 238 | no_values_h=yes |
---|
| 239 | freebsd_problem=no)) |
---|
| 240 | if test "${freebsd_problem}" != no; then |
---|
[8fac88] | 241 | grep -v "#warning" /usr/include/values.h > ./MP/h/values.h |
---|
[3824e90] | 242 | elif test "${no_values_h}" != no; then |
---|
[8fac88] | 243 | cp ./values.h.subst ./MP/h/values.h |
---|
[a79bef5] | 244 | CPPFLAGS="-I. ${CPPFLAGS}" |
---|
[f0a718] | 245 | fi |
---|
[678cfd] | 246 | |
---|
| 247 | AC_HEADER_CHECK(fcntl.h,:, echo "*** no fcntl.h";exit) |
---|
| 248 | AC_HEADER_CHECK(sys/ioctl.h,:, echo "*** no sys/ioctl.h";exit) |
---|
| 249 | AC_HEADER_CHECK(sys/param.h,:, echo "*** no sys/param.h";exit) |
---|
| 250 | AC_HEADER_CHECK(sys/socket.h,:, echo "*** no sys/socket.h";exit) |
---|
| 251 | AC_HEADER_CHECK(sys/stat.h,:, echo "*** no sys/stat.h";exit) |
---|
| 252 | AC_HEADER_CHECK(sys/time.h,:, echo "*** no sys/time.h";exit) |
---|
| 253 | AC_HEADER_CHECK(sys/types.h,:, echo "*** no sys/types.h";exit) |
---|
| 254 | AC_HEADER_CHECK(sys/uio.h,:, echo "*** no sys/uio.h";exit) |
---|
| 255 | AC_HEADER_CHECK(sys/un.h,:, echo "*** no sys/un.h";exit) |
---|
| 256 | AC_HEADER_CHECK(unistd.h,:, echo "*** no unistd.h";exit) |
---|
| 257 | AC_HEADER_CHECK(math.h,:, echo "*** no math.h";exit) |
---|
| 258 | |
---|
| 259 | |
---|
| 260 | AC_CHECK_HEADERS(sys/select.h gmp.h genpari.h saclib.h) |
---|
| 261 | |
---|
| 262 | dnl Check whether mpz_ptr is defined (is not defined in earlier gmp versions) |
---|
| 263 | if test "$ac_cv_header_gmp_h" = yes; then |
---|
| 264 | AC_EGREP_HEADER(mpz_ptr, gmp.h, MPZ_PTR=mpz_ptr) |
---|
| 265 | if test ! "$MPZ_PTR" = mpz_ptr; then |
---|
| 266 | AC_EGREP_HEADER(MP_INT, gmp.h, MPZ_PTR="MP_INT*") |
---|
| 267 | AC_DEFINE_UNQUOTED(mpz_ptr, MP_INT*) |
---|
| 268 | AC_DEFINE_UNQUOTED(_mp_alloc,alloc) |
---|
| 269 | AC_DEFINE_UNQUOTED(_mp_size,size) |
---|
| 270 | AC_DEFINE_UNQUOTED(_mp_d,d) |
---|
| 271 | fi |
---|
| 272 | AC_EGREP_HEADER(mpf_ptr, gmp.h, MPF_PTR=mpf_ptr) |
---|
| 273 | fi |
---|
| 274 | |
---|
| 275 | dnl |
---|
| 276 | dnl deal with Ap Number configuration |
---|
| 277 | dnl |
---|
| 278 | AC_ARG_WITH(apint, \ |
---|
| 279 | [ --with-default_apint=PACKAGE use PACKAGE as MP's default ApInt format |
---|
[7adb502] | 280 | where PACKAGE can be: gmp (default), pari, |
---|
| 281 | saclib, none]) |
---|
[678cfd] | 282 | AC_ARG_WITH(apreal, \ |
---|
| 283 | [ --with-default_apreal=PACKAGE use PACKAGE as MP's default ApReal format |
---|
[7adb502] | 284 | where PACKAGE can be: gmp (default), none]) |
---|
[678cfd] | 285 | AC_ARG_WITH(gmp, \ |
---|
| 286 | [ --without-gmp build without gmp ApNumber routines]) |
---|
| 287 | |
---|
| 288 | AC_ARG_WITH(pari, \ |
---|
| 289 | [ --with-pari build with pari ApInt routines]) |
---|
| 290 | |
---|
| 291 | AC_ARG_WITH(saclib, \ |
---|
| 292 | [ --with-saclib build with saclib ApInt routines]) |
---|
| 293 | |
---|
| 294 | AC_ARG_WITH(tb, \ |
---|
| 295 | [ --with-tb build with Toolbus device interface]) |
---|
| 296 | |
---|
| 297 | AC_ARG_WITH(pvm, \ |
---|
| 298 | [ --with-pvm build with Pvm saclib device interface]) |
---|
| 299 | |
---|
| 300 | AC_ARG_WITH(debug, \ |
---|
| 301 | [ --with-debug build with debug options and logging]) |
---|
| 302 | |
---|
[ae6370] | 303 | AC_ARG_WITH(extra_cflags, \ |
---|
| 304 | [ --with-extra_cflags=cflags build with 'cflags' appended to |
---|
| 305 | CFLAGS given to the compiler]) |
---|
| 306 | |
---|
| 307 | AC_ARG_WITH(rsh, \ |
---|
| 308 | [ --with-rsh=command use 'command' as remote shell command]) |
---|
| 309 | |
---|
[678cfd] | 310 | dnl evaluate specifications |
---|
| 311 | AC_DEFINE(MP_DUMMY, 0) |
---|
| 312 | AC_DEFINE(MP_GMP, 1) |
---|
| 313 | AC_DEFINE(MP_PARI, 2) |
---|
| 314 | AC_DEFINE(MP_SAC, 3) |
---|
| 315 | |
---|
| 316 | if test "$with_default_apint" = none; then |
---|
| 317 | AC_DEFINE(MP_DEFAULT_APINT, MP_DUMMY) |
---|
| 318 | elif test "$with_default_apint" = pari; then |
---|
| 319 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
| 320 | AC_MSG_WARN(Need genpari.h to use pari as default ApInt format) |
---|
| 321 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 322 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_DUMMY) |
---|
| 323 | else |
---|
| 324 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_PARI) |
---|
| 325 | AC_DEFINE(MP_HAVE_PARI) |
---|
| 326 | fi |
---|
| 327 | elif test "$with_default_apint" = saclib; then |
---|
| 328 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
| 329 | AC_MSG_WARN(Need saclib.h to use saclib as default ApInt format) |
---|
| 330 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 331 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 332 | else |
---|
| 333 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_SAC) |
---|
| 334 | AC_DEFINE(MP_HAVE_SACLIB) |
---|
| 335 | fi |
---|
| 336 | else |
---|
| 337 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 338 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
| 339 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 340 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 341 | elif test -z "$MPZ_PTR" && test "$enable_gmp" != yes; then |
---|
| 342 | AC_MSG_WARN(Need gmp.h containing typedef of 'mpz_ptr' or 'MP_INT') |
---|
| 343 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 344 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 345 | else |
---|
| 346 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_GMP) |
---|
| 347 | AC_DEFINE(MP_HAVE_GMP_APINT) |
---|
| 348 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
| 349 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
| 350 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 351 | fi |
---|
| 352 | fi |
---|
| 353 | fi |
---|
| 354 | |
---|
| 355 | if test "$with_default_apreal" = none; then |
---|
| 356 | AC_DEFINE(MP_DEFAULT_APREAL, MP_DUMMY) |
---|
| 357 | else |
---|
| 358 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 359 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
| 360 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
| 361 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
| 362 | elif test -z "$MPF_PTR" && test "$enable_gmp" != yes; then |
---|
| 363 | AC_MSG_WARN(Need gmp.h containing tyedef of 'mpf_ptr') |
---|
| 364 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
| 365 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
| 366 | else |
---|
| 367 | AC_DEFINE(MP_DEFAULT_APREAL_FORMAT, MP_GMP) |
---|
| 368 | AC_DEFINE(MP_HAVE_GMP_APREAL) |
---|
| 369 | if test "$ac_cv_header_gmp_h" != yes ; then |
---|
| 370 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
| 371 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 372 | fi |
---|
| 373 | fi |
---|
| 374 | fi |
---|
| 375 | |
---|
| 376 | if test "$with_gmp" != no; then |
---|
| 377 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 378 | AC_MSG_WARN(Can not build MP with gmp ApInt routines: Need gmp.h) |
---|
| 379 | else |
---|
| 380 | AC_DEFINE(MP_HAVE_GMP) |
---|
| 381 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
| 382 | AC_MSG_WARN(Need gmp.h to build MP with gmp ApInt routines) |
---|
| 383 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 384 | fi |
---|
| 385 | fi |
---|
| 386 | fi |
---|
| 387 | |
---|
| 388 | if test "$with_saclib" = yes; then |
---|
| 389 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
| 390 | AC_MSG_WARN(Can not build MP with saclib ApInt routines: Need saclib.h) |
---|
| 391 | else |
---|
| 392 | AC_DEFINE(MP_HAVE_SAC) |
---|
| 393 | fi |
---|
| 394 | fi |
---|
| 395 | |
---|
| 396 | if test "$with_pari" = yes; then |
---|
| 397 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
| 398 | AC_MSG_WARN(Can not build MP with pari ApInt routines: Need genpari.h) |
---|
| 399 | else |
---|
| 400 | AC_DEFINE(MP_HAVE_PARI) |
---|
[0485bd] | 401 | AC_DEFINE(LONG_IS_32BIT) |
---|
| 402 | AC_CHECK_TYPE(ulong, no) |
---|
| 403 | if test "$ac_cv_type_ulong" = no; then |
---|
| 404 | AC_DEFINE(ULONG_NOT_DEFINED) |
---|
| 405 | fi |
---|
[678cfd] | 406 | fi |
---|
| 407 | fi |
---|
| 408 | |
---|
[0485bd] | 409 | |
---|
| 410 | |
---|
[678cfd] | 411 | if test "$with_tb" = yes; then |
---|
| 412 | AC_CHECK_HEADER(TB.h) |
---|
| 413 | if test "$ac_cv_header_TB_h" != yes; then |
---|
| 414 | AC_MSG_WARN(Can not build with Toolbus: Need TB.h) |
---|
| 415 | else |
---|
| 416 | AC_DEFINE(MP_HAVE_TB) |
---|
| 417 | fi |
---|
| 418 | fi |
---|
| 419 | |
---|
| 420 | if test "$with_pvm" = yes; then |
---|
[7adb502] | 421 | AC_CHECK_HEADER(pvm3.h) |
---|
[678cfd] | 422 | if test "$ac_cv_header_pvm3_h" != yes; then |
---|
| 423 | AC_MSG_WARN(Can not build with Pvm: Need pvm3.h) |
---|
| 424 | else |
---|
| 425 | AC_DEFINE(MP_HAVE_PVM) |
---|
| 426 | fi |
---|
| 427 | fi |
---|
| 428 | |
---|
[ae6370] | 429 | if test "${with_extra_cflags+set}" = set; then |
---|
| 430 | CFLAGS="$CFLAGS ${with_extra_cflags}" |
---|
| 431 | fi |
---|
| 432 | |
---|
| 433 | if test "${with_rsh+set}" = set; then |
---|
[a8f3d7] | 434 | AC_CHECK_PROG(with_rsh, ${with_rsh}, ${with_rsh}) |
---|
| 435 | if test "$ac_cv_prog_with_rsh" = $with_rsh; then |
---|
[3824e90] | 436 | mp_rsh_cmdline=${with_rsh} |
---|
[a8f3d7] | 437 | else |
---|
[3824e90] | 438 | mp_rsh_cmdline=no |
---|
[a8f3d7] | 439 | fi |
---|
[3824e90] | 440 | else |
---|
| 441 | mp_rsh_cmdline=no |
---|
[a8f3d7] | 442 | fi |
---|
| 443 | |
---|
[3824e90] | 444 | if test "$mp_rsh_cmdline" = no; then |
---|
| 445 | AC_CHECK_PROG(mp_ssh, ssh, ssh, no) |
---|
| 446 | AC_CHECK_PROG(mp_remsh, remsh, remsh, no) |
---|
| 447 | AC_CHECK_PROG(mp_rsh, rsh, rsh, no) |
---|
| 448 | if test "$ac_cv_prog_mp_ssh" = ssh; then |
---|
| 449 | mp_rsh_found=ssh |
---|
| 450 | elif test "$ac_cv_prog_mp_remsh" = remsh; then |
---|
| 451 | mp_rsh_found=remsh |
---|
| 452 | elif test "$ac_cv_prog_mp_rsh" = rsh; then |
---|
| 453 | mp_rsh_found=rsh |
---|
| 454 | else |
---|
| 455 | mp_rsh_found=no |
---|
| 456 | fi |
---|
| 457 | else |
---|
| 458 | mp_rsh_found=${mp_rsh_cmdline} |
---|
[a8f3d7] | 459 | fi |
---|
| 460 | |
---|
[3824e90] | 461 | AC_MSG_CHECKING(which remote shell command to use) |
---|
| 462 | AC_MSG_RESULT(${mp_rsh_found}) |
---|
[85c8634] | 463 | |
---|
[3824e90] | 464 | if test "$mp_rsh_found" = no; then |
---|
| 465 | AC_MSG_WARN("No remote shell command found") |
---|
[ae6370] | 466 | else |
---|
[a8f3d7] | 467 | AC_DEFINE_UNQUOTED(MP_RSH_COMMAND, "$mp_rsh_found") |
---|
[3824e90] | 468 | # check whether it also works with localhost, instead of hostname |
---|
| 469 | #if $mp_rsh localhost -n uname > /dev/null 2>&1; then |
---|
| 470 | # AC_DEFINE(RSH_CAN_LOCALHOST) |
---|
| 471 | #fi |
---|
[ae6370] | 472 | fi |
---|
| 473 | |
---|
[c23f3f] | 474 | |
---|
| 475 | |
---|
[0e5dde] | 476 | dnl Check for external memory managements |
---|
[638b6a] | 477 | AC_ARG_WITH(malloc_h, \ |
---|
| 478 | [ --with-malloc_h=HEADER use external malloc routines declared in HEADER]) |
---|
[0e5dde] | 479 | |
---|
[638b6a] | 480 | if test "${with_malloc_h+set}" = set; then |
---|
| 481 | AC_CHECK_HEADER(${with_malloc_h},,with_malloc=) |
---|
[0e5dde] | 482 | fi |
---|
| 483 | AC_MSG_CHECKING(where malloc rotuines come from) |
---|
[638b6a] | 484 | if test "${with_malloc_h+set}" = set; then |
---|
| 485 | AC_MSG_RESULT(${with_malloc_h}) |
---|
[0e5dde] | 486 | AC_DEFINE(WITH_EXTERNAL_MALLOC) |
---|
[638b6a] | 487 | AC_DEFINE_UNQUOTED(EXTERNAL_MALLOC_H, "${with_malloc_h}") |
---|
[0e5dde] | 488 | else |
---|
| 489 | AC_MSG_RESULT(stdlib.h) |
---|
| 490 | fi |
---|
| 491 | |
---|
| 492 | |
---|
[678cfd] | 493 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
| 494 | AC_C_BIGENDIAN |
---|
| 495 | AC_C_CONST |
---|
| 496 | AC_TYPE_SIZE_T |
---|
| 497 | AC_HEADER_TIME |
---|
| 498 | |
---|
| 499 | dnl miscellanous stuff |
---|
| 500 | dnl check for sizeof(long) |
---|
| 501 | AC_CHECK_SIZEOF(long, 4) |
---|
| 502 | if test "$ac_cv_sizeof_long" != 4; then |
---|
| 503 | AC_MSG_ERROR(Need sizeof long to equal 4) |
---|
| 504 | fi |
---|
| 505 | |
---|
[0485bd] | 506 | dnl add some defines for if pari is used |
---|
| 507 | |
---|
[678cfd] | 508 | CLEAN="rm -f *~ a.out core *.o .log" |
---|
| 509 | AC_SUBST(CLEAN) |
---|
| 510 | |
---|
| 511 | dnl if we use GCC, then we know CFLAGS best and do not let user overwrite it |
---|
[ae6370] | 512 | if test "${GCC}" = yes && test "$ac_cv_cflags_not_set" = yes; then |
---|
[678cfd] | 513 | if test "$with_debug" = yes; then |
---|
[ae6370] | 514 | CFLAGS="-g -Wall -Wno-unused ${with_extra_cflags}" |
---|
[678cfd] | 515 | else |
---|
[ae6370] | 516 | CFLAGS="-O3 -w -fomit-frame-pointer ${with_extra_cflags}" |
---|
[678cfd] | 517 | fi |
---|
| 518 | fi |
---|
| 519 | |
---|
| 520 | dnl check for args to pass to subconfigure |
---|
| 521 | if test "$prefix" = NONE; then |
---|
| 522 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
| 523 | fi |
---|
[7adb502] | 524 | |
---|
[678cfd] | 525 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
| 526 | |
---|
| 527 | AC_OUTPUT(Makefile MP/Makefile MPT/Makefile mpviewer/Makefile \ |
---|
| 528 | mp-pvm3/Makefile examples/Makefile, \ |
---|
| 529 | if test "$CONFIG_HEADERS"; then echo timestamp > MP/stamp-h; fi) |
---|