autogen.sh: Remove bashism / non-portable stuff.
This commit is contained in:
parent
6637546a37
commit
5da12b112f
1 changed files with 16 additions and 4 deletions
20
autogen.sh
20
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue