summaryrefslogtreecommitdiff
path: root/libcurl/libcurl/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'libcurl/libcurl/buildfile')
-rw-r--r--libcurl/libcurl/buildfile76
1 files changed, 53 insertions, 23 deletions
diff --git a/libcurl/libcurl/buildfile b/libcurl/libcurl/buildfile
index 583aaf9..62c8680 100644
--- a/libcurl/libcurl/buildfile
+++ b/libcurl/libcurl/buildfile
@@ -1,16 +1,11 @@
# file : libcurl/buildfile
-# license : cURL License; see accompanying COPYING file
+# license : curl License; see accompanying COPYING file
# Version script.
#
define vsc: file
vsc{*}: extension = vers
-# Exported symbols.
-#
-define esm: file
-esm{*}: extension = expsym
-
import imp_libs = libssl%lib{ssl}
import imp_libs += libcrypto%lib{crypto}
import imp_libs += libz%lib{z}
@@ -25,8 +20,7 @@ bsd = ($tclass == 'bsd')
macos = ($tclass == 'macos')
windows = ($tclass == 'windows')
-lib{curl}: vsc{libcurl}: include = ($linux || $bsd ? adhoc : false)
-lib{curl}: esm{libcurl-symbols}: include = ($macos ? adhoc : false)
+libs{curl}: vsc{libcurl}: include = ($linux || $bsd ? adhoc : false)
vsc{libcurl}: lib/in{libcurl}
{
@@ -35,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 hostip}: cc.reprocess = true
+
# Build options.
#
c.poptions += -DBUILDING_LIBCURL -DHAVE_CONFIG_H \
@@ -43,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
}
@@ -63,22 +84,24 @@ obja{*}: c.poptions += -DCURL_STATICLIB
if! $windows
c.coptions += -fvisibility=hidden
-switch $c.class, $tsys
+switch $c.class
{
case 'gcc'
{
# 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'
{
# Disable warnings that pop up with /W3.
#
- c.coptions += /wd4996
+ c.coptions += /wd4028 /wd4996
}
}
@@ -91,17 +114,24 @@ 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'
{
- c.loptions += "-Wl,-exported_symbols_list,$src_base/libcurl-symbols.expsym"
- c.libs += -framework CoreFoundation -framework Security
+ # Note that upstream generates the libcurl-symbols.expsym file on MacOS
+ # and passes it to linker via the -exported_symbols_list option. This
+ # looks redundant, since the __visibility__("default") attribute is also
+ # used for the API function declarations. Thus, we don't bother
+ # generating/passing the exported symbol list file.
+ #
+ c.libs += -framework CoreFoundation \
+ -framework SystemConfiguration \
+ -framework Security
}
case 'windows', 'mingw32'
{
c.loptions += -Wl,--enable-auto-image-base
- c.libs += -lws2_32 -lcrypt32
+ c.libs += -lws2_32 -lcrypt32 -lbcrypt
}
case 'windows'
{