[Sugar-devel] [sugar] Allow for out-of-tree build

Caspar Bothmer caspar at activitycentral.com
Tue Jul 17 17:55:13 EDT 2012


The build can now be built outside the source tree.

We need to temporarily jump into the source tree, though, to allow
autotools to do some in-tree configuration.

Caveat: this patch doesn't make autogen.sh ready for parallel builds
of the same package.

Based on the patches #1062 [1] by Marco P. Gritti <marco at marcopg.org>
                 and #1557 [2] by Daniel Narvaez <dwnarvaez at gmail.com>

[1] https://patchwork.sugarlabs.org/patch/1062/
[2] https://patchwork.sugarlabs.org/patch/1557/

Signed-off-by: Caspar Bothmer <caspar at activitycentral.com>
---
 autogen.sh |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index bac5247..15fc7c0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,13 +1,18 @@
 #!/bin/sh
 
-test -n "${srcdir}" || srcdir=`dirname "$0"`
-test -n "${srcdir}" || srcdir="$(pwd)"
-
-olddir="$(pwd)"
-cd "$srcdir"
+srcdir="$(dirname "$0")"  # POSIX dirname returns at least "."
+builddir="$(pwd)"
 
+# We temporarily jump into srcdir to allow
+# autoreconf to take into account the changes
+# by intltoolize.
+#
+# Warning: this does not allow parallel builds of
+# this package!
+#
+cd "${srcdir}"
 intltoolize
 autoreconf -i
+cd "${builddir}"
 
-cd "$olddir"
-"$srcdir/configure" --enable-maintainer-mode "$@"
+"${srcdir}/configure" --enable-maintainer-mode "$@"
-- 
1.7.10



More information about the Sugar-devel mailing list