From b74166b24be492a0a1a39297008f1ac5f67ee6f6 Mon Sep 17 00:00:00 2001 From: goodale Date: Thu, 14 Sep 2000 21:28:20 +0000 Subject: Checking for additional headers for socket stuff. Now defines HAVE_SOCKLEN_T if socklen_t exists. Have modified so CCTK_SOCKLEN_T gets set depending on the value of the HAVE_SOCKLEN_T, but, if this new config stuff works, would like to lose the CCTK_SOCKLEN_T stuff. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1816 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/configure | 347 ++++++++++++++++++----------------------------------- 1 file changed, 114 insertions(+), 233 deletions(-) (limited to 'lib/make/configure') diff --git a/lib/make/configure b/lib/make/configure index d07892a1..98d71e2d 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -2996,330 +2996,211 @@ else echo "$ac_t""no" 1>&6 fi - -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3002: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then +for cctk_hdr in sys/types.h +do +cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 +echo "configure:3004: checking for $cctk_hdr" >&5 +if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -#include -#include +#include <$cctk_hdr> int main() { -struct tm *tp; +return 0; ; return 0; } EOF if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_header_time=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_time" 1>&6 -if test $ac_cv_header_time = yes; then - cat >> confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF - -fi - - -#Check type of socklen - - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - -my_LIBS="$LIBS" -echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:3050: checking for main in -lsocket" >&5 -ac_lib_var=`echo socket'_'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 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "cctk_cv_header_$cctk_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "cctk_cv_header_$cctk_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi +done -echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:3093: checking for main in -lnsl" >&5 -ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +for cctk_hdr in sys/socket.h +do +cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 +echo "configure:3043: checking for $cctk_hdr" >&5 +if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < int main() { -main() +return 0; ; return 0; } EOF -if { (eval echo configure:3108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "cctk_cv_header_$cctk_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "cctk_cv_header_$cctk_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi +done - -socket_argtype= -cat > socketHdrs.h << EOF -EOF -ac_safe=`echo "unistd.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for unistd.h""... $ac_c" 1>&6 -echo "configure:3141: checking for unistd.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +for cctk_hdr in winsock2.h +do +cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 +echo "configure:3082: checking for $cctk_hdr" >&5 +if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include <$cctk_hdr> +int main() { +return 0; +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3151: \"$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 +if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "cctk_cv_header_$cctk_safe=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "cctk_cv_header_$cctk_safe=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo "#include " >> socketHdrs.h + cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 fi +done -ac_safe=`echo "sys/types.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for sys/types.h""... $ac_c" 1>&6 -echo "configure:3174: checking for sys/types.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:3119: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3184: \"$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 +if { (eval echo configure:3133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + ac_cv_header_time=yes else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cv_header_time=no fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo "#include " >> socketHdrs.h -else - echo "$ac_t""no" 1>&6 -fi -ac_safe=`echo "sys/socket.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for sys/socket.h""... $ac_c" 1>&6 -echo "configure:3207: checking for sys/socket.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 < +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3217: \"$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* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo "#include " >> socketHdrs.h -else - echo "$ac_t""no" 1>&6 + fi -if test "$ARCH" = "intelnt" ; then - ac_safe=`echo "winsock2.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for winsock2.h""... $ac_c" 1>&6 -echo "configure:3241: checking for winsock2.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + +#Check type of socklen + +# Check if we have socklen_t available +echo $ac_n "checking if socklen_t is defined""... $ac_c" 1>&6 +echo "configure:3158: checking if socklen_t is defined" >&5 +if eval "test \"`echo '$''{'cctk_cv_have_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WINSOCK2_H #include +#endif +int main() { +socklen_t foo; return 0 +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3251: \"$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 +if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "cctk_cv_have_socklen_t=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "cctk_cv_have_socklen_t=no" fi rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo "#include " >> socketHdrs.h -else - echo "$ac_t""no" 1>&6 -fi fi -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - - -try="socklen_t" -cat > conftest.$ac_ext < -#include "socketHdrs.h" - -int main() { - -$try *foo = NULL; -int i = getsockname(1, (struct sockaddr *)NULL, foo); - -; return 0; } +if test "$cctk_cv_have_socklen_t" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_SOCKLEN_T 1 EOF -if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - + + echo "$ac_t""yes" 1>&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -try="int" - + echo "$ac_t""no" 1>&6 fi -rm -f conftest* - -cat >> confdefs.h <&6 -echo "configure:3341: checking for $cctk_hdr" >&5 +echo "configure:3222: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; ; return 0; } EOF -if { (eval echo configure:3353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3389,14 +3270,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_BOOL 1 @@ -3421,12 +3302,12 @@ fi for ac_func in getopt_long_only do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3425: checking for $ac_func" >&5 +echo "configure:3306: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3334: \"$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 -- cgit v1.2.3