From 75f6b9505080faa1a60cb45b2d5a9ca03580e9dc Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 8 Oct 2017 18:45:48 +0200 Subject: [PATCH] clean up openssl dependency handling in Jamfile --- Jamfile | 91 ++++++++++++++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/Jamfile b/Jamfile index ce50c438d..d23fc2ee3 100644 --- a/Jamfile +++ b/Jamfile @@ -59,44 +59,6 @@ else VERSION = 1.1.5 ; -# rule for linking the correct libraries depending -# on features and target-os -rule link-openssl ( properties * ) -{ - local result ; - - # openssl libraries, if enabled - # exclude gcc from a regular windows build to make mingw - # link against the regular unix library name - if pre1.1 in $(properties) - && windows in $(properties) - && ! gcc in $(properties) - { - result += ssleay32 - libeay32 - ; - } - else - { - # on windows the library names were changed to be in line with other - # system starting with OpenSSL 1.1 - result += crypto ssl ; - } - - # windows needs some more libraries when using openSSL - if windows in $(properties) - && ! gcc in $(properties) - { - result += advapi32 - user32 - shell32 - gdi32 - ; - } - echo "link openssl = " $(result) ; - return $(result) ; -} - rule linking ( properties * ) { local result ; @@ -414,7 +376,6 @@ rule openssl-lib-path ( properties * ) local result ; result += $(OPENSSL_LIB) ; - echo "openssl-lib-path = " $(result) ; return $(result) ; } @@ -449,7 +410,6 @@ rule openssl-include-path ( properties * ) local result ; result += $(OPENSSL_INCLUDE) ; - echo "openssl-include-path = " $(result) ; return $(result) ; } @@ -601,16 +561,50 @@ variant test_barebones : debug on on multi on ; -lib crypto : : crypto z @openssl-lib-path : : @openssl-include-path ; -lib ssl : : ssl crypto @openssl-lib-path : : @openssl-include-path ; - -# required for openssl on windows -lib ssleay32 : : ssleay32 @openssl-lib-path : : @openssl-include-path ; -lib libeay32 : : libeay32 @openssl-lib-path : : @openssl-include-path ; +# windows variants for libssl and libcrypto (they have different names and some +# additional dependencies) lib advapi32 : : advapi32 ; lib user32 : : user32 ; lib shell32 : : shell32 ; lib gdi32 : : gdi32 ; + +lib crypto + : # sources + : # requirements + windows + pre1.1 + libeay32 + @openssl-lib-path + : # default-build + : # usage-requirements + @openssl-include-path + advapi32 + user32 + shell32 + gdi32 + ; + +lib ssl + : # sources + : # requirements + windows + pre1.1 + ssleay32 + crypto + @openssl-lib-path + : # default-build + : # usage-requirments + @openssl-include-path + advapi32 + user32 + shell32 + gdi32 + ; + + +lib crypto : : crypto z @openssl-lib-path : : @openssl-include-path ; +lib ssl : : ssl crypto @openssl-lib-path : : @openssl-include-path ; + lib dbghelp : : dbghelp ; # required for networking on beos @@ -625,8 +619,6 @@ lib gcrypt : : gcrypt shared /opt/local/lib ; lib z : : shared z ; lib dl : : shared dl ; -alias openssl-libraries : : : : @link-openssl ; - # time functions used on linux require librt lib librt : : rt shared ; @@ -830,7 +822,8 @@ lib torrent shared:TORRENT_BUILDING_SHARED BOOST_NO_DEPRECATED shared:BOOST_SYSTEM_SOURCE - openssl:openssl-libraries + openssl:ssl + openssl:crypto on:src/kademlia/$(KADEMLIA_SOURCES).cpp on:ed25519/src/$(ED25519_SOURCES).cpp