Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pkg-config #9777

Open
thielema mannequin opened this issue Mar 5, 2011 · 7 comments
Open

Support for pkg-config #9777

thielema mannequin opened this issue Mar 5, 2011 · 7 comments
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular llvm-tools All llvm tools that do not have corresponding tag

Comments

@thielema
Copy link
Mannequin

thielema mannequin commented Mar 5, 2011

Bugzilla Link 9405
Version 2.8
OS All
CC @sylvestre

Extended Description

I would very like to have support for the pkg-config tool, since that is directly supported by Haskell's build system Cabal.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 25, 2013

Is there no .pc file because there is no interest from the developpers or is it because no one volonteered to do it? In the latter case, I'll do it there is an interest to merge it in the source tree.

@thielema
Copy link
Mannequin Author

thielema mannequin commented Jan 19, 2014

I came up with the following bash script that writes a pc file to stdout. The pc file addresses the LLVM shared object.

$ cat make-pkg-config.sh
version=$(llvm-config --version)

echo Name: LLVM
echo Description: Low-level Virtual Machine compiler framework

We keep the initial numeric part of a version number.

I.e. a suffix like 'svn' or 'rc' will be removed.

This way Cabal can match on version ranges.

echo Version: $(echo ${version} | sed 's/([0-9.]+).*/\1/')
echo URL: http://www.llvm.org/
echo Requires:
echo Conflicts:
echo Libs: -L$(llvm-config --libdir) -lLLVM-${version}
echo Cflags: -I$(llvm-config --includedir)

@thielema
Copy link
Mannequin Author

thielema mannequin commented Mar 11, 2014

I have written a Haskell program that performs almost the same as the given shell script:
http://hackage.haskell.org/package/llvm-pkg-config

You may install it with
$ cabal install llvm-pkg-config

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@illiliti
Copy link

illiliti commented May 2, 2022

Hello? Are devs still interested in supporting pkg-config or it's dead end?

@tristan957
Copy link

I think this is the right place to discuss this.

I am currently using libclang + Meson. I use libclang with the compile_commands.json that Meson generates (Awesome stuff by the way!), but I continually get errors parsing code about standard library headers not being found (fatal error: 'stdbool.h' file not found). After discovery, I have found that these headers are located in /usr/lib64/clang/14.0.5/include on my system, but for some reason libclang doesn't have this path in its automatic includes.

Yesterday I discovered that if one is using CMake to get access to libclang, libclang provides a CLANG_INCLUDE_DIRS macro which includes the aforementioned path.

It would be great if libclang could provide a pkg-config file that exposes this parameter in a build-system agnostic way.

Otherwise, I am stuck trying to parse the path from clang -Wp,-v -x c /dev/null -fsyntax-only, unless someone knows of a different way to access this path.

@tristan957
Copy link

Apparently CLANG_INCLUDE_DIRS is not what I want, what the hell...

@tstellar
Copy link
Collaborator

This also came up here: #58984.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

5 participants