Skip to content

Commit

Permalink
tools: zlib: do not hardcode the install prefix in zlib.pc
Browse files Browse the repository at this point in the history
Our pkg-config wrapper relies on the ability to redefine the $prefix and
$exec_prefix variables in order to construct proper search paths relative
to the build environment.

Patch the .pc file template to construct libdir, sharedlibdir and includedir
relative to the ${prefix} variable so that it can be overridden as needed.

This also fixes the libxml2/host build issue raised at
openwrt/packages#6073 - it was caused by libxml2's
configure picking up a wrong host search path through zlib.pc, letting it
include the wrong endian.h, causing spurious member redeclaration errors in
system headers.

Signed-off-by: Jo-Philipp Wich <[email protected]>
  • Loading branch information
jow- committed May 24, 2018
1 parent e6b8ce4 commit 4da832e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/zlib/patches/900-overridable-pc-exec-prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/zlib.pc.cmakein
+++ b/zlib.pc.cmakein
@@ -1,8 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@INSTALL_LIB_DIR@
-sharedlibdir=@INSTALL_LIB_DIR@
-includedir=@INSTALL_INC_DIR@
+libdir=${prefix}/lib
+sharedlibdir=${prefix}/lib
+includedir=${prefix}/include

Name: zlib
Description: zlib compression library

0 comments on commit 4da832e

Please sign in to comment.