autoconf
[Top][All Lists]
Advanced

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

Re: default searchpaths on *BSD machines?


From: James K. Lowden
Subject: Re: default searchpaths on *BSD machines?
Date: Tue, 17 Apr 2012 12:42:52 -0400

On Tue, 17 Apr 2012 10:24:11 +0900
Miles Bader <address@hidden> wrote:

> I installed "libjpeg" using the FreeBSD ports infrastructure, but my
> configure script still couldn't "see" it... once I explicitly added
> "-I/usr/local/include" to CPPFLAGS, and "-L/usr/local/lib" to LDFLAGS,
> then it did find it.

That in fact is the right solution.  The package should honor
CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, and LIBS.  As long as it doesn't
overwrite them, the user can describe the location of any needed
libraries through them to the package.  

Keep in mind that the default search paths are configurable,
either someplace like /etc/ld.so.conf, or when the compiler/linker
itself was built.  I don't know how autoconf discovers these settings,
though.  

The pkgsrc system puts things in /usr/pkg.  Sometimes these override
older versions /usr; sometimes packages are themselves overridden
in /usr/local.  It's up to the person building the package to know
what's where, and to communicate that to the package.  All you as
packager can do is make it possible.  

Autoconf could help, though.  It would be nice if configure.ac supported
an option to define a simple search path for library finding, e.g.

        DETECT_ROOTS=${HOME}:/usr/local:/usr/pkg:/usr

and generated all the magical -I, -L, and -Wl arguments.  There's an
awful lot of redundancy and arcania required to get this stuff right,
and quite a bit of variety among packages.  

--jkl



reply via email to

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