]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
In pkg-config File, Derive Lib and Include Dir from Prefix at Use-Time 1851/head
authorW. Felix Handte <w@felixhandte.com>
Fri, 25 Oct 2019 19:05:20 +0000 (15:05 -0400)
committerW. Felix Handte <w@felixhandte.com>
Fri, 25 Oct 2019 19:07:31 +0000 (15:07 -0400)
Addresses #1794. Instead of deriving the lib dir and include dir at
build-time, let's do it like everyone else does at pkg-config run-time.

This has the disadvantage that we can no longer override LIBDIR and
INCLUDEDIR in the Makefile and have that reflected in the .pc file.

build/cmake/lib/CMakeLists.txt
lib/Makefile
lib/libzstd.pc.in

index 77b389cae65c5cd8b2ce352ee6ef27601c14ec08..7adca875c529f4bceb6e5c1a0110b161e71df9b7 100644 (file)
@@ -134,11 +134,10 @@ if (UNIX)
     # pkg-config
     set(PREFIX "${CMAKE_INSTALL_PREFIX}")
     set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
-    set(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
     set(VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}")
     add_custom_target(libzstd.pc ALL
             ${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc"
-            -DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}"
+            -DPREFIX="${PREFIX}" -DVERSION="${VERSION}"
             -P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake"
             COMMENT "Creating pkg-config file")
 
index 87a396c53ebd8cc389341e9eb932c5cc01f72753..273ceb90490d422ce99246ea94d3c8adfb7b6004 100644 (file)
@@ -244,8 +244,6 @@ libzstd.pc:
 libzstd.pc: libzstd.pc.in
        @echo creating pkgconfig
        @sed -e 's|@PREFIX@|$(PREFIX)|' \
-             -e 's|@LIBDIR@|$(LIBDIR)|' \
-             -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
              -e 's|@VERSION@|$(VERSION)|' \
              $< >$@
 
index 1d07b91f25ab31323e38576178c189e385fa0f81..e7880be475d0b550ac38831fa54c726144d190cb 100644 (file)
@@ -3,8 +3,9 @@
 #   BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
 
 prefix=@PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${exec_prefix}/lib
 
 Name: zstd
 Description: fast lossless compression algorithm library