From 9221fb85f6f5dc97d5a4810c2e87e8882fa85f02 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Nov 2011 12:12:20 +0100 Subject: build-sys: add tools/config-gen and basic compilation scenarios Signed-off-by: Karel Zak --- tools/config-gen | 31 +++++++++++++++++++++++++++++++ tools/config-gen-functions.sh | 33 +++++++++++++++++++++++++++++++++ tools/config-gen.d/all-non-nls.conf | 2 ++ tools/config-gen.d/all.conf | 6 ++++++ tools/config-gen.d/audit.conf | 4 ++++ tools/config-gen.d/core.conf | 2 ++ tools/config-gen.d/devel.conf | 8 ++++++++ tools/config-gen.d/non-libblkid.conf | 3 +++ tools/config-gen.d/non-libmount.conf | 3 +++ tools/config-gen.d/non-libs.conf | 4 ++++ tools/config-gen.d/non-libuuid.conf | 3 +++ tools/config-gen.d/non-nls.conf | 3 +++ tools/config-gen.d/selinux.conf | 4 ++++ tools/config-gen.d/slang.conf | 3 +++ tools/config-gen.d/static.conf | 3 +++ 15 files changed, 112 insertions(+) create mode 100755 tools/config-gen create mode 100644 tools/config-gen-functions.sh create mode 100644 tools/config-gen.d/all-non-nls.conf create mode 100644 tools/config-gen.d/all.conf create mode 100644 tools/config-gen.d/audit.conf create mode 100644 tools/config-gen.d/core.conf create mode 100644 tools/config-gen.d/devel.conf create mode 100644 tools/config-gen.d/non-libblkid.conf create mode 100644 tools/config-gen.d/non-libmount.conf create mode 100644 tools/config-gen.d/non-libs.conf create mode 100644 tools/config-gen.d/non-libuuid.conf create mode 100644 tools/config-gen.d/non-nls.conf create mode 100644 tools/config-gen.d/selinux.conf create mode 100644 tools/config-gen.d/slang.conf create mode 100644 tools/config-gen.d/static.conf (limited to 'tools') diff --git a/tools/config-gen b/tools/config-gen new file mode 100755 index 000000000..441e5a465 --- /dev/null +++ b/tools/config-gen @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Copyright (C) 2011 Karel Zak +# + +test -f mount/mount.c || { + echo + echo "You must run this script in the top-level util-linux directory" + echo + exit 1 +} + +. tools/config-gen-functions.sh + +while [ -n "$1" ]; do + opts="$opts $(ul_get_configuration tools/config-gen.d/$1.conf)" + 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" + export CFLAGS="$CFLAGS" +fi + +echo +./configure $opts diff --git a/tools/config-gen-functions.sh b/tools/config-gen-functions.sh new file mode 100644 index 000000000..4f0e575f6 --- /dev/null +++ b/tools/config-gen-functions.sh @@ -0,0 +1,33 @@ +# +# Copyright (C) 2011 Karel Zak +# + + +# Returns configure options from selected config file +# +# ul_get_configuration +# +# for example +# +# ul_get_configuration $top_srcdir/tools/config-gen.d/all +# +function 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 000000000..d8fc6fe46 --- /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 000000000..7a5233479 --- /dev/null +++ b/tools/config-gen.d/all.conf @@ -0,0 +1,6 @@ +include:core.conf +include:static.conf + +--enable-most-builds +--enable-login-stat-mail +--enable-partx diff --git a/tools/config-gen.d/audit.conf b/tools/config-gen.d/audit.conf new file mode 100644 index 000000000..236f9b22c --- /dev/null +++ b/tools/config-gen.d/audit.conf @@ -0,0 +1,4 @@ +include:core.conf + +--with-audit +--enable-login-utils diff --git a/tools/config-gen.d/core.conf b/tools/config-gen.d/core.conf new file mode 100644 index 000000000..4abf4e071 --- /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/devel.conf b/tools/config-gen.d/devel.conf new file mode 100644 index 000000000..2a079742d --- /dev/null +++ b/tools/config-gen.d/devel.conf @@ -0,0 +1,8 @@ +include:all.conf +include:audit.conf +include:selinux.conf +include:static.conf + +--enable-gtk-doc +--enable-libmount-mount +--with-utempter diff --git a/tools/config-gen.d/non-libblkid.conf b/tools/config-gen.d/non-libblkid.conf new file mode 100644 index 000000000..b3a745245 --- /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 000000000..dae9d601c --- /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 000000000..d2f16d2e2 --- /dev/null +++ b/tools/config-gen.d/non-libs.conf @@ -0,0 +1,4 @@ +include:core.conf +include:non-libblkid.conf +include:non-libmount.conf +include:non-libuuid.conf diff --git a/tools/config-gen.d/non-libuuid.conf b/tools/config-gen.d/non-libuuid.conf new file mode 100644 index 000000000..8ac0629e1 --- /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 000000000..029ad9a55 --- /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/selinux.conf b/tools/config-gen.d/selinux.conf new file mode 100644 index 000000000..4da627ccf --- /dev/null +++ b/tools/config-gen.d/selinux.conf @@ -0,0 +1,4 @@ +include:core.conf + +--with-selinux +--enable-login-utils diff --git a/tools/config-gen.d/slang.conf b/tools/config-gen.d/slang.conf new file mode 100644 index 000000000..ee2099399 --- /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 000000000..bc192835c --- /dev/null +++ b/tools/config-gen.d/static.conf @@ -0,0 +1,3 @@ +include:core.conf + +--enable-static-programs -- cgit v1.2.3-55-g7522