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: 11 Feb 2002 15:23:31 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| > [Simplification] has to been done calmly, with a whole
| > period of development dedicated to itself alone.
| 
| I quite agree.  We both need more free time.  :-)

Yep...

| > As far as AC_TRY_LINK goes, I'm really against it: it is the very
| > Cartesian product I'm referring to.
| 
| Sorry, I don't quite understand your point about the Cartesian
| product.  I agree that AC_TRY_LINK should be simplified, but I'm not
| sure where you're headed.

I mean

        {compile, link, run} x {function call, whole program, whole source}

Plus the weird thing that I still have not understood: the bizarre
duplication of

  # AC_LANG_CALL(C)(PROLOGUE, FUNCTION)
  # -----------------------------------
  # Avoid conflicting decl of main.
  m4_define([AC_LANG_CALL(C)],
  [AC_LANG_PROGRAM([$1
  m4_if([$2], [main], ,
  [/* Override any gcc2 internal prototype to avoid an error.  */
  #ifdef __cplusplus
  extern "C"
  #endif
  /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
  char $2 ();])], [$2 ();])])
  
  
  # AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
  # ----------------------------------
  # Don't include <ctype.h> because on OSF/1 3.0 it includes
  # <sys/types.h> which includes <sys/select.h> which contains a
  # prototype for select.  Similarly for bzero.
  m4_define([AC_LANG_FUNC_LINK_TRY(C)],
  [AC_LANG_PROGRAM(
  [/* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $1 (); below.  */
  #include <assert.h>
  /* Override any gcc2 internal prototype to avoid an error.  */
  #ifdef __cplusplus
  extern "C"
  #endif
  /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
  char $1 ();
  char (*f) ();
  ],
  [/* The GNU C library defines this for functions which it implements
      to always fail with ENOSYS.  Some functions are actually named
      something starting with __ and the normal name is an alias.  */
  #if defined (__stub_$1) || defined (__stub___$1)
  choke me
  #else
  f = $1;
  #endif
  ])])
  
I don't want to face this combinatorial explosion.  Also, please
remember that there are other languages, and that we want to include
others easily.

| To be honest, I'd rather have something like this:
| 
|   AC_DEF_FUNC_CHECKER([error_at_line],
|     [AC_LIBSOURCES([error.c, error.h])
|      AC_TRY_LINK(, [error_at_line (0, 0, "", 0, "");]) || AC_LIBOBJ(error)])
| 
| The idea is to use shell syntax rather than IFELSE when programming
| something that is executed at runtime by 'configure'.  This is partly
| because the shell syntax is more readable than IFELSE, and partly
| because using a different syntax makes it easier for readers to
| distinguish autoconf-time actions from configure-time actions.

In fact, there several reasons why I'm heading to more M4-IF one
being... that it's that IF that ought to handle the cache part.  In a
few words, I plan something like

        AC_CHECK_FUNC_IFELSE

etc. which will be the very low level macros testing functions,
including the cache part.  That way, the *user* will not have to know
the name of the cache variable.

Then, the higher level macros, AC_CHECK_FUNCS etc. will be
specializing: AC_CHECK_FUNC(fnmatch) will use AC_FUNC_FNMATCH etc.




reply via email to

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