Re: multiarch: arch dependent header file path choice
Am 28.06.2014 19:44, schrieb Osamu Aoki:
> The path for the arch dependent header file seems to have several options.
> 1) /usr/include/<multiarch>/*.h
> 2) /usr/include/<multiarch>/<packagename>/*.h
> 3) /usr/lib/<multiarch>/<packagename>/include/*.h
> I would like to know rationale for each choice, especially between 2 and 3.
1) has the advantage that it is found in the standard include path.
3) is a cheap work around for packages installing everything
into a common prefix and then either providing symlinks in
other places or forcing users to rely on pkg-config or other
methods to find files.
You are missing 1b) /usr/include/<packagename>/*.h
There should almost be no issues for packages putting header files directly in
/usr/include or /usr/include/<multiarch>. Yes, there are some dumb tests
checking for the existence of files in a certain path which will break.
Packages installing header files in /usr/include/<packagename> usually need a
knowledge of the include path, and you'll break things just moving all header
files or a part of it to /usr/include/<multiarch>/<packagename>, because
depending packages expect that only one include path is sufficient. The solution
here is to use a fake header in /usr/include/<packagename> which includes the
appropriate header in /usr/include/<multiarch>/<packagename>. python2.7's and
python3.4's pyconfig.h file is such an example. But even here you find
configure checks to grep pyconfig.h for certain features which break which such
kind of setup ... and of course it needs updates for new architectures.
> I am sure they all are functioning choice but intriguing to see choice 3.
> (I was looking for the typedef of gsize in gobject header files in
> /usr/include/glib-2.0. It tool me time to find it in
this doesn't seem to conform to the FHS, and I assume a FHS conformant packaging
wouldn't make things worse.
> As I look around on my system, I observe followings
> For 1, *.h are:
one of them can live in /usr/include, however I personally prefer to install
header files in one location.
this is an example where the upstream header was patched to co-install on 32/64
bit systems not knowing about multiarch.
> For 2, <packagename> are
see above for the explanation for python.
this is in the standard c++ include path, so it doesn't need any special configury.
> For 3, <packagename> are:
> dbus-1.0 (dbus/dbus-arch-deps.h as *.h)
what a surprise ... I assume many upstream developers are working for distros
not using multiarch.