autoconf
[Top][All Lists]
Advanced

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

Re: AC quoting rules


From: Akim Demaille
Subject: Re: AC quoting rules
Date: 07 Feb 2002 11:30:33 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| > > # AC_FUNC_ERROR_AT_LINE
| > > # ---------------------
| > > AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
| > > [AC_LIBSOURCES([error.h, error.c])dnl
| > > AC_CACHE_CHECK([for error_at_line], ac_cv_lib_error_at_line,
| > > [AC_LINK_IFELSE([AC_LANG_PROGRAM([],[error_at_line (0, 0, "", 0, "");])],
| > >                 [ac_cv_lib_error_at_line=yes],
| > >                 [ac_cv_lib_error_at_line=no])])
| > > if test $ac_cv_lib_error_at_line = no; then
| > >   AC_LIBOBJ(error)
| > > fi
| > > ])
| > 
| > That is very hard for the novice.
| 
| I to agree with you here.  There is way too much repetition there, and
| the repetition is confusing.

Err, first of all, if you are talking about novices, strip the cache
part, and go down to

 AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
 [AC_LIBSOURCES([error.h, error.c])dnl
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([],[error_at_line (0, 0, "", 0, "");])],
                 [AC_LIBOBJ(error)])])
 ])

Anyway, I don't think novices will write such things, they will merely
invoke macros we provide.


As far as simplification is concerned, I agree much can be done, but
there is work to do before.  And also, pay extreme attention not to
multiply the number of macros to mask Cartesian products.

For instance:

AC_DEF_FUNC_CHECKER([error_at_line],
  [AC_TRY_LINK(, [error_at_line (0, 0, "", 0, "");]),
   ,
   AC_LIBOBJ(error),
   AC_LIBSOURCES([error.c, error.h])])

I agree _very_ much with AC_DEF_FUNC_CHECKER([error_at_line], that's
what I've been calling specializing loops for years (I submitted a
proto 3 or 4 years ago).  But it has to been done calmly, with a whole
period of development dedicated to itself alone.

As far as AC_TRY_LINK goes, I'm really against it: it is the very
Cartesian product I'm referring to.  You are composing (i) the form
the input (are you passing a part of main, a whole program, a whole
source file?), and (ii) the treatment (compile, link, or run?).



reply via email to

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