From 9f5cb4d27d10b645f617bf4063611b8bddab3e40 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 2 Dec 2019 17:55:53 +0300 Subject: Release version 1.1.1+7 Use switch in buildfile Use variable block for targets with prerequisites --- openssl/openssl/buildfile | 118 +++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 63 deletions(-) (limited to 'openssl/openssl/buildfile') diff --git a/openssl/openssl/buildfile b/openssl/openssl/buildfile index 81e1d85..f9e317a 100644 --- a/openssl/openssl/buildfile +++ b/openssl/openssl/buildfile @@ -8,91 +8,83 @@ import libs += libcrypto%lib{crypto} exe{openssl}: {h c}{** -vms_* -apps/win32_init} $libs tclass = $c.target.class +tsys = $c.target.system -i686 = ($c.target.cpu == 'i686') - -linux = ($tclass == 'linux') -bsd = ($tclass == 'bsd') windows = ($tclass == 'windows') -msvc_runtime = ($c.target.system == 'win32-msvc') - -gcc = ($c.class == 'gcc') -msvc = ($c.class == 'msvc') - exe{openssl}: apps/c{win32_init}: include = $windows # Build options. # +# 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 also passes +# -D_REENTRANT. +# 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_runtime - c.poptions += -DOPENSSL_SYS_WIN32 -D_CRT_SECURE_NO_DEPRECATE \ - -D_WINSOCK_DEPRECATED_NO_WARNINGS +switch $tclass, $tsys +{ + case 'bsd' + c.poptions += -D_THREAD_SAFE - if $msvc - c.coptions += /Gs0 /GF /Gy - else + case 'windows', 'mingw32' 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 + case 'windows' + { + # Note that upstream also passes -DOPENSSL_USE_APPLINK if compiled with + # VC. We drop this option (see libcrypto/buildfile) for details. + # + c.poptions += -DOPENSSL_SYS_WIN32 -D_CRT_SECURE_NO_DEPRECATE \ + -D_WINSOCK_DEPRECATED_NO_WARNINGS + } } -elif $gcc + +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/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 + case 'gcc' + { + if ($c.target.cpu == 'i686') + c.coptions += -fomit-frame-pointer + + # 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 + } + case 'msvc' + { + c.coptions += /Gs0 /GF /Gy + + # Disable warnings that pop up with /W3. + # + c.coptions += /wd4090 /wd4244 /wd4267 + } } c.poptions =+ "-I$src_base" -if! $windows +switch $tclass, $tsys { - if $linux - c.libs += -ldl + case 'linux' + c.libs += -ldl -lpthread - if ($linux || $bsd) + case 'bsd' c.libs += -lpthread -} -else -{ - c.libs += $regex.apply(ws2_32 gdi32 crypt32, \ - '(.+)', \ - $msvc_runtime ? '\1.lib' : '-l\1') - if $msvc_runtime - c.libs += advapi32.lib + + case 'windows', 'mingw32' + c.libs += -lws2_32 -lgdi32 -lcrypt32 + + case 'windows' + c.libs += ws2_32.lib gdi32.lib crypt32.lib advapi32.lib } -- cgit v1.1