Skip to content
Snippets Groups Projects
Commit 6720ceba authored by alice's avatar alice
Browse files

meson: remove -Dstatic_apk

now users that want a static apk should do something like

 LDFLAGS="-static" meson setup build . -Ddefault_library=static -Dprefer_static=true
parent 583b7b51
No related branches found
No related tags found
No related merge requests found
......@@ -14,20 +14,15 @@ lua_bin = find_program('lua' + get_option('lua_version'), required: get_option('
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
zlib_dep = dependency('zlib')
zlib_static_dep = dependency('zlib', static: true)
libzstd_dep = dependency('libzstd', required: get_option('zstd'))
libzstd_static_dep = dependency('libzstd', required: get_option('zstd'), static: true)
if get_option('crypto_backend') == 'openssl'
crypto_dep = dependency('openssl')
crypto_static_dep = dependency('openssl', static: true)
elif get_option('crypto_backend') == 'mbedtls'
crypto_dep = [ dependency('mbedtls'), dependency('mbedcrypto') ]
crypto_static_dep = [ dependency('mbedtls', static: true), dependency('mbedcrypto', static: true) ]
endif
shared_deps = [ crypto_dep, zlib_dep, libzstd_dep ]
static_deps = [ crypto_static_dep, zlib_static_dep, libzstd_static_dep ]
apk_deps = [ crypto_dep, zlib_dep, libzstd_dep ]
add_project_arguments('-D_GNU_SOURCE', language: 'c')
......
......@@ -5,7 +5,6 @@ option('docs', description: 'Build manpages with scdoc', type: 'feature', value:
option('help', description: 'Build help into apk binaries, needs lua', type: 'feature', value: 'auto')
option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
option('static_apk', description: 'Also build apk.static', type: 'boolean', value: false)
option('url_backend', description: 'URL backend', type: 'combo', choices: ['libfetch', 'wget'], value: 'libfetch')
option('uvol_db_target', description: 'Default target for uvol database layer', type: 'string')
option('zstd', description: 'Build with zstd support', type: 'boolean', value: true)
......@@ -140,7 +140,7 @@ if get_option('zstd')
apk_cargs += [ '-DHAVE_ZSTD' ]
endif
libapk_shared = shared_library(
libapk_lib = library(
'apk',
libapk_src,
version: libapk_so_version,
......@@ -148,30 +148,18 @@ libapk_shared = shared_library(
dependencies: [
libfetch_dep,
libportability_dep,
shared_deps,
apk_deps,
],
c_args: apk_cargs,
)
libapk_static = static_library(
'apk',
libapk_src,
install: not subproject,
dependencies: [
libfetch_dep,
libportability_dep,
static_deps,
],
c_args: [apk_cargs, '-DOPENSSL_NO_ENGINE'],
)
libapk_dep = declare_dependency(
link_with: libapk_shared,
link_with: libapk_lib,
)
if not subproject
pkgc.generate(
libapk_shared,
libapk_lib,
name: 'apk',
version: libapk_so_version,
)
......@@ -193,7 +181,7 @@ if(lua_dep.found())
dependencies: [
lua_dep,
libapk_dep,
shared_deps,
apk_deps,
libportability_dep.partial_dependency(includes: true),
],
install: true,
......@@ -208,25 +196,9 @@ apk_exe = executable(
install: not subproject,
dependencies: [
libapk_dep,
shared_deps,
apk_deps,
libfetch_dep.partial_dependency(includes: true),
libportability_dep.partial_dependency(includes: true),
],
c_args: apk_cargs,
)
if get_option('static_apk')
apk_static_exe = executable(
'apk.static',
apk_src,
install: not subproject,
dependencies: [
static_deps,
libfetch_dep.partial_dependency(includes: true),
libportability_dep.partial_dependency(includes: true),
],
link_with: libapk_static,
c_args: [apk_cargs, '-DOPENSSL_NO_ENGINE'],
link_args: '-static',
)
endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment