From 9b63d7d5131d02369af498f7930183138535fa80 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Jun 2012 15:01:59 -0500 Subject: [svn-r22471] Add check for MINGW - ws2_32 library Tested: windows - mingw --- config/cmake/H5pubconf.h.in | 3 +++ configure | 65 ++++++++++++++++++++++++++++++++++++++++++++- configure.in | 4 +++ src/H5config.h.in | 3 +++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 0c6cc0b..6fca1ae 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -260,6 +260,9 @@ /* Define to 1 if you have the `sz' library (-lsz). */ #cmakedefine H5_HAVE_LIBSZ @H5_HAVE_LIBSZ@ +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#cmakedefine H5_HAVE_LIBWS2_32 @H5_HAVE_LIBWS2_32@ + /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ diff --git a/configure b/configure index 515a9e4..f1fa27f 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22430 2012-06-04 17:05:02Z byrn . +# From configure.in Id: configure.in 22448 2012-06-10 13:53:06Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.122. # @@ -22271,6 +22271,69 @@ fi done ;; + MINGW*) + for ac_header in io.h winsock2.h sys/timeb.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 +$as_echo_n "checking for main in -lws2_32... " >&6; } +if ${ac_cv_lib_ws2_32_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ws2_32_main=yes +else + ac_cv_lib_ws2_32_main=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_ws2_32_main" >&5 +$as_echo "$ac_cv_lib_ws2_32_main" >&6; } +if test "x$ac_cv_lib_ws2_32_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBWS2_32 1 +_ACEOF + + LIBS="-lws2_32 $LIBS" + +fi +ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main + + ;; *) for ac_header in io.h winsock2.h sys/timeb.h do : diff --git a/configure.in b/configure.in index 3dc354b..6f8a3e9 100644 --- a/configure.in +++ b/configure.in @@ -1286,6 +1286,10 @@ case "`uname`" in CYGWIN*) AC_CHECK_HEADERS([io.h sys/timeb.h]) ;; + MINGW*) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) + AC_HAVE_LIBRARY([ws2_32]) + ;; *) AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; diff --git a/src/H5config.h.in b/src/H5config.h.in index 6176b33..a2b75df 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -217,6 +217,9 @@ /* Define to 1 if you have the `sz' library (-lsz). */ #undef HAVE_LIBSZ +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#undef HAVE_LIBWS2_32 + /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ -- cgit v0.12