meson: rename libudev_internal to libudev_static and link into libudev

This reduces the meson man=false target count to 1281.

v2:
- link test-engine with libshared instead of libsystemd_static
Previous version built fine on F27, but fails on F26 with the following error:
/usr/bin/ld: /tmp/ccr8HRGw.ltrans6.ltrans.o: undefined reference to symbol '__start_BUS_ERROR_MAP@@SD_SHARED'
/home/zbyszek/fedora/systemd/systemd-9d5aae75c64f5583a110f03b94816aacc03bbf4d/x86_64-redhat-linux-gnu/src/shared/libsystemd-shared-236.so: error adding symbols: DSO missing from command line

v3:
- add libudev_basic
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-12-19 20:54:46 +01:00
parent 5e3cec87be
commit 0c06b50662
5 changed files with 35 additions and 28 deletions

View File

@ -2223,7 +2223,7 @@ if conf.get('ENABLE_HWDB') == 1
'src/hwdb/hwdb.c',
'src/libsystemd/sd-hwdb/hwdb-internal.h',
include_directories : includes,
link_with : [libudev_internal],
link_with : [libudev_static],
install_rpath : udev_rpath,
install : true,
install_dir : rootbindir)
@ -2256,7 +2256,7 @@ exe = executable('systemd-udevd',
c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
link_with : [libudev_core,
libsystemd_network,
libudev_internal],
libudev_static],
dependencies : [threads,
libkmod,
libidn,
@ -2273,7 +2273,7 @@ exe = executable('udevadm',
include_directories : includes,
link_with : [libudev_core,
libsystemd_network,
libudev_internal],
libudev_static],
dependencies : [threads,
libkmod,
libidn,
@ -2347,7 +2347,7 @@ if conf.get('ENABLE_NETWORKD') == 1
include_directories : includes,
link_with : [libnetworkd_core,
libsystemd_network,
libudev_internal,
libudev_static,
libshared],
dependencies : [threads],
install_rpath : rootlibexecdir,

View File

@ -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_static],
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())

View File

@ -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],

View File

@ -67,7 +67,7 @@ tests += [
'src/test/test-helper.c'],
[libcore,
libudev,
libsystemd_static],
libshared],
[threads,
librt,
libseccomp,
@ -411,7 +411,7 @@ tests += [
[libcore,
libjournal_core,
libudev_core,
libudev_internal,
libudev_static,
libsystemd_network,
libshared],
[threads,
@ -611,7 +611,7 @@ tests += [
[['src/test/test-udev.c'],
[libudev_core,
libudev_internal,
libudev_static,
libsystemd_network,
libshared],
[threads,

View File

@ -117,11 +117,31 @@ else
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',
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 +170,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)