patch to fix out-of-tree builds

Taylor R Campbell campbell+gnucash at mumble.net
Sun Jan 19 10:37:45 EST 2014


The configure script currently cd's into $srcdir to run gnc-scm-info,
and in the case of non-SCM builds, doesn't return to the build
directory until too late, causing out-of-tree builds to fail.

The attached patch to master as of last night obviates the need to cd
into $srcdir at all by passing $srcdir to gnc-scm-info.  With this
patch, my out-of-tree build worked.
-------------- next part --------------
>From fd625dee4f5735449fbdf4a7eff8c8e613867828 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <campbell+gnucash at mumble.net>
Date: Sun, 19 Jan 2014 15:19:40 +0000
Subject: [PATCH] Fix configure's use of gnc-scm-info for out-of-tree builds.

---
 configure.ac | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index c3aefb5..342d82b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,12 +184,10 @@ fi
 
 # test whether we are building directly from svn/svk/git/bzr
 AC_MSG_CHECKING(if building from an scm managed directory)
-savedir="$PWD"
-cd "${srcdir}"
-./util/gnc-scm-info -r . >/dev/null 2>&1
+"$srcdir/util/gnc-scm-info" -r "$srcdir" >/dev/null 2>&1
 if test $? = 0 -o "x${BUILDING_FROM_SCM}" = "xyes" ; then
   BUILDING_FROM_SCM=yes
-  SCM_TYPE=$(./util/gnc-scm-info -t .)
+  SCM_TYPE=$("$srcdir/util/gnc-scm-info" -t "$srcdir")
   AC_MSG_RESULT($SCM_TYPE)
 
   if test "x${SCM_TYPE}" = "xgit"; then
@@ -229,7 +227,6 @@ the tarball you downloaded is broken.
 
     ])])
 fi
-cd "${savedir}"
 AM_CONDITIONAL(BUILDING_FROM_SCM, test "x$BUILDING_FROM_SCM" = "xyes")
 AC_SUBST(SCM_TYPE)
 AC_SUBST(GIT_CMD)
-- 
1.8.3.1



More information about the gnucash-devel mailing list