summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKarel Zak2011-11-04 12:12:20 +0100
committerKarel Zak2011-11-04 20:56:06 +0100
commit9221fb85f6f5dc97d5a4810c2e87e8882fa85f02 (patch)
tree0e0d7ea68817763eb2b4d7fd0ac54486be1f5818 /tools
parentbuild-sys: fix UL_INIT_BUILD macro (diff)
downloadkernel-qcow2-util-linux-9221fb85f6f5dc97d5a4810c2e87e8882fa85f02.tar.gz
kernel-qcow2-util-linux-9221fb85f6f5dc97d5a4810c2e87e8882fa85f02.tar.xz
kernel-qcow2-util-linux-9221fb85f6f5dc97d5a4810c2e87e8882fa85f02.zip
build-sys: add tools/config-gen and basic compilation scenarios
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/config-gen31
-rw-r--r--tools/config-gen-functions.sh33
-rw-r--r--tools/config-gen.d/all-non-nls.conf2
-rw-r--r--tools/config-gen.d/all.conf6
-rw-r--r--tools/config-gen.d/audit.conf4
-rw-r--r--tools/config-gen.d/core.conf2
-rw-r--r--tools/config-gen.d/devel.conf8
-rw-r--r--tools/config-gen.d/non-libblkid.conf3
-rw-r--r--tools/config-gen.d/non-libmount.conf3
-rw-r--r--tools/config-gen.d/non-libs.conf4
-rw-r--r--tools/config-gen.d/non-libuuid.conf3
-rw-r--r--tools/config-gen.d/non-nls.conf3
-rw-r--r--tools/config-gen.d/selinux.conf4
-rw-r--r--tools/config-gen.d/slang.conf3
-rw-r--r--tools/config-gen.d/static.conf3
15 files changed, 112 insertions, 0 deletions
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 <kzak@redhat.com>
+#
+
+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 <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
+#
+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