diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/configure.in b/configure.in index c547b9d93..4aa793f8b 100644 --- a/configure.in +++ b/configure.in @@ -60,7 +60,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #endif ]], [[]])],[AC_MSG_RESULT(yes) GCC= - CFLAGS="-pc64 -fp_port -mp $CFLAGS" + CFLAGS="-pc64 -fp_port -mp -wd1572 -wd265 -wd186 -wd239 $CFLAGS" ],[AC_MSG_RESULT(no)]) dnl If compiler is gcc, then use some specific flags. @@ -155,7 +155,32 @@ if test -f confdefs.h; then mv confdefs.tmp confdefs.h fi -AC_MY_LIBS($with_gmp_lib, gmp) +dnl AC_CHECK_LIB doesn't do what we want +AC_MSG_CHECKING(for GMP library) +if test -r "$with_gmp_lib/libgmp.a"; then + LIBS="$with_gmp_lib/libgmp.a $LIBS" +elif test -r "$with_gmp_lib/libgmp.so"; then + LIBS="$with_gmp_lib/libgmp.so $LIBS" +elif test -r "$with_gmp_lib/libgmp.lib"; then + LIBS="$with_gmp_lib/libgmp.lib $LIBS" +else + if test -d "$with_gmp_lib"; then + LDFLAGS="-L$with_gmp_lib $LDFLAGS" + fi + LIBS="-lgmp $LIBS" +fi +dnl FIXME: If AC_RUN_IFELSE failed try with AC_LINK_IFELSE? +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include "gmp.h" +int main() { return !gmp_version; } + ]])], [ + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + AC_MSG_ERROR(libgmp not found) + ], [ + AC_MSG_RESULT([can't test]) + ]) dnl Check for corresponding 'gmp.h' and libgmp.a AC_MSG_CHECKING(if gmp.h version and libgmp version are the same) @@ -168,14 +193,15 @@ int main() char buffer[100]; if (__GNU_MP_VERSION_PATCHLEVEL != 0) sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, - __GNU_MP_VERSION_PATCHLEVEL); + __GNU_MP_VERSION_PATCHLEVEL); else sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR); + printf ("(%s/%s) ", buffer, gmp_version); return (strcmp (buffer, gmp_version) != 0) ? 1 : 0; } -], AC_MSG_RESULT(yes), +], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) - AC_MSG_ERROR(['gmp.h' and 'libgmp' have different versions! you have to properly reinstall GMP.])], + AC_MSG_ERROR(['gmp.h' and 'libgmp' have different versions, or (on some platforms) libgmp couldn't be found! You have to properly reinstall GMP.])], AC_MSG_RESULT([can't test]) ) |