Skip to content

Commit

Permalink
meson: fix static builds for libsystemd and libudev
Browse files Browse the repository at this point in the history
  • Loading branch information
davide125 committed Apr 25, 2018
1 parent 3dea0a4 commit 076a894
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions meson.build
Expand Up @@ -1349,9 +1349,9 @@ install_libsystemd_static = static_library(
'systemd',
libsystemd_sources,
journal_client_sources,
basic_sources,
basic_gcrypt_sources,
include_directories : includes,
link_with : [libbasic,
libbasic_gcrypt],
build_by_default : static_libsystemd != 'false',
install : static_libsystemd != 'false',
install_dir : rootlibdir,
Expand All @@ -1360,7 +1360,9 @@ install_libsystemd_static = static_library(
librt,
libxz,
liblz4,
libgcrypt],
libgcrypt,
libcap,
libmount],
c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))

############################################################
Expand Down
4 changes: 2 additions & 2 deletions src/basic/meson.build
Expand Up @@ -318,10 +318,10 @@ libbasic = static_library(

# A convenience library that is separate from libbasic to avoid
# unnecessary linking to libgcrypt.
basic_gcrypt_sources = files(['gcrypt-util.c', 'gcrypt-util.h'])
libbasic_gcrypt = static_library(
'basic-gcrypt',
'gcrypt-util.c',
'gcrypt-util.h',
basic_gcrypt_sources,
include_directories : includes,
dependencies : [libgcrypt],
c_args : ['-fvisibility=default'])
12 changes: 6 additions & 6 deletions src/shared/meson.build
Expand Up @@ -2,7 +2,7 @@
#
# Copyright 2017 Zbigniew Jędrzejewski-Szmek

shared_sources = '''
shared_sources = files('''
acl-util.h
acpi-fpdt.c
acpi-fpdt.h
Expand Down Expand Up @@ -104,25 +104,25 @@ shared_sources = '''
watchdog.c
watchdog.h
wireguard-netlink.h
'''.split()
'''.split())

test_tables_h = files('test-tables.h')
shared_sources += [test_tables_h]

if conf.get('HAVE_ACL') == 1
shared_sources += ['acl-util.c']
shared_sources += files('acl-util.c')
endif

if conf.get('ENABLE_UTMP') == 1
shared_sources += ['utmp-wtmp.c']
shared_sources += files('utmp-wtmp.c')
endif

if conf.get('HAVE_SECCOMP') == 1
shared_sources += ['seccomp-util.c']
shared_sources += files('seccomp-util.c')
endif

if conf.get('HAVE_LIBIPTC') == 1
shared_sources += ['firewall-util.c']
shared_sources += files('firewall-util.c')
endif

libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
Expand Down
8 changes: 4 additions & 4 deletions src/udev/meson.build
Expand Up @@ -122,15 +122,15 @@ static_libudev_pic = static_libudev == 'true' or static_libudev == 'pic'
install_libudev_static = static_library(
'udev',
libudev_sources,
basic_sources,
shared_sources,
libsystemd_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],
dependencies : libshared_deps + [libmount],
c_args : static_libudev_pic ? [] : ['-fno-PIC'],
pic : static_libudev_pic)

Expand Down

0 comments on commit 076a894

Please sign in to comment.