pkg-config: Add sysroot prefix

Submitted by Daniel Stone on Sept. 27, 2017, 5:16 p.m.

Details

Message ID 20170927171622.14856-1-daniels@collabora.com
State New
Headers show
Series "pkg-config: Add sysroot prefix" ( rev: 1 ) in XCB

Not browsing as part of any series.

Commit Message

Daniel Stone Sept. 27, 2017, 5:16 p.m.
xcb-proto's pkg-config file exports static file paths for where to find
its Python files and the XML definitions.

When used to discover cflags, library paths, etc, pkg-config will
prepend ${PKG_CONFIG_SYSROOT_DIR}, if any, to those paths. This makes
the use of a sysroot prefix transparent to users. However, since it
doesn't know about paths in custom variables, it cannot automatically
prefix this.

Adding ${pc_sysrootdir} to these absolute paths makes the behaviour
match, and XCB builds work out of the box in a sysroot.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 xcb-proto.pc.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/xcb-proto.pc.in b/xcb-proto.pc.in
index d312e6e..a35f0bd 100644
--- a/xcb-proto.pc.in
+++ b/xcb-proto.pc.in
@@ -3,8 +3,8 @@  exec_prefix=@exec_prefix@
 datarootdir=@datarootdir@
 datadir=@datadir@
 libdir=@libdir@
-xcbincludedir=@xcbincludedir@
-pythondir=@pythondir@
+xcbincludedir=${pc_sysrootdir}@xcbincludedir@
+pythondir=${pc_sysrootdir}@pythondir@
 
 Name: XCB Proto
 Description: X protocol descriptions for XCB

Comments

Daniel Stone <daniels@collabora.com> writes:

> xcb-proto's pkg-config file exports static file paths for where to find
> its Python files and the XML definitions.
>
> When used to discover cflags, library paths, etc, pkg-config will
> prepend ${PKG_CONFIG_SYSROOT_DIR}, if any, to those paths. This makes
> the use of a sysroot prefix transparent to users. However, since it
> doesn't know about paths in custom variables, it cannot automatically
> prefix this.
>
> Adding ${pc_sysrootdir} to these absolute paths makes the behaviour
> match, and XCB builds work out of the box in a sysroot.

Reviewed-by: Eric Anholt <eric@anholt.net>