diff --git a/autogen.sh b/autogen.sh index 3c5fdcb..60be64e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,2 +1,62 @@ #!/bin/sh -autoreconf -f --install + +set -e + +oldpwd=$(pwd) +topdir=$(dirname $0) +cd $topdir + +#intltoolize --force --automake +autoreconf --force --install --symlink + +libdir() { + echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) +} + +args="\ +--sysconfdir=/etc \ +--localstatedir=/var \ +--libdir=$(libdir /usr/lib) \ +" + +if [ -f "$topdir/.config.args" ]; then + args="$args $(cat $topdir/.config.args)" +fi + +cd $oldpwd + +if [ "x$1" = "xc" ]; then + $topdir/configure CFLAGS='-g -O0 -ftrapv' $args + make clean +elif [ "x$1" = "xg" ]; then + $topdir/configure CFLAGS='-g -Og -ftrapv' $args + make clean +elif [ "x$1" = "xa" ]; then + $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args + make clean +elif [ "x$1" = "xl" ]; then + $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args + make clean +elif [ "x$1" = "xs" ]; then + scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args + scan-build make +else + cat <