summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-12-01 19:03:56 +0100
committerJan Holesovsky <kendy@suse.cz>2010-12-01 19:03:56 +0100
commit5da12b112f20e3db16dc4b04881284a96547c259 (patch)
treed4e50848e2fe2e11038738832f97f550cdd380a2 /autogen.sh
parent6637546a37fc7cc6c0c898b1445eed053f4bdabc (diff)
autogen.sh: Remove bashism / non-portable stuff.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh
index cd54c90bc802..f646dab0c1d0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,7 +15,19 @@ requote()
set -- "${@//\'/$q\'$q}" # quote inner instances of '
set -- "${@/#/$q}" # add ' to start of each param
set -- "${@/%/$q}" # add ' to end of each param
- echo "$*"
+ echo "$*" # ' in a comment to stop confusing vim
+}
+
+distro()
+{
+ name=''
+ while test "$#" -gt 0 ; do
+ case "$1" in
+ --with-distro=*) name=${1#--with-distro=} ;;
+ esac
+ shift
+ done
+ echo $name
}
old_args=""
@@ -34,16 +46,16 @@ if test "z`uname -s`" != "zDarwin" ; then
fi
conf_args=$(requote "$@")
-distro_name=$(requote "$@" | sed -n -e "s/.*'--with-distro=\([^']*\)'.*/\1/p")
+distro_name=$(distro "$@")
if test "z${distro_name}" != "z" ; then
cumul=""
if test -f "./distro-configs/${distro_name}.conf" ; then
- IFS=$'\n'
+ IFS="$(printf '\n')"
for opt in $(cat distro-configs/${distro_name}.conf) ; do cumul="$cumul $opt" ; done ;
unset IFS
conf_args=$(requote "$@" | sed -e "s/'--with-distro=[^']*'/$cumul/")
else
- echo "Warning: there is no pre-set configuration for ${distro_config}, ignoring --with-distro=${distro_config}"
+ echo "Warning: there is no pre-set configuration for ${distro_name}, ignoring --with-distro=${distro_name}"
fi
fi