aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-07-15 20:02:21 -0400
committerJack Lloyd <[email protected]>2019-07-15 20:02:21 -0400
commit9df40cce5756f8109ca5659c4c92459fd35d3380 (patch)
tree319ff2e77f37edc9c392e65fc50fc5b0b4a2a870
parent99b55d8e5992a541a01d396cad4b5a168d607631 (diff)
parente6ba703a429e56a1d6c80c4a28c8251aadca3df4 (diff)
Merge GH #2036 Set _WIN32_WINNT for Windows Server 2008
-rwxr-xr-xconfigure.py12
-rw-r--r--src/build-data/cc/clang.txt1
-rw-r--r--src/build-data/cc/gcc.txt3
-rw-r--r--src/build-data/makefile.in2
-rw-r--r--src/build-data/os/mingw.txt5
-rw-r--r--src/build-data/os/netbsd.txt4
-rw-r--r--src/build-data/os/qnx.txt4
-rw-r--r--src/build-data/os/windows.txt4
8 files changed, 28 insertions, 7 deletions
diff --git a/configure.py b/configure.py
index 7cc6afab1..858138e0f 100755
--- a/configure.py
+++ b/configure.py
@@ -712,7 +712,7 @@ def lex_me_harder(infofile, allowed_groups, allowed_maps, name_val_pairs):
return group.replace(':', '_')
lexer = shlex.shlex(open(infofile), infofile, posix=True)
- lexer.wordchars += ':.<>/,-!?+*' # handle various funky chars in info.txt
+ lexer.wordchars += '=:.<>/,-!?+*' # handle various funky chars in info.txt
groups = allowed_groups + allowed_maps
for group in groups:
@@ -1406,7 +1406,7 @@ class OsInfo(InfoObject): # pylint: disable=too-many-instance-attributes
super(OsInfo, self).__init__(infofile)
lex = lex_me_harder(
infofile,
- ['aliases', 'target_features'],
+ ['aliases', 'target_features', 'feature_macros'],
[],
{
'program_suffix': '',
@@ -1482,6 +1482,7 @@ class OsInfo(InfoObject): # pylint: disable=too-many-instance-attributes
self.shared_lib_uses_symlinks = (lex.shared_lib_symlinks == 'yes')
self.default_compiler = lex.default_compiler
self.uses_pkg_config = (lex.uses_pkg_config == 'yes')
+ self.feature_macros = lex.feature_macros
def matches_name(self, nm):
if nm in self._aliases:
@@ -1506,6 +1507,12 @@ class OsInfo(InfoObject): # pylint: disable=too-many-instance-attributes
return sorted(feats)
+ def macros(self, cc):
+ value = [cc.add_compile_definition_option + define
+ for define in self.feature_macros]
+
+ return ' '.join(value)
+
def fixup_proc_name(proc):
proc = proc.lower().replace(' ', '')
for junk in ['(tm)', '(r)']:
@@ -2036,6 +2043,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
'dash_c': cc.compile_flags,
'cc_lang_flags': cc.cc_lang_flags(),
+ 'os_feature_macros': osinfo.macros(cc),
'cc_sysroot': sysroot_option(),
'cc_compile_flags': options.cxxflags or cc.cc_compile_flags(options),
'ldflags': options.ldflags or '',
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
index c0ad6e483..6614d5a63 100644
--- a/src/build-data/cc/clang.txt
+++ b/src/build-data/cc/clang.txt
@@ -79,5 +79,4 @@ ppc64 -> "-m64"
macos -> "-stdlib=libc++"
ios -> "-stdlib=libc++"
-netbsd -> "-D_NETBSD_SOURCE"
</mach_abi_linking>
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index b546d9ce9..f495af4e6 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -91,7 +91,6 @@ x86_32 -> "-m32"
x86_64 -> "-m64"
x32 -> "-mx32"
-netbsd -> "-D_NETBSD_SOURCE"
-qnx -> "-fexceptions -D_QNX_SOURCE"
+qnx -> "-fexceptions"
cygwin -> "-U__STRICT_ANSI__"
</mach_abi_linking>
diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in
index 0e877c680..1bd3c83aa 100644
--- a/src/build-data/makefile.in
+++ b/src/build-data/makefile.in
@@ -12,7 +12,7 @@ PYTHON_EXE = %{python_exe}
# Compiler Flags
ABI_FLAGS = %{cc_sysroot} %{cxx_abi_flags}
-LANG_FLAGS = %{cc_lang_flags}
+LANG_FLAGS = %{cc_lang_flags} %{os_feature_macros}
CXXFLAGS = %{cc_compile_flags}
WARN_FLAGS = %{cc_warning_flags}
LIB_FLAGS = %{lib_flags}
diff --git a/src/build-data/os/mingw.txt b/src/build-data/os/mingw.txt
index bbe17e084..8394eade6 100644
--- a/src/build-data/os/mingw.txt
+++ b/src/build-data/os/mingw.txt
@@ -3,12 +3,15 @@ program_suffix .exe
obj_suffix o
static_suffix a
-
install_root /mingw
header_dir include
lib_dir lib
doc_dir share/doc
+<feature_macros>
+_WIN32_WINNT=0x0600
+</feature_macros>
+
<aliases>
msys
mingw32.*
diff --git a/src/build-data/os/netbsd.txt b/src/build-data/os/netbsd.txt
index 6ff7529ff..cbfd8659e 100644
--- a/src/build-data/os/netbsd.txt
+++ b/src/build-data/os/netbsd.txt
@@ -13,3 +13,7 @@ sockets
threads
filesystem
</target_features>
+
+<feature_macros>
+_NETBSD_SOURCE
+</feature_macros>
diff --git a/src/build-data/os/qnx.txt b/src/build-data/os/qnx.txt
index 1cf671ce7..ef5c0872b 100644
--- a/src/build-data/os/qnx.txt
+++ b/src/build-data/os/qnx.txt
@@ -10,3 +10,7 @@ sockets
threads
filesystem
</target_features>
+
+<feature_macros>
+_QNX_SOURCE
+</feature_macros>
diff --git a/src/build-data/os/windows.txt b/src/build-data/os/windows.txt
index d11bacc37..edd4541d6 100644
--- a/src/build-data/os/windows.txt
+++ b/src/build-data/os/windows.txt
@@ -21,6 +21,10 @@ soname_pattern_base "{libname}.dll"
install_root c:\\Botan
doc_dir docs
+<feature_macros>
+_WIN32_WINNT=0x0600
+</feature_macros>
+
<target_features>
win32
winsock2