Skip to content

Commit

Permalink
libcrypto_lib -> libcrypto_dep
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Jul 3, 2022
1 parent 657267e commit 431d302
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 68 deletions.
36 changes: 1 addition & 35 deletions openssl/build-universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 4 additions & 21 deletions scripts/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 8 additions & 12 deletions scripts/patch/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -11,6 +12,7 @@ if host_machine.system() == 'windows'
include_directories: 'win/include'
)
else
platform = 'mac'
config_mt = 'release'
config_md = 'release'

Expand All @@ -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'),
Expand Down

0 comments on commit 431d302

Please sign in to comment.