diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-10-31 21:30:01 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-10-31 21:30:01 +0000 |
commit | b4b55511a10277ccc1dae4ae94fdbebd16e4528c (patch) | |
tree | 808df9133cc54c2c57a41bd2927adf624adbc23a /lib | |
parent | f7c3c19b8b32a48bf5c7c0e1235f9fb4ab04446c (diff) |
Checking if SOCKET is defined in the network stuff.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1873 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r-- | lib/make/cctk_Config.h.in | 4 | ||||
-rwxr-xr-x | lib/make/configure | 78 | ||||
-rw-r--r-- | lib/make/configure.in | 27 |
3 files changed, 95 insertions, 14 deletions
diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index 9443ad6e..b9606505 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -88,6 +88,10 @@ #undef HAVE_SOCKLEN_T +/* Do we have SOCKET ? */ + +#undef HAVE_SOCKET_TYPE + /* Some include things */ #undef HAVE_TIME_H #undef HAVE_SYS_TIME_H diff --git a/lib/make/configure b/lib/make/configure index 8589dd31..d5cf26e4 100755 --- a/lib/make/configure +++ b/lib/make/configure @@ -3366,16 +3366,66 @@ else echo "$ac_t""no" 1>&6 fi +# Check if someone has defined SOCKET +echo $ac_n "checking if SOCKET is defined""... $ac_c" 1>&6 +echo "configure:3372: checking if SOCKET is defined" >&5 +if eval "test \"`echo '$''{'cctk_cv_have_SOCKET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3377 "configure" +#include "confdefs.h" +#include <stdio.h> +#include <stdlib.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +int main() { +SOCKET foo; return 0 +; return 0; } +EOF +if { (eval echo configure:3397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "cctk_cv_have_SOCKET=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "cctk_cv_have_SOCKET=no" +fi +rm -f conftest* + +fi + +if test "$cctk_cv_have_SOCKET" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_SOCKET_TYPE 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + # Do we have gethostbyname for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3374: checking for $ac_func" >&5 +echo "configure:3424: 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 3379 "configure" +#line 3429 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3398,7 +3448,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3452: \"$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 @@ -3438,12 +3488,12 @@ cross_compiling=$ac_cv_prog_cxx_cross do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:3442: checking for $cctk_hdr" >&5 +echo "configure:3492: 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 <<EOF -#line 3447 "configure" +#line 3497 "configure" #include "confdefs.h" #include <$cctk_hdr> @@ -3451,7 +3501,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3491,14 +3541,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <<EOF -#line 3495 "configure" +#line 3545 "configure" #include "confdefs.h" int main() { bool foo; ; return 0; } EOF -if { (eval echo configure:3502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_BOOL 1 @@ -3523,12 +3573,12 @@ fi for ac_func in getopt_long_only do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3527: checking for $ac_func" >&5 +echo "configure:3577: 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 3532 "configure" +#line 3582 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3551,7 +3601,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3605: \"$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 @@ -3596,12 +3646,12 @@ fi for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3600: checking for $ac_func" >&5 +echo "configure:3650: 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 3605 "configure" +#line 3655 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3624,7 +3674,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3678: \"$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 diff --git a/lib/make/configure.in b/lib/make/configure.in index 06af3ea2..0567997c 100644 --- a/lib/make/configure.in +++ b/lib/make/configure.in @@ -439,6 +439,33 @@ else AC_MSG_RESULT(no) fi +# Check if someone has defined SOCKET +AC_MSG_CHECKING([if SOCKET is defined]) +AC_CACHE_VAL(cctk_cv_have_SOCKET, +[AC_TRY_COMPILE([#include <stdio.h> +#include <stdlib.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif], +[SOCKET foo; return 0], eval "cctk_cv_have_SOCKET=yes", +eval "cctk_cv_have_SOCKET=no") +]) +if test "$cctk_cv_have_SOCKET" = "yes"; then + AC_DEFINE(HAVE_SOCKET_TYPE) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + # Do we have gethostbyname AC_CHECK_FUNCS(gethostbyname) |