]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
add static partx
authorBinBashBanana <51469593+BinBashBanana@users.noreply.github.com>
Fri, 8 Mar 2024 09:12:26 +0000 (01:12 -0800)
committerBinBashBanana <51469593+BinBashBanana@users.noreply.github.com>
Fri, 8 Mar 2024 09:12:26 +0000 (01:12 -0800)
configure.ac
disk-utils/Makemodule.am
meson.build
meson_options.txt

index ab7c986367c54ae1bcd91c6f726c7f0c9444e3cd..e787131e124a95160f5c83b86f4dbf88c951b0bb 100644 (file)
@@ -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],
index d08e95d4f34b8ff59e9eac93b49f1a2fd40dbf74..d7e936d74dd5fd69d12a150ab25b6b5d86ad7de9 100644 (file)
@@ -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
index f7baab7a22640c4a7cdef694e20e54040e07409f..8bb5203083407a7bae6fb8ef49d68c5114b7b447 100644 (file)
@@ -2388,6 +2388,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
 
 ############################################################
 
index 7b8cf3f35f58344280d6c8549405b80a98fa332e..76e917b56ea9290e9e4ab80121601aaf671259e1 100644 (file)
@@ -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