summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSteve Lhomme <robux4@ycbcr.xyz>2020-04-02 15:33:40 +0200
committerSteve Lhomme <robux4@ycbcr.xyz>2020-06-19 13:01:16 +0200
commit1fd0c0152bda69de7470850a0fa14b1571b241e2 (patch)
treee78bd876632b284aba4b73c5ff51286f15a3dfb3 /configure.ac
parentc400064a1c63d122340d09d8ce3f671d4cf24b6e (diff)
downloadlibarchive-1fd0c0152bda69de7470850a0fa14b1571b241e2.tar.gz
don't force windows versions if they are set in the environment
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 17 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 41ba5a49..fbb7b3c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,9 +245,23 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
# Set up defines needed before including any headers
case $host in
*mingw* | *cygwin* | *msys* )
- AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
- AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
- AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+ [[#ifdef _WIN32_WINNT
+ # error _WIN32_WINNT already defined
+ #endif
+ ]],[[;]])
+ ],[
+ AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
+ AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
+ ])
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+ [[#ifdef WINVER
+ # error WINVER already defined
+ #endif
+ ]],[[;]])
+ ],[
+ AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
+ ])
;;
esac