From b71035ce89480ed66ce855dd0923a5f3371aa0cd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 20 May 2012 23:58:07 +0200 Subject: build-sys: modernize build system --- autogen.sh | 72 +++++++++++++++++--------------------------------------------- 1 file changed, 20 insertions(+), 52 deletions(-) (limited to 'autogen.sh') diff --git a/autogen.sh b/autogen.sh index d9bef57..815cc01 100755 --- a/autogen.sh +++ b/autogen.sh @@ -18,65 +18,33 @@ # License along with libatasmart; If not, see # . -AM_VERSION=1.11 -AC_VERSION=2.63 - -run_versioned() { - local P - local V - - V=$(echo "$2" | sed -e 's,\.,,g') - - if [ -e "`which $1$V 2> /dev/null`" ] ; then - P="$1$V" - else - if [ -e "`which $1-$2 2> /dev/null`" ] ; then - P="$1-$2" - else - P="$1" - fi - fi - - shift 2 - "$P" "$@" -} - -set -ex - if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then - cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ - chmod +x .git/hooks/pre-commit && \ - echo "Activated pre-commit hook." + cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ + chmod +x .git/hooks/pre-commit && \ + echo "Activated pre-commit hook." fi -if type -p colorgcc > /dev/null ; then - export CC=colorgcc -fi +autoreconf --force --install --symlink libdir() { - echo $(cd $1/$(gcc -print-multi-os-directory); pwd) + echo $(cd $1/$(gcc -print-multi-os-directory); pwd) } -if [ "x$1" = "xam" ] ; then - run_versioned automake "$AM_VERSION" -a -c --foreign - ./config.status -else - rm -rf autom4te.cache - rm -f config.cache +args="\ +--sysconfdir=/etc \ +--localstatedir=/var \ +--libdir=$(libdir /usr/lib) \ +--libexecdir=/usr/lib" - libtoolize -c --force - run_versioned aclocal "$AM_VERSION" -I m4 - run_versioned autoconf "$AC_VERSION" -Wall - run_versioned autoheader "$AC_VERSION" - run_versioned automake "$AM_VERSION" --copy --foreign --add-missing - - if [ "x$1" != "xac" ]; then - CFLAGS="$CFLAGS -g -O0" ./configure \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --libexecdir=/usr/lib \ - --libdir=$(libdir /usr/local/lib) \ - "$@" +if [ "x$1" == "xc" ]; then + ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args make clean - fi +else + echo + echo "----------------------------------------------------------------" + echo "Initialized build system. For a common configuration please run:" + echo "----------------------------------------------------------------" + echo + echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args" + echo fi -- cgit