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 --- libssl/libssl/buildfile | 151 +++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 80 deletions(-) (limited to 'libssl/libssl/buildfile') diff --git a/libssl/libssl/buildfile b/libssl/libssl/buildfile index 2eebf19..6b41c17 100644 --- a/libssl/libssl/buildfile +++ b/libssl/libssl/buildfile @@ -7,113 +7,104 @@ import int_libs = libcrypto%lib{crypto} lib{ssl}: {h c}{**} def{libssl} file{libssl.map} $int_libs tclass = $c.target.class - -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') -mingw = ($c.target.system == 'mingw32') +tsys = $c.target.system # Build options. # # Drop -DOPENSSL_PIC, -D{L|B}_ENDIAN, -DOPENSSLDIR and -DENGINESDIR as they # are not used in the libssl source code nor in the libcrypto public headers. # -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. - # +# 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 ($tclass != 'windows') c.poptions += -D_REENTRANT +else + c.poptions += -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE - if $linux +switch $tclass, $tsys +{ + case 'linux' c.poptions += -DOPENSSL_USE_NODELETE - if $bsd + case '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 + case 'windows', 'mingw32' + c.poptions += -D_MT + + 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 - - if $msvc - 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 /wd4133 /wd4244 /wd4267 -} -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 /wd4133 /wd4244 /wd4267 + } } c.poptions =+ "-I$src_base" -if! $windows +switch $tclass, $tsys { - if $linux + case 'linux' { - libs{ssl}: c.loptions += -Wl,-znodelete - c.libs += -ldl - } + c.loptions += -Wl,-znodelete -Wl,-Bsymbolic \ + "-Wl,--version-script=$src_base/libssl.map" - if ($linux || $bsd) + c.libs += -ldl -lpthread + } + case 'bsd' { - libs{ssl}: c.loptions += -Wl,-Bsymbolic \ - "-Wl,--version-script=$src_base/libssl.map" + c.loptions += -Wl,-Bsymbolic \ + "-Wl,--version-script=$src_base/libssl.map" + c.libs += -lpthread } -} -else -{ - # Note that for MinGW GCC the upstream package also passes -static-libgcc. - # We normally don't link GCC run-time statically when packaging other C - # libraries, so let's not do it here either and see how it goes. - # - if $mingw - libs{ssl}: c.loptions += -Wl,--enable-auto-image-base - - c.libs += $regex.apply(ws2_32 gdi32 crypt32, \ - '(.+)', \ - $msvc_runtime ? '\1.lib' : '-l\1') - - if $msvc_runtime - c.libs += advapi32.lib + case 'windows', 'mingw32' + { + # Note that for MinGW GCC the upstream package also passes -static-libgcc. + # We normally don't link GCC run-time statically when packaging other C + # libraries, so let's not do that here either and see how it goes. + # + c.loptions += -Wl,--enable-auto-image-base + + c.libs += -lws2_32 -lgdi32 -lcrypt32 + } + case 'windows' + { + c.libs += ws2_32.lib gdi32.lib crypt32.lib advapi32.lib + } } # Export options. -- cgit v1.1