aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m470
-rw-r--r--ares/acinclude.m435
-rw-r--r--ares/configure.ac34
-rw-r--r--configure.ac23
4 files changed, 109 insertions, 53 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 7c98371a7..a9ace2041 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -59,6 +59,41 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
])
+dnl CURL_CHECK_NATIVE_WINDOWS
+dnl -------------------------------------------------
+dnl Check if building a native Windows target
+
+AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
+ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
+ AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [
+ if test "$ac_cv_header_windows_h" = "no"; then
+ ac_cv_native_windows="no"
+ else
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+ ],[
+#ifdef __MINGW32__
+ int dummy=1;
+#else
+ Not a native Windows build target.
+#endif
+ ])
+ ],[
+ ac_cv_native_windows="yes"
+ ],[
+ ac_cv_native_windows="no"
+ ])
+ fi
+ ])
+ case "$ac_cv_native_windows" in
+ yes)
+ AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
+ [Define to 1 if you are building a native Windows target.])
+ ;;
+ esac
+])
+
+
dnl CURL_CHECK_HEADER_WINSOCK
dnl -------------------------------------------------
dnl Check for compilable and valid winsock.h header
@@ -2575,41 +2610,6 @@ AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [
])
-dnl CURL_CHECK_NATIVE_WINDOWS
-dnl -------------------------------------------------
-dnl Check if building a native Windows target
-
-AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
- AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
- AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [
- if test "$ac_cv_header_windows_h" = "no"; then
- ac_cv_native_windows="no"
- else
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
- ],[
-#ifdef __MINGW32__
- int dummy=1;
-#else
- Not a native Windows build target.
-#endif
- ])
- ],[
- ac_cv_native_windows="yes"
- ],[
- ac_cv_native_windows="no"
- ])
- fi
- ])
- case "$ac_cv_native_windows" in
- yes)
- AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
- [Define to 1 if you are building a native Windows target.])
- ;;
- esac
-])
-
-
dnl CURL_CHECK_CA_BUNDLE
dnl -------------------------------------------------
dnl Check if a default ca-bundle should be used
diff --git a/ares/acinclude.m4 b/ares/acinclude.m4
index 566595031..0ee7adf41 100644
--- a/ares/acinclude.m4
+++ b/ares/acinclude.m4
@@ -37,6 +37,41 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
])
+dnl CURL_CHECK_NATIVE_WINDOWS
+dnl -------------------------------------------------
+dnl Check if building a native Windows target
+
+AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
+ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
+ AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [
+ if test "$ac_cv_header_windows_h" = "no"; then
+ ac_cv_native_windows="no"
+ else
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+ ],[
+#ifdef __MINGW32__
+ int dummy=1;
+#else
+ Not a native Windows build target.
+#endif
+ ])
+ ],[
+ ac_cv_native_windows="yes"
+ ],[
+ ac_cv_native_windows="no"
+ ])
+ fi
+ ])
+ case "$ac_cv_native_windows" in
+ yes)
+ AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
+ [Define to 1 if you are building a native Windows target.])
+ ;;
+ esac
+])
+
+
dnl CURL_CHECK_HEADER_WINSOCK
dnl -------------------------------------------------
dnl Check for compilable and valid winsock.h header
diff --git a/ares/configure.ac b/ares/configure.ac
index da728edac..d1755bb14 100644
--- a/ares/configure.ac
+++ b/ares/configure.ac
@@ -124,6 +124,28 @@ dnl **********************************************************************
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
dnl **********************************************************************
+dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
+dnl and ws2tcpip.h take precedence over any other further checks which
+dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
+dnl this specific header files. And do them before its results are used.
+dnl **********************************************************************
+
+CURL_CHECK_HEADER_WINDOWS
+CURL_CHECK_NATIVE_WINDOWS
+case X-"$ac_cv_native_windows" in
+ X-yes)
+ CURL_CHECK_HEADER_WINSOCK
+ CURL_CHECK_HEADER_WINSOCK2
+ CURL_CHECK_HEADER_WS2TCPIP
+ ;;
+ *)
+ ac_cv_header_winsock_h="no"
+ ac_cv_header_winsock2_h="no"
+ ac_cv_header_ws2tcpip_h="no"
+ ;;
+esac
+
+dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags
dnl **********************************************************************
@@ -365,18 +387,6 @@ dnl **********************************************************************
dnl Checks for header files.
AC_HEADER_STDC
-dnl **********************************************************************
-dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
-dnl and ws2tcpip.h take precedence over any other further checks which
-dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
-dnl this specific header files. And do them before its results are used.
-dnl **********************************************************************
-
-CURL_CHECK_HEADER_WINDOWS
-CURL_CHECK_HEADER_WINSOCK
-CURL_CHECK_HEADER_WINSOCK2
-CURL_CHECK_HEADER_WS2TCPIP
-
CURL_CHECK_HEADER_MALLOC
dnl check for a few basic system headers we need
diff --git a/configure.ac b/configure.ac
index 3e54496c2..43eabd866 100644
--- a/configure.ac
+++ b/configure.ac
@@ -220,12 +220,23 @@ dnl this specific header files. And do them before its results are used.
dnl **********************************************************************
CURL_CHECK_HEADER_WINDOWS
-CURL_CHECK_HEADER_WINSOCK
-CURL_CHECK_HEADER_WINSOCK2
-CURL_CHECK_HEADER_WS2TCPIP
-
-CURL_CHECK_HEADER_WINLDAP
-CURL_CHECK_HEADER_WINBER
+CURL_CHECK_NATIVE_WINDOWS
+case X-"$ac_cv_native_windows" in
+ X-yes)
+ CURL_CHECK_HEADER_WINSOCK
+ CURL_CHECK_HEADER_WINSOCK2
+ CURL_CHECK_HEADER_WS2TCPIP
+ CURL_CHECK_HEADER_WINLDAP
+ CURL_CHECK_HEADER_WINBER
+ ;;
+ *)
+ ac_cv_header_winsock_h="no"
+ ac_cv_header_winsock2_h="no"
+ ac_cv_header_ws2tcpip_h="no"
+ ac_cv_header_winldap_h="no"
+ ac_cv_header_winber_h="no"
+ ;;
+esac
dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags