From 2e0e0371d34cfe120a87d8a386aef2a67f868b21 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 24 May 2005 17:07:41 +0000 Subject: [PATCH] Fix PL makefiles to support running regression tests in VPATH builds. --- src/pl/plperl/GNUmakefile | 21 +++++++++++++++++++++ src/pl/plpython/Makefile | 21 +++++++++++++++++++++ src/pl/tcl/Makefile | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index d64889dbd9..71a363fe8f 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -47,6 +47,27 @@ all: all-lib SPI.c: SPI.xs $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX) diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 48ed3c86bb..a2f283476b 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -66,6 +66,27 @@ include $(top_srcdir)/src/Makefile.shlib all: all-lib +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX) diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index 4955a39bb5..89fa1109f2 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -50,6 +50,27 @@ ifeq ($(TCL_SHARED_BUILD), 1) all: all-lib $(MAKE) -C modules $@ +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX) -- 2.39.5