2012-03-18 15:38:39 -05:00
|
|
|
#!/bin/sh
|
2011-11-04 06:12:20 -05:00
|
|
|
#
|
2019-08-28 18:25:57 -05:00
|
|
|
# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
|
|
|
|
#
|
2011-11-04 06:12:20 -05:00
|
|
|
|
2012-05-30 10:16:11 -05:00
|
|
|
test -f sys-utils/mount.c || {
|
2011-11-04 06:12:20 -05:00
|
|
|
echo
|
|
|
|
echo "You must run this script in the top-level util-linux directory"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
. tools/config-gen-functions.sh
|
|
|
|
|
2014-02-16 09:22:55 -06:00
|
|
|
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
|
|
|
|
|
2011-11-04 06:12:20 -05:00
|
|
|
while [ -n "$1" ]; do
|
|
|
|
opts="$opts $(ul_get_configuration tools/config-gen.d/$1.conf)"
|
2020-07-28 06:23:50 -05:00
|
|
|
if [ "$1" == "fuzz" ]; then
|
|
|
|
export CC=${CC:-clang}
|
|
|
|
export CXX=${CXX:-clang++}
|
|
|
|
fi
|
2011-11-04 06:12:20 -05:00
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
opts=$(echo $opts | tr " " "\n" | sort -u)
|
|
|
|
echo "Configure options:"
|
|
|
|
for x in $opts; do
|
|
|
|
echo " $x"
|
|
|
|
done
|
|
|
|
if [ -n "$CFLAGS" ]; then
|
|
|
|
echo "CFLAGS: $CFLAGS"
|
2012-03-18 15:38:39 -05:00
|
|
|
CFLAGS="$CFLAGS"
|
|
|
|
export CFLAGS
|
2011-11-04 06:12:20 -05:00
|
|
|
fi
|
|
|
|
|
2013-09-08 11:09:07 -05:00
|
|
|
if [ ! -f ./configure ]; then
|
|
|
|
./autogen.sh
|
|
|
|
fi
|
|
|
|
|
2011-11-04 06:12:20 -05:00
|
|
|
echo
|
|
|
|
./configure $opts
|