aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-04-02 13:19:03 +0200
committerKarel Zak <kzak@redhat.com>2024-04-02 13:19:03 +0200
commit20a740eb7c19d9bb343a8ca927d1c27402a1da5c (patch)
treed4ee6afcc33cb88d1df77a57f617506cca5fc807
parentc984aa7426a64ed2dbad789ff568e600db40aaa3 (diff)
parent44bf6d808e2babad93762d372812243c9156c81e (diff)
downloadutil-linux-20a740eb7c19d9bb343a8ca927d1c27402a1da5c.tar.gz
Merge branch 'master' of https://github.com/BinBashBanana/util-linux
* 'master' of https://github.com/BinBashBanana/util-linux: add static partx
-rw-r--r--configure.ac2
-rw-r--r--disk-utils/Makemodule.am20
-rw-r--r--meson.build43
-rw-r--r--meson_options.txt2
4 files changed, 65 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9531daa831..2fff2de09d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -804,7 +804,7 @@ AC_CHECK_DECL([IOC_OPAL_GET_STATUS],
[#include <linux/sed-opal.h>])
dnl Static compilation
-m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, sfdisk, umount, unshare])
+m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, partx, sfdisk, umount, unshare])
AC_ARG_ENABLE([static-programs],
[AS_HELP_STRING([--enable-static-programs=LIST],
diff --git a/disk-utils/Makemodule.am b/disk-utils/Makemodule.am
index d08e95d4f3..d7e936d74d 100644
--- a/disk-utils/Makemodule.am
+++ b/disk-utils/Makemodule.am
@@ -253,4 +253,24 @@ partx_SOURCES = disk-utils/partx.c
partx_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir) -I$(ul_libsmartcols_incdir)
partx_LDADD = $(LDADD) libblkid.la libcommon.la libsmartcols.la
+if HAVE_STATIC_PARTX
+usrsbin_exec_PROGRAMS += partx.static addpart.static delpart.static resizepart.static
+
+addpart_static_SOURCES = $(addpart_SOURCES)
+addpart_static_LDADD = $(addpart_LDADD)
+addpart_static_LDFLAGS = -all-static
+
+delpart_static_SOURCES = $(delpart_SOURCES)
+delpart_static_LDADD = $(delpart_LDADD)
+delpart_static_LDFLAGS = -all-static
+
+resizepart_static_SOURCES = $(resizepart_SOURCES)
+resizepart_static_LDADD = $(resizepart_LDADD)
+resizepart_static_LDFLAGS = -all-static
+
+partx_static_SOURCES = $(partx_SOURCES)
+partx_static_CFLAGS = $(partx_CFLAGS)
+partx_static_LDADD = $(partx_LDADD)
+partx_static_LDFLAGS = -all-static
+endif
endif # BUILD_PARTX
diff --git a/meson.build b/meson.build
index b74733d1b3..daf1527327 100644
--- a/meson.build
+++ b/meson.build
@@ -2397,6 +2397,49 @@ if opt
'disk-utils/partx.8.adoc']
bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
endif
+opt = opt and 'partx' in static_programs
+exe = executable(
+ 'addpart.static',
+ addpart_sources,
+ include_directories : includes,
+ link_args : ['--static'],
+ link_with : [lib_common],
+ install_dir : usrsbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+exe2 = executable(
+ 'delpart.static',
+ delpart_sources,
+ include_directories : includes,
+ link_args : ['--static'],
+ link_with : [lib_common],
+ install_dir : usrsbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+exe3 = executable(
+ 'resizepart.static',
+ resizepart_sources,
+ include_directories : includes,
+ link_args : ['--static'],
+ link_with : [lib_common],
+ install_dir : usrsbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+exe4 = executable(
+ 'partx.static',
+ partx_sources,
+ include_directories : includes,
+ link_args : ['--static'],
+ link_with : [lib_common,
+ lib_blkid.get_static_lib(),
+ lib_smartcols.get_static_lib()],
+ install_dir : usrsbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+
+if opt
+ exes += [exe, exe2, exe3, exe4]
+endif
############################################################
diff --git a/meson_options.txt b/meson_options.txt
index 7b8cf3f35f..76e917b56e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -176,7 +176,7 @@ option('build-pylibmount', type : 'feature',
option('static-programs', type : 'array',
value : [],
- choices : ['losetup', 'mount', 'umount', 'fdisk', 'sfdisk', 'blkid', 'nsenter', 'unshare'],
+ choices : ['losetup', 'mount', 'umount', 'fdisk', 'sfdisk', 'blkid', 'nsenter', 'unshare', 'partx'],
description : 'list of programs to also build with static linking')
# feature selection and other configuration