summaryrefslogtreecommitdiff
path: root/curl/curl/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'curl/curl/buildfile')
-rw-r--r--curl/curl/buildfile59
1 files changed, 59 insertions, 0 deletions
diff --git a/curl/curl/buildfile b/curl/curl/buildfile
new file mode 100644
index 0000000..f6c40c4
--- /dev/null
+++ b/curl/curl/buildfile
@@ -0,0 +1,59 @@
+# file : curl/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : cURL License; see accompanying COPYING file
+
+import libs = libcurl%lib{curl}
+import libs += libca-certificates-curl%lib{ca-certificates-curl}
+
+exe{curl}: h{**} c{** -src/tool_main -lib/**} $libs
+
+tclass = $c.target.class
+tsys = $c.target.system
+
+# Build options.
+#
+c.poptions += -DHAVE_CONFIG_H
+
+# 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
+}
+
+c.poptions =+ "-I$src_base" "-I$src_base/src" "-I$src_base/lib"
+
+switch $c.class, $tsys
+{
+ case 'gcc'
+ {
+ # Disable the Clang targeting MSVC warnings.
+ #
+ if ($c.id == 'clang' && $tsys == 'win32-msvc')
+ c.coptions += -Wno-deprecated-declarations
+ }
+ case 'msvc'
+ {
+ # Disable warnings that pop up with /W3.
+ #
+ c.coptions += /wd4996
+ }
+}
+
+switch $tclass, $tsys
+{
+ case 'linux' | 'bsd'
+ c.libs += -lpthread
+
+ case 'windows', 'mingw32'
+ c.libs+= -lws2_32
+
+ case 'windows'
+ c.libs += ws2_32.lib
+}