0
votes

Nowdays I'm just trying to build libsamperate from source using MSYS on Windows, but i meet a configure checking problem I've installed FFTW & libsndfile before, their include files lib files and pkg-config files are all in the right place, but when I use sh ./configure to generate makefile for libsamprate the output always mentions

checking for pkg-config... no
checking for SNDFILE... no

I also set the PKG_CONFIG_PATH(usr/local/lib/pkgconfig) and tried many times but the result seems the same

Does anyone knows anything about this?

1
The configure script leaves a config.log file behind that lists the exact checks that were done and any error messages they produced. It's rather big, but have a look at it and try to find the section relevant to the pkg-config test (since it didn't find pkg-config, it couldn't possibly find SNDFILE either, so don't care for that check yet). If it won't give you a clue what is not set up correctly, try to add the relevant bit to the question.Jan Hudec
I've checked the log file, but it seems not so useful information...Hugo
Could you explain something about how does sh.exe search for the 3rd party library?Hugo
sh.exe does not search for 3rd party library. configure script (which is interpreted by sh.exe) does. Besides you are not interested in how it searches for library (asks pkg-config (if the library uses it, but yours seems to)), but in how it searches for pkg-config (it didn't find it, so it than couldn't ask it where the library is installed). Well, it simply tries to run pkg-config (pkg-config.exe). If it's not in PATH, it won't find it.Jan Hudec
Thank you very much ! :)Hugo

1 Answers

-1
votes

As mentioned in comments, your environment is not set up to run the pkg-config executable. There are many problems associated with pkg-config, and it has become increasingly popular to suggest that the correct solution is to stop using it completely. Unfortunately, if you are trying to install a package that does use pkg-config, you are not in a position to use that solution. The closest you can get is to set PKG_CONFIG to 'true' or ':' in your environment. This causes pkg-config to emit no output but always return true when it is run, so you need to specify locations of libraries and headers via the standard mechanisms (LDFLAGS, etc.).

pkg-config is great in that it allows a user (someone installing the package) to be ignorant of the standard flags. The problem with pkg-config is that it allows the users to be ignorant.

As a package maintainer, you should stop using pkg-config. As a user, you should either set PKG_CONFIG=: in your environment or in a config.site, or get in the habit of invoking configure with PKG_CONFIG=: as an argument. (If you are using packages that rely on ancient autoconf in which you cannot pass such flags as an argument, I'm not sure what the appropriate action is, but suggesting that the package maintainer upgrade is probably not a bad idea.)