pkg-config

Jay Vaughan EMAIL HIDDEN
Sun Jan 22 15:45:50 CET 2012


> Hi, I'm trying to compile ffmpeg-0.9.1 on Mac OS X 10.6 
> and configure returns a "pkg-config not found, library detection may fail."
> Trying to compile/link it anyway gives a "make: *** [libavcodec/x86/imdct36_sse.o] Error 1"

Any of these 'unix' style tools have to be installed on OSX through either (or both) of the ports or fink package management systems, which add debian-style package management to Darwin/OSX.  OSX is *not* Unix - it has no pkg-config onboard (because instead of using pkg-config, Apple 'solved' the whole mess by adding -framework extensions to its compiler; app-bundles and package management are two solutions to the same problem: Apple didn't take the Unix ("just use text files to configure things") route, and instead added .app/Info.plist and so on ..)

On my system with fink installed, pkg-config is in /sw/bin.  On the system with ports, its in /opt/local/bin .. and in either case, pkg-config is hard-coded to get the *.pc files from their respective roots - /opt/local/lib/pkgconfig and /sw/lib/pkgconfig.

Once you find/install pkg-config as a tool through a proper package manager, if you want to make it work with your own "out of tree band" sources, you can usually copy a *.pc file (they're normal text files), give it the name that you expect to use on the arg list (i.e. "pkg-config somepackage" == /sw/lib/pkgconfig/somepackage.pc) and edit the details so that its giving the flags you expect.  This can then be used to install whatever you need to use pkg-config for, originally.

If you don't want to pollute your pristine fink/ports tree, you can install your package with a new temporary --prefix, and then tell pkg-config to use that $PREFIX to find its *.pc files .. I've done this for interesting packages on the odd occasion.

But I fear that, since you don't know yet about pkg-config from ports or fink, you probably don't use ports or fink - and in that case, I'd say: use ports or fink.  In my fink install, anyway, installing libavcodec is as simple as "fink install libavcodec52-dev" and off we go .. 

;
--
Jay Vaughan







More information about the music-bar mailing list