summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-10-20 17:43:42 +0200
committerGitHub <noreply@github.com>2016-10-20 17:43:42 +0200
commitd9a0df256de9fca531afc95cc67a63b4ed1ff180 (patch)
tree1b022530e393e24ded4f997850813efb97c1714f /autogen.sh
parent8fdea26c94b22149040b8f29c8df7a92a50e0588 (diff)
parentfe9d97c673e6e2c0c39147582547a89e217bfcdb (diff)
Merge pull request #4418 from keszybz/autogen-params
Allow ./autogen.sh to take parameters for configure
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh34
1 files changed, 25 insertions, 9 deletions
diff --git a/autogen.sh b/autogen.sh
index 4ec1b2be79..fa8d2916ad 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,6 +17,16 @@
set -e
+verb="$1"
+
+if [[ -n "$verb" ]]; then
+ if [[ "$verb" != [cgals] ]]; then
+ echo "Unexpected argument: $verb" >&2
+ exit 1
+ fi
+ shift
+fi
+
oldpwd=$(pwd)
topdir=$(dirname $0)
cd $topdir
@@ -52,21 +62,27 @@ args="$args \
"
fi
+args="$args $@"
cd $oldpwd
-if [ "x$1" = "xc" ]; then
+if [ "$verb" = "c" ]; then
+ set -x
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
- make clean
-elif [ "x$1" = "xg" ]; then
+ make clean >/dev/null
+elif [ "$verb" = "g" ]; then
+ set -x
$topdir/configure CFLAGS='-g -Og -ftrapv' $args
- make clean
-elif [ "x$1" = "xa" ]; then
+ make clean >/dev/null
+elif [ "$verb" = "a" ]; then
+ set -x
$topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args
- make clean
-elif [ "x$1" = "xl" ]; then
+ make clean >/dev/null
+elif [ "$verb" = "l" ]; then
+ set -x
$topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
- make clean
-elif [ "x$1" = "xs" ]; then
+ make clean >/dev/null
+elif [ "$verb" = "s" ]; then
+ set -x
scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
scan-build make
else