From 4d0483608e3b794fdec29a8e82d67f21df3baac8 Mon Sep 17 00:00:00 2001 From: Srivardhan Hebbar Date: Wed, 24 Sep 2014 10:20:07 +0200 Subject: [PATCH] autotools: modified autogen.sh to be able to build from any directory. Summary: Now we cannot have a designated build directory for building EFL. We have to build from the same source folder only. So have modified autogen.sh script so that we can build from any directory. This is similar to the one which I had submitted for Enlightenment and Elementary. Signed-off-by: Srivardhan Hebbar Reviewers: devilhorns, cedric, raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1480 Signed-off-by: Cedric BAIL --- autogen.sh | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/autogen.sh b/autogen.sh index d8535886a1..0481d71613 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,32 +1,39 @@ #!/bin/sh -rm -rf autom4te.cache -rm -f aclocal.m4 ltmain.sh +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. +( + cd "$srcdir" && + ( + rm -rf autom4te.cache + rm -f aclocal.m4 ltmain.sh -autoreconf -vif + autoreconf -vif + ) -W=0 + W=0 -rm -f config.cache-env.tmp -echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp -echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp -echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp -echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp -echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp + rm -f config.cache-env.tmp + echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp + echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp + echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp + echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp + echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp -cmp config.cache-env.tmp config.cache-env >> /dev/null -if [ $? -ne 0 ]; then - W=1; -fi + cmp config.cache-env.tmp config.cache-env >> /dev/null + if [ $? -ne 0 ]; then + W=1; + fi -if [ $W -ne 0 ]; then - echo "Cleaning configure cache..."; - rm -f config.cache config.cache-env - mv config.cache-env.tmp config.cache-env -else - rm -f config.cache-env.tmp -fi + if [ $W -ne 0 ]; then + echo "Cleaning configure cache..."; + rm -f config.cache config.cache-env + mv config.cache-env.tmp config.cache-env + else + rm -f config.cache-env.tmp + fi +) if [ -z "$NOCONFIGURE" ]; then - exec ./configure -C "$@" + exec $srcdir/configure -C "$@" fi