author | deba |
Tue, 18 Apr 2006 07:02:32 +0000 | |
changeset 2059 | ebf3b2962554 |
parent 2015 | 5e51c9eb5e83 |
child 2103 | a979fcdda073 |
permissions | -rwxr-xr-x |
ladanyi@1304 | 1 |
#!/bin/bash |
ladanyi@1304 | 2 |
|
klao@2015 | 3 |
quiet=0 |
klao@2015 | 4 |
function quiet { [[ $quiet == 1 ]]; } |
klao@2015 | 5 |
|
klao@2015 | 6 |
if [[ "$1" == "-q" ]]; then |
klao@2015 | 7 |
quiet=1 |
klao@2015 | 8 |
shift |
klao@2015 | 9 |
fi |
klao@2015 | 10 |
|
ladanyi@1304 | 11 |
prev= |
ladanyi@1304 | 12 |
for option |
ladanyi@1304 | 13 |
do |
ladanyi@1304 | 14 |
if test -n "$prev" |
ladanyi@1304 | 15 |
then |
ladanyi@1304 | 16 |
eval "$prev=\$option" |
ladanyi@1304 | 17 |
prev= |
ladanyi@1304 | 18 |
continue |
ladanyi@1304 | 19 |
fi |
ladanyi@1304 | 20 |
|
ladanyi@1304 | 21 |
optarg=`expr "x$option" : 'x[^=]*=\(.*\)'` |
ladanyi@1304 | 22 |
|
ladanyi@1304 | 23 |
case $option in |
ladanyi@1304 | 24 |
|
ladanyi@1304 | 25 |
-amver | --amver) |
ladanyi@1304 | 26 |
prev=amver ;; |
ladanyi@1304 | 27 |
-amver=* | --amver=*) |
ladanyi@1304 | 28 |
amver=$optarg ;; |
ladanyi@1304 | 29 |
|
ladanyi@1304 | 30 |
-acver | --acver) |
ladanyi@1304 | 31 |
prev=acver ;; |
ladanyi@1304 | 32 |
-acver=* | --acver=*) |
ladanyi@1304 | 33 |
acver=$optarg ;; |
ladanyi@1304 | 34 |
|
ladanyi@1304 | 35 |
--help | -h) |
ladanyi@1304 | 36 |
cat << EOF |
ladanyi@1304 | 37 |
Usage: $0 [OPTION] |
ladanyi@1304 | 38 |
|
ladanyi@1304 | 39 |
Options: |
ladanyi@1304 | 40 |
-h, --help display this help and exit |
ladanyi@1304 | 41 |
--amver=VERSION use VERSION version of automake |
ladanyi@1304 | 42 |
--acver=VERSION use VERSION version of autoconf |
ladanyi@1304 | 43 |
|
ladanyi@1304 | 44 |
Expamle: |
ladanyi@1304 | 45 |
$0 --amver=1.8 --acver=2.59 |
ladanyi@1304 | 46 |
EOF |
ladanyi@1304 | 47 |
exit 0 |
ladanyi@1304 | 48 |
;; |
ladanyi@1304 | 49 |
|
ladanyi@1304 | 50 |
*) |
ladanyi@1304 | 51 |
cat << EOF >&2 |
ladanyi@1304 | 52 |
$0: unrecognized option: $option |
ladanyi@1304 | 53 |
Try \`$0 --help' for more information. |
ladanyi@1304 | 54 |
EOF |
ladanyi@1304 | 55 |
exit 1 |
ladanyi@1304 | 56 |
;; |
ladanyi@1304 | 57 |
|
ladanyi@1304 | 58 |
esac |
ladanyi@1304 | 59 |
done |
ladanyi@1304 | 60 |
|
ladanyi@1304 | 61 |
automake=automake |
ladanyi@1304 | 62 |
aclocal=aclocal |
ladanyi@1304 | 63 |
autoconf=autoconf |
ladanyi@1348 | 64 |
autoheader=autoheader |
ladanyi@1304 | 65 |
|
ladanyi@1304 | 66 |
if test -n "$amver" |
ladanyi@1304 | 67 |
then |
ladanyi@1304 | 68 |
automake=automake-$amver |
ladanyi@1304 | 69 |
aclocal=aclocal-$amver |
ladanyi@1304 | 70 |
fi |
ladanyi@1304 | 71 |
|
ladanyi@1304 | 72 |
if test -n "$acver" |
ladanyi@1304 | 73 |
then |
ladanyi@1304 | 74 |
autoconf=autoconf-$acver |
ladanyi@1348 | 75 |
autoheader=autoheader-$acver |
ladanyi@1304 | 76 |
fi |
ladanyi@1304 | 77 |
|
klao@2015 | 78 |
quiet || echo "Try using 'autoreconf -vi' instead of this." |
ladanyi@2012 | 79 |
|
klao@2015 | 80 |
set -e |
klao@2015 | 81 |
quiet || set -x |
klao@2015 | 82 |
|
ladanyi@2043 | 83 |
autopoint |
klao@2015 | 84 |
$aclocal -I m4 |
klao@2015 | 85 |
(quiet && exec > /dev/null; libtoolize --force --copy) |
klao@2015 | 86 |
$autoconf |
klao@2015 | 87 |
$autoheader |
klao@2015 | 88 |
$automake --add-missing --copy --gnu |