summaryrefslogtreecommitdiffstats
path: root/libfdisk/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
commit378c18e5f024ac5a8aef4cb40d7c9aa9633d144c (patch)
tree44dfb6ca500d32cabd450649b322a42e70a30683 /libfdisk/meson.build
parentInitial commit. (diff)
downloadutil-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.tar.xz
util-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.zip
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--libfdisk/meson.build83
1 files changed, 83 insertions, 0 deletions
diff --git a/libfdisk/meson.build b/libfdisk/meson.build
new file mode 100644
index 0000000..1debb21
--- /dev/null
+++ b/libfdisk/meson.build
@@ -0,0 +1,83 @@
+dir_libfdisk = include_directories('.', 'src')
+
+defs = configuration_data()
+defs.set('LIBFDISK_VERSION', pc_version)
+defs.set('LIBFDISK_MAJOR_VERSION', pc_version.split('.')[0])
+defs.set('LIBFDISK_MINOR_VERSION', pc_version.split('.')[1])
+defs.set('LIBFDISK_PATCH_VERSION', pc_version.split('.')[2])
+
+libfdisk_h = configure_file(
+ input : 'src/libfdisk.h.in',
+ output : 'libfdisk.h',
+ configuration : defs,
+ install : build_libfdisk,
+ install_dir : join_paths(get_option('includedir'), 'libfdisk'),
+)
+
+lib_fdisk_sources = '''
+ src/fdiskP.h
+ src/init.c
+ src/field.c
+ src/item.c
+ src/test.c
+ src/ask.c
+ src/alignment.c
+ src/label.c
+ src/utils.c
+ src/context.c
+ src/parttype.c
+ src/partition.c
+ src/table.c
+ src/iter.c
+ src/script.c
+ src/version.c
+ src/wipe.c
+
+ src/sun.c
+ src/sgi.c
+ src/dos.c
+ src/bsd.c
+ src/gpt.c
+'''.split() + [
+ list_h,
+]
+
+libfdisk_sym = 'src/libfdisk.sym'
+libfdisk_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libfdisk_sym)
+
+lib_fdisk_includes = [dir_include,
+ dir_libblkid,
+ dir_libfdisk,
+ dir_libuuid] # XXX: should this be declared along with the lib?
+
+lib__fdisk = static_library(
+ '_fdisk',
+ lib_fdisk_sources,
+ include_directories : lib_fdisk_includes,
+ dependencies : build_libfdisk ? [] : disabler())
+
+lib_fdisk_static = static_library(
+ 'fdisk',
+ link_whole : lib__fdisk,
+ link_with : [lib_common,
+ lib_blkid.get_static_lib(),
+ lib_uuid.get_static_lib()],
+ install : false)
+
+lib_fdisk = library(
+ 'fdisk',
+ link_whole : lib__fdisk,
+ link_depends : libfdisk_sym,
+ version : libfdisk_version,
+ link_args : ['-Wl,--version-script=@0@'.format(libfdisk_sym_path)],
+ link_with : [lib_common,
+ lib_blkid,
+ lib_uuid],
+ install : build_libfdisk)
+
+if build_libfdisk
+ pkgconfig.generate(lib_fdisk,
+ description : 'fdisk library',
+ subdirs : 'libfdisk',
+ version : pc_version)
+endif