From cfe5e3905201349e9cf3f95d52ff4bd100bde37d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:10:49 +0200 Subject: Adding upstream version 2.39.3. Signed-off-by: Daniel Baumann --- tools/config-gen | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 tools/config-gen (limited to 'tools/config-gen') diff --git a/tools/config-gen b/tools/config-gen new file mode 100755 index 0000000..c2989e9 --- /dev/null +++ b/tools/config-gen @@ -0,0 +1,64 @@ +#!/bin/sh +# +# Copyright (C) 2011 Karel Zak +# + +test -f sys-utils/mount.c || { + echo + echo "You must run this script in the top-level util-linux directory" + echo + exit 1 +} + +unset CC +unset CXX +unset CFLAGS +unset LDFLAGS +unset SUID_CFLAGS +unset SUID_LDFLAGS + +. 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 -- cgit v1.2.3