autoconf
[Top][All Lists]
Advanced

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

Re: CFLAGS/LDFLAGS vs. --with


From: Braden McDaniel
Subject: Re: CFLAGS/LDFLAGS vs. --with
Date: Thu, 06 Aug 2009 17:23:06 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3

On 8/6/09 4:36 PM, Murray S. Kucherawy wrote:
What is the general wisdom when deciding whether to add support for a new 
"--with" vs. just encouraging use of CFLAGS/LDFLAGS on the command line?

In particular I'm talking about openssl here.  I have a package that needs it.  
Several systems come stock with an older version in /usr and then people 
install a newer one in /usr/local or perhaps someplace weird like /usr/pkg.  Is 
it more common or correct to tell people to do:

./configure CFLAGS=-I/usr/pkg/include LDFLAGS=-L/usr/pkg/lib

...or add support for a "--with-openssl" that adds additional variables during 
compilation pointing to the one the user wants my package to use?

Unless I'm missing something (which is possible because I'm still learning autoconf), adding the 
"--with" will mean I can't use AC_CHECK_HEADERS to search for various openssl includes 
and will have to do my own tests for the required headers, libraries and functions.  Or is it 
possible to arrange that AC_CHECK_HEADERS applies its work to the additional path provided via the 
"--with"?  I didn't see such a capability described in the info pages, but I may not have 
looked in the right place.

If all your --with argument would be doing is dumbly appending "/include" and "/lib" for -I and -L flags, I don't see the point.

The advantage of training the user add the appropriate -I and -L flags to CPPFLAGS (not CFLAGS) and LDFLAGS, respectively, is that this is knowledge that's reusable for any conventionally constructed package. It is also a strategy that can succeed in getting things working without any special knowledge from the package maintainer--something that can be very useful in general.

Braden




reply via email to

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