summaryrefslogtreecommitdiff
path: root/libcurl/libcurl/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'libcurl/libcurl/buildfile')
-rw-r--r--libcurl/libcurl/buildfile53
1 files changed, 42 insertions, 11 deletions
diff --git a/libcurl/libcurl/buildfile b/libcurl/libcurl/buildfile
index d44293f..5f783c1 100644
--- a/libcurl/libcurl/buildfile
+++ b/libcurl/libcurl/buildfile
@@ -29,6 +29,40 @@ vsc{libcurl}: lib/in{libcurl}
CURL_LT_SHLIB_VERSIONED_FLAVOUR = 'OPENSSL_'
}
+# It seems that for earlier versions of clang the __has_include_next() macro
+# is broken in the -frewrite-includes mode. So, in particular, the following
+# fragment of llvm-6.0's stdatomic.h:
+#
+# #if __STDC_HOSTED__ && __has_include_next(<stdatomic.h>)
+# # include_next <stdatomic.h>
+# #else
+# ...
+# typedef _Atomic(_Bool) atomic_bool;
+# ...
+# #endif
+#
+# expands into:
+#
+# #if __STDC_HOSTED__ && (1)/*__has_include_next(<stdatomic.h>)*/
+# #if 0 /* expanded by -frewrite-includes */
+# # include_next <stdatomic.h>
+# #endif /* expanded by -frewrite-includes */
+# # 31 "/usr/lib/llvm-6.0/lib/clang/6.0.0/include/stdatomic.h" 3
+# # 32 "/usr/lib/llvm-6.0/lib/clang/6.0.0/include/stdatomic.h" 3
+# #else
+# ...
+# typedef _Atomic(_Bool) atomic_bool;
+# ...
+# #endif
+#
+# This ends up with no atomic_* types defined, etc.
+#
+# Thus, we enable reprocessing for the source files which (indirectly) include
+# <stdatomic.h> for Clang versions prior to 7.0.
+#
+#if ($c.id == 'clang' && $c.version.major < 7)
+# lib/obj{easy version}: cc.reprocess = true
+
# Build options.
#
c.poptions += -DBUILDING_LIBCURL -DHAVE_CONFIG_H \
@@ -37,15 +71,8 @@ c.poptions += -DBUILDING_LIBCURL -DHAVE_CONFIG_H \
if! $windows
c.poptions += -DCURL_HIDDEN_SYMBOLS
-# Note that the upstream package uses the -pthread compiler/linker option on
-# Linux and FreeBSD. The option is unsupported by build2 so we pass
-# -D_REENTRANT and -lpthread preprocessor/linker options instead.
-#
switch $tclass, $tsys
{
- case 'linux' | 'bsd'
- c.poptions += -D_REENTRANT
-
case 'windows', 'win32-msvc'
c.poptions += -DWIN32
}
@@ -64,9 +91,11 @@ switch $c.class
# Disable warnings that pop up with -Wall -Wextra. Upstream doesn't seem
# to care about these and it is not easy to disable specific warnings in a
# way that works across compilers/version (some -Wno-* options are only
- # recognized in newer versions).
+ # recognized in newer versions). There are still some warnings left that
+ # appear for certain platforms/compilers. We pass them through but disable
+ # treating them as errors.
#
- c.coptions += -Wno-all -Wno-extra -Wno-deprecated-declarations
+ c.coptions += -Wno-all -Wno-extra -Wno-deprecated-declarations -Wno-error
}
case 'msvc'
{
@@ -85,7 +114,7 @@ switch $tclass, $tsys
c.loptions += -Wl,--no-undefined
c.loptions += "-Wl,--version-script=$out_base/libcurl.vers"
- c.libs += -lpthread
+ c.libs += -pthread
}
case 'macos'
{
@@ -95,7 +124,9 @@ switch $tclass, $tsys
# used for the API function declarations. Thus, we don't bother
# generating/passing the exported symbol list file.
#
- c.libs += -framework CoreFoundation -framework Security
+ c.libs += -framework CoreFoundation \
+ -framework SystemConfiguration \
+ -framework Security
}
case 'windows', 'mingw32'
{