diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:30:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:30:35 +0000 |
commit | 378c18e5f024ac5a8aef4cb40d7c9aa9633d144c (patch) | |
tree | 44dfb6ca500d32cabd450649b322a42e70a30683 /tools/config-gen | |
parent | Initial commit. (diff) | |
download | util-linux-upstream.tar.xz util-linux-upstream.zip |
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
26 files changed, 183 insertions, 0 deletions
diff --git a/tools/config-gen b/tools/config-gen new file mode 100755 index 0000000..e1d6474 --- /dev/null +++ b/tools/config-gen @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (C) 2011 Karel Zak <kzak@redhat.com> +# + +test -f sys-utils/mount.c || { + echo + echo "You must run this script in the top-level util-linux directory" + echo + exit 1 +} + +. tools/config-gen-functions.sh + +if [ $# -eq 0 ]; then + echo "This script requires at least one of the folloving arguments:" + cd tools/config-gen.d + for i in *.conf; do + echo " ${i%%.conf}" + done + exit 1 +fi + +while [ -n "$1" ]; do + opts="$opts $(ul_get_configuration tools/config-gen.d/$1.conf)" + if [ "$1" == "fuzz" ]; then + export CC=${CC:-clang} + export CXX=${CXX:-clang++} + fi + shift +done + +opts=$(echo $opts | tr " " "\n" | sort -u) +echo "Configure options:" +for x in $opts; do + echo " $x" +done +echo + +if [ -n "$CFLAGS" ]; then + echo "CFLAGS: $CFLAGS" + CFLAGS="$CFLAGS" + export CFLAGS + echo +fi +if [ -n "$LDFLAGS" ]; then + echo "LDFLAGS: $LDFLAGS" + LDFLAGS="$LDFLAGS" + export LDFLAGS + echo +fi + +if [ ! -f ./configure ]; then + ./autogen.sh +fi + +./configure $opts diff --git a/tools/config-gen-functions.sh b/tools/config-gen-functions.sh new file mode 100644 index 0000000..ea62432 --- /dev/null +++ b/tools/config-gen-functions.sh @@ -0,0 +1,33 @@ +# +# Copyright (C) 2011 Karel Zak <kzak@redhat.com> +# + + +# Returns configure options from selected config file +# +# ul_get_configuration <config-file> +# +# for example +# +# ul_get_configuration $top_srcdir/tools/config-gen.d/all +# +ul_get_configuration() { + local conf="$1" + local dir=$(dirname $1) + local opts=$(cat $conf) + local old_opts= + + while [ "$opts" != "$old_opts" ]; do + local new_opts= + + old_opts="$opts" + for citem in $opts; do + case $citem in + include:*) new_opts="$new_opts $(cat $dir/${citem##*:})" ;; + *) new_opts="$new_opts $citem" ;; + esac + done + opts="$new_opts" + done + echo $opts | tr " " "\n" | sort -u +} diff --git a/tools/config-gen.d/all-non-nls.conf b/tools/config-gen.d/all-non-nls.conf new file mode 100644 index 0000000..d8fc6fe --- /dev/null +++ b/tools/config-gen.d/all-non-nls.conf @@ -0,0 +1,2 @@ +include:all.conf +include:non-nls.conf diff --git a/tools/config-gen.d/all.conf b/tools/config-gen.d/all.conf new file mode 100644 index 0000000..f8860a1 --- /dev/null +++ b/tools/config-gen.d/all.conf @@ -0,0 +1,5 @@ +include:core.conf + +--enable-all-programs +--enable-login-stat-mail +--with-smack diff --git a/tools/config-gen.d/audit.conf b/tools/config-gen.d/audit.conf new file mode 100644 index 0000000..604b78d --- /dev/null +++ b/tools/config-gen.d/audit.conf @@ -0,0 +1,3 @@ +include:core.conf + +--with-audit diff --git a/tools/config-gen.d/chfnsh-libuser.conf b/tools/config-gen.d/chfnsh-libuser.conf new file mode 100644 index 0000000..9bb6bfe --- /dev/null +++ b/tools/config-gen.d/chfnsh-libuser.conf @@ -0,0 +1,5 @@ +include:audit.conf +include:selinux.conf + +--enable-chfn-chsh +--with-user diff --git a/tools/config-gen.d/chfnsh-no-password.conf b/tools/config-gen.d/chfnsh-no-password.conf new file mode 100644 index 0000000..fba4264 --- /dev/null +++ b/tools/config-gen.d/chfnsh-no-password.conf @@ -0,0 +1,6 @@ +include:audit.conf +include:selinux.conf + +--enable-chfn-chsh +--disable-chfn-chsh-password +--without-user diff --git a/tools/config-gen.d/chfnsh-pam.conf b/tools/config-gen.d/chfnsh-pam.conf new file mode 100644 index 0000000..f859f58 --- /dev/null +++ b/tools/config-gen.d/chfnsh-pam.conf @@ -0,0 +1,6 @@ +include:audit.conf +include:selinux.conf + +--enable-chfn-chsh +--enable-chfn-chsh-password +--without-user diff --git a/tools/config-gen.d/core.conf b/tools/config-gen.d/core.conf new file mode 100644 index 0000000..4abf4e0 --- /dev/null +++ b/tools/config-gen.d/core.conf @@ -0,0 +1,2 @@ +--disable-rpath +--disable-makeinstall-chown diff --git a/tools/config-gen.d/cryptsetup.conf b/tools/config-gen.d/cryptsetup.conf new file mode 100644 index 0000000..d52d529 --- /dev/null +++ b/tools/config-gen.d/cryptsetup.conf @@ -0,0 +1,3 @@ +include:all.conf + +--with-cryptsetup diff --git a/tools/config-gen.d/devel-non-asan.conf b/tools/config-gen.d/devel-non-asan.conf new file mode 100644 index 0000000..b7c18ab --- /dev/null +++ b/tools/config-gen.d/devel-non-asan.conf @@ -0,0 +1,7 @@ +include:all.conf +include:audit.conf +include:selinux.conf + +--enable-gtk-doc +--with-utempter +--enable-werror diff --git a/tools/config-gen.d/devel-non-docs.conf b/tools/config-gen.d/devel-non-docs.conf new file mode 100644 index 0000000..7eeffdb --- /dev/null +++ b/tools/config-gen.d/devel-non-docs.conf @@ -0,0 +1,6 @@ +include:all.conf +include:audit.conf +include:selinux.conf + +--with-utempter +--enable-werror diff --git a/tools/config-gen.d/devel.conf b/tools/config-gen.d/devel.conf new file mode 100644 index 0000000..7493372 --- /dev/null +++ b/tools/config-gen.d/devel.conf @@ -0,0 +1,8 @@ +include:all.conf +include:audit.conf +include:selinux.conf + +--enable-gtk-doc +--with-utempter +--enable-asan +--enable-werror diff --git a/tools/config-gen.d/disable-all.conf b/tools/config-gen.d/disable-all.conf new file mode 100644 index 0000000..1d178b2 --- /dev/null +++ b/tools/config-gen.d/disable-all.conf @@ -0,0 +1 @@ +--disable-all-programs diff --git a/tools/config-gen.d/enable-schedutils.conf b/tools/config-gen.d/enable-schedutils.conf new file mode 100644 index 0000000..08deee4 --- /dev/null +++ b/tools/config-gen.d/enable-schedutils.conf @@ -0,0 +1,3 @@ +include:disable-all.conf + +--enable-schedutils diff --git a/tools/config-gen.d/fuzz.conf b/tools/config-gen.d/fuzz.conf new file mode 100644 index 0000000..b1d8eda --- /dev/null +++ b/tools/config-gen.d/fuzz.conf @@ -0,0 +1,4 @@ +include:devel.conf + +--enable-ubsan +--enable-fuzzing-engine diff --git a/tools/config-gen.d/non-libblkid.conf b/tools/config-gen.d/non-libblkid.conf new file mode 100644 index 0000000..b3a7452 --- /dev/null +++ b/tools/config-gen.d/non-libblkid.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-libblkid diff --git a/tools/config-gen.d/non-libmount.conf b/tools/config-gen.d/non-libmount.conf new file mode 100644 index 0000000..dae9d60 --- /dev/null +++ b/tools/config-gen.d/non-libmount.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-libmount diff --git a/tools/config-gen.d/non-libs.conf b/tools/config-gen.d/non-libs.conf new file mode 100644 index 0000000..a73e8ad --- /dev/null +++ b/tools/config-gen.d/non-libs.conf @@ -0,0 +1,5 @@ +include:core.conf +include:non-libblkid.conf +include:non-libmount.conf +include:non-libuuid.conf +include:non-libsmartcols.conf diff --git a/tools/config-gen.d/non-libsmartcols.conf b/tools/config-gen.d/non-libsmartcols.conf new file mode 100644 index 0000000..ea273bf --- /dev/null +++ b/tools/config-gen.d/non-libsmartcols.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-libsmartcols diff --git a/tools/config-gen.d/non-libuuid.conf b/tools/config-gen.d/non-libuuid.conf new file mode 100644 index 0000000..8ac0629 --- /dev/null +++ b/tools/config-gen.d/non-libuuid.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-libuuid diff --git a/tools/config-gen.d/non-nls.conf b/tools/config-gen.d/non-nls.conf new file mode 100644 index 0000000..029ad9a --- /dev/null +++ b/tools/config-gen.d/non-nls.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-nls diff --git a/tools/config-gen.d/non-widechar.conf b/tools/config-gen.d/non-widechar.conf new file mode 100644 index 0000000..7319726 --- /dev/null +++ b/tools/config-gen.d/non-widechar.conf @@ -0,0 +1,3 @@ +include:core.conf + +--disable-widechar diff --git a/tools/config-gen.d/selinux.conf b/tools/config-gen.d/selinux.conf new file mode 100644 index 0000000..288cf55 --- /dev/null +++ b/tools/config-gen.d/selinux.conf @@ -0,0 +1,3 @@ +include:core.conf + +--with-selinux diff --git a/tools/config-gen.d/slang.conf b/tools/config-gen.d/slang.conf new file mode 100644 index 0000000..ee20993 --- /dev/null +++ b/tools/config-gen.d/slang.conf @@ -0,0 +1,3 @@ +include:core.conf + +--with-slang diff --git a/tools/config-gen.d/static.conf b/tools/config-gen.d/static.conf new file mode 100644 index 0000000..bc19283 --- /dev/null +++ b/tools/config-gen.d/static.conf @@ -0,0 +1,3 @@ +include:core.conf + +--enable-static-programs |