LM wrote:
> Am attempting to build the glib and the gtk libraries.  I built libffi
> which glib requires.  I noticed libffi puts its include files under
> the lib directory and not under the usual include directory.  The blfs
> information leaves the files where they are.  I checked the Debian
> patches to see how they place their files and they move the files to
> the standard include directory.  So, I tried building and moving the
> include files there.  Then I tried building glib and all files ended
> up in the standard include directory except one, glibconfig.h, which
> ends up in lib\glib-2.0\include\.  Checked the Debian patches and they
> don't move this one to the standard include directory.  Tried
> searching on Google and saw some mention that moving the file could
> mess up cross-compilers, but in that example the file wasn't exactly
> under lib\glib-2.0\include but was under lib\triplet\glib-2.0\include.

>  Is there a standard for this?  Should library include files end up in
> a common include directory or should they end up under
> lib\name_of_lib\include.  

Generally include files are found in /usr/include or a subdirectory of 
that.  In some cases, the include files are placed in a location for a 
package, for example Qt in my system is installed in /opt with the 
include files for that in /opt/qt-4.8.0/include.

> Is there a rule when they should go to one place as opposed to another.  

The general rule is /usr/include, but different developers may feel 
their situation is 'different' and put them somewhere else.

> I don't mind moving the files around,
> I'm just trying to find a consistent approach to where my include
> files end up that makes sense.  

In the case of libffi, they do place libffi.pc in /usr/lib/pkgconfig. 
The authors expect a program using libffi to use pkg-config and the pc 
file says:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${libdir}/libffi-3.0.10/include

so if you move the include files, you probably should update libffi.pc 
also.  OTOH, the gcc will look in /usr/include (and a few other places) 
by default unless you explicitly disable that with -nostdinc.

http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

> Does anyone have any input on why to do it one way as opposed to
> another or how to make this more consistent?

You would really have to ask the authors of libffi why they install the 
headers in a non-standard location.  In the source include/ directory is 
Makefile.am that has:

includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include

so they did it on purpose.  It does have a version as a part of the 
path, but I have no idea why they used libdir instead of includedir.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to