autoconf
[Top][All Lists]
Advanced

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

Re: how to use libraries in /usr/local


From: Steve M. Robbins
Subject: Re: how to use libraries in /usr/local
Date: Tue, 22 May 2001 09:27:18 -0400
User-agent: Mutt/1.3.17i

On Mon, May 21, 2001 at 06:50:57PM -0700, Russ Allbery wrote:
> Bruno Haible <address@hidden> writes:
> 
> > 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.
> 
> What if your /usr/local isn't called /usr/local?  It's quite frequently
> called something else, particularly for site-wide installations on shared
> file systems where individual systems may want to have their own (usually
> much smaller) /usr/local in addition to the site-wide installation.

... leading to two or more places in which to look for 3rd party libraries.

Recently, I've begun adding a simple "--with-build-path" option to my
configure scripts, to allow specifying a colon-separated list of
locations to search for libraries.  If you say
--with-build-path=/a:/b, then /a/include and /b/include are added as
-I options, while /a/lib and /b/lib are added as -L options.


dnl Add extra include or link directories
AC_ARG_WITH(build-path,[
  --with-build-path[=DIR] use DIR/include DIR/lib
],[
for d in `echo $withval | tr : ' '`; do
    test -d $d/include && CPPFLAGS="$CPPFLAGS -I$d/include"
    test -d $d/lib && LDFLAGS="$LDFLAGS -L$d/lib"
done
])


I hadn't thought of FORTRAN; but if it has a similar "FFLAGS", you
could add them too.

-S


 

-- 
by Rocket to the Moon,
by Airplane to the Rocket,
by Taxi to the Airport,
by Frontdoor to the Taxi,
by throwing back the blanket and laying down the legs ...
- They Might Be Giants




reply via email to

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