[Top][All Lists]

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

Re: help setting LDFLAGS and CFLAGS within AC_ARG_ENABLE

From: Stepan Kasal
Subject: Re: help setting LDFLAGS and CFLAGS within AC_ARG_ENABLE
Date: Fri, 19 Aug 2005 15:02:34 +0200
User-agent: Mutt/1.4.1i

Hello Patrick,
  I haven't read your code snippet thouroughly either, but I have a few
comments, too:

> >   [certification],
> >     [--enable-certification],
> >     [Include code for interfacing to an information currency server. 
> >     (default)]), ,
> >   [enable_certification=yes])

If the feature is enabled by default, then help should mention the
--disable variant, which switches it off.

The whole AC_HELP_STRING(...) should be quoted.  Otherwise m4 expands it
while it collects parameters for AC_ARG_ENABLE, before it expands
AC_ARG_ENABLE.  Similarly, the second parameter to AC_CHECK_HEADERS
must be quoted.

Please note that the second parameter of AC_CHECK_HEADERS is called as
soon as one of the headers is called.  This is probably not what you

And if the user says explicitely --enable-certification, and the feature
cannot be enabled, configure should report an error and give up.

So the code should look like this:

     [Do not innclude code for interfacing to an information currency 

if test no != "$enable_certification"; then
    [openssl/evp.h libxml/tree.h libcsoap/soap-client.h xmlsec/xmlsec.h],
  AC_CHECK_LIB(ssl,xyz,[LIBS="-lssl $LIBS"], [certification=no])
  AC_CHECK_LIB(xml2,xmlfoo,[LIBS="-lxml2 $LIBS"], [certification=no])
  AC_CHECK_LIB(xmlsec1,xmlSecCryptoInit,[LIBS="-lxmlsec1 $LIBS"], 
  AC_CHECK_LIB(csoap,sapon_init,[LIBS="-lcsoap $LIBS"], [certification=no])
  CFLAGS="$CFLAGS -g `xmlsec1-config --cflags`" || certification=no
  LDFLAGS="$LDFLAGS -g `xmlsec1-config --libs`" || certification=no

  if test $certification = yes; then
      [Define if you want CVS to be able to create information currency from
      submitted code.])
  else if test "$enable_certification" != ""; then
    AC_MSG_ERROR([Prerequisities for interfacing to an information currency 
        are not available.])
On Fri, Aug 19, 2005 at 10:02:37AM +0200, Ralf Wildenhues wrote:
> but I think Autoconf sanitizes the $enable_* variables so that it is not
> necessary to do so (`-' is changed to `_').

No, this is not true.  

If the user, calls ./configure --enable-certification=-n, then variable

The documentation say that there are platforms which would be confused by
        test "-n" != no
so Autoconf traditionally uses
        test x"$enable_certification" != xno

I'm not sure whether
        test no != -n
can couse problems on some platforms...

> I see that several examples in the Autoconf manual do this differently.
> Below is a proposed patch to fix this.

Yes, Ralph, the patch looks good.


reply via email to

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