[#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],
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
'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
############################################################
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