summaryrefslogtreecommitdiff
path: root/openssl/openssl/buildfile
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-02-26 17:04:25 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-02-28 16:07:10 +0300
commit0ca0851a01251b960ba19d958978004168f58593 (patch)
treed50cc7f7d17e1f1a79dd2c1026606ed23540222d /openssl/openssl/buildfile
parent05e886fee177833f75d01ebf72f120021f71f130 (diff)
Add implementation
Diffstat (limited to 'openssl/openssl/buildfile')
-rw-r--r--openssl/openssl/buildfile97
1 files changed, 97 insertions, 0 deletions
diff --git a/openssl/openssl/buildfile b/openssl/openssl/buildfile
new file mode 100644
index 0000000..10eefb6
--- /dev/null
+++ b/openssl/openssl/buildfile
@@ -0,0 +1,97 @@
+# file : openssl/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+
+import libs = libssl%lib{ssl}
+import libs += libcrypto%lib{crypto}
+
+exe{openssl}: {h c}{** -vms_* -apps/win32_init} $libs
+
+tclass = $c.target.class
+
+i686 = ($c.target.cpu == 'i686')
+
+linux = ($tclass == 'linux')
+bsd = ($tclass == 'bsd')
+macos = ($tclass == 'macos')
+windows = ($tclass == 'windows')
+
+gcc = ($c.class == 'gcc')
+msvc = ($c.class == 'msvc')
+mingw = ($c.target.system == 'mingw32')
+
+exe{openssl}: apps/c{win32_init}: include = $windows
+
+if! $windows
+{
+ # Note that the upstream package uses -pthread compiler/linker option on
+ # Linux and FreeBSD. The option is currently unsupported by build2, so we
+ # use -D_REENTRANT and -lpthread preprocessor/linker options instead.
+ #
+ # Also note that on FreeBSD and Mac OS the upstream package passes
+ # -D_REENTRANT.
+ #
+ c.poptions += -D_REENTRANT
+
+ if $bsd
+ c.poptions += -D_THREAD_SAFE
+}
+else
+{
+ c.poptions += -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
+
+ # Note that upstream also passes -DOPENSSL_USE_APPLINK if compiled with VC.
+ # We drop this option (see libcrypto/buildfile) for details.
+ #
+ if $msvc
+ {
+ c.poptions += -DOPENSSL_SYS_WIN32 -D_CRT_SECURE_NO_DEPRECATE \
+ -D_WINSOCK_DEPRECATED_NO_WARNINGS
+
+ c.coptions += /Gs0 /GF /Gy
+ }
+ else
+ c.poptions += -D_MT
+}
+
+if ($i686 && $gcc)
+ c.coptions += -fomit-frame-pointer
+
+# Disable compiler warnings.
+#
+if $msvc
+{
+ # Disable warnings that pop up with /W3.
+ #
+ c.coptions += /wd4090 /wd4244 /wd4267
+}
+else
+{
+ # 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/versions (some -Wno-* options are only
+ # 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-error
+}
+
+c.poptions =+ "-I$src_base"
+
+if! $windows
+{
+ if $linux
+ c.libs += -ldl
+
+ if ($linux || $bsd)
+ c.libs += -lpthread
+}
+else
+{
+ c.libs += $regex.apply(ws2_32 gdi32 crypt32, \
+ '(.+)', \
+ $msvc ? '\1.lib' : '-l\1')
+ if $msvc
+ c.libs += advapi32.lib
+}