Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
pkg-config
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 56
    • Issues 56
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pkg-config
  • pkg-config
  • Issues
  • #7

Closed
Open
Created Mar 17, 2018 by Bugzilla Migration User@bugzilla-migration

pkg-config --cflags returns cflags from Requires.private

Submitted by Xavier Claessens @xclaesse

Assigned to pkg..@..op.org

Link to original bug (#105572)

Description

For example, libsoup-2.4.pc has Requires.private libxml2

$ pkg-config --cflags libsoup-2.4 returns "-I/usr/include/libxml2"

$ pkg-config --libs libsoup2.4 does not include -lxml2

$ pkg-config --libs --static libsoup2.4 does include -lxml2

That means that if I'm compiling an app that uses libsoup I have to install header files for libxml2 even if I don't use them. There is currently no way to tell in a .pc file that libfoo needs libbar when static linking but does not exposes libbar into its API.

This behaviour seems intentional from that commit [1] for bug [2].

If I understand correctly the reason is to support case where libfoo exposes libbar in its API but does not need to link to it. So there are 2 valid use cases but only one of them is possible to express. There is a long discussion about this in a Meson issue[3].

My suggestion:

  1. Keep Requires.private behaviour unchanged, for backward compatibility. Consider it deprecated.
  2. Add Requires.cflags to mean only pull cflags from those deps, not libs. Maybe pull their libs with --static?
  3. Add Requires.private-libs to mean only pull libs from those deps when with --static.

[1] https://cgit.freedesktop.org/pkg-config/commit/pkg.c?id=0936824bf02c604457147af1858ae6f5b504155f [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340904 [3] https://github.com/mesonbuild/meson/pull/3251

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None