Re: CFLAGS/LDFLAGS vs. --with

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

 



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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux