aboutsummaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-26 12:54:12 +0000
committerYang Tse <yangsita@gmail.com>2008-08-26 12:54:12 +0000
commitfef60d9d4155c75809b278968cff345cc47be512 (patch)
treeb4e0c7e4f1824de655558b160d14994b714b26da /acinclude.m4
parent2fdd24c724eaeddd8a3b299b86b4d4053ced01c8 (diff)
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.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m457
1 files changed, 57 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 1e1c99b78..71c3ca579 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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