diff options
author | Karel Zak | 2011-11-04 12:12:20 +0100 |
---|---|---|
committer | Karel Zak | 2011-11-04 20:56:06 +0100 |
commit | 9221fb85f6f5dc97d5a4810c2e87e8882fa85f02 (patch) | |
tree | 0e0d7ea68817763eb2b4d7fd0ac54486be1f5818 /tools/config-gen-functions.sh | |
parent | build-sys: fix UL_INIT_BUILD macro (diff) | |
download | kernel-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.sh | 33 |
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 +} |