autoconf
[Top][All Lists]
Advanced

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

Re: make install : config.h?


From: Guido Draheim
Subject: Re: make install : config.h?
Date: Fri, 26 Jul 2013 11:43:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

Am 24.07.2013 11:39, schrieb LRN:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24.07.2013 11:53, Daniel Pocock wrote:

I've come across a project that is installing config.h when "make
install" is invoked

The project in question is the SRTP library.  Some of the headers are
actually dependent on some config.h stuff, for example:

https://github.com/cisco/libsrtp/blob/master/crypto/include/integers.h

has a lot of conditional logic

The result of including that extra copy of config.h is that when I build
other projects, the compiler has two copies of config.h available and
complains about the redefinition of things like PACKAGE_NAME.  It's
quite possible that there are less obvious side-effects as well.

Can anybody comment on the right way to do this?  Should integers.h
(above) be changed?  Or should other projects using libsrtp find ways to
work around this?
This is wrong. No one should ever install a header named 'config.h'.

If a project must install its config.h, it should install a renamed copy
of it (or rename it altogether and use it under the new name even
internally; 'config' part of 'config.h' is not mandatory, it's just the
usual name).


A "config.h" should not even get installed in a renamed fashion - if two
libraries have these then you will see errors coming up speaking of
"duplicate defintion"s. You will even get subtle differences in library
behaviour when the precompiler definitions in the two installed config.h have a
different value due to a different configure.ac content. I've even seen errors
when a function is defined conditionally on an environment check.

So an explicit pkgconfig.h should try to use some kind of prefix for the
definitions so that you would not try to depend a precompiler-if on the config
value of another project. To make it easier I had written a macro for it that
will take the config.h creating a pkgconfig.h by adding the library name as
a proper prefix, see:

http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html

Or even better, separate config.h into two files - use one internally
(normal config.h), while the other will be both installed and used
internally (sadly, i can't tell you how exactly that can be done;
config.h.in is generated by autoheader, so they will have to either
tinker with autoheader, or just form the second (smaller) header
manually, at least an .in template of it).

- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJR76C3AAoJEOs4Jb6SI2CwbfcIAM4p8Og/fQLLc39nkS5GClFa
j0mJuZOlnFql/Al9oLSZ1O+imfuxqgJ1rmS4InlHmTMMxeWRzvbH2REwMXkIL+Rh
tnE+AgU3JcXjMAYKg/OrGmNZUn8cLosDqe/R149uHgSVRZyKdaygdVoW3q4dc1JI
0Wkhjhp7Rz7qgYhgxBUOnvB7WW4Lb5E3JtWdPuWaWShnA8BeIbKRlnSmqTwLUZ5y
MkN+7umbaqBHUMeSO9Xw2kr0F5Tc85ALw8K7mkOCIvGI4e8GxbcVVxAlR8KshTO5
uVuWpeunoFxivhN17AFW3JNDf6xKBCJrdPthJv/qdo5jCwM7NgWN3YbeRM0N/w0=
=d7+f
-----END PGP SIGNATURE-----

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]