From 431d302ff7b08ffc686e379dc151ed8e03292dfd Mon Sep 17 00:00:00 2001 From: Marcus Tomlinson Date: Sun, 3 Jul 2022 16:22:31 +0100 Subject: [PATCH] libcrypto_lib -> libcrypto_dep --- openssl/build-universal.sh | 36 +----------------------------------- scripts/bundle.py | 25 ++++--------------------- scripts/patch/meson.build | 20 ++++++++------------ 3 files changed, 13 insertions(+), 68 deletions(-) diff --git a/openssl/build-universal.sh b/openssl/build-universal.sh index 1b1b5db3f6..434e9b0cad 100644 --- a/openssl/build-universal.sh +++ b/openssl/build-universal.sh @@ -9,41 +9,7 @@ meson compile -C arm-build meson setup x64-build --buildtype=release --cross-file=x64-build.txt meson compile -C x64-build -mkdir -p builddir/subprojects/openssl-3.0.2/libcrypto.a.p -mkdir -p builddir/subprojects/openssl-3.0.2/libssl.a.p +mkdir -p builddir/subprojects/openssl-3.0.2 lipo -create -output builddir/subprojects/openssl-3.0.2/libcrypto.a arm-build/subprojects/openssl-3.0.2/libcrypto.a x64-build/subprojects/openssl-3.0.2/libcrypto.a lipo -create -output builddir/subprojects/openssl-3.0.2/libssl.a arm-build/subprojects/openssl-3.0.2/libssl.a x64-build/subprojects/openssl-3.0.2/libssl.a - -cd arm-build - -others=() - -for filename in subprojects/openssl-3.0.2/libcrypto.a.p/*.o; do - if [ -f "../x64-build/$filename" ] - then - lipo -create -output ../builddir/$filename ../x64-build/$filename $filename - else - others+=( "arm-build/$filename" ) - fi -done - -for filename in subprojects/openssl-3.0.2/libssl.a.p/*.o; do - if [ -f "../x64-build/$filename" ] - then - lipo -create -output ../builddir/$filename ../x64-build/$filename $filename - fi -done - -cd ../x64-build - -for filename in subprojects/openssl-3.0.2/libcrypto.a.p/*.o; do - if [ ! -f "../arm-build/$filename" ] - then - others+=( "x64-build/$filename" ) - fi -done - -cd .. - -lipo -create -output builddir/subprojects/openssl-3.0.2/libcrypto.a.p/others.o $others diff --git a/scripts/bundle.py b/scripts/bundle.py index d3047a2b2b..f559efd374 100644 --- a/scripts/bundle.py +++ b/scripts/bundle.py @@ -27,32 +27,15 @@ shutil.copytree(srcdir + '/builddir/bundle/include/Poco', bundledir + '/poco/' + opsys + '/include/Poco') -# bundle openssl objects +# bundle openssl libs if os.path.exists(configdir): shutil.rmtree(configdir) -os.makedirs(configdir + '/libcrypto') +os.makedirs(configdir) -if platform.system() == 'Windows': - files = glob.iglob(os.path.join(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libcrypto.a.p/*.obj')) -else: - files = glob.iglob(os.path.join(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libcrypto.a.p/*.o')) - -for file in files: - if os.path.isfile(file): - shutil.copy2(file, configdir + '/libcrypto') - -os.makedirs(configdir + '/libssl') - -if platform.system() == 'Windows': - files = glob.iglob(os.path.join(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libssl.a.p/*.obj')) -else: - files = glob.iglob(os.path.join(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libssl.a.p/*.o')) - -for file in files: - if os.path.isfile(file): - shutil.copy2(file, configdir + '/libssl') +shutil.copy2(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libcrypto.a', configdir) +shutil.copy2(srcdir + '/openssl/builddir/subprojects/openssl-3.0.2/libssl.a', configdir) # bundle poco objects diff --git a/scripts/patch/meson.build b/scripts/patch/meson.build index b3a8e37fab..cb23dee07a 100644 --- a/scripts/patch/meson.build +++ b/scripts/patch/meson.build @@ -3,6 +3,7 @@ project('poco') python = find_program('python', 'python3', required : true) if host_machine.system() == 'windows' + platform = 'win' config_mt = 'release_mt' config_md = 'release_md' @@ -11,6 +12,7 @@ if host_machine.system() == 'windows' include_directories: 'win/include' ) else + platform = 'mac' config_mt = 'release' config_md = 'release' @@ -20,19 +22,13 @@ else ) endif -libcrypto_lib = static_library( 'libcrypto', - objects: run_command(python, 'globo', config_mt, 'libcrypto', check: true).stdout().strip().split('\n'), -) -libcrypto_lib_md = static_library( 'libcrypto_md', - objects: run_command(python, 'globo', config_md, 'libcrypto', check: true).stdout().strip().split('\n'), -) +cpp = meson.get_compiler('cpp') -libssl_lib = static_library( 'libssl', - objects: run_command(python, 'globo', config_mt, 'libssl', check: true).stdout().strip().split('\n'), -) -libssl_lib_md = static_library( 'libssl_md', - objects: run_command(python, 'globo', config_md, 'libssl', check: true).stdout().strip().split('\n'), -) +libcrypto_dep = cpp.find_library('crypto', dirs: meson.current_source_dir() + '/' + platform + '/' + config_mt, required: true) +libcrypto_dep_md = cpp.find_library('crypto', dirs: meson.current_source_dir() + '/' + platform + '/' + config_md, required: true) + +libssl_dep = cpp.find_library('ssl', dirs: meson.current_source_dir() + '/' + platform + '/' + config_mt, required: true) +libssl_dep_md = cpp.find_library('ssl', dirs: meson.current_source_dir() + '/' + platform + '/' + config_md, required: true) activerecord_lib = static_library( 'activerecord', objects: run_command(python, 'globo', config_mt, 'Poco/ActiveRecord', check: true).stdout().strip().split('\n'),