1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

meson: move libudev related definitions to src/libudev/meson.build

Also, this makes libudev.so built in build directory.
This commit is contained in:
Yu Watanabe 2021-01-04 21:13:30 +09:00
parent f6fe732ff3
commit 3976f372ae
3 changed files with 67 additions and 65 deletions

View File

@ -1641,13 +1641,14 @@ includes = include_directories('src/basic',
subdir('po') subdir('po')
subdir('catalog') subdir('catalog')
subdir('src/libudev')
subdir('src/systemd')
subdir('src/basic') subdir('src/basic')
subdir('src/libsystemd') subdir('src/libsystemd')
subdir('src/libsystemd-network') subdir('src/libsystemd-network')
subdir('src/journal') subdir('src/journal')
subdir('src/login') subdir('src/login')
subdir('src/shared')
subdir('src/udev')
subdir('src/libudev')
libjournal_core = static_library( libjournal_core = static_library(
'journal-core', 'journal-core',
@ -1702,16 +1703,44 @@ install_libsystemd_static = static_library(
libgcrypt], libgcrypt],
c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC'])) c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
libudev = shared_library(
'udev',
disable_mempool_c,
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)
install_libudev_static = static_library(
'udev',
basic_sources,
shared_sources,
libsystemd_sources,
libudev_sources,
disable_mempool_c,
include_directories : includes,
build_by_default : static_libudev != 'false',
install : static_libudev != 'false',
install_dir : rootlibdir,
link_depends : libudev_sym,
dependencies : libshared_deps + [libmount],
c_args : static_libudev_pic ? [] : ['-fno-PIC'],
pic : static_libudev_pic)
############################################################ ############################################################
# binaries that have --help and are intended for use by humans, # binaries that have --help and are intended for use by humans,
# usually, but not always, installed in /bin. # usually, but not always, installed in /bin.
public_programs = [] public_programs = []
subdir('src/shared')
subdir('src/core') subdir('src/core')
subdir('src/shutdown') subdir('src/shutdown')
subdir('src/udev')
subdir('src/network') subdir('src/network')
subdir('src/analyze') subdir('src/analyze')
@ -1741,6 +1770,8 @@ subdir('src/vconsole')
subdir('src/boot/efi') subdir('src/boot/efi')
subdir('src/xdg-autostart-generator') subdir('src/xdg-autostart-generator')
subdir('src/systemd')
subdir('src/test') subdir('src/test')
subdir('src/fuzz') subdir('src/fuzz')
subdir('rules.d') subdir('rules.d')

View File

@ -1,26 +1,43 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
libudev_sources = files(''' libudev_sources = files(
libudev.c 'libudev-device.c',
libudev-device.c 'libudev-device-internal.h',
libudev-device-internal.h 'libudev-enumerate.c',
libudev-enumerate.c 'libudev-hwdb.c',
libudev-hwdb.c 'libudev-list.c',
libudev-list.c 'libudev-list-internal.h',
libudev-list-internal.h 'libudev-monitor.c',
libudev-monitor.c 'libudev-queue.c',
libudev-queue.c 'libudev-util.c',
libudev-util.c 'libudev-util.h',
libudev-util.h 'libudev.c',
'''.split()) 'libudev.h')
############################################################ ############################################################
libudev_includes = [includes, include_directories('.')]
libudev_sym = files('libudev.sym') libudev_sym = files('libudev.sym')
libudev_sym_path = meson.current_source_dir() + '/libudev.sym' libudev_sym_path = join_paths(meson.current_source_dir(), 'libudev.sym')
install_headers('libudev.h') install_headers('libudev.h')
libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir()) libudev_h_path = join_paths(meson.current_source_dir(), 'libudev.h')
libudev_basic = static_library(
'udev-basic',
libudev_sources,
include_directories : includes,
c_args : ['-fvisibility=default'])
libudev_static = static_library(
'udev_static',
include_directories : includes,
link_with : udev_link_with,
link_whole : libudev_basic)
static_libudev = get_option('static-libudev')
static_libudev_pic = static_libudev == 'true' or static_libudev == 'pic'
configure_file( configure_file(
input : 'libudev.pc.in', input : 'libudev.pc.in',

View File

@ -103,52 +103,6 @@ else
udev_rpath = '' udev_rpath = ''
endif endif
libudev_includes = [includes, include_directories('../libudev')]
libudev_basic = static_library(
'udev-basic',
libudev_sources,
include_directories : libudev_includes,
c_args : ['-fvisibility=default'])
libudev_static = static_library(
'udev_static',
include_directories : libudev_includes,
link_with : udev_link_with,
link_whole : libudev_basic)
static_libudev = get_option('static-libudev')
static_libudev_pic = static_libudev == 'true' or static_libudev == 'pic'
install_libudev_static = static_library(
'udev',
basic_sources,
shared_sources,
libsystemd_sources,
libudev_sources,
disable_mempool_c,
include_directories : libudev_includes,
build_by_default : static_libudev != 'false',
install : static_libudev != 'false',
install_dir : rootlibdir,
link_depends : libudev_sym,
dependencies : libshared_deps + [libmount],
c_args : static_libudev_pic ? [] : ['-fno-PIC'],
pic : static_libudev_pic)
libudev = shared_library(
'udev',
disable_mempool_c,
version : libudev_version,
include_directories : libudev_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)
############################################################ ############################################################
libudevd_core_includes = [includes, include_directories('net')] libudevd_core_includes = [includes, include_directories('net')]