Finding libraries to link with and autoconf resources?

Mike Meyer mwm-keyword-freebsdhackers2.e313df at mired.org
Sun Feb 11 21:08:46 UTC 2007


In <17871.29428.183244.232189 at gromit.timing.com>, John E Hein <jhein at timing.com> typed:
> Garrett Cooper wrote at 22:46 -0800 on Feb 10, 2007:
>  > Are there any global scripts or options to pass to autoconf that sets  
>  > the -L option for gcc properly?
> 
> If the configure script doesn't support --with-png=/your/path/to/png,
> then you can force feed it by using env vars.  As in:
> 
> env LDFLAGS=-L/your/path/to/png/lib CPPFLAGS=-I/your/path/to/png/include configure

You also need this if the port splits the directories in a way that
libpng doesn't expect. Since it uses $(LOCALBASE)/lib and
$(LOCALBASE)/include/libpng, it may be doing that.

> In your freebsd port, there is a common idiom that looks like this
> in the Makefile:
> 
> LDFLAGS+=-L/your/path/to/png/lib
> CPPFLAGS+=-I/your/path/to/png/include
> CONFIGURE_ENV=CPPFLAGS="${CPPFLAGS} LDFLAGS="${LDFLAGS}

The port idiom is correctly more like:

LDFLAGS+=-L$(LOCALBASE)/subdir/to/png/lib
CPPFLAGS+=-I$(LOCALBASE)/subdir/to/png/include

to get LOCALBASE correct. 

> ports@ is a better place to ask such questions, by the way.

Unless it's really an autoconf question, in which case the right place
would be an autoconf list.

	<mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.


More information about the freebsd-hackers mailing list