3 ms·
There are several wrong things with that post. First of the PKG_CHECK_MODULES macro checks that pkg-config is present on the system and presents a nice error me
by bjourne 14y ago
There are several wrong things with that post. First of the PKG_CHECK_MODULES macro checks that pkg-config is present on the system and presents a nice error message if it isn't. Second, PKG_CHECK_MODULES can be used to specify several dependencies:
PKG_CHECK_MODULES(DEP, foo udev >= 999 neverhere)
Then if one or more of the dependencies aren't met, all problems are shown:
Package foo was not found in the pkg-config search path.
Perhaps you should add the directory containing `foo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'foo' found
Requested 'udev >= 999' but version of udev is 175
Package neverhere was not found in the pkg-config search path.
Perhaps you should add the directory containing `neverhere.pc'
to the PKG_CONFIG_PATH environment variable
No package 'neverhere' found
It may not seem like much, but for someone not used to compiling stuff from source it means a lot that all missing dependencies are shown at once. A sloppy shell script to check for the same dependencies would mean that the user would first see "foo not found" and go and download that package, then "udev >= 175 required" and when that is fixed the third error and so on.
Also, the error message "You can download mono from www.go.mono.com" isn't very useful for most Linux users. The correct remedy on distros that ship with devel packages is to figure out the name of the package that supplies the include headers and pkg-config file and istall that. pkg-configs error message aren't that great either, but at least they are easily recognizable.
In my opinion, autoconf is a very misguided build system. It is designed so that it should have no other requirements on the compiling users system other than a POSIX environment, a shell and a C compiler. It is a completely unnecessary constraint because nowadays everyone is able to install great languages like Python, Ruby, Scheme and many others much more suitable for writing build configuration systems than shell script. There is no point anymore in using the M4 language to generate a 1000 line configure script when a 50 line Python/Ruby/$OtherNiceScriptingLanguage would work just as well.
- klodolph 14y ago> It is a completely unnecessary constraint because nowadays everyone is able to install great languages like Python, Ruby, Scheme and many others much more suitable for writing build configuration systems than shell script. There is no point anymore in using the M4 language to generate a 1000 line configure script when a 50 line Python/Ruby/$OtherNiceScriptingLanguage would work just as well. First, autoconf isn't a build system. It's just a 'configure' script generator. It's nice that the configuration script runs anywhere you can find a POSIX environment. It's not actually that hard, either; it mostly just runs commands and checks the result code. The bulk of the knowledge stored in autoconf is the knowledge of how to write those tests, which tests are necessary, and what flags you need on various platforms. I think the big problem here is not that the configure script is a portable shell script, but rather, that it's generated by an M4 script. Don't forget that Python itself has a configure script, and writing the configure script in Python would create a bootstrapping problem (it would add Python to the list of programs that need to be cross-compiled on new systems).