Re: how to let configure know include and library path for library foo?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sebastien,

On 1/24/2019 8:16 PM, Sébastien Hinderer wrote:
Dear all,

When an autoconf-driven project has a dependency on library foo, what's the
best / recommended way to let users specify the directories for header
files and library files when configuring the project?

I would expect there are different opinions on this. As a user I think the best way is to rely on variables CPPFLAGS, CFLAGS (or CXXFLAGS for C++) and LDFLAGS. If explained in the README it is pretty straightforward for users to e.g. call

./configure CPPFLAGS=-I/path/to/includedir

or similarly

./configure LDFLAGS=-L/path/to/libdir



For the XWindow system, for instance, there are the --x-includes=DIR
and --x-libraries=DIR options, and also --with-x to enable / disable X.

I assume it's good to also provide three options for each library: one
to let configure know whether it should be enabled or not, i.e. an
equivalent of --with-x,

An option --without-foo is useful if the foo is optional, i.e., it's possible to build and use your package without foo. If foo is required an option --without-foo does not make much sense. I had a use case when a co-maintainer wanted to be able 'make dist' without required dependencies. Not really recommended as I would recommend using 'make distcheck' rather than 'make dist' for that.

Whether you want the default

./configure

behave as

./configure --with-foo

or as

./configure --without-foo

depends very much on the situation and the different cases how to accomplish that is well described in the manual.

Hope that helps,

Peter

  and two options to specify the header and
library directories. But, of course, it is not possible to define
--foo-includes=DIR and --foo-libraries=DIR as is done for X, so is one
supposed to use AC_ARG_VAR to achieve this?

Many thanks in advance for your recommendations,

Sébastien.

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux