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
  • #57

Closed
Open
Opened Oct 08, 2020 by Linus@nidan

Reordering of arguments specified in the pkg-config.pc file.

pkg-config --version
0.29.2
cat app.pc:
prefix=/opt/app
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${exec_prefix}/include

Name: app
Description: app lib
Version: 0
Libs: -L ${libdir} -l app -Wl,-rpath=${libdir}
Cflags: -I${includedir}
pkg-config --cflags app
-I/opt/app/include

Changing the Cflags line to: Cflags: -I ${includedir} that is, with a space between -I and the path, causes the following, (arguments reordered):

pkg-config --cflags app
/opt/app/include -I

Considering that both POSIX and gcc specify -I<SPACE>path as valid command line arguments for the c99/gcc commands respectivly, I consider this to be a bug.

POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html

c99 [options...] pathname [[pathname] [-I directory]
       [-L directory] [-l library]]... 
...
-I  directory

GCC: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options

3.16 Options for Directory Search

These options specify directories to search for header files, for libraries and for parts of the compiler:

-I dir
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
Reference: pkg-config/pkg-config#57