summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-03 18:37:00 +0100
committerGitHub <noreply@github.com>2018-01-03 18:37:00 +0100
commit7f9ac71c76f8157707fb36e1b316961aa4db0ac8 (patch)
treeac0dc28ea629a5c6b096bd67edcd7a6441eafed0 /src
parenthwdb: Add accelerometer orientation entry for Teclast X98 Plus II tablet (#7766) (diff)
parentmeson: add a single .h file to shared libs with no sources (diff)
downloadsystemd-7f9ac71c76f8157707fb36e1b316961aa4db0ac8.tar.xz
systemd-7f9ac71c76f8157707fb36e1b316961aa4db0ac8.zip
Merge pull request #7705 from keszybz/redo-linking
Redo linking
Diffstat (limited to 'src')
-rw-r--r--src/basic/gcrypt-util.c (renamed from src/shared/gcrypt-util.c)0
-rw-r--r--src/basic/gcrypt-util.h (renamed from src/shared/gcrypt-util.h)0
-rw-r--r--src/basic/meson.build18
-rw-r--r--src/journal/meson.build14
-rw-r--r--src/libsystemd/meson.build9
-rw-r--r--src/libudev/meson.build17
-rw-r--r--src/network/meson.build4
-rw-r--r--src/resolve/meson.build33
-rw-r--r--src/shared/meson.build27
-rw-r--r--src/test/meson.build11
-rw-r--r--src/udev/meson.build31
11 files changed, 93 insertions, 71 deletions
diff --git a/src/shared/gcrypt-util.c b/src/basic/gcrypt-util.c
index 1bfb776725..1bfb776725 100644
--- a/src/shared/gcrypt-util.c
+++ b/src/basic/gcrypt-util.c
diff --git a/src/shared/gcrypt-util.h b/src/basic/gcrypt-util.h
index 69faf08e56..69faf08e56 100644
--- a/src/shared/gcrypt-util.h
+++ b/src/basic/gcrypt-util.h
diff --git a/src/basic/meson.build b/src/basic/meson.build
index 31a00cee5e..c8abe74070 100644
--- a/src/basic/meson.build
+++ b/src/basic/meson.build
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-basic_sources_plain = files('''
+basic_sources = files('''
MurmurHash2.c
MurmurHash2.h
af-list.c
@@ -306,7 +306,7 @@ foreach item : [['af', af_list_txt, 'af', ''],
generated_gperf_headers += [target1, target2]
endforeach
-basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers
+basic_sources += [missing_h] + generated_gperf_headers
libbasic = static_library(
'basic',
@@ -315,6 +315,16 @@ libbasic = static_library(
dependencies : [threads,
libcap,
libblkid,
- libselinux,
- ],
+ libselinux],
+ c_args : ['-fvisibility=default'],
install : false)
+
+# A convenience library that is separate from libbasic to avoid
+# unnecessary linking to libgcrypt.
+libbasic_gcrypt = static_library(
+ 'basic-gcrypt',
+ 'gcrypt-util.c',
+ 'gcrypt-util.h',
+ include_directories : includes,
+ dependencies : [libgcrypt],
+ c_args : ['-fvisibility=default'])
diff --git a/src/journal/meson.build b/src/journal/meson.build
index edb2a1a30e..a23f6a712c 100644
--- a/src/journal/meson.build
+++ b/src/journal/meson.build
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-journal_internal_sources = files('''
+journal_client_sources = files('''
audit-type.c
audit-type.h
catalog.c
@@ -38,14 +38,12 @@ journal_internal_sources = files('''
'''.split())
if conf.get('HAVE_GCRYPT') == 1
- journal_internal_sources += files('''
+ journal_client_sources += files('''
journal-authenticate.c
journal-authenticate.h
fsprg.c
fsprg.h
'''.split())
-
- journal_internal_sources += gcrypt_util_sources
endif
############################################################
@@ -71,7 +69,13 @@ audit_type_to_name = custom_target(
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
-journal_internal_sources += [audit_type_to_name]
+journal_client_sources += [audit_type_to_name]
+
+libjournal_client = static_library(
+ 'journal-client',
+ journal_client_sources,
+ include_directories : includes,
+ c_args : ['-fvisibility=default'])
############################################################
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
index 4abf50b111..9eb5a917cf 100644
--- a/src/libsystemd/meson.build
+++ b/src/libsystemd/meson.build
@@ -17,7 +17,7 @@
sd_login_c = files('sd-login/sd-login.c')
-libsystemd_internal_sources = files('''
+libsystemd_sources = files('''
sd-bus/bus-bloom.c
sd-bus/bus-bloom.h
sd-bus/bus-common-errors.c
@@ -93,14 +93,15 @@ libsystemd_internal_sources = files('''
sd-utf8/sd-utf8.c
'''.split()) + sd_login_c
-libsystemd_internal = static_library(
+libsystemd_static = static_library(
'systemd',
- libsystemd_internal_sources,
+ libsystemd_sources,
install : false,
include_directories : includes,
link_with : libbasic,
dependencies : [threads,
- librt])
+ librt],
+ c_args : ['-fvisibility=default'])
libsystemd_sym = 'src/libsystemd/libsystemd.sym'
diff --git a/src/libudev/meson.build b/src/libudev/meson.build
index 30d6721b60..c381352ce8 100644
--- a/src/libudev/meson.build
+++ b/src/libudev/meson.build
@@ -31,21 +31,8 @@ libudev_sources = files('''
############################################################
-libudev_sym = 'libudev.sym'
-libudev_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libudev_sym)
-libudev = shared_library(
- 'udev',
- libudev_sources,
- version : libudev_version,
- include_directories : includes,
- link_args : ['-shared',
- '-Wl,--version-script=' + libudev_sym_path],
- link_with : [libbasic,
- libsystemd_internal],
- dependencies : [threads],
- link_depends : libudev_sym,
- install : true,
- install_dir : rootlibdir)
+libudev_sym = files('libudev.sym')
+libudev_sym_path = meson.current_source_dir() + '/libudev.sym'
install_headers('libudev.h')
libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir())
diff --git a/src/network/meson.build b/src/network/meson.build
index f97484eb26..914f9f93c6 100644
--- a/src/network/meson.build
+++ b/src/network/meson.build
@@ -151,7 +151,7 @@ if conf.get('ENABLE_NETWORKD') == 1
[['src/network/test-network.c'],
[libnetworkd_core,
- libudev_internal,
+ libudev_static,
libsystemd_network,
libshared],
[threads]],
@@ -166,7 +166,7 @@ if conf.get('ENABLE_NETWORKD') == 1
'src/network/test-network-tables.c',
test_tables_h],
[libnetworkd_core,
- libudev_internal,
+ libudev_static,
libudev_core,
libsystemd_network,
libshared],
diff --git a/src/resolve/meson.build b/src/resolve/meson.build
index ee1acb5166..15752d24ff 100644
--- a/src/resolve/meson.build
+++ b/src/resolve/meson.build
@@ -31,7 +31,7 @@ basic_dns_sources = files('''
dns_type_h = files('dns-type.h')[0]
-systemd_resolved_only_sources = files('''
+systemd_resolved_sources = files('''
resolved.c
resolved-manager.c
resolved-manager.h
@@ -80,7 +80,7 @@ systemd_resolved_only_sources = files('''
resolved-etc-hosts.c
'''.split())
-systemd_resolve_only_sources = files('resolve-tool.c')
+systemd_resolve_sources = files('resolve-tool.c')
############################################################
@@ -141,14 +141,13 @@ resolved_dnssd_gperf_c = custom_target(
output : 'resolved-dnssd-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
-systemd_resolved_sources = (basic_dns_sources +
- [resolved_gperf_c, resolved_dnssd_gperf_c] +
- systemd_resolved_only_sources +
- dns_type_headers)
+libsystemd_resolve_core = static_library(
+ 'systemd-resolve-core',
+ basic_dns_sources,
+ dns_type_headers,
+ include_directories : includes)
-systemd_resolve_sources = (basic_dns_sources +
- systemd_resolve_only_sources +
- dns_type_headers)
+systemd_resolved_sources += [resolved_gperf_c, resolved_dnssd_gperf_c]
if conf.get('ENABLE_RESOLVE') == 1
install_data('org.freedesktop.resolve1.conf',
@@ -178,37 +177,37 @@ endif
tests += [
[['src/resolve/test-resolve-tables.c',
- basic_dns_sources,
dns_type_headers,
'src/shared/test-tables.h'],
- [],
+ [libsystemd_resolve_core,
+ libshared],
[libgcrypt,
libgpg_error,
libm],
'ENABLE_RESOLVE'],
[['src/resolve/test-dns-packet.c',
- basic_dns_sources,
dns_type_headers],
- [],
+ [libsystemd_resolve_core,
+ libshared],
[libgcrypt,
libgpg_error,
libm],
'ENABLE_RESOLVE'],
[['src/resolve/test-resolved-packet.c',
- basic_dns_sources,
dns_type_headers],
- [],
+ [libsystemd_resolve_core,
+ libshared],
[libgcrypt,
libgpg_error,
libm],
'ENABLE_RESOLVE'],
[['src/resolve/test-dnssec.c',
- basic_dns_sources,
dns_type_headers],
- [],
+ [libsystemd_resolve_core,
+ libshared],
[libgcrypt,
libgpg_error,
libm],
diff --git a/src/shared/meson.build b/src/shared/meson.build
index 06a944c49d..290fa0524c 100644
--- a/src/shared/meson.build
+++ b/src/shared/meson.build
@@ -56,8 +56,6 @@ shared_sources = '''
firewall-util.h
fstab-util.c
fstab-util.h
- gcrypt-util.c
- gcrypt-util.h
generator.c
generator.h
gpt.h
@@ -159,24 +157,25 @@ libshared_deps = [threads,
libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
-libshared = shared_library(
+libshared_static = static_library(
libshared_name,
shared_sources,
- basic_sources,
- journal_internal_sources,
- libsystemd_internal_sources,
+ include_directories : includes,
+ dependencies : libshared_deps,
+ c_args : ['-fvisibility=default'])
+
+libshared = shared_library(
+ libshared_name,
libudev_sources,
include_directories : includes,
link_args : ['-shared',
- '-Wl,--version-script=' + libshared_sym_path],
+ '-Wl,--version-script=' + libshared_sym_path],
+ link_whole : [libshared_static,
+ libbasic,
+ libbasic_gcrypt,
+ libsystemd_static,
+ libjournal_client],
c_args : ['-fvisibility=default'],
dependencies : libshared_deps,
install : true,
install_dir : rootlibexecdir)
-
-libshared_static = static_library(
- libshared_name,
- shared_sources,
- basic_sources,
- include_directories : includes,
- dependencies : libshared_deps)
diff --git a/src/test/meson.build b/src/test/meson.build
index 6bb5bd629e..71b440637d 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -67,7 +67,7 @@ tests += [
'src/test/test-helper.c'],
[libcore,
libudev,
- libsystemd_internal],
+ libshared],
[threads,
librt,
libseccomp,
@@ -119,6 +119,7 @@ tests += [
[['src/test/test-dns-domain.c'],
[libcore,
+ libshared,
libsystemd_network],
[]],
@@ -167,7 +168,7 @@ tests += [
[]],
[['src/test/test-copy.c'],
- [libshared_static],
+ [],
[]],
[['src/test/test-sigbus.c'],
@@ -410,7 +411,7 @@ tests += [
[libcore,
libjournal_core,
libudev_core,
- libudev_internal,
+ libudev_static,
libsystemd_network,
libshared],
[threads,
@@ -610,7 +611,7 @@ tests += [
[['src/test/test-udev.c'],
[libudev_core,
- libudev_internal,
+ libudev_static,
libsystemd_network,
libshared],
[threads,
@@ -772,7 +773,7 @@ tests += [
[['src/libsystemd/sd-bus/test-bus-error.c'],
[libshared_static,
- libsystemd_internal],
+ libsystemd_static],
[]],
[['src/libsystemd/sd-bus/test-bus-track.c'],
diff --git a/src/udev/meson.build b/src/udev/meson.build
index 3b2c7b5e12..de2fd2d9c4 100644
--- a/src/udev/meson.build
+++ b/src/udev/meson.build
@@ -113,15 +113,36 @@ if get_option('link-udev-shared')
udev_rpath = rootlibexecdir
else
udev_link_with = [libshared_static,
- libsystemd_internal]
+ libsystemd_static]
udev_rpath = ''
endif
-libudev_internal = static_library(
- 'udev',
+libudev_basic = static_library(
+ 'udev-basic',
libudev_sources,
include_directories : includes,
- link_with : udev_link_with)
+ c_args : ['-fvisibility=default'])
+
+libudev_static = static_library(
+ 'udev',
+ 'udev.h',
+ include_directories : includes,
+ link_with : udev_link_with,
+ link_whole : libudev_basic)
+
+libudev = shared_library(
+ 'udev',
+ 'udev.h', # pick a header file at random to work around old meson bug
+ version : libudev_version,
+ include_directories : includes,
+ link_args : ['-shared',
+ '-Wl,--version-script=' + libudev_sym_path],
+ link_with : [libsystemd_static, libshared_static],
+ link_whole : libudev_basic,
+ dependencies : [threads],
+ link_depends : libudev_sym,
+ install : true,
+ install_dir : rootlibdir)
libudev_core_includes = [includes, include_directories('net')]
libudev_core = static_library(
@@ -150,7 +171,7 @@ foreach prog : [['ata_id/ata_id.c'],
prog,
include_directories : includes,
c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
- link_with : [libudev_internal],
+ link_with : [libudev_static],
install_rpath : udev_rpath,
install : true,
install_dir : udevlibexecdir)