diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-04-24 17:36:42 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-04-24 17:36:42 +0000 |
commit | a1d6e94c681d4015e2c42ea7bfc12e0725478437 (patch) | |
tree | 42c54ba6b8b7300713b760d593afd18053180172 /lib | |
parent | b3e37e4180365035d351528c59da3cfef0842885 (diff) |
Added configure check for finite(3).
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2135 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r-- | lib/make/cctk_Config.h.in | 1 | ||||
-rwxr-xr-x | lib/make/configure | 131 | ||||
-rw-r--r-- | lib/make/configure.in | 11 |
3 files changed, 131 insertions, 12 deletions
diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index b2336427..0a8e5dba 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -78,6 +78,7 @@ #undef HAVE_GETHOSTBYNAME #undef HAVE_GETOPT_LONG_ONLY #undef HAVE_CRYPT +#undef HAVE_FINITE /* Do we have mode_t ? */ diff --git a/lib/make/configure b/lib/make/configure index 3e35c316..297cc5c2 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -3816,11 +3816,124 @@ fi +ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5' +for ac_func in finite +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3824: 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 <<EOF +#line 3829 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* 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:3852: \"$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 <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for finite in library m""... $ac_c" 1>&6 +echo "configure:3874: checking for finite in library m" >&5 +ac_lib_var=`echo m'_'finite | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5' +ac_save_LIBS="$LIBS" +LIBS="m $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3883 "configure" +#include "confdefs.h" +/* 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 finite(); + +int main() { +finite() +; return 0; } +EOF +if { (eval echo configure:3894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cctk_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cctk_tr_func=HAVE_`echo finite | sed -e 's/^a-zA-Z0-9_/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $cctk_tr_lib 1 +EOF + + cat >> confdefs.h <<EOF +#define $cctk_tr_func 1 +EOF + + LIBS="m $LIBS" + +else + echo "$ac_t""no" 1>&6 +fi + +fi +done + + + + if test "X$PTHREADS" = "Xyes"; then PTHREAD_LIBS= echo $ac_n "checking for main in library c_r""... $ac_c" 1>&6 -echo "configure:3824: checking for main in library c_r" >&5 +echo "configure:3937: checking for main in library c_r" >&5 ac_lib_var=`echo c_r'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3829,14 +3942,14 @@ else ac_save_LIBS="$LIBS" LIBS="c_r $LIBS" cat > conftest.$ac_ext <<EOF -#line 3833 "configure" +#line 3946 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3857,7 +3970,7 @@ else fi echo $ac_n "checking for main in library pthread""... $ac_c" 1>&6 -echo "configure:3861: checking for main in library pthread" >&5 +echo "configure:3974: checking for main in library pthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3866,14 +3979,14 @@ else ac_save_LIBS="$LIBS" LIBS="pthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 3870 "configure" +#line 3983 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3892,7 +4005,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in library pthreads""... $ac_c" 1>&6 -echo "configure:3896: checking for main in library pthreads" >&5 +echo "configure:4009: checking for main in library pthreads" >&5 ac_lib_var=`echo pthreads'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3901,14 +4014,14 @@ else ac_save_LIBS="$LIBS" LIBS="pthreads $LIBS" cat > conftest.$ac_ext <<EOF -#line 3905 "configure" +#line 4018 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/lib/make/configure.in b/lib/make/configure.in index 5ebcfb60..f31b2bb8 100644 --- a/lib/make/configure.in +++ b/lib/make/configure.in @@ -486,7 +486,9 @@ AC_DEFINE(HAVE_BOOL)) AC_LANG_RESTORE fi -dnl Misc stuff +dnl ####################################################################### +dnl ############################ Misc stuff ############################### +dnl ####################################################################### dnl Do we need to build the GNU getopt and regex stuff ? @@ -510,8 +512,11 @@ fi dnl Do we have crypt(3) -CCTK_CHECK_FUNC(crypt, , -CCTK_CHECK_LIB_FUNC(crypt, crypt)) +CCTK_CHECK_FUNC(crypt, , CCTK_CHECK_LIB_FUNC(crypt, crypt)) + +dnl Do we have finite(3) + +CCTK_CHECK_FUNCS(finite, , CCTK_CHECK_LIB_FUNC(m, finite)) dnl Checks for availability of pthreads library. |