[678cfd] | 1 | dnl |
---|
[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) |
---|
| 230 | AC_HEADER_CHECK(values.h,:, echo "*** no values.h";exit) |
---|
| 231 | |
---|
| 232 | AC_HEADER_CHECK(fcntl.h,:, echo "*** no fcntl.h";exit) |
---|
| 233 | AC_HEADER_CHECK(sys/ioctl.h,:, echo "*** no sys/ioctl.h";exit) |
---|
| 234 | AC_HEADER_CHECK(sys/param.h,:, echo "*** no sys/param.h";exit) |
---|
| 235 | AC_HEADER_CHECK(sys/socket.h,:, echo "*** no sys/socket.h";exit) |
---|
| 236 | AC_HEADER_CHECK(sys/stat.h,:, echo "*** no sys/stat.h";exit) |
---|
| 237 | AC_HEADER_CHECK(sys/time.h,:, echo "*** no sys/time.h";exit) |
---|
| 238 | AC_HEADER_CHECK(sys/types.h,:, echo "*** no sys/types.h";exit) |
---|
| 239 | AC_HEADER_CHECK(sys/uio.h,:, echo "*** no sys/uio.h";exit) |
---|
| 240 | AC_HEADER_CHECK(sys/un.h,:, echo "*** no sys/un.h";exit) |
---|
| 241 | AC_HEADER_CHECK(unistd.h,:, echo "*** no unistd.h";exit) |
---|
| 242 | AC_HEADER_CHECK(math.h,:, echo "*** no math.h";exit) |
---|
| 243 | |
---|
| 244 | |
---|
| 245 | AC_CHECK_HEADERS(sys/select.h gmp.h genpari.h saclib.h) |
---|
| 246 | |
---|
| 247 | dnl Check whether mpz_ptr is defined (is not defined in earlier gmp versions) |
---|
| 248 | if test "$ac_cv_header_gmp_h" = yes; then |
---|
| 249 | AC_EGREP_HEADER(mpz_ptr, gmp.h, MPZ_PTR=mpz_ptr) |
---|
| 250 | if test ! "$MPZ_PTR" = mpz_ptr; then |
---|
| 251 | AC_EGREP_HEADER(MP_INT, gmp.h, MPZ_PTR="MP_INT*") |
---|
| 252 | AC_DEFINE_UNQUOTED(mpz_ptr, MP_INT*) |
---|
| 253 | AC_DEFINE_UNQUOTED(_mp_alloc,alloc) |
---|
| 254 | AC_DEFINE_UNQUOTED(_mp_size,size) |
---|
| 255 | AC_DEFINE_UNQUOTED(_mp_d,d) |
---|
| 256 | fi |
---|
| 257 | AC_EGREP_HEADER(mpf_ptr, gmp.h, MPF_PTR=mpf_ptr) |
---|
| 258 | fi |
---|
| 259 | |
---|
| 260 | dnl |
---|
| 261 | dnl deal with Ap Number configuration |
---|
| 262 | dnl |
---|
| 263 | AC_ARG_WITH(apint, \ |
---|
| 264 | [ --with-default_apint=PACKAGE use PACKAGE as MP's default ApInt format |
---|
[7adb502] | 265 | where PACKAGE can be: gmp (default), pari, |
---|
| 266 | saclib, none]) |
---|
[678cfd] | 267 | AC_ARG_WITH(apreal, \ |
---|
| 268 | [ --with-default_apreal=PACKAGE use PACKAGE as MP's default ApReal format |
---|
[7adb502] | 269 | where PACKAGE can be: gmp (default), none]) |
---|
[678cfd] | 270 | AC_ARG_WITH(gmp, \ |
---|
| 271 | [ --without-gmp build without gmp ApNumber routines]) |
---|
| 272 | |
---|
| 273 | AC_ARG_WITH(pari, \ |
---|
| 274 | [ --with-pari build with pari ApInt routines]) |
---|
| 275 | |
---|
| 276 | AC_ARG_WITH(saclib, \ |
---|
| 277 | [ --with-saclib build with saclib ApInt routines]) |
---|
| 278 | |
---|
| 279 | AC_ARG_WITH(tb, \ |
---|
| 280 | [ --with-tb build with Toolbus device interface]) |
---|
| 281 | |
---|
| 282 | AC_ARG_WITH(pvm, \ |
---|
| 283 | [ --with-pvm build with Pvm saclib device interface]) |
---|
| 284 | |
---|
| 285 | AC_ARG_WITH(debug, \ |
---|
| 286 | [ --with-debug build with debug options and logging]) |
---|
| 287 | |
---|
[ae6370] | 288 | AC_ARG_WITH(extra_cflags, \ |
---|
| 289 | [ --with-extra_cflags=cflags build with 'cflags' appended to |
---|
| 290 | CFLAGS given to the compiler]) |
---|
| 291 | |
---|
| 292 | AC_ARG_WITH(rsh, \ |
---|
| 293 | [ --with-rsh=command use 'command' as remote shell command]) |
---|
| 294 | |
---|
[678cfd] | 295 | dnl evaluate specifications |
---|
| 296 | AC_DEFINE(MP_DUMMY, 0) |
---|
| 297 | AC_DEFINE(MP_GMP, 1) |
---|
| 298 | AC_DEFINE(MP_PARI, 2) |
---|
| 299 | AC_DEFINE(MP_SAC, 3) |
---|
| 300 | |
---|
| 301 | if test "$with_default_apint" = none; then |
---|
| 302 | AC_DEFINE(MP_DEFAULT_APINT, MP_DUMMY) |
---|
| 303 | elif test "$with_default_apint" = pari; then |
---|
| 304 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
| 305 | AC_MSG_WARN(Need genpari.h to use pari as default ApInt format) |
---|
| 306 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 307 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_DUMMY) |
---|
| 308 | else |
---|
| 309 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_PARI) |
---|
| 310 | AC_DEFINE(MP_HAVE_PARI) |
---|
| 311 | fi |
---|
| 312 | elif test "$with_default_apint" = saclib; then |
---|
| 313 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
| 314 | AC_MSG_WARN(Need saclib.h to use saclib as default ApInt format) |
---|
| 315 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 316 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 317 | else |
---|
| 318 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_SAC) |
---|
| 319 | AC_DEFINE(MP_HAVE_SACLIB) |
---|
| 320 | fi |
---|
| 321 | else |
---|
| 322 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 323 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
| 324 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 325 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 326 | elif test -z "$MPZ_PTR" && test "$enable_gmp" != yes; then |
---|
| 327 | AC_MSG_WARN(Need gmp.h containing typedef of 'mpz_ptr' or 'MP_INT') |
---|
| 328 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
| 329 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
| 330 | else |
---|
| 331 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_GMP) |
---|
| 332 | AC_DEFINE(MP_HAVE_GMP_APINT) |
---|
| 333 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
| 334 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
| 335 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 336 | fi |
---|
| 337 | fi |
---|
| 338 | fi |
---|
| 339 | |
---|
| 340 | if test "$with_default_apreal" = none; then |
---|
| 341 | AC_DEFINE(MP_DEFAULT_APREAL, MP_DUMMY) |
---|
| 342 | else |
---|
| 343 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 344 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
| 345 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
| 346 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
| 347 | elif test -z "$MPF_PTR" && test "$enable_gmp" != yes; then |
---|
| 348 | AC_MSG_WARN(Need gmp.h containing tyedef of 'mpf_ptr') |
---|
| 349 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
| 350 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
| 351 | else |
---|
| 352 | AC_DEFINE(MP_DEFAULT_APREAL_FORMAT, MP_GMP) |
---|
| 353 | AC_DEFINE(MP_HAVE_GMP_APREAL) |
---|
| 354 | if test "$ac_cv_header_gmp_h" != yes ; then |
---|
| 355 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
| 356 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 357 | fi |
---|
| 358 | fi |
---|
| 359 | fi |
---|
| 360 | |
---|
| 361 | if test "$with_gmp" != no; then |
---|
| 362 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
| 363 | AC_MSG_WARN(Can not build MP with gmp ApInt routines: Need gmp.h) |
---|
| 364 | else |
---|
| 365 | AC_DEFINE(MP_HAVE_GMP) |
---|
| 366 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
| 367 | AC_MSG_WARN(Need gmp.h to build MP with gmp ApInt routines) |
---|
| 368 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
| 369 | fi |
---|
| 370 | fi |
---|
| 371 | fi |
---|
| 372 | |
---|
| 373 | if test "$with_saclib" = yes; then |
---|
| 374 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
| 375 | AC_MSG_WARN(Can not build MP with saclib ApInt routines: Need saclib.h) |
---|
| 376 | else |
---|
| 377 | AC_DEFINE(MP_HAVE_SAC) |
---|
| 378 | fi |
---|
| 379 | fi |
---|
| 380 | |
---|
| 381 | if test "$with_pari" = yes; then |
---|
| 382 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
| 383 | AC_MSG_WARN(Can not build MP with pari ApInt routines: Need genpari.h) |
---|
| 384 | else |
---|
| 385 | AC_DEFINE(MP_HAVE_PARI) |
---|
[0485bd] | 386 | AC_DEFINE(LONG_IS_32BIT) |
---|
| 387 | AC_CHECK_TYPE(ulong, no) |
---|
| 388 | if test "$ac_cv_type_ulong" = no; then |
---|
| 389 | AC_DEFINE(ULONG_NOT_DEFINED) |
---|
| 390 | fi |
---|
[678cfd] | 391 | fi |
---|
| 392 | fi |
---|
| 393 | |
---|
[0485bd] | 394 | |
---|
| 395 | |
---|
[678cfd] | 396 | if test "$with_tb" = yes; then |
---|
| 397 | AC_CHECK_HEADER(TB.h) |
---|
| 398 | if test "$ac_cv_header_TB_h" != yes; then |
---|
| 399 | AC_MSG_WARN(Can not build with Toolbus: Need TB.h) |
---|
| 400 | else |
---|
| 401 | AC_DEFINE(MP_HAVE_TB) |
---|
| 402 | fi |
---|
| 403 | fi |
---|
| 404 | |
---|
| 405 | if test "$with_pvm" = yes; then |
---|
[7adb502] | 406 | AC_CHECK_HEADER(pvm3.h) |
---|
[678cfd] | 407 | if test "$ac_cv_header_pvm3_h" != yes; then |
---|
| 408 | AC_MSG_WARN(Can not build with Pvm: Need pvm3.h) |
---|
| 409 | else |
---|
| 410 | AC_DEFINE(MP_HAVE_PVM) |
---|
| 411 | fi |
---|
| 412 | fi |
---|
| 413 | |
---|
[ae6370] | 414 | if test "${with_extra_cflags+set}" = set; then |
---|
| 415 | CFLAGS="$CFLAGS ${with_extra_cflags}" |
---|
| 416 | fi |
---|
| 417 | |
---|
| 418 | if test "${with_rsh+set}" = set; then |
---|
[a8f3d7] | 419 | AC_CHECK_PROG(with_rsh, ${with_rsh}, ${with_rsh}) |
---|
| 420 | if test "$ac_cv_prog_with_rsh" = $with_rsh; then |
---|
| 421 | ac_rsh_programs=${with_rsh} |
---|
| 422 | else |
---|
| 423 | ac_rsh_programs= |
---|
| 424 | fi |
---|
| 425 | fi |
---|
| 426 | |
---|
| 427 | |
---|
[ae6370] | 428 | |
---|
[a8f3d7] | 429 | AC_CHECK_PROG(mp_rsh, rsh, rsh, no) |
---|
| 430 | if test "$ac_cv_prog_mp_rsh" = rsh; then |
---|
| 431 | ac_rsh_programs="$ac_rsh_programs rsh" |
---|
| 432 | fi |
---|
| 433 | |
---|
| 434 | AC_CHECK_PROG(mp_remsh, remsh, remsh, no) |
---|
| 435 | if test "$ac_cv_prog_mp_remsh" = remsh; then |
---|
| 436 | ac_rsh_programs="$ac_rsh_programs remsh" |
---|
| 437 | fi |
---|
| 438 | |
---|
[85c8634] | 439 | AC_CHECK_PROG(mp_ssh, ssh, ssh, no) |
---|
| 440 | if test "$ac_cv_prog_mp_ssh" = ssh; then |
---|
| 441 | ac_rsh_programs="$ac_rsh_programs ssh" |
---|
| 442 | fi |
---|
| 443 | |
---|
[a8f3d7] | 444 | AC_MSG_CHECKING(which remote shell command to use) |
---|
| 445 | for mp_rsh in $ac_rsh_programs; do |
---|
[89eb77] | 446 | if $mp_rsh localhost -n uname \>\& /dev/null; then |
---|
[a8f3d7] | 447 | mp_rsh_found=$mp_rsh |
---|
| 448 | break; |
---|
| 449 | else |
---|
| 450 | mp_rsh_found=none |
---|
| 451 | fi |
---|
| 452 | done |
---|
| 453 | AC_MSG_RESULT($mp_rsh_found) |
---|
| 454 | if test "${mp_rsh_found}" = none; then |
---|
| 455 | AC_MSG_WARN("No working remote shell command found") |
---|
[ae6370] | 456 | else |
---|
[a8f3d7] | 457 | AC_DEFINE_UNQUOTED(MP_RSH_COMMAND, "$mp_rsh_found") |
---|
[ae6370] | 458 | fi |
---|
| 459 | |
---|
[0e5dde] | 460 | dnl Check for external memory managements |
---|
| 461 | AC_ARG_WITH(malloc, \ |
---|
[e5dafa] | 462 | [ --with-malloc=HEADER use external malloc routines declared in HEADER]) |
---|
[0e5dde] | 463 | |
---|
| 464 | if test "${with_malloc+set}" = set; then |
---|
| 465 | AC_CHECK_HEADER(${with_malloc},,with_malloc=) |
---|
| 466 | fi |
---|
| 467 | AC_MSG_CHECKING(where malloc rotuines come from) |
---|
| 468 | if test "${with_malloc+set}" = set; then |
---|
| 469 | AC_MSG_RESULT(${with_malloc}) |
---|
| 470 | AC_DEFINE(WITH_EXTERNAL_MALLOC) |
---|
| 471 | AC_DEFINE_UNQUOTED(EXTERNAL_MALLOC_H, "${with_malloc}") |
---|
| 472 | else |
---|
| 473 | AC_MSG_RESULT(stdlib.h) |
---|
| 474 | fi |
---|
| 475 | |
---|
| 476 | |
---|
[678cfd] | 477 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
| 478 | AC_C_BIGENDIAN |
---|
| 479 | AC_C_CONST |
---|
| 480 | AC_TYPE_SIZE_T |
---|
| 481 | AC_HEADER_TIME |
---|
| 482 | |
---|
| 483 | dnl miscellanous stuff |
---|
| 484 | dnl check for sizeof(long) |
---|
| 485 | AC_CHECK_SIZEOF(long, 4) |
---|
| 486 | if test "$ac_cv_sizeof_long" != 4; then |
---|
| 487 | AC_MSG_ERROR(Need sizeof long to equal 4) |
---|
| 488 | fi |
---|
| 489 | |
---|
[0485bd] | 490 | dnl add some defines for if pari is used |
---|
| 491 | |
---|
[678cfd] | 492 | CLEAN="rm -f *~ a.out core *.o .log" |
---|
| 493 | AC_SUBST(CLEAN) |
---|
| 494 | |
---|
| 495 | dnl if we use GCC, then we know CFLAGS best and do not let user overwrite it |
---|
[ae6370] | 496 | if test "${GCC}" = yes && test "$ac_cv_cflags_not_set" = yes; then |
---|
[678cfd] | 497 | if test "$with_debug" = yes; then |
---|
[ae6370] | 498 | CFLAGS="-g -Wall -Wno-unused ${with_extra_cflags}" |
---|
[678cfd] | 499 | else |
---|
[ae6370] | 500 | CFLAGS="-O3 -w -fomit-frame-pointer ${with_extra_cflags}" |
---|
[678cfd] | 501 | fi |
---|
| 502 | fi |
---|
| 503 | |
---|
| 504 | dnl check for args to pass to subconfigure |
---|
| 505 | if test "$prefix" = NONE; then |
---|
| 506 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
| 507 | fi |
---|
[7adb502] | 508 | |
---|
[678cfd] | 509 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
| 510 | |
---|
| 511 | AC_OUTPUT(Makefile MP/Makefile MPT/Makefile mpviewer/Makefile \ |
---|
| 512 | mp-pvm3/Makefile examples/Makefile, \ |
---|
| 513 | if test "$CONFIG_HEADERS"; then echo timestamp > MP/stamp-h; fi) |
---|