I am trying to build a library with a different build system, but files in the library require a config.h
header file that is generated after running the configure scripts generated by autoconf.
This is the sequence of steps I am following to try and generate the config.h
file that is needed
autoreconf -ivf
./configure --disable-dependency-tracking
The build system guarantees that the library gflags
will be linked and the headers will be available at preprocessing time. But the configure
script exits with the following error
configure: error: Please install google-gflags library
Is there some way I can get the list of required libraries (such as gflags) and then pass arguments to the configure script that tells it to assume that this library exists on the system? I went through the help output for both autoreconf
and ./configure
and wasn't able to figure this out.
Sorry for the long explanation and problem. I am very new to autoconf
, etc.
The answer to your question is: no, it is not possible to get a list of dependencies from autotools.
Why?
Well, autotools doesn't track dependencies at all. Instead, it checks whether specific features are present on the system (e.g. a given header-file; or a given library file). Now a specific header file can come from a variety of sources, e.g. depending on your distribution the
foo.h
header can be installed vialibfoo-dev
(Debian and derivatives)foo-devel
(Fedora)foo
(upstream)In your specific case, the maintainers of your project output a nice error message telling you to install a given package by name.
The maintainers of your project also chose to abort with a fatal error if a given dependency is not available. The reason might well be, that the project simply won't work without that dependency, and that is impossible to compile the program without it.
Example
Your project might be written in
C++
and thus require aC++
-compiler. Obviously there is little use in passing some flags to ./configure so it assumes that there is a C++-compiler available if in reality there is none.There is hope
However, not all is bad. Your
configure
script might will have the ability to disable certain features (that appear to be hard requirements by default).Just check
./configure --help
and look for flags like--enable-FOO
--disable-FOO
--with-BAR
--without-BAR
automation?
One thing to know about autotools, is that
configure
really is a program (the source-code beingconfigure.ac
) written in some arcane programming language (involvingbash
andm4
), This means that it can practically have any behavior, and there is no single standard way to achieve "dependecy tracking".