mirror of
https://github.com/systemd/systemd.git
synced 2024-12-31 21:18:09 +03:00
meson: add support for building static libsystemd and libudev
This commit is contained in:
parent
0d6f0ea6c1
commit
70848ecfc6
21
meson.build
21
meson.build
@ -1342,6 +1342,27 @@ libsystemd = shared_library(
|
||||
install : true,
|
||||
install_dir : rootlibdir)
|
||||
|
||||
static_libsystemd = get_option('static-libsystemd')
|
||||
static_libsystemd_pic = static_libsystemd == 'true' or static_libsystemd == 'pic'
|
||||
|
||||
install_libsystemd_static = static_library(
|
||||
'systemd',
|
||||
libsystemd_sources,
|
||||
journal_client_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libbasic,
|
||||
libbasic_gcrypt],
|
||||
build_by_default : static_libsystemd != 'false',
|
||||
install : static_libsystemd != 'false',
|
||||
install_dir : rootlibdir,
|
||||
pic : static_libsystemd == 'true' or static_libsystemd == 'pic',
|
||||
dependencies : [threads,
|
||||
librt,
|
||||
libxz,
|
||||
liblz4,
|
||||
libgcrypt],
|
||||
c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
|
||||
|
||||
############################################################
|
||||
|
||||
# binaries that have --help and are intended for use by humans,
|
||||
|
@ -13,6 +13,12 @@ option('rootprefix', type : 'string',
|
||||
description : '''override the root prefix''')
|
||||
option('link-udev-shared', type : 'boolean',
|
||||
description : 'link systemd-udev and its helpers to libsystemd-shared.so')
|
||||
option('static-libsystemd', type : 'combo',
|
||||
choices : ['false', 'true', 'pic', 'no-pic'],
|
||||
description : '''install a static library for libsystemd''')
|
||||
option('static-libudev', type : 'combo',
|
||||
choices : ['false', 'true', 'pic', 'no-pic'],
|
||||
description : '''install a static library for libudev''')
|
||||
|
||||
option('sysvinit-path', type : 'string', value : '/etc/init.d',
|
||||
description : 'the directory where the SysV init scripts are located')
|
||||
|
@ -82,15 +82,17 @@ libsystemd_sources = files('''
|
||||
sd-utf8/sd-utf8.c
|
||||
'''.split()) + id128_sources + sd_daemon_c + sd_event_c + sd_login_c
|
||||
|
||||
libsystemd_c_args = ['-fvisibility=default']
|
||||
|
||||
libsystemd_static = static_library(
|
||||
'systemd',
|
||||
'systemd_static',
|
||||
libsystemd_sources,
|
||||
install : false,
|
||||
include_directories : includes,
|
||||
link_with : libbasic,
|
||||
dependencies : [threads,
|
||||
librt],
|
||||
c_args : ['-fvisibility=default'])
|
||||
c_args : libsystemd_c_args)
|
||||
|
||||
libsystemd_sym = 'src/libsystemd/libsystemd.sym'
|
||||
|
||||
|
@ -111,12 +111,27 @@ libudev_basic = static_library(
|
||||
c_args : ['-fvisibility=default'])
|
||||
|
||||
libudev_static = static_library(
|
||||
'udev',
|
||||
'udev_static',
|
||||
'udev.h',
|
||||
include_directories : includes,
|
||||
link_with : udev_link_with,
|
||||
link_whole : libudev_basic)
|
||||
|
||||
static_libudev = get_option('static-libudev')
|
||||
install_libudev_static = static_library(
|
||||
'udev',
|
||||
libudev_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libshared_static,
|
||||
libsystemd_static],
|
||||
link_whole : libudev_basic,
|
||||
build_by_default : static_libudev != 'false',
|
||||
install : static_libudev != 'false',
|
||||
install_dir : rootlibdir,
|
||||
link_depends : libudev_sym,
|
||||
dependencies : [threads],
|
||||
pic : static_libudev == 'true' or static_libudev == 'pic')
|
||||
|
||||
libudev = shared_library(
|
||||
'udev',
|
||||
'udev.h', # pick a header file at random to work around old meson bug
|
||||
|
Loading…
Reference in New Issue
Block a user