您的位置:首页 > 其它

Using pkg-config to detect libraries installed using homebrew

2016-06-22 11:28 525 查看
http://flummox-engineering.blogspot.com/2015/01/osx-cmake-no-package-gnutls-found.html


Using pkg-config to detect libraries installed using homebrew

If you are trying to link to a library installed via Homebrew, I suggest reading
this article.

Whilst trying to build OpenVAS on OSX, I encounter this message. 

Package gnutls was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnutls.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnutls' found
Package gnutls was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnutls.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnutls' found


This is surprising because I have the latest version of GnuTLS installed viaHomebrewpkg-config cannot find it though

$ pkg-config --cflags gnutls


Package gnutls was not found in the pkg-config search path.

Perhaps you should add the directory containing `gnutls.pc'

to the PKG_CONFIG_PATH environment variable

No package 'gnutls' found

Add the pkg-config configuration file /usr/local/opt/gnutls/lib/pkgconfig/gnutls.pc to PKG_CONFIG_PATH and now pkg-config will be able to locate it

$ PKG_CONFIG_PATH=/usr/local/opt/gnutls/lib/pkgconfig pkg-config --cflags gnutls
Package libtasn1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtasn1.pc'
to the PKG_CONFIG_PATH environment variable


Not so fast! GNuTLS itself has a couple of dependencies. You can either install them:

$ brew install libtasn1 p11-kit


Or in my case they had been installed, but not properly linked by homebrew:

$ brew link libtasn1 p11-kit


Now pkg-config can locate the GnuTLS library and header files

$ PKG_CONFIG_PATH=/usr/local/opt/gnutls/lib/pkgconfig pkg-config --cflags gnutls
-I/usr/local/Cellar/gnutls/3.1.10/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/p11-kit/0.18.4/include/p11-kit-1 







Related articles

JHBuild (wiki.archlinux.org)
Environment
Variables Considered Harmful for Your Secrets (movingfast.io)
Organizing
Your Clojure Environment and Logs with Leiningen (8thlight.com)
ModSecurity
Advanced Topic of the Week: Detecting Malware with Fuzzy Hashing (spiderlabs.com)
Environment
variables (rosettacode.org)
Blog
Post: [Script Of Dec. 16] How to check for duplicate paths in PATH environment variable (blogs.technet.com)
Uhhh,
I fucked up cmd (gbatemp.net)
PyCmd:
a smarter command line? (betanews.com)

Posted 9th January 2015 by Hanxue
Lee

Labels: automake cmake OSX
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: