From: Jakub Jirutka Date: Mon, 08 Nov 2021 14:56:33 +0100 Subject: [PATCH] Allow to install interfaces headers and server headers separately Don't install headers of the interfaces (libpq and libecpg) by the install target, allow to install them separately from the headers needed for server. We need this for two reasons: a. Allow building PostgreSQL server with LDAP support, but libpq without dependency on LDAP. b. Allow building/installing PostgreSQL server without the interfaces. This is used for non-default postgresql aports (older versions of PostgreSQL) - we want to provide just one version of libpq and libecpg library provided by the default (newest) postgresql aport. diff --git a/src/include/Makefile b/src/include/Makefile index 62e222c..836330b 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -26,8 +26,10 @@ SUBDIRS = access archive bootstrap catalog commands common datatype \ port/win32_msvc/sys port/win32/arpa port/win32/netinet \ port/win32/sys portability -# Install all headers -install: all installdirs +# Install server headers +install: install-server +install-interfaces: all + $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq' # These headers are needed by the public headers of the interfaces. $(INSTALL_DATA) $(srcdir)/postgres_ext.h '$(DESTDIR)$(includedir)' $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h '$(DESTDIR)$(includedir)/libpq' @@ -40,6 +42,8 @@ install: all installdirs $(INSTALL_DATA) $(srcdir)/postgres_fe.h '$(DESTDIR)$(includedir_internal)' $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h '$(DESTDIR)$(includedir_internal)/libpq' $(INSTALL_DATA) $(srcdir)/libpq/protocol.h '$(DESTDIR)$(includedir_internal)/libpq' +install-server: all + $(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS)) # These headers are needed for server-side development $(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir_server)' $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)' @@ -58,10 +62,6 @@ ifeq ($(vpath_build),yes) endif $(MAKE) -C catalog install -installdirs: - $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq' - $(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS)) - uninstall: rm -f $(addprefix '$(DESTDIR)$(includedir)'/, pg_config.h pg_config_os.h pg_config_manual.h postgres_ext.h libpq/libpq-fs.h)