projects/aports·blob master · refs

52 lines · 2.4 KiB

1From: Jakub Jirutka <[email protected]>
2Date: Mon, 08 Nov 2021 14:56:33 +0100
3Subject: [PATCH] Allow to install interfaces headers and server headers separately
4
5Don't install headers of the interfaces (libpq and libecpg) by the install
6target, allow to install them separately from the headers needed for server.
7We need this for two reasons:
8
9a. Allow building PostgreSQL server with LDAP support, but libpq without
10 dependency on LDAP.
11b. Allow building/installing PostgreSQL server without the interfaces.
12 This is used for non-default postgresql aports (older versions of
13 PostgreSQL) - we want to provide just one version of libpq and libecpg
14 library provided by the default (newest) postgresql aport.
15
16diff --git a/src/include/Makefile b/src/include/Makefile
17index 62e222c..836330b 100644
18--- a/src/include/Makefile
19+++ b/src/include/Makefile
20@@ -26,8 +26,10 @@ SUBDIRS = access archive bootstrap catalog commands common datatype \
21 port/win32_msvc/sys port/win32/arpa port/win32/netinet \
22 port/win32/sys portability
23
24-# Install all headers
25-install: all installdirs
26+# Install server headers
27+install: install-server
28+install-interfaces: all
29+ $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'
30 # These headers are needed by the public headers of the interfaces.
31 $(INSTALL_DATA) $(srcdir)/postgres_ext.h '$(DESTDIR)$(includedir)'
32 $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h '$(DESTDIR)$(includedir)/libpq'
33@@ -40,6 +42,8 @@ install: all installdirs
34 $(INSTALL_DATA) $(srcdir)/postgres_fe.h '$(DESTDIR)$(includedir_internal)'
35 $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h '$(DESTDIR)$(includedir_internal)/libpq'
36 $(INSTALL_DATA) $(srcdir)/libpq/protocol.h '$(DESTDIR)$(includedir_internal)/libpq'
37+install-server: all
38+ $(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS))
39 # These headers are needed for server-side development
40 $(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir_server)'
41 $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)'
42@@ -58,10 +62,6 @@ ifeq ($(vpath_build),yes)
43 endif
44 $(MAKE) -C catalog install
45
46-installdirs:
47- $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'
48- $(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS))
49-
50
51 uninstall:
52 rm -f $(addprefix '$(DESTDIR)$(includedir)'/, pg_config.h pg_config_os.h pg_config_manual.h postgres_ext.h libpq/libpq-fs.h)