bdr: Only set VPATH build variables when actually doing a vpath build...
authorAndres Freund <andres@anarazel.de>
Mon, 9 Feb 2015 20:34:24 +0000 (21:34 +0100)
committerAndres Freund <andres@anarazel.de>
Thu, 12 Feb 2015 09:16:59 +0000 (10:16 +0100)
Fixes building the docs from within the source directory. No need to
backpatch, as we previously didn't rely on srcdir being set.

Makefile.global.in
configure
configure.in

index 27c5002f53c19a31e5b94f5f5bfe80a48e58e8ae..8ddcf6a36295d71094d30641986a516d559f5f04 100644 (file)
@@ -9,8 +9,11 @@ bdr_abs_srcdir := @srcdir@
 PG_CONFIG :=@PG_CONFIG@
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 
-VPATH := $(bdr_abs_srcdir)/$(bdr_subdir)
-USE_VPATH :=$(VPATH)
+vpath_build=@vpath_build@
+ifeq ($(vpath_build),yes)
+   VPATH := $(bdr_abs_srcdir)/$(bdr_subdir)
+   USE_VPATH :=$(VPATH)
+endif
 GIT_WORK_TREE=${bdr_abs_srcdir}
 GIT_DIR=${bdr_abs_srcdir}/.git
 export GIT_DIR
index 577c58cfdb1f47653deb35928aec788d755a6706..a4fed6e40d27c4180116f8a9c54a3ce42de7e789 100755 (executable)
--- a/configure
+++ b/configure
@@ -589,6 +589,7 @@ PACKAGE_URL='http://2ndquadrant.com/en/resources/bdr/'
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+vpath_build
 BUILDING_BDR
 BUILDING_UDR
 OBJEXT
@@ -2760,6 +2761,14 @@ $as_echo "#define BUILDING_BDR 1" >>confdefs.h
 fi;
 
 
+# check whether we're building inside the source tree.
+if test "$srcdir" -ef '.' ; then
+  vpath_build=no
+else
+  vpath_build=yes
+fi
+
+
 ac_config_files="$ac_config_files Makefile"
 
 ac_config_files="$ac_config_files Makefile.global"
index 21ca22eafe2d6072728158a7253616e1c41630d2..547737f14fdd9d52c83a6975a52971e7d6d60ffa 100644 (file)
@@ -57,6 +57,14 @@ else
 fi;
 
 
+# check whether we're building inside the source tree.
+if test "$srcdir" -ef '.' ; then
+  vpath_build=no
+else
+  vpath_build=yes
+fi
+AC_SUBST(vpath_build)
+
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([Makefile.global])
 AC_CONFIG_FILES([doc/Makefile])