Skip to content

Commit ae28cfe

Browse files
committed
Partial fix for ecpg's VPATH problems. It compiles and successfully
builds all the files needed for its regression tests, but the tests themselves fail because of diffs in the #line directives output by ecpg itself. Not sure what to do about that.
1 parent fcba3b8 commit ae28cfe

File tree

9 files changed

+666
-641
lines changed

9 files changed

+666
-641
lines changed

src/interfaces/ecpg/compatlib/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.23 2005/12/09 21:19:35 petere Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.24 2006/08/28 16:13:10 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,11 +17,12 @@ SO_MAJOR_VERSION= 2
1717
SO_MINOR_VERSION= 2
1818
DLTYPE= library
1919

20-
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
21-
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
20+
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
21+
-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
2222
override CFLAGS += $(PTHREAD_CFLAGS)
2323
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
24-
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
24+
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) \
25+
$(PTHREAD_LIBS)
2526

2627
OBJS= informix.o
2728

src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.40 2006/04/29 20:13:07 tgl Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.41 2006/08/28 16:13:11 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,7 +17,8 @@ SO_MAJOR_VERSION= 5
1717
SO_MINOR_VERSION= 2
1818
DLTYPE= library
1919

20-
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
20+
override CPPFLAGS := -DFRONTEND \
21+
-I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2122
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
2223
override CFLAGS += $(PTHREAD_CFLAGS)
2324

src/interfaces/ecpg/include/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ subdir = src/interfaces/ecpg/include
22
top_builddir = ../../../..
33
include $(top_builddir)/src/Makefile.global
44

5-
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
5+
override CPPFLAGS := -DFRONTEND \
6+
-I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
67
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
78

89
informix_esql_dir = $(pkgincludedir)/informix/esql

src/interfaces/ecpg/pgtypeslib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.29 2005/12/09 21:19:36 petere Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.30 2006/08/28 16:13:11 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,7 +17,8 @@ SO_MAJOR_VERSION= 2
1717
SO_MINOR_VERSION= 2
1818
DLTYPE= library
1919

20-
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
20+
override CPPFLAGS := -DFRONTEND \
21+
-I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2122
-I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS)
2223
override CFLAGS += $(PTHREAD_CFLAGS)
2324

src/interfaces/ecpg/preproc/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2006, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.120 2006/03/07 00:48:07 tgl Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.121 2006/08/28 16:13:11 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,9 +17,10 @@ MAJOR_VERSION= 4
1717
MINOR_VERSION= 2
1818
PATCHLEVEL=1
1919

20-
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
21-
-DMAJOR_VERSION=$(MAJOR_VERSION) \
22-
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)
20+
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
21+
-I$(srcdir) -DMAJOR_VERSION=$(MAJOR_VERSION) \
22+
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
23+
$(CPPFLAGS)
2324

2425
ifeq ($(GCC), yes)
2526
override CFLAGS += -Wno-error

src/interfaces/ecpg/test/Makefile

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.58 2006/08/19 13:42:40 meskes Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.59 2006/08/28 16:13:11 tgl Exp $
22

33
subdir = src/interfaces/ecpg/test
44
top_builddir = ../../../..
@@ -17,6 +17,12 @@ ifdef NO_LOCALE
1717
NOLOCALE += --no-locale
1818
endif
1919

20+
ifneq ($(PORTNAME),win32)
21+
abs_builddir := $(shell pwd)
22+
else
23+
abs_builddir := $(shell pwd -W)
24+
endif
25+
2026
all install installdirs uninstall dep depend distprep:
2127
$(MAKE) -C connect $@
2228
$(MAKE) -C sql $@
@@ -36,13 +42,11 @@ clean distclean maintainer-clean:
3642
$(MAKE) -C complex $@
3743
$(MAKE) -C thread $@
3844
rm -rf tmp_check results log
39-
rm -f pg_regress.inc.sh regression.diffs
45+
rm -f pg_regress regression.diffs
4046

41-
all: pg_regress.sh
47+
all: pg_regress
4248

43-
pg_regress.sh: pg_regress.inc.sh
44-
45-
pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
49+
pg_regress: pg_regress.sh $(top_builddir)/src/Makefile.global
4650
sed -e 's,@bindir@,$(bindir),g' \
4751
-e 's,@libdir@,$(libdir),g' \
4852
-e 's,@pkglibdir@,$(pkglibdir),g' \
@@ -54,12 +58,29 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
5458
-e 's/@GCC@/$(GCC)/g' \
5559
$< >$@
5660

57-
check: all pg_regress.inc.sh
58-
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
61+
# When doing a VPATH build, copy over the .pgc, .stdout and .stderr
62+
# files so that the driver script can find them. We have to use an
63+
# absolute path for the targets, because otherwise make will try to
64+
# locate the missing files using VPATH, and will find them in
65+
# $(srcdir), but the point here is that we want to copy them from
66+
# $(srcdir) to the build directory.
67+
68+
ifdef VPATH
69+
remaining_files_src := $(wildcard $(srcdir)/*/*.pgc) $(wildcard $(srcdir)/expected/*.c) $(wildcard $(srcdir)/expected/*.stdout) $(wildcard $(srcdir)/expected/*.stderr)
70+
remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
71+
72+
all: $(remaining_files_build)
73+
$(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
74+
ln -s $< $@
75+
endif
76+
77+
78+
check: all
79+
sh ./pg_regress --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
5980

6081
# the same options, but with --listen-on-tcp
61-
checktcp: all pg_regress.inc.sh
62-
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) --listen-on-tcp
82+
checktcp: all
83+
sh ./pg_regress --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) --listen-on-tcp
6384

64-
installcheck: all pg_regress.inc.sh
65-
sh ./pg_regress.sh --dbname=regress1 --debug --top-builddir=$(top_builddir) --load-language=plpgsql $(NOLOCALE)
85+
installcheck: all
86+
sh ./pg_regress --dbname=regress1 --debug --top-builddir=$(top_builddir) --load-language=plpgsql $(NOLOCALE)

src/interfaces/ecpg/test/Makefile.regress

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
override CPPFLAGS := -I$(srcdir)/../../include -I$(libpq_srcdir) $(CPPFLAGS)
1+
override CPPFLAGS := -I../../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2+
-I$(libpq_srcdir) $(CPPFLAGS)
23
override CFLAGS += $(PTHREAD_CFLAGS)
34

45
override LDFLAGS := -L../../ecpglib -L../../pgtypeslib -L../../../libpq $(LDFLAGS)

0 commit comments

Comments
 (0)