From 8816646796401df89afdd12daf749ca99400c949 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 1 Jul 2011 00:09:08 +0000 Subject: * config/open-axiom.m4 (OPENAXIOM_CHECK_GMP): New. (OPENAXIOM_CHECK_CORE_SUPPORT): Use it. --- ChangeLog | 5 ++ config/open-axiom.m4 | 9 ++++ config/openaxiom-c-macros.h.in | 6 +++ configure | 114 +++++++++++++++++++++++++++++++++-------- 4 files changed, 114 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e32ff16..8d8065e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-30 Gabriel Dos Reis + + * config/open-axiom.m4 (OPENAXIOM_CHECK_GMP): New. + (OPENAXIOM_CHECK_CORE_SUPPORT): Use it. + 2011-06-15 Gabriel Dos Reis * OpenAxiom-1.4.0 has been released. diff --git a/config/open-axiom.m4 b/config/open-axiom.m4 index f4ae8d05..feb30740 100644 --- a/config/open-axiom.m4 +++ b/config/open-axiom.m4 @@ -796,6 +796,7 @@ OPENAXIOM_CHECK_FILESYSTEM OPENAXIOM_CHECK_SIGNALS OPENAXIOM_CHECK_SOCKETS OPENAXIOM_CHECK_PROCESS +OPENAXIOM_CHECK_GMP ]) dnl ------------------------ @@ -1009,6 +1010,14 @@ AC_DEFINE_UNQUOTED([openaxiom_alignment],[$oa_alignment], AC_MSG_RESULT([$oa_alignment]) ]) +dnl ------------------------- +dnl -- OPENAXIOM_CHECK_GMP -- +dnl ------------------------- +AC_DEFUN([OPENAXIOM_CHECK_GMP],[ +AC_CHECK_HEADERS([gmp.h], [AC_CHECK_LIB([gmp],[__gmpz_init])]) +AM_CONDITIONAL([OA_HAS_GMP], [test -n $ac_cv_header_gmp_h]) +]) + dnl -------------------------- dnl -- OPENAXIOM_CHECK_MISC -- dnl -------------------------- diff --git a/config/openaxiom-c-macros.h.in b/config/openaxiom-c-macros.h.in index 1eb6df78..d2e0d23e 100644 --- a/config/openaxiom-c-macros.h.in +++ b/config/openaxiom-c-macros.h.in @@ -54,6 +54,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_GMP_H + /* Define to 1 if the system has the type `int16_t'. */ #undef HAVE_INT16_T @@ -75,6 +78,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `gmp' library (-lgmp). */ +#undef HAVE_LIBGMP + /* Define to 1 if you have the header file. */ #undef HAVE_LIBUTIL_H diff --git a/configure b/configure index f4689907..1be64aa6 100755 --- a/configure +++ b/configure @@ -770,6 +770,8 @@ X_CFLAGS XMKMF OA_BUILD_SMAN_FALSE OA_BUILD_SMAN_TRUE +OA_HAS_GMP_FALSE +OA_HAS_GMP_TRUE oa_c_runtime_extra oa_c_runtime MAKEINDEX @@ -4987,6 +4989,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + @@ -9078,13 +9082,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:9081: $ac_compile\"" >&5) + (eval echo "\"\$as_me:9085: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:9084: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:9088: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:9087: output\"" >&5) + (eval echo "\"\$as_me:9091: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -10287,7 +10291,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 10290 "configure"' > conftest.$ac_ext + echo '#line 10294 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12380,11 +12384,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12383: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12387: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12387: \$? = $ac_status" >&5 + echo "$as_me:12391: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12719,11 +12723,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12722: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12726: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12726: \$? = $ac_status" >&5 + echo "$as_me:12730: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12824,11 +12828,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12827: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12831: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12831: \$? = $ac_status" >&5 + echo "$as_me:12835: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12879,11 +12883,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12882: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12886: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12886: \$? = $ac_status" >&5 + echo "$as_me:12890: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15246,7 +15250,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15249 "configure" +#line 15253 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15342,7 +15346,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15345 "configure" +#line 15349 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17298,11 +17302,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17301: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17305: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17305: \$? = $ac_status" >&5 + echo "$as_me:17309: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17397,11 +17401,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17400: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17404: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17404: \$? = $ac_status" >&5 + echo "$as_me:17408: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17449,11 +17453,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17452: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17456: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17456: \$? = $ac_status" >&5 + echo "$as_me:17460: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19483,6 +19487,72 @@ _ACEOF +for ac_header in gmp.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" +if test "x$ac_cv_header_gmp_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GMP_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __gmpz_init in -lgmp" >&5 +$as_echo_n "checking for __gmpz_init in -lgmp... " >&6; } +if test "${ac_cv_lib_gmp___gmpz_init+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgmp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __gmpz_init (); +int +main () +{ +return __gmpz_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_gmp___gmpz_init=yes +else + ac_cv_lib_gmp___gmpz_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp___gmpz_init" >&5 +$as_echo "$ac_cv_lib_gmp___gmpz_init" >&6; } +if test "x$ac_cv_lib_gmp___gmpz_init" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGMP 1 +_ACEOF + + LIBS="-lgmp $LIBS" + +fi + +fi + +done + + if test -n $ac_cv_header_gmp_h; then + OA_HAS_GMP_TRUE= + OA_HAS_GMP_FALSE='#' +else + OA_HAS_GMP_TRUE='#' + OA_HAS_GMP_FALSE= +fi + + + # Honor support for large files # Check whether --enable-largefile was given. @@ -21138,6 +21208,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${OA_HAS_GMP_TRUE}" && test -z "${OA_HAS_GMP_FALSE}"; then + as_fn_error "conditional \"OA_HAS_GMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${OA_BUILD_SMAN_TRUE}" && test -z "${OA_BUILD_SMAN_FALSE}"; then as_fn_error "conditional \"OA_BUILD_SMAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 -- cgit v1.2.3