aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-07-20 01:16:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-07-20 01:16:57 +0000
commit5652ea703b20d92837d735f2253570eb96f2be91 (patch)
tree6350169df5362b3246d20ed909c7b40da4c2572c /src
parent9dc842f0832fd71eda826349a0c17ecf8ae93b84 (diff)
downloadpostgresql-5652ea703b20d92837d735f2253570eb96f2be91.tar.gz
postgresql-5652ea703b20d92837d735f2253570eb96f2be91.zip
Make pg_regress.c get paths from pg_config_paths.h, instead of -D
switches passed from the Makefile. This looks like it will fix problem with virtual vs real paths under msys.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/GNUmakefile16
-rw-r--r--src/test/regress/pg_regress.c11
2 files changed, 15 insertions, 12 deletions
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index 792ff4a98fc..cb22a1c55c6 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -6,7 +6,7 @@
# Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.60 2006/07/19 17:02:59 tgl Exp $
+# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.61 2006/07/20 01:16:57 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -35,10 +35,7 @@ NOLOCALE += --no-locale
endif
# stuff to pass into build of pg_regress
-EXTRADEFS = '-DPGBINDIR="$(bindir)"' \
- '-DLIBDIR="$(libdir)"' \
- '-DPGSHAREDIR="$(datadir)"' \
- '-DHOST_TUPLE="$(host_tuple)"' \
+EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
'-DMAKEPROG="$(MAKE)"' \
'-DSHELLPROG="$(SHELL)"'
@@ -53,9 +50,12 @@ all: submake-libpgport pg_regress$(X)
pg_regress$(X): pg_regress.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
-# depend on Makefile.global to ensure that symbol changes propagate
-pg_regress.o: pg_regress.c $(top_builddir)/src/Makefile.global
- $(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRADEFS) -c -o $@ $<
+# dependencies ensure that path changes propagate
+pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -I$(top_builddir)/src/port $(EXTRADEFS) -c -o $@ $<
+
+$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
+ $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
install: pg_regress$(X)
$(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index ad3d0cd3e1b..bd80cf75355 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.5 2006/07/19 17:02:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.6 2006/07/20 01:16:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,6 +25,7 @@
#include <unistd.h>
#include "getopt_long.h"
+#include "pg_config_paths.h"
#ifndef WIN32
#define PID_TYPE pid_t
@@ -51,9 +52,11 @@ typedef struct _resultmap
} _resultmap;
/*
- * Values inserted from Makefile. (It might seem tempting to get the paths
- * via get_share_path() and friends, but that's not going to work because
- * pg_regress is typically not executed from an installed bin directory.)
+ * Values obtained from pg_config_paths.h and Makefile. (It might seem
+ * tempting to get the paths via get_share_path() and friends, but that's
+ * not going to work because pg_regress is typically not executed from an
+ * installed bin directory. In any case, for our purposes the configured
+ * paths are what we want anyway.)
*/
static char *bindir = PGBINDIR;
static char *libdir = LIBDIR;