aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Lebedev <lebdron@gmail.com>2020-09-24 22:29:13 +0300
committerGitHub <noreply@github.com>2020-09-24 12:29:13 -0700
commit8d4fd6df85e94e8658f512418027ff7d66857b15 (patch)
treeee0a30c0f000afbaa6205ed3dc3edaa1c5111e49
parentc6fbdb0c5d03429e40b8990e1637b57290a283f3 (diff)
downloadvcpkg-8d4fd6df85e94e8658f512418027ff7d66857b15.tar.gz
vcpkg-8d4fd6df85e94e8658f512418027ff7d66857b15.zip
[vcpkg, libpq] separate static and shared library installations (#13491)
* [vcpkg] add missing Makefile flag for install step Signed-off-by: Andrei Lebedev <lebdron@gmail.com> * [libpq] add custom Makefile to install only required targets Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
-rw-r--r--ports/libpq/CONTROL2
-rw-r--r--ports/libpq/Makefile34
-rw-r--r--ports/libpq/portfile.cmake10
-rw-r--r--scripts/cmake/vcpkg_build_make.cmake2
4 files changed, 43 insertions, 5 deletions
diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL
index e42dd5f5e..ab2447379 100644
--- a/ports/libpq/CONTROL
+++ b/ports/libpq/CONTROL
@@ -1,6 +1,6 @@
Source: libpq
Version: 12.2
-Port-Version: 6
+Port-Version: 7
Build-Depends: libpq[bonjour] (osx)
Supports: !uwp
Homepage: https://www.postgresql.org/
diff --git a/ports/libpq/Makefile b/ports/libpq/Makefile
new file mode 100644
index 000000000..4832b503b
--- /dev/null
+++ b/ports/libpq/Makefile
@@ -0,0 +1,34 @@
+subdir = .
+top_builddir = .
+include src/Makefile.global
+
+.NOTPARALLEL:
+
+ifeq ($(LIBPQ_LIBRARY_TYPE), shared)
+LIBPQ_LIB_SUFFIX = _shlib
+endif
+
+ifeq ($(LIBPQ_LIBRARY_TYPE), static)
+LIBPQ_INSTALL_LIBS = install-stlib
+endif
+
+.PHONY: all
+all:
+ $(MAKE) -C src/include MAKELEVEL=0
+ $(MAKE) -C src/common MAKELEVEL=0 libpgcommon$(LIBPQ_LIB_SUFFIX).a
+ $(MAKE) -C src/port MAKELEVEL=0 libpgport$(LIBPQ_LIB_SUFFIX).a
+ $(MAKE) -C src/interfaces/libpq MAKELEVEL=0 all-$(LIBPQ_LIBRARY_TYPE)-lib
+ $(MAKE) -C src/bin/pg_config MAKELEVEL=0
+
+.PHONY: install-stlib
+install-stlib:
+ $(MAKE) -C src/common MAKELEVEL=0 install -o all
+ rm -f '$(DESTDIR)$(libdir)/libpgcommon_shlib.a'
+ $(MAKE) -C src/port MAKELEVEL=0 install -o all
+ rm -f '$(DESTDIR)$(libdir)/libpgport_shlib.a'
+
+.PHONY: install
+install: $(LIBPQ_INSTALL_LIBS)
+ $(MAKE) -C src/include MAKELEVEL=0 install
+ $(MAKE) -C src/interfaces/libpq MAKELEVEL=0 install-lib-$(LIBPQ_LIBRARY_TYPE) install-lib-pc install -o all -o install-lib
+ $(MAKE) -C src/bin/pg_config MAKELEVEL=0 install
diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake
index 3d147104e..4c8f4fa8f 100644
--- a/ports/libpq/portfile.cmake
+++ b/ports/libpq/portfile.cmake
@@ -252,6 +252,8 @@ if(VCPKG_TARGET_IS_WINDOWS)
message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done")
else()
+ file(COPY ${CMAKE_CURRENT_LIST_DIR}/Makefile DESTINATION ${SOURCE_PATH})
+
if("${FEATURES}" MATCHES "openssl")
list(APPEND BUILD_OPTS --with-openssl)
endif()
@@ -274,11 +276,13 @@ else()
--enable-debug
)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ set(ENV{LIBPQ_LIBRARY_TYPE} shared)
+ else()
+ set(ENV{LIBPQ_LIBRARY_TYPE} static)
+ endif()
vcpkg_install_make()
- # instead?
- # make -C src/include install
- # make -C src/interfaces install
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake
index c957fc628..523f0042d 100644
--- a/scripts/cmake/vcpkg_build_make.cmake
+++ b/scripts/cmake/vcpkg_build_make.cmake
@@ -80,7 +80,7 @@ function(vcpkg_build_make)
# Set make command and install command
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f Makefile ${_bc_BUILD_TARGET})
set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j 1 -f Makefile ${_bc_BUILD_TARGET})
- set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR})
+ set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} -f Makefile install DESTDIR=${CURRENT_PACKAGES_DIR})
endif()
# Since includes are buildtype independent those are setup by vcpkg_configure_make