From a28518a6a645710b5c8a78e3d98da4bac828d63e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 11 May 2000 18:41:32 +0000 Subject: Add check for rint() in math library. --- config.h.in | 3 ++ configure | 102 +++++++++++++++++++++++++++++++++++++++++++++++------------ configure.in | 6 ++++ 3 files changed, 90 insertions(+), 21 deletions(-) diff --git a/config.h.in b/config.h.in index ce254b8..bbe3490 100644 --- a/config.h.in +++ b/config.h.in @@ -381,6 +381,9 @@ /* Define if you have the readlink function. */ #undef HAVE_READLINK +/* Define if you have the rint function. */ +#undef HAVE_RINT + /* Define if you have the select function. */ #undef HAVE_SELECT diff --git a/configure b/configure index 581c8a4..b59e5cc 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.120 +# From configure.in Revision: 1.121 # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 @@ -5003,9 +5003,69 @@ done LIBS=$LIBS_SAVE +# check for rint() in math library +LIBS_SAVE=$LIBS +LIBS="$LIBS $LIBM" +for ac_func in rint +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5013: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +LIBS=$LIBS_SAVE + # check for getopt echo $ac_n "checking for genuine getopt""... $ac_c" 1>&6 -echo "configure:5009: checking for genuine getopt" >&5 +echo "configure:5069: checking for genuine getopt" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5013,7 +5073,7 @@ else ac_cv_func_getopt=no else cat > conftest.$ac_ext < extern int optind, opterr, getopt(); @@ -5025,7 +5085,7 @@ int main() { exit(0); } EOF -if { (eval echo configure:5029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_getopt=yes else @@ -5043,7 +5103,7 @@ test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o" # check whether malloc(0) returns NULL or not echo $ac_n "checking what malloc(0) returns""... $ac_c" 1>&6 -echo "configure:5047: checking what malloc(0) returns" >&5 +echo "configure:5107: checking what malloc(0) returns" >&5 if eval "test \"`echo '$''{'ac_cv_malloc_zero'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5051,7 +5111,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #ifdef HAVE_STDLIB @@ -5070,7 +5130,7 @@ main() { exit(0); } EOF -if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_malloc_zero=nonnull else @@ -5096,17 +5156,17 @@ fi # check for wchar.h ac_safe=`echo "wchar.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wchar.h""... $ac_c" 1>&6 -echo "configure:5100: checking for wchar.h" >&5 +echo "configure:5160: checking for wchar.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5136,12 +5196,12 @@ fi # check for usable wchar_t usable_wchar_t="unkown" echo $ac_n "checking for usable wchar_t""... $ac_c" 1>&6 -echo "configure:5140: checking for usable wchar_t" >&5 +echo "configure:5200: checking for usable wchar_t" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define HAVE_USABLE_WCHAR_T 1 @@ -5174,14 +5234,14 @@ echo "$ac_t""$usable_wchar_t" 1>&6 # check for endianness echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:5178: checking whether byte ordering is bigendian" >&5 +echo "configure:5238: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -5192,11 +5252,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:5196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -5207,7 +5267,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:5211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -5227,7 +5287,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -5266,7 +5326,7 @@ fi # Check for --with-wctype-functions echo $ac_n "checking for --with-wctype-functions""... $ac_c" 1>&6 -echo "configure:5270: checking for --with-wctype-functions" >&5 +echo "configure:5330: checking for --with-wctype-functions" >&5 # Check whether --with-wctype-functions or --without-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then withval="$with_wctype_functions" diff --git a/configure.in b/configure.in index 6a846a2..99d3eec 100644 --- a/configure.in +++ b/configure.in @@ -996,6 +996,12 @@ AC_CHECK_FUNCS(hypot) AC_REPLACE_FUNCS(hypot) LIBS=$LIBS_SAVE +# check for rint() in math library +LIBS_SAVE=$LIBS +LIBS="$LIBS $LIBM" +AC_CHECK_FUNCS(rint) +LIBS=$LIBS_SAVE + # check for getopt AC_MSG_CHECKING(for genuine getopt) AC_CACHE_VAL(ac_cv_func_getopt, -- cgit v0.12