--enable-sspi only supported on Windows native builds
authorYang Tse <yangsita@gmail.com>
Tue, 10 Apr 2007 18:53:21 +0000 (18:53 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 10 Apr 2007 18:53:21 +0000 (18:53 +0000)
acinclude.m4
configure.ac

index 1f98acd..bf0c4b4 100644 (file)
@@ -2018,3 +2018,39 @@ AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [
       ;;
   esac
 ])
+
+
+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
+])
+
index 00d0553..7d6e3fc 100644 (file)
@@ -2124,19 +2124,26 @@ AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
        AC_MSG_RESULT(yes)
 )
 
+CURL_CHECK_NATIVE_WINDOWS
+
 dnl ************************************************************
 dnl enable SSPI support
 dnl
-AC_MSG_CHECKING([whether to enable SSPI support (win32 builds only)])
+AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
 AC_ARG_ENABLE(sspi,
 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
 [ case "$enableval" in
   yes)
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
-       AC_SUBST(USE_WINDOWS_SSPI)
-       curl_sspi_msg="yes"
+       if test "$ac_cv_native_windows" = "yes"; then
+         AC_MSG_RESULT(yes)
+         AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
+         AC_SUBST(USE_WINDOWS_SSPI)
+         curl_sspi_msg="yes"
+       else
+         AC_MSG_RESULT(no)
+         AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
+       fi
        ;;
   *)
        AC_MSG_RESULT(no)