dnl Process this file with autoconf to produce a configure script. AC_INIT() mpfr_version=`cat $srcdir/VERSION` AM_INIT_AUTOMAKE(mpfr, $mpfr_version, [no-define]) AC_ARG_WITH(gmp_include, [ --with-gmp-include=DIR GMP include directory ], with_gmp_include=$withval) AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=DIR GMP lib directory ], with_gmp_lib=$withval) AC_ARG_WITH(gmp, [ --with-gmp=DIR GMP directory ], with_gmp_include=$withval/include with_gmp_lib=$withval/lib) AC_ARG_WITH(irix64, [ --with-irix64=on/off Irix 32/64 bits support ], with_irix64=$withval, with_irix64=off) test_CFLAGS=${CFLAGS+set} dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB AC_CANONICAL_HOST AC_CHECK_OS AC_CHECK_MACHTYPE dnl If compiler is gcc, then use some specific flags. dnl But don't touch user specified flags. if test "$test_CFLAGS" != set && test -n "$GCC"; then CFLAGS="-Wall -Wmissing-prototypes $CFLAGS" fi MISCFLAGS='$<' dnl Set the OS-dependent flags. case $OS_TYPE in HP-UX*) AC_CHECK_LIB(M, main) AC_DEFINE(hpux) if test -n "$GCC"; then LDFLAGS="-Xlinker +allowunsats $LDFLAGS" fi ;; SunOS*) MISCFLAGS="trunc.c" AC_CHECK_LIB(m, main) ;; Linux*) AC_CHECK_LIB(m, main) ;; IRIX64) AC_CHECK_LIB(m, main) if [[ "$irix64" = "on" ]]; then CFLAGS ="-mabi=64 $CFLAGS" else CFLAGS ="-mabi=n32 $CFLAGS" fi ;; OSF*) AC_CHECK_LIB(m, main) AC_DEFINE(__STDC__) ;; *) AC_CHECK_LIB(m, main) ;; esac dnl Tests concerning the include directories. AC_MSG_CHECKING(for gmp files) if test -d "$with_gmp_include"; then CPPFLAGS="$CPPFLAGS -I$with_gmp_include" else with_gmp_include= fi AC_TRY_COMPILE([ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" ], , AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_ERROR([gmp.h or gmp-impl.h or config.h or gmp-mparam.h or longlong.h may be missing ${with_gmp_include:+in $with_gmp_include}])] ) dnl Check for valid BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB AC_MSG_CHECKING(for valid BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB) AC_TRY_RUN([ #include #include "gmp.h" #include "gmp-impl.h" int main() { return BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1; } ], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_ERROR([BITS_PER_MP_LIMB and/or BYTES_PER_MP_LIMB are incorrect. You probably need to change some of the GMP or MPFR compile options: MPFR doesn't currently do as many architecture checks as GMP, so the default target architecture may be different, hence the error.])], AC_MSG_RESULT([can't test]) ) MPFR_CONFIGS # Recent autoconf creates AC_DEFINEs of PACKAGE_VERSION etc, unfortunately # those -D defines in $DEFS conflict with the same defines in config.h from # GMP. Unless or until autoconf gives us a better way for two closely # related packages to cooperate, use this hack to get rid of them from $DEFS # here. # if test -f confdefs.h; then sed '/#define PACKAGE_/d' confdefs.tmp mv confdefs.tmp confdefs.h fi AC_MY_LIBS($with_gmp_lib, gmp) AC_SUBST(INCLUDES) AC_SUBST(LDADD) AC_SUBST(LDFLAGS) AC_SUBST(CFLAGS) AC_SUBST(MISCFLAGS) AC_OUTPUT(Makefile tests/Makefile) dnl NEWS README AUTHORS Changelog