Skip to content

wrong pkgconfig content when cross compile with sysroot #132

@jacky-lau-1

Description

@jacky-lau-1

Describe the bug
I cross compile libcups with sysroot, I must use a CFLAGS with sysroot, otherwise configure will failed:

checking for inflateCopy in -lz... no
configure: error: Sorry, this software requires ZLIB 1.1 or higher.

I must use PKG_CONFIG_ALLOW_SYSTEM_LIBS=1, otherwise build will failed. But if I set the PKG_CONFIG_xxx environment variable, the cups3.pc has an unexpected content:

Lib.private: -L/tmp/mysysroot/usr/lib -lavahi-common -lavahi-client -lz -lm -lpthread

To Reproduce
Steps to reproduce the behavior:

  1. Extract the tar file and enter the source directory
  2. run ./configure --host=aarch64-linux-gnu
  3. configure will failed
  4. export CFLAGS="--sysroot=/tmp/mysysroot"
  5. run ./configure --host=aarch64-linux-gnu
  6. configure will successful and the cups3.pc don't have the unexpected content
  7. run make, neither pdfio nor libcups can't find the depend libraries
  8. export PKG_CONFIG_LIBDIR=/tmp/mysysrot/usr/lib/pkgconfig
  9. export PKG_CONFIG_SYSROOT_DIR=/tmp/mysysroot
  10. export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
  11. run ./configure --host=aarch64-linux-gnu
  12. configure will successful but the cups3.pc don't have the unexpected content
  13. run make, both pdfio and libcups build sucessful.

Expected behavior
the cups3.pc shoud be:
Lib.private: -lavahi-common -lavahi-client -lz -lm -lpthread

System Information:

  • OS: Ubuntu 22.04 LTS
  • Version libcups3.0rc4

Metadata

Metadata

Assignees

Labels

investigatingInvestigating the issueplatform issueIssue is specific to an OS or desktop

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions