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-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.tar.xz util-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.zip |
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/config-gen')
-rwxr-xr-x | tools/config-gen | 57 |
1 files changed, 57 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 |