diff --git a/meson.build b/meson.build index 3e5242e09e6..e73b24dedbb 100644 --- a/meson.build +++ b/meson.build @@ -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, diff --git a/src/libudev/meson.build b/src/libudev/meson.build index 09cf762c273..c381352ce8a 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_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()) diff --git a/src/network/meson.build b/src/network/meson.build index f97484eb265..914f9f93c6c 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/test/meson.build b/src/test/meson.build index 7ba73af7041..71b440637d7 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -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, diff --git a/src/udev/meson.build b/src/udev/meson.build index fc06d6f85aa..2c0e3a65df8 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -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)