]> granicus.if.org Git - curl/commitdiff
Added check and symbol definition for WIN32 file API usage in configure,
authorYang Tse <yangsita@gmail.com>
Tue, 26 Aug 2008 12:54:12 +0000 (12:54 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 26 Aug 2008 12:54:12 +0000 (12:54 +0000)
supporting configure's --disable-largefile option for WIN32 targets also.
Non-configure systems which do not use config-win32.h configuration file,
and want to use the WIN32 file API, must define USE_WIN32_LARGE_FILES or
USE_WIN32_SMALL_FILES as appropriate in their own configuration files.

CHANGES
acinclude.m4
configure.ac

diff --git a/CHANGES b/CHANGES
index c70a5eec3abe85370a4d48ca018c7cefc8a04d00..fdc2a33077ec843cab5aa8acca64d8ae2e398627 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,14 @@
 
                                   Changelog
 
+Yang Tse (26 Aug 2008)
+- Added check and symbol definition for WIN32 file API usage in configure,
+  supporting configure's --disable-largefile option for WIN32 targets also.
+
+- Non-configure systems which do not use config-win32.h configuration file,
+  and want to use the WIN32 file API, must define USE_WIN32_LARGE_FILES or
+  USE_WIN32_SMALL_FILES as appropriate in their own configuration files.
+
 Daniel Stenberg (23 Aug 2008)
 - Running 'make ca-firefox' in the root build dir will now run the new
   firefox-db2pem.sh conversion script that converts a local Firefox db of ca
index 1e1c99b78d811d345617897860bd217181878c08..71c3ca5794e577d6a135e8398b5a07f4f661ce03 100644 (file)
@@ -3895,3 +3895,60 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
   #
 ])
 
+
+dnl CURL_CHECK_WIN32_LARGEFILE
+dnl -------------------------------------------------
+dnl Check if curl's WIN32 large file will be used
+
+AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
+  AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
+  AC_MSG_CHECKING([whether build target supports WIN32 file API])
+  curl_win32_file_api="no"
+  if test "$ac_cv_header_windows_h" = "yes"; then
+    if test x"$enable_largefile" != "xno"; then
+      AC_COMPILE_IFELSE([
+        AC_LANG_PROGRAM([[
+        ]],[[
+#if !defined(_WIN32_WCE) && \
+    (defined(__MINGW32__) || \
+    (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))))
+          int dummy=1;
+#else
+          WIN32 large file API not supported.
+#endif
+        ]])
+      ],[
+        curl_win32_file_api="win32_large_files"
+      ])
+    fi
+    if test "$curl_win32_file_api" = "no"; then
+      AC_COMPILE_IFELSE([
+        AC_LANG_PROGRAM([[
+        ]],[[
+#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER)
+          int dummy=1;
+#else
+          WIN32 small file API not supported.
+#endif
+        ]])
+      ],[
+        curl_win32_file_api="win32_small_files"
+      ])
+    fi
+  fi
+  case "$curl_win32_file_api" in
+    win32_large_files)
+      AC_MSG_RESULT([yes (large file enabled)])
+      AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
+        [Define to 1 if you are building a Windows target with large file support.])
+      ;;
+    win32_small_files)
+      AC_MSG_RESULT([yes (large file disabled)])
+      AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
+        [Define to 1 if you are building a Windows target without large file support.])
+      ;;
+    *)
+      AC_MSG_RESULT([no])
+      ;;
+  esac
+])
\ No newline at end of file
index c9e4f338832dcf06de59ee01a95be070e3cc4e7e..6d7dd0e35d1c281a2ba110196a86979bf8bcdb56 100644 (file)
@@ -348,6 +348,7 @@ case X-"$ac_cv_native_windows" in
     ac_cv_header_winber_h="no"
     ;;
 esac
+CURL_CHECK_WIN32_LARGEFILE
 
 dnl ************************************************************
 dnl switch off particular protocols