Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] util-linux pkg-config files point to build machine paths
Date: Thu, 1 Mar 2018 10:13:20 +0100	[thread overview]
Message-ID: <20180301101320.671394fe@windsurf.lan> (raw)
In-Reply-To: <CAFOYHZBt8tGfL+vbT=jGLuGoGLp8CUNKjBuJ_Z7ArMTOj7gbJA@mail.gmail.com>

Hello Chris,

On Thu, 1 Mar 2018 14:16:20 +1300, Chris Packham wrote:
> Hi Buildroot,
> 
> I imagine this will end-up on the util-linux mailing-list eventually
> but hopefully someone here can help me formulate an intelligent
> suggestion first.
> 
> If I build one of the libraries from util-linux the generated .pc
> refers to /usr/include instead of ${prefix}/include which makes
> cross-compilation interesting (particularly when the host doesn't have
> those files).
> 
> For example here's uuid.pc
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=/usr/lib
> includedir=/usr/include
> 
> Name: uuid
> Description: Universally unique id library
> Version: 2.31.1
> Requires:
> Cflags: -I${includedir}/uuid
> Libs: -L${libdir} -luuid
> 
> Compare that with zlib.pc
> 
> prefix=/usr
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib
> sharedlibdir=${libdir}
> includedir=${prefix}/include
> 
> Name: zlib
> Description: zlib compression library
> Version: 1.2.11
> 
> Requires:
> Libs: -L${libdir} -L${sharedlibdir} -lz
> Cflags: -I${includedir}
> 
> But the .pc.in files that these were generated from are pretty
> similar. I assume it has something to do with the way these are
> generated. Does anyone have an intelligent suggestion for something to
> propose upstream or should I just patch the pc files after the fact?

The way uuid.pc is written is perfectly fine. See:

thomas at windsurf:~$ cat /usr/lib64/pkgconfig/uuid.pc 
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: uuid
Description: Universally unique id library
Version: 2.30.2
Requires:
Cflags: -I${includedir}/uuid
Libs: -L${libdir} -luuid
thomas at windsurf:~$ cat /usr/lib64/pkgconfig/uuid.pc 
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: uuid
Description: Universally unique id library
Version: 2.30.2
Requires:
Cflags: -I${includedir}/uuid
Libs: -L${libdir} -luuid
thomas at windsurf:~$ pkg-config --cflags uuid
-I/usr/include/uuid 
thomas at windsurf:~$ PKG_CONFIG_SYSROOT_DIR=/foo/bar/ pkg-config --cflags uuid
-I/foo/bar/usr/include/uuid 

I.e, pkg-config doesn't use the ${prefix} variable or anything like
that to prepend the sysroot location. The ${prefix} variable is just a
convenience to make the .pc file easier to read. But the
PKG_CONFIG_SYSROOT_DIR mechanism is independent of that. As you can see
above, despite uuid.pc not using ${prefix}, PKG_CONFIG_SYSROOT_DIR does
work as expected.

Therefore, unless I misunderstood your concern, I believe there is no
need to contact the util-linux guys :-)

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

  reply	other threads:[~2018-03-01  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  1:16 [Buildroot] util-linux pkg-config files point to build machine paths Chris Packham
2018-03-01  9:13 ` Thomas Petazzoni [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-01 10:03 Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301101320.671394fe@windsurf.lan \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox