summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/cfdisk.txt35
-rw-r--r--Documentation/howto-build-sys.txt7
-rw-r--r--configure.ac150
-rw-r--r--disk-utils/sfdisk.c2
-rw-r--r--m4/ul.m438
-rw-r--r--misc-utils/cal.c50
-rw-r--r--misc-utils/uuidd.c22
-rw-r--r--misc-utils/uuidgen.c11
-rw-r--r--tools/config-gen.d/all.conf3
-rw-r--r--tools/config-gen.d/disable-all.conf1
10 files changed, 173 insertions, 146 deletions
diff --git a/Documentation/cfdisk.txt b/Documentation/cfdisk.txt
deleted file mode 100644
index 45728da39..000000000
--- a/Documentation/cfdisk.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Announcing the new curses based fdisk program... cfdisk
-
-cfdisk is a curses based disk drive partitioning program that can
-create partitions for a wide variety of operating systems including
-Linux, MS-DOS and OS/2. cfdisk was inspired by the fdisk program, by
-A. V. Le Blanc (LeBlanc@mcc.ac.uk). I hope that this program will be
-useful to both new and old Linux users, and I hope it will make the
-installation process easier.
-
-
- **** WARNING ****
-If you write a bad partition table to disk, it may destroy data and
-partitions.
-
--------------------------------------------------------------------
-
- Copyright (C) 1994 Kevin E. Martin (martin@cs.unc.edu)
-
-cfdisk is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-cfdisk is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-___
-Kevin E. Martin University of North Carolina at Chapel Hill
-martin@cs.unc.edu Department of Computer Science
diff --git a/Documentation/howto-build-sys.txt b/Documentation/howto-build-sys.txt
index cd59e1840..46d2793a1 100644
--- a/Documentation/howto-build-sys.txt
+++ b/Documentation/howto-build-sys.txt
@@ -60,6 +60,13 @@ util-linux build system
"no" - the util/feature is unwanted
+ The default status is always defined by UL_DEFAULT_ENABLE() and it might be
+ globally modified by $ul_default_estate (see AC_ARG_ENABLE([all-programs])).
+
+ - it's possible to disable all programs, but enable just one (or more)
+ explicitly specified, for example:
+
+ ./configure --disable-all-programs --enable-hwclock
- some basic scenarios for the ./configure script are defined in the
tools/config-gen.d/ directory. If you want to use these predefined scenarios
diff --git a/configure.ac b/configure.ac
index e59442be6..adea05018 100644
--- a/configure.ac
+++ b/configure.ac
@@ -415,6 +415,20 @@ m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [
[test "x$static_[]UL_PRG" = xyes])
])
+
+AC_ARG_ENABLE([all-programs],
+ AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]),
+ [], [enable_all_programs=undefined]
+)
+
+AS_CASE([$enable_all_programs],
+ [yes], [AC_MSG_WARN([force to build all programs by default])
+ ul_default_estate=check],
+ [no], [AC_MSG_WARN([disable all programs by default])
+ ul_default_estate=no]
+)
+
+
AX_CHECK_TLS
AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
@@ -688,7 +702,6 @@ AS_IF([test "x$with_slang" = xyes], [
])
AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes])
-AM_CONDITIONAL([BUILD_CFDISK], [test "x$have_slang" = xyes -o "x$have_ncurses" = xyes])
AS_IF([test "x$have_slang" = xyes -o "x$have_ncurses" = xyes], [
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [
@@ -726,30 +739,13 @@ AS_IF([test "x$with_utempter" = xyes], [
])
-AC_ARG_ENABLE([most-builds],
- AS_HELP_STRING([--enable-most-builds], [build everything other than experimental code]),
- [], [enable_most_builds=no]
-)
-AS_IF([test "x$enable_most_builds" = xyes], [
- enable_chfn_chsh=yes
- enable_line=yes
- enable_mesg=yes
- enable_newgrp=yes
- enable_reset=yes
- enable_socket_activation=yes
- enable_journald=yes
- enable_tunelp=yes
- enable_vipw=yes
- enable_write=yes
- with_python=yes
-])
dnl
dnl libuuid
dnl
AC_ARG_ENABLE([libuuid],
AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
- [], [enable_libuuid=yes]
+ [], [UL_DEFAULT_ENABLE([libuuid], [yes])]
)
UL_BUILD_INIT([libuuid])
AC_SUBST([LIBUUID_VERSION])
@@ -758,8 +754,6 @@ AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes)
AS_IF([test "x$enable_libuuid" = xyes], [
AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
-], [
- AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
])
dnl
@@ -767,7 +761,7 @@ dnl libblkid
dnl
AC_ARG_ENABLE([libblkid],
AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]),
- [], [enable_libblkid=yes]
+ [], [UL_DEFAULT_ENABLE([libblkid], [yes])]
)
UL_BUILD_INIT([libblkid])
AC_SUBST([LIBBLKID_DATE])
@@ -786,7 +780,7 @@ dnl libmount
dnl
AC_ARG_ENABLE([libmount],
AS_HELP_STRING([--disable-libmount], [do not build libmount]),
- [], [enable_libmount=check]
+ [], [UL_DEFAULT_ENABLE([libmount], [check])]
)
UL_BUILD_INIT([libmount])
UL_REQUIRES_LINUX([libmount])
@@ -805,7 +799,7 @@ dnl libsmartcols
dnl
AC_ARG_ENABLE([libsmartcols],
AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]),
- [], [enable_libsmartcols=yes]
+ [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])]
)
UL_BUILD_INIT([libsmartcols])
AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes])
@@ -834,9 +828,16 @@ UL_EXCLUDE_ARCH([sfdisk], [sparc*])
AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
+UL_BUILD_INIT([cfdisk], [check])
+UL_REQUIRES_BUILD([cfdisk], [libfdisk])
+UL_REQUIRES_BUILD([cfdisk], [libsmartcols])
+UL_REQUIRES_HAVE([cfdisk], [ncurses,slang], [ncurses or slang library])
+AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes])
+
+
AC_ARG_ENABLE([mount],
AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]),
- [], [enable_mount=check]
+ [], [UL_DEFAULT_ENABLE([mount], [check])]
)
UL_BUILD_INIT([mount])
UL_REQUIRES_BUILD([mount], [libmount])
@@ -845,16 +846,17 @@ AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes])
AC_ARG_ENABLE([losetup],
AS_HELP_STRING([--disable-losetup], [do not build losetup]),
- [], [enable_losetup=check]
+ [], [UL_DEFAULT_ENABLE([losetup], [check])]
)
UL_BUILD_INIT([losetup])
UL_REQUIRES_LINUX([losetup])
+UL_REQUIRES_BUILD([losetup], [libsmartcols])
AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes])
AC_ARG_ENABLE([fsck],
AS_HELP_STRING([--disable-fsck], [do not build fsck]),
- [], [enable_fsck=check]
+ [], [UL_DEFAULT_ENABLE([fsck], [check])]
)
UL_BUILD_INIT([fsck])
UL_REQUIRES_BUILD([fsck], [libmount])
@@ -863,17 +865,18 @@ AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes])
AC_ARG_ENABLE([partx],
AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]),
- [], [enable_partx=check]
+ [], [UL_DEFAULT_ENABLE([partx], [check])]
)
UL_BUILD_INIT([partx])
UL_REQUIRES_LINUX([partx])
UL_REQUIRES_BUILD([partx], [libblkid])
+UL_REQUIRES_BUILD([partx], [libsmartcols])
AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes])
AC_ARG_ENABLE([uuidd],
AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
- [], [enable_uuidd=check]
+ [], [UL_DEFAULT_ENABLE([uuidd], [check])]
)
UL_BUILD_INIT([uuidd])
UL_REQUIRES_BUILD([uuidd], [libuuid])
@@ -907,7 +910,7 @@ AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes])
AC_ARG_ENABLE([mountpoint],
AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]),
- [], [enable_mountpoint=check]
+ [], [UL_DEFAULT_ENABLE([mountpoint], [check])]
)
UL_BUILD_INIT([mountpoint])
UL_REQUIRES_BUILD([mountpoint], [libmount])
@@ -916,7 +919,7 @@ AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes])
AC_ARG_ENABLE([fallocate],
AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
- [], [enable_fallocate=check]
+ [], [UL_DEFAULT_ENABLE([fallocate], [check])]
)
UL_BUILD_INIT([fallocate])
UL_REQUIRES_LINUX([fallocate])
@@ -959,7 +962,7 @@ AS_IF([test "x$build_fallocate" = xyes], [
AC_ARG_ENABLE([unshare],
AS_HELP_STRING([--disable-unshare], [do not build unshare]),
- [], [enable_unshare=check]
+ [], [UL_DEFAULT_ENABLE([unshare], [check])]
)
UL_BUILD_INIT([unshare])
UL_REQUIRES_LINUX([unshare])
@@ -969,7 +972,7 @@ AC_CHECK_FUNCS([unshare])
AC_ARG_ENABLE([nsenter],
AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
- [], [enable_nsenter=check]
+ [], [UL_DEFAULT_ENABLE([nsenter], [check])]
)
UL_BUILD_INIT([nsenter])
UL_REQUIRES_LINUX([nsenter])
@@ -983,7 +986,7 @@ dnl but this isn't currently supported.
UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
AC_ARG_ENABLE([setpriv],
AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
- [], [enable_setpriv=check]
+ [], [UL_DEFAULT_ENABLE([setpriv], [check])]
)
UL_BUILD_INIT([setpriv])
UL_REQUIRES_LINUX([setpriv])
@@ -994,7 +997,7 @@ AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
AC_ARG_ENABLE([eject],
AS_HELP_STRING([--disable-eject], [do not build eject]),
- [], [enable_eject=check]
+ [], [UL_DEFAULT_ENABLE([eject], [check])]
)
UL_BUILD_INIT([eject])
UL_REQUIRES_LINUX([eject])
@@ -1004,7 +1007,7 @@ AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes])
AC_ARG_ENABLE([agetty],
AS_HELP_STRING([--disable-agetty], [do not build agetty]),
- [], [enable_agetty=yes]
+ [], [UL_DEFAULT_ENABLE([agetty], [yes])]
)
UL_BUILD_INIT([agetty])
AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
@@ -1012,7 +1015,7 @@ AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
AC_ARG_ENABLE([cramfs],
AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
- [], [enable_cramfs=check]
+ [], [UL_DEFAULT_ENABLE([cramfs], [check])]
)
UL_BUILD_INIT([cramfs])
AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
@@ -1022,7 +1025,7 @@ AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])
AC_ARG_ENABLE([bfs],
AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]),
- [], [enable_bfs=yes]
+ [], [UL_DEFAULT_ENABLE([bfs], [yes])]
)
UL_BUILD_INIT([bfs])
AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
@@ -1030,7 +1033,7 @@ AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes])
AC_ARG_ENABLE([minix],
AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]),
- [], [enable_minix=yes]
+ [], [UL_DEFAULT_ENABLE([minix], [yes])]
)
UL_BUILD_INIT([minix])
AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
@@ -1038,7 +1041,7 @@ AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes])
AC_ARG_ENABLE([fdformat],
AS_HELP_STRING([--disable-fdformat], [do not build fdformat]),
- [], [enable_fdformat=check]
+ [], [UL_DEFAULT_ENABLE([fdformat], [check])]
)
UL_BUILD_INIT([fdformat])
UL_REQUIRES_LINUX([fdformat])
@@ -1047,7 +1050,7 @@ AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes])
AC_ARG_ENABLE([hwclock],
AS_HELP_STRING([--disable-hwclock], [do not build hwclock]),
- [], [enable_hwclock=check]
+ [], [UL_DEFAULT_ENABLE([hwclock], [check])]
)
have_linuxdummy=$linux_os
@@ -1073,6 +1076,7 @@ UL_BUILD_INIT([swapon], [check])
UL_REQUIRES_LINUX([swapon])
UL_REQUIRES_BUILD([swapon], [libblkid])
UL_REQUIRES_BUILD([swapon], [libmount])
+UL_REQUIRES_BUILD([swapon], [libsmartcols])
AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes])
@@ -1080,11 +1084,13 @@ UL_BUILD_INIT([lsblk], [check])
UL_REQUIRES_LINUX([lsblk])
UL_REQUIRES_BUILD([lsblk], [libblkid])
UL_REQUIRES_BUILD([lsblk], [libmount])
+UL_REQUIRES_BUILD([lsblk], [libsmartcols])
AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes])
UL_BUILD_INIT([lscpu], [check])
UL_REQUIRES_LINUX([lscpu])
+UL_REQUIRES_BUILD([lscpu], [libsmartcols])
UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes])
@@ -1102,10 +1108,11 @@ AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes])
AC_ARG_ENABLE([wdctl],
AS_HELP_STRING([--disable-wdctl], [do not build wdctl]),
- [], [enable_wdctl=check]
+ [], [UL_DEFAULT_ENABLE([wdctl], [check])]
)
UL_BUILD_INIT([wdctl])
UL_REQUIRES_LINUX([wdctl])
+UL_REQUIRES_BUILD([wdctl], [libsmartcols])
UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file])
AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes])
@@ -1117,6 +1124,9 @@ AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes])
UL_BUILD_INIT([mkswap], [yes])
AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes])
+AS_IF([test "x$build_mkswap" = xyes -a "x$build_libuuid" != xyes], [
+ AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
+])
UL_BUILD_INIT([cal], [yes])
AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
@@ -1147,6 +1157,7 @@ AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes])
UL_BUILD_INIT([prlimit], [check])
UL_REQUIRES_LINUX([prlimit])
+UL_REQUIRES_BUILD([prlimit], [libsmartcols])
UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes])
AS_IF([test "x$build_prlimit" = xyes], [
@@ -1157,12 +1168,13 @@ AS_IF([test "x$build_prlimit" = xyes], [
UL_BUILD_INIT([lslocks], [check])
UL_REQUIRES_LINUX([lslocks])
UL_REQUIRES_BUILD([lslocks], [libmount])
+UL_REQUIRES_BUILD([lslocks], [libsmartcols])
AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes])
AC_ARG_ENABLE([switch_root],
AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
- [], [enable_switch_root=check]
+ [], [UL_DEFAULT_ENABLE([switch_root], [check])]
)
UL_BUILD_INIT([switch_root])
UL_REQUIRES_LINUX([switch_root])
@@ -1172,7 +1184,7 @@ AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
AC_ARG_ENABLE([pivot_root],
AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
- [], [enable_pivot_root=check]
+ [], [UL_DEFAULT_ENABLE([pivot_root], [check])]
)
UL_BUILD_INIT([pivot_root])
UL_REQUIRES_LINUX([switch_root])
@@ -1260,7 +1272,7 @@ AM_CONDITIONAL([BUILD_TAILF], [test "x$build_tailf" = xyes])
AC_ARG_ENABLE([tunelp],
AS_HELP_STRING([--enable-tunelp], [build tunelp]),
- [], [enable_tunelp=no]
+ [], [UL_DEFAULT_ENABLE([tunelp], [no])]
)
UL_BUILD_INIT([tunelp])
UL_REQUIRES_LINUX([tunelp])
@@ -1269,7 +1281,7 @@ AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes])
AC_ARG_ENABLE([kill],
AS_HELP_STRING([--disable-kill], [do not build kill]),
- [], [enable_kill=check]
+ [], [UL_DEFAULT_ENABLE([kill], [check])]
)
UL_BUILD_INIT([kill])
UL_REQUIRES_LINUX([kill])
@@ -1278,7 +1290,7 @@ AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])
AC_ARG_ENABLE([deprecated-last],
AS_HELP_STRING([--enable-deprecated-last], [build old deprecated last]),
- [], [enable_deprecated_last=no]
+ [], [UL_DEFAULT_ENABLE([deprecated_last], [no])]
)
UL_BUILD_INIT([deprecated_last])
AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])
@@ -1286,7 +1298,7 @@ AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])
AC_ARG_ENABLE([last],
AS_HELP_STRING([--disable-last], [do not build last]),
- [], [enable_last=check]
+ [], [UL_DEFAULT_ENABLE([last], [check])]
)
UL_BUILD_INIT([last])
UL_CONFLICTS_BUILD([last], [deprecated_last], [old deprecated last version])
@@ -1295,7 +1307,7 @@ AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
AC_ARG_ENABLE([utmpdump],
AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]),
- [], [enable_utmpdump=yes]
+ [], [UL_DEFAULT_ENABLE([utmpdump], [yes])]
)
UL_BUILD_INIT([utmpdump])
AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
@@ -1303,7 +1315,7 @@ AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes])
AC_ARG_ENABLE([line],
AS_HELP_STRING([--enable-line], [build line]),
- [], [enable_line=no]
+ [], [UL_DEFAULT_ENABLE([line], [no])]
)
UL_BUILD_INIT([line])
AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
@@ -1311,7 +1323,7 @@ AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes])
AC_ARG_ENABLE([mesg],
AS_HELP_STRING([--disable-mesg], [do not build mesg]),
- [], [enable_mesg=yes]
+ [], [UL_DEFAULT_ENABLE([mesg], [yes])]
)
UL_BUILD_INIT([mesg])
AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
@@ -1319,7 +1331,7 @@ AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes])
AC_ARG_ENABLE([raw],
AS_HELP_STRING([--disable-raw], [do not build raw]),
- [], [enable_raw=check]
+ [], [UL_DEFAULT_ENABLE([raw], [check])]
)
UL_BUILD_INIT([raw])
UL_REQUIRES_LINUX([raw])
@@ -1329,7 +1341,7 @@ AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes])
AC_ARG_ENABLE([rename],
AS_HELP_STRING([--disable-rename], [do not build rename]),
- [], [enable_rename=yes]
+ [], [UL_DEFAULT_ENABLE([rename], [yes])]
)
UL_BUILD_INIT([rename])
AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
@@ -1337,7 +1349,7 @@ AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes])
AC_ARG_ENABLE([reset],
AS_HELP_STRING([--enable-reset], [build reset]),
- [], [enable_reset=no]
+ [], [UL_DEFAULT_ENABLE([reset], [no])]
)
UL_BUILD_INIT([reset])
AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
@@ -1345,7 +1357,7 @@ AM_CONDITIONAL([BUILD_RESET], [test "x$build_reset" = xyes])
AC_ARG_ENABLE([vipw],
AS_HELP_STRING([--enable-vipw], [build vipw]),
- [], [enable_vipw=no]
+ [], [UL_DEFAULT_ENABLE([vipw], [no])]
)
UL_BUILD_INIT([vipw])
AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
@@ -1353,7 +1365,7 @@ AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes])
AC_ARG_ENABLE([newgrp],
AS_HELP_STRING([--enable-newgrp], [build newgrp]),
- [], [enable_newgrp=no]
+ [], [UL_DEFAULT_ENABLE([newgrp], [no])]
)
UL_BUILD_INIT([newgrp])
AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes])
@@ -1386,7 +1398,7 @@ AC_ARG_ENABLE([chfn-chsh-password],
AC_ARG_ENABLE([chfn-chsh],
AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
- [], [enable_chfn_chsh=no]
+ [], [UL_DEFAULT_ENABLE([chfn_chsh], [no])]
)
UL_BUILD_INIT([chfn_chsh])
@@ -1409,7 +1421,7 @@ AS_IF([test "x$enable_chsh_only_listed" = xyes], [
AC_ARG_ENABLE([login],
AS_HELP_STRING([--disable-login], [do not build login]),
- [], [enable_login=check]
+ [], [UL_DEFAULT_ENABLE([login], [check])]
)
UL_BUILD_INIT([login])
UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
@@ -1436,7 +1448,7 @@ AS_IF([test "x$enable_login_stat_mail" = xyes], [
AC_ARG_ENABLE([nologin],
AS_HELP_STRING([--disable-nologin], [do not build nologin]),
- [], [enable_nologin=yes]
+ [], [UL_DEFAULT_ENABLE([nologin], [yes])]
)
UL_BUILD_INIT([nologin])
AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
@@ -1444,7 +1456,7 @@ AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes])
AC_ARG_ENABLE([sulogin],
AS_HELP_STRING([--disable-sulogin], [do not build sulogin]),
- [], [enable_sulogin=yes]
+ [], [UL_DEFAULT_ENABLE([sulogin], [yes])]
)
UL_BUILD_INIT([sulogin])
AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
@@ -1452,7 +1464,7 @@ AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes])
AC_ARG_ENABLE([su],
AS_HELP_STRING([--disable-su], [do not build su]),
- [], [enable_su=check]
+ [], [UL_DEFAULT_ENABLE([su], [check])]
)
UL_BUILD_INIT([su])
UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
@@ -1461,7 +1473,7 @@ AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
AC_ARG_ENABLE([runuser],
AS_HELP_STRING([--disable-runuser], [do not build runuser]),
- [], [enable_runuser=check]
+ [], [UL_DEFAULT_ENABLE([runuser], [check])]
)
UL_BUILD_INIT([runuser])
UL_REQUIRES_HAVE([runuser], [security_pam_misc_h], [PAM header file])
@@ -1470,7 +1482,7 @@ AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
AC_ARG_ENABLE([ul],
AS_HELP_STRING([--disable-ul], [do not build ul]),
- [], [enable_ul=check]
+ [], [UL_DEFAULT_ENABLE([ul], [check])]
)
UL_BUILD_INIT([ul])
UL_REQUIRES_HAVE([ul], [ncurses, tinfo], [ncurses or tinfo libraries])
@@ -1479,7 +1491,7 @@ AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
AC_ARG_ENABLE([more],
AS_HELP_STRING([--disable-more], [do not build more]),
- [], [enable_more=check]
+ [], [UL_DEFAULT_ENABLE([more], [check])]
)
UL_BUILD_INIT([more])
UL_REQUIRES_HAVE([more], [ncurses, tinfo, termcap], [ncurses, tinfo or termcap libraries])
@@ -1488,7 +1500,7 @@ AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])
AC_ARG_ENABLE([pg],
AS_HELP_STRING([--disable-pg], [do not build pg]),
- [], [enable_pg=check]
+ [], [UL_DEFAULT_ENABLE([pg], [check])]
)
UL_BUILD_INIT([pg])
UL_REQUIRES_HAVE([pg], [ncurses], [ncurses or ncursesw library])
@@ -1497,7 +1509,7 @@ AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes])
AC_ARG_ENABLE([setterm],
AS_HELP_STRING([--disable-setterm], [do not build setterm]),
- [], [enable_setterm=check]
+ [], [UL_DEFAULT_ENABLE([setterm], [check])]
)
UL_BUILD_INIT([setterm])
UL_REQUIRES_LINUX([setterm])
@@ -1508,7 +1520,7 @@ AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
# ionice, taskset and chrt
AC_ARG_ENABLE([schedutils],
AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
- [], [enable_schedutils=yes]
+ [], [UL_DEFAULT_ENABLE([schedutils], [yes])]
)
UL_BUILD_INIT([schedutils])
@@ -1555,7 +1567,7 @@ AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
AC_ARG_ENABLE([wall],
AS_HELP_STRING([--disable-wall], [do not build wall]),
- [], [enable_wall=yes]
+ [], [UL_DEFAULT_ENABLE([wall], [yes])]
)
UL_BUILD_INIT([wall])
AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
@@ -1563,7 +1575,7 @@ AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes])
AC_ARG_ENABLE([write],
AS_HELP_STRING([--enable-write], [build write]),
- [], [enable_write=no]
+ [], [UL_DEFAULT_ENABLE([write], [no])]
)
UL_BUILD_INIT([write])
AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes])
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 3c55d5e3f..12162af87 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -1383,7 +1383,7 @@ extended_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z)
"from %lld to %lld\n"
"(For listing purposes only. "
"Do not change its contents.)"), ep->start, start);
- } else {
+ } else if (!Linux) {
warnx(_("Warning: extended partition does not start at a "
"cylinder boundary.\n"
"DOS and Linux will interpret the contents differently."));
diff --git a/m4/ul.m4 b/m4/ul.m4
index 9d4dc5619..093213133 100644
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -335,10 +335,38 @@ dnl The default <name> for $build_ and $enable_ could be overwrited by option $2
dnl
AC_DEFUN([UL_BUILD_INIT], [
m4_define([suffix], m4_default([$3],$1))
- m4_define([estate], m4_default([$2],$enable_[]suffix))
+ m4_ifblank([$2],
+[if test "x$enable_[]suffix" = xno; then
+ build_[]suffix=no
+else
+ build_[]suffix=yes
+fi],
+[if test "x$ul_default_estate" != x; then
+ enable_[]suffix=$ul_default_estate
+else[]
+ ifelse(
+ [$2], [check],[
+ build_[]suffix=yes
+ enable_[]suffix=check],
+ [$2], [yes],[
+ build_[]suffix=yes
+ enable_[]suffix=yes],
+ [$2], [no], [
+ build_[]suffix=no
+ enable_[]suffix=no])
+fi])
+])
-ifelse(estate, [check], [build_[]suffix='yes' enable_[]suffix='check'],
- estate, [yes], [build_[]suffix='yes' enable_[]suffix='yes'],
- estate, [no], [build_[]suffix='no' enable_[]suffix='no'],
- [build_[]suffix=$enable_[]suffix])
+dnl UL_DEFAULT_ENABLE(NAME, ENABLE_STATE)
+dnl
+dnl Initializes $enable_<name> variable according to ENABLE_STATE. The default
+dnl setting is possible to override by global $ul_default_estate.
+dnl
+AC_DEFUN([UL_DEFAULT_ENABLE], [
+ m4_define([suffix], $1)
+ if test "x$ul_default_estate" != x; then
+ enable_[]suffix=$ul_default_estate
+ else
+ enable_[]suffix=$2
+ fi
])
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 81375fe19..e763fe140 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -609,7 +609,7 @@ static void cal_output_header(struct cal_month *month, const struct cal_control
center(out, ctl->week_width - 1, i->next == NULL ? 0 : ctl->gutter_width);
}
if (!ctl->yflag) {
- fputs("\n", stdout);
+ my_putstring("\n");
for (i = month; i; i = i->next) {
sprintf(out, _("%d"), i->year);
center(out, ctl->week_width - 1, i->next == NULL ? 0 : ctl->gutter_width);
@@ -621,23 +621,27 @@ static void cal_output_header(struct cal_month *month, const struct cal_control
center(out, ctl->week_width - 1, i->next == NULL ? 0 : ctl->gutter_width);
}
}
- puts("");
+ my_putstring("\n");
for (i = month; i; i = i->next) {
if (ctl->weektype) {
if (ctl->julian)
- printf("%*s%s", (int)ctl->day_width - 1, "", day_headings);
+ sprintf(out, "%*s%s", (int)ctl->day_width - 1, "", day_headings);
else
- printf("%*s%s", (int)ctl->day_width, "", day_headings);
+ sprintf(out, "%*s%s", (int)ctl->day_width, "", day_headings);
+ my_putstring(out);
} else
- fputs(day_headings, stdout);
- if (i->next != NULL)
- printf("%*s", ctl->gutter_width, "");
+ my_putstring(day_headings);
+ if (i->next != NULL) {
+ sprintf(out, "%*s", ctl->gutter_width, "");
+ my_putstring(out);
+ }
}
- puts("");
+ my_putstring("\n");
}
static void cal_output_months(struct cal_month *month, const struct cal_control *ctl)
{
+ char out[FMT_ST_CHARS];
int reqday, week_line, d;
int skip;
struct cal_month *i;
@@ -659,12 +663,13 @@ static void cal_output_months(struct cal_month *month, const struct cal_control
if (0 < i->weeks[week_line]) {
if ((ctl->weektype & WEEK_NUM_MASK) ==
i->weeks[week_line])
- printf("%s%2d%s", Senter, i->weeks[week_line],
+ sprintf(out, "%s%2d%s", Senter, i->weeks[week_line],
Sexit);
else
- printf("%2d", i->weeks[week_line]);
+ sprintf(out, "%2d", i->weeks[week_line]);
} else
- printf("%2s", "");
+ sprintf(out, "%2s", "");
+ my_putstring(out);
skip = ctl->day_width;
} else
/* First day of the week is one char narrower than the other days,
@@ -675,21 +680,26 @@ static void cal_output_months(struct cal_month *month, const struct cal_control
d < DAYS_IN_WEEK * week_line + DAYS_IN_WEEK; d++) {
if (0 < i->days[d]) {
if (reqday == i->days[d])
- printf("%*s%s%*d%s", skip - (ctl->julian ? 3 : 2),
+ sprintf(out, "%*s%s%*d%s", skip - (ctl->julian ? 3 : 2),
"", Senter, (ctl->julian ? 3 : 2),
i->days[d], Sexit);
else
- printf("%*d", skip, i->days[d]);
+ sprintf(out, "%*d", skip, i->days[d]);
} else
- printf("%*s", skip, "");
+ sprintf(out, "%*s", skip, "");
+ my_putstring(out);
if (skip < (int)ctl->day_width)
skip++;
}
- if (i->next != NULL)
- printf("%*s", ctl->gutter_width, "");
+ if (i->next != NULL) {
+ sprintf(out, "%*s", ctl->gutter_width, "");
+ my_putstring(out);
+ }
+ }
+ if (i == NULL) {
+ sprintf(out, "%*s\n", ctl->gutter_width - (ctl->yflag ? 0 : 1), "");
+ my_putstring(out);
}
- if (i == NULL)
- printf("%*s\n", ctl->gutter_width - (ctl->yflag ? 0 : 1), "");
}
}
@@ -754,7 +764,7 @@ static void yearly(const struct cal_control *ctl)
year_width--;
sprintf(out, "%d", ctl->req.year);
center(out, year_width, 0);
- fputs("\n\n", stdout);
+ my_putstring("\n\n");
for (month = 1; month < MONTHS_IN_YEAR; month += ctl->julian ? 2 : 3) {
set_consecutive_months(&m1, month, ctl->req.year);
@@ -764,7 +774,7 @@ static void yearly(const struct cal_control *ctl)
cal_output_months(&m1, ctl);
}
/* Is empty line at the end year output really needed? */
- puts("");
+ my_putstring("\n");
}
/*
diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index c62610509..8909b5178 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
@@ -37,6 +37,7 @@ extern int optind;
#include "c.h"
#include "closestream.h"
#include "strutils.h"
+#include "optutils.h"
#ifdef HAVE_LIBSYSTEMD
# include <systemd/sd-daemon.h>
@@ -58,7 +59,7 @@ extern int optind;
/* server loop control structure */
struct uuidd_cxt_t {
- int timeout;
+ uint32_t timeout;
unsigned int debug: 1,
quiet: 1,
no_fork: 1,
@@ -338,10 +339,12 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
if (pidfile_path) {
sprintf(reply_buf, "%8d\n", getpid());
- ignore_result( ftruncate(fd_pidfile, 0) );
+ if (ftruncate(fd_pidfile, 0))
+ err(EXIT_FAILURE, _("could not truncate file: %s"), pidfile_path);
write_all(fd_pidfile, reply_buf, strlen(reply_buf));
if (fd_pidfile > 1)
- close(fd_pidfile); /* Unlock the pid file */
+ if (close_fd(fd_pidfile) != 0) /* Unlock the pid file */
+ err(EXIT_FAILURE, _("write failed: %s"), pidfile_path);
}
}
@@ -363,7 +366,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
while (1) {
fromlen = sizeof(from_addr);
- if (uuidd_cxt->timeout > 0)
+ if (uuidd_cxt->timeout != 0)
alarm(uuidd_cxt->timeout);
ns = accept(s, (struct sockaddr *) &from_addr, &fromlen);
alarm(0);
@@ -508,6 +511,13 @@ int main(int argc, char **argv)
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
+ static const ul_excl_t excl[] = {
+ { 'P', 'p' },
+ { 'd', 'q' },
+ { 'r', 't' },
+ { 0 }
+ };
+ int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
@@ -517,6 +527,7 @@ int main(int argc, char **argv)
while ((c =
getopt_long(argc, argv, "p:s:T:krtn:PFSdqVh", longopts,
NULL)) != -1) {
+ err_exclusive_options(c, longopts, excl, excl_st);
switch (c) {
case 'd':
uuidd_cxt.debug = 1;
@@ -574,9 +585,6 @@ int main(int argc, char **argv)
}
}
- if (no_pid && pidfile_path_param && !uuidd_cxt.quiet)
- warnx(_("Both --pid and --no-pid specified. Ignoring --no-pid."));
-
if (!no_pid && !pidfile_path_param)
pidfile_path = UUIDD_PIDFILE_PATH;
else if (pidfile_path_param)
diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index 450e26a05..0c844d216 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -26,9 +26,6 @@ extern int optind;
#include "c.h"
#include "closestream.h"
-#define DO_TYPE_TIME 1
-#define DO_TYPE_RANDOM 2
-
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
fputs(_("\nUsage:\n"), out);
@@ -68,10 +65,10 @@ main (int argc, char *argv[])
while ((c = getopt_long(argc, argv, "rtVh", longopts, NULL)) != -1)
switch (c) {
case 't':
- do_type = DO_TYPE_TIME;
+ do_type = UUID_TYPE_DCE_TIME;
break;
case 'r':
- do_type = DO_TYPE_RANDOM;
+ do_type = UUID_TYPE_DCE_RANDOM;
break;
case 'V':
printf(UTIL_LINUX_VERSION);
@@ -83,10 +80,10 @@ main (int argc, char *argv[])
}
switch (do_type) {
- case DO_TYPE_TIME:
+ case UUID_TYPE_DCE_TIME:
uuid_generate_time(uu);
break;
- case DO_TYPE_RANDOM:
+ case UUID_TYPE_DCE_RANDOM:
uuid_generate_random(uu);
break;
default:
diff --git a/tools/config-gen.d/all.conf b/tools/config-gen.d/all.conf
index 1027ba932..f8860a1e2 100644
--- a/tools/config-gen.d/all.conf
+++ b/tools/config-gen.d/all.conf
@@ -1,6 +1,5 @@
include:core.conf
---enable-most-builds
+--enable-all-programs
--enable-login-stat-mail
---enable-partx
--with-smack
diff --git a/tools/config-gen.d/disable-all.conf b/tools/config-gen.d/disable-all.conf
new file mode 100644
index 000000000..1d178b217
--- /dev/null
+++ b/tools/config-gen.d/disable-all.conf
@@ -0,0 +1 @@
+--disable-all-programs