summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2014-09-22 14:37:57 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-09-22 14:38:34 +0200
commitc2ac7986ed1f9209352f646b2e637bd0e2582f73 (patch)
tree521493e0ddec406c73e3d0ce0d890a67af0300b4 /autogen.sh
parentf595f0c0003ffeb307d12458886118394a341939 (diff)
downloadelementary-c2ac7986ed1f9209352f646b2e637bd0e2582f73.tar.gz
autotools: modified autogen.sh to be able to build from different directory.
Summary: Right now we cannot have a designated build directory and we should build in the source directory. So the proposed solution lets you to build from any directory. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: raster, cedric Differential Revision: https://phab.enlightenment.org/D1395 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh77
1 files changed, 42 insertions, 35 deletions
diff --git a/autogen.sh b/autogen.sh
index b814903b8..d7ab12330 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,40 +1,47 @@
#!/bin/sh
-rm -rf autom4te.cache
-rm -f aclocal.m4 ltmain.sh
-
-touch README
-touch ABOUT-NLS
-
-echo "Running autopoint..." ; autopoint -f || :
-echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
-echo "Running autoheader..." ; autoheader || exit 1
-echo "Running autoconf..." ; autoconf || exit 1
-echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
-echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
-
-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
-
-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
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+(
+ cd "$srcdir" &&
+ (
+ rm -rf autom4te.cache
+ rm -f aclocal.m4 ltmain.sh
+
+ touch README
+ touch ABOUT-NLS
+
+ echo "Running autopoint..." ; autopoint -f || :
+ echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
+ echo "Running autoheader..." ; autoheader || exit 1
+ echo "Running autoconf..." ; autoconf || exit 1
+ echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
+ echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
+ )
+
+ 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
+
+ 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 [ -z "$NOCONFIGURE" ]; then
- ./configure -C "$@"
+ $srcdir/configure -C "$@"
fi