Discussion:
machine-dependent header installation path
Thomas Klausner
2014-05-18 11:18:55 UTC
Permalink
Hi!

I'm co-developing libzip (www.nih.at/libzip). During configury, the
library detects types of sizes 8, 16, 32 and defines zip_{u,}intX_t
dependent on that, which is then used in all places that need fixed
sized integers.

These defines are saved in a file "zipconf.h" which is used by the
installed zip.h header file.

I remember reading years ago that such machine-dependent header files
should not be installed in include/, but below lib/, so that include/
can be shared between all kinds of machines. That's the reason
zipconf.h is currently installed into
$PREFIX/lib/libzip/include/zipconf.h. A pkg-config file helps users
find the library headers.

Ok, long story short: users are asking why we're installing in this
"weird" path, and I couldn't find the rationale I was remembering any
longer. Can you someone point me to it?

Or do I misremember or had misunderstood something? If so, what are
the current best practices for where to install such a header file?

Thanks,
Thomas
Ralf Corsepius
2014-05-18 15:59:43 UTC
Permalink
Post by Thomas Klausner
Hi!
I'm co-developing libzip (www.nih.at/libzip). During configury, the
library detects types of sizes 8, 16, 32 and defines zip_{u,}intX_t
dependent on that, which is then used in all places that need fixed
sized integers.
These defines are saved in a file "zipconf.h" which is used by the
installed zip.h header file.
I remember reading years ago that such machine-dependent header files
should not be installed in include/, but below lib/, so that include/
can be shared between all kinds of machines. That's the reason
zipconf.h is currently installed into
$PREFIX/lib/libzip/include/zipconf.h. A pkg-config file helps users
find the library headers.
Ok, long story short: users are asking why we're installing in this
"weird" path, and I couldn't find the rationale I was remembering any
longer. Can you someone point me to it?
To cut a long story short: In a multilib'ed compilation environment all
files below /usr/include must be identical on all architectures.
Post by Thomas Klausner
Or do I misremember or had misunderstood something? If so, what are
the current best practices for where to install such a header file?
${libdir}/<pkg>/<somewhere> is a perfectly suitable choice, because in a
multilib'ed environment, ${libdir} is architecture-dependent.

Ralf

Loading...