summaryrefslogtreecommitdiffstats
path: root/tools/config-gen-functions.sh
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/config-gen-functions.sh
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/config-gen-functions.sh')
-rw-r--r--tools/config-gen-functions.sh33
1 files changed, 33 insertions, 0 deletions
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
+}