aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-10-20 21:04:27 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-10-20 21:04:27 +0000
commit805e431a3868ac71681316927403d1ba389e113b (patch)
treee20ff81ccb4be79cbd43e87cf76f33ee5fb1887d /src/interfaces
parent039f3f1b051b189e7ccf0c28d86d415e693ee8d6 (diff)
downloadpostgresql-805e431a3868ac71681316927403d1ba389e113b.tar.gz
postgresql-805e431a3868ac71681316927403d1ba389e113b.zip
Add support for VPATH builds, that is, building somewhere else than in the
source directory. This involves mostly makefiles using $(srcdir) when they might have used ".". (Regression tests don't work with this, yet.) Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword in most places, to preserve necessary flags even when the user overrode the flags.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/lib/Makefile4
-rw-r--r--src/interfaces/ecpg/preproc/Makefile2
-rw-r--r--src/interfaces/libpgeasy/Makefile4
-rw-r--r--src/interfaces/libpgtcl/Makefile4
-rw-r--r--src/interfaces/libpq++/Makefile25
-rw-r--r--src/interfaces/libpq/Makefile6
-rw-r--r--src/interfaces/odbc/GNUmakefile22
7 files changed, 26 insertions, 41 deletions
diff --git a/src/interfaces/ecpg/lib/Makefile b/src/interfaces/ecpg/lib/Makefile
index 591a286f0e9..9d150abb4e8 100644
--- a/src/interfaces/ecpg/lib/Makefile
+++ b/src/interfaces/ecpg/lib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.9 2000/09/19 11:47:13 meskes Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.10 2000/10/20 21:04:05 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ NAME= ecpg
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 2.0
-CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)
+override CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index b2ab66ef342..048a13080cf 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -6,7 +6,7 @@ MAJOR_VERSION=2
MINOR_VERSION=8
PATCHLEVEL=0
-CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
+override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
-DINCLUDE_PATH=\"$(includedir)\"
diff --git a/src/interfaces/libpgeasy/Makefile b/src/interfaces/libpgeasy/Makefile
index 02a04cdb9b4..ae0e7ff78e6 100644
--- a/src/interfaces/libpgeasy/Makefile
+++ b/src/interfaces/libpgeasy/Makefile
@@ -2,7 +2,7 @@
#
# Makefile for src/interfaces/libpgeasy
#
-# $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile,v 1.3 2000/09/17 13:02:48 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile,v 1.4 2000/10/20 21:04:07 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ NAME= pgeasy
SO_MAJOR_VERSION= 2
SO_MINOR_VERSION= 1
-CPPFLAGS += -I$(libpq_srcdir)
+override CPPFLAGS += -I$(libpq_srcdir)
OBJS= libpgeasy.o halt.o
diff --git a/src/interfaces/libpgtcl/Makefile b/src/interfaces/libpgtcl/Makefile
index a20970c098a..95894cc65d3 100644
--- a/src/interfaces/libpgtcl/Makefile
+++ b/src/interfaces/libpgtcl/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.22 2000/09/25 22:23:00 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.23 2000/10/20 21:04:10 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ NAME= pgtcl
SO_MAJOR_VERSION= 2
SO_MINOR_VERSION= 1
-CPPFLAGS += -I$(libpq_srcdir)
+override CPPFLAGS += -I$(libpq_srcdir)
OBJS= pgtcl.o pgtclCmds.o pgtclId.o
diff --git a/src/interfaces/libpq++/Makefile b/src/interfaces/libpq++/Makefile
index 8c4afddad56..1d5b82e174d 100644
--- a/src/interfaces/libpq++/Makefile
+++ b/src/interfaces/libpq++/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.25 2000/09/17 13:02:50 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.26 2000/10/20 21:04:12 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,8 +16,7 @@ NAME= pq++
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 1
-SRCHEADERDIR = $(top_srcdir)/src/include
-CXXFLAGS+= -I$(SRCHEADERDIR) -I$(libpq_srcdir)
+override CPPFLAGS += -I$(libpq_srcdir)
OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o
@@ -29,35 +28,29 @@ endif
# For CC on IRIX, must use CC as linker/archiver of C++ libraries
ifeq ($(PORTNAME), irix5)
- ifeq ($(CXX), CC)
+ ifneq ($(GXX), yes)
AR := CC
AROPT := -ar -o
LD := CC
endif
endif
# Same for Solaris with native compiler
-ifeq ($(PORTNAME), solaris_sparc)
- ifeq ($(CXX), CC)
- AR := CC
- AROPT := -xar -o
- LD := CC
- endif
-endif
-ifeq ($(PORTNAME), solaris_i386)
- ifeq ($(CXX), CC)
+ifeq ($(PORTNAME), solaris)
+ ifneq ($(GXX), yes)
AR := CC
AROPT := -xar -o
LD := CC
endif
endif
+
all: all-lib
# Shared library stuff
-include $(top_builddir)/src/Makefile.shlib
+include $(top_srcdir)/src/Makefile.shlib
# Pull shared-lib CFLAGS into CXXFLAGS
-CXXFLAGS+= $(CFLAGS_SL)
+override CXXFLAGS+= $(CFLAGS_SL)
.PHONY: examples
@@ -88,7 +81,7 @@ clean distclean maintainer-clean: clean-lib
dep depend:
- $(CXX) -MM $(CXXFLAGS) *.cc >depend
+ $(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) *.cc >depend
ifeq (depend,$(wildcard depend))
include depend
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 66bf3af1069..a34b22746e6 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.44 2000/10/20 03:45:35 tgl Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.45 2000/10/20 21:04:11 petere Exp $
#
#-------------------------------------------------------------------------
@@ -17,7 +17,7 @@ NAME= pq
SO_MAJOR_VERSION= 2
SO_MINOR_VERSION= 1
-CFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"'
+override CPPFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"'
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON)
@@ -77,7 +77,7 @@ installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
uninstall: uninstall-lib
- rm -f $(addprefix ($DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h)
+ rm -f $(addprefix $(DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h)
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS) dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c
diff --git a/src/interfaces/odbc/GNUmakefile b/src/interfaces/odbc/GNUmakefile
index a51f71899ac..ab849fbbc7a 100644
--- a/src/interfaces/odbc/GNUmakefile
+++ b/src/interfaces/odbc/GNUmakefile
@@ -2,7 +2,7 @@
#
# GNUMakefile for psqlodbc (Postgres ODBC driver)
#
-# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.4 2000/09/18 20:11:37 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.5 2000/10/20 21:04:13 petere Exp $
#
#-------------------------------------------------------------------------
@@ -15,7 +15,7 @@ NAME = psqlodbc
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 26
-CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
+override CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
@@ -35,23 +35,15 @@ LDFLAGS_SL+= $(LDFLAGS_ODBC)
odbc_headers = isql.h isqlext.h iodbc.h
odbc_includedir = $(includedir)/iodbc
-install: all installdirs install-headers install-ini install-lib install-data
+install: all installdirs
+ for i in $(odbc_headers); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done
+ $(INSTALL_DATA) $(srcdir)/odbcinst.ini $(DESTDIR)$(odbcinst_ini_dir)/odbcinst.ini
+ $(INSTALL_DATA) $(srcdir)/odbc.sql $(DESTDIR)$(datadir)/odbc.sql
+ $(MAKE) install-lib
installdirs:
$(mkinstalldirs) $(DESTDIR)$(odbc_includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir) $(DESTDIR)$(datadir)
-.PHONY: install-headers
-install-headers: $(odbc_headers)
- for i in $^; do $(INSTALL_DATA) $$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done
-
-.PHONY: install-ini
-install-ini: odbcinst.ini
- $(INSTALL_DATA) $< $(DESTDIR)$(odbcinst_ini_dir)/$<
-
-.PHONY: install-data
-install-data: odbc.sql
- $(INSTALL_DATA) $< $(DESTDIR)$(datadir)/$<
-
uninstall: uninstall-lib
rm -f $(addprefix $(DESTDIR)$(odbc_includedir)/, $(odbc_headers))
rm -f $(DESTDIR)$(datadir)/odbc.sql