autoconf
[Top][All Lists]
Advanced

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

how to use libraries in /usr/local


From: Bruno Haible
Subject: how to use libraries in /usr/local
Date: Mon, 21 May 2001 22:51:44 +0200 (CEST)

Hi,

You remember the need for
   CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
while running configure? (We discussed this around 2001-03-15, subject
"installation instructions on OpenBSD and FreeBSD".)

It is not only a problem with *BSD. Also all of

  SunOS 4    cc
  Solaris    cc
  AIX        cc, xlc
  IRIX       cc
  OSF/1      cc

are affected, as well as gcc installations built with
--with-local-prefix option.

So, in fact, it is a problem with *most* platforms, excluding GNU.
This is also what is written in the GNU standards:

     Most compilers other than GCC do not look for header files in
     directory `/usr/local/include'.  So installing the header files
     this way is only useful with GCC.  Sometimes this is not a problem
     because some libraries are only really intended to work with GCC.
     But some libraries are intended to work with other compilers.
     They should install their header files in two places, one
     specified by `includedir' and one specified by `oldincludedir'.

Note that oldincludedir = /usr/include. I haven't seen a single
package following this advice to install header files both in
/usr/include and /usr/local/include (fortunately - because I can
imagine the mess this can lead to).

The objective is to make installed GNU libraries easily available to
other packages during configuration.

I would like to propose a "configure" option --use-local which,
depending on the language being used, does the following. For C and
C++, it appends " -I/usr/local/include" to CPPFLAGS and
" -L/usr/local/lib" to LDFLAGS. For Fortran, it should do similar
things.

Another totally different approach is to recommend that every
library libfoo comes with a script 'foo-config' in /usr/local/bin that
can spit out the required -I and -L options. Here as well, autoconf
support would be nice, so that the resulting -I/-L options would be
substituted into the Makefile.

Bruno



reply via email to

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