]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1999-09-28 Akim Demaille <akim@epita.fr>
authorAkim Demaille <akim@epita.fr>
Tue, 28 Sep 1999 08:37:40 +0000 (08:37 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 28 Sep 1999 08:37:40 +0000 (08:37 +0000)
* acgeneral.m4 (AC_NEED_DECL): When $4 is given, don't provide
defaults headers.
Change the message from `have' to `need'.
Change the actions for `if-(not-)found' to `if-(not-)needed.
Remove trailing parentheses.

* acgeneral.m4 (AC_NEED_DECLS): Change the actions for
`if-(not-)found' to `if-(not-)needed.
Define NEED_DECL_foo, instead of NEED_foo_DECL.

* autoheader.sh (decls): Reflect this.

* autoconf.texi (Generic Declarations): Update.

ChangeLog
acgeneral.m4
autoconf.texi
autoheader.sh
configure
doc/autoconf.texi
lib/autoconf/general.m4

index f1e0ff693c11f7988b0da9685d134a27d0471546..451a0da7f2c7fcc364b3183d0a4c992e5125381c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+1999-09-28  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AC_NEED_DECL): When $4 is given, don't provide
+       defaults headers.
+       Change the message from `have' to `need'.
+       Change the actions for `if-(not-)found' to `if-(not-)needed.
+       Remove trailing parentheses.
+
+       * acgeneral.m4 (AC_NEED_DECLS): Change the actions for
+       `if-(not-)found' to `if-(not-)needed.
+       Define NEED_DECL_foo, instead of NEED_foo_DECL.
+
+       * autoheader.sh (decls): Reflect this.
+
+       * autoconf.texi (Generic Declarations): Update.
+
 1999-09-27  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (AC_OUTPUT): Divert AC_OUTPUT_FILE to
index d019024f0bc466bc49c59046f9a36113d51df0b6..0b9c9d4340785a35746551ad2e7a008d9cd942b0 100644 (file)
@@ -2491,16 +2491,16 @@ dnl ])
 dnl ### Checking for declared symbols
 
 
-dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
+dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
 dnl              [, INCLUDES,]]])
-dnl ------------------------------------------------------------
+dnl --------------------------------------------------------------
 dnl Check if SYMBOL (a variable or a function) is declared.
 dnl This macro is not a _CHECK_, because it is better not to declare
 dnl a symbol if you don't really need it.
 AC_DEFUN([AC_NEED_DECL],
-[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_decl_$1])dnl
-AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
-[AC_TRY_COMPILE([#include <stdio.h>
+[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_need_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 needs to be declared], ac_Symbol,
+[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
 #ifdef HAVE_STRING_H
 # if !STDC_HEADERS && HAVE_MEMORY_H
 #  include <memory.h>
@@ -2522,36 +2522,36 @@ AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-$4],
+]),
 [#ifndef $1
 char *p = (char *) $1;
 #endif
 ],
-AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
+AC_VAR_SET(ac_Symbol, no), AC_VAR_SET(ac_Symbol, yes))])
 AC_SHELL_IFELSE(test AC_VAR_GET(ac_Symbol) = yes,
-               [$2], [$3])dnl
+                [$2], [$3])dnl
 AC_VAR_POPDEF([ac_Symbol])dnl
 ])dnl AC_NEED_DECL
 
-dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl               [, INCLUDES,]]])
-dnl -------------------------------------------------------------
+dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl               [, INCLUDES]]])
+dnl ---------------------------------------------------------------
 AC_DEFUN([AC_NEED_DECLS],
-[AC_FOREACH([ac_Symbol], [$1],
-  [AC_SPECIALIZE([AC_NEED_DECL], ac_Symbol,
-                 [$2],
-                 [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_[]ac_Symbol[]_DECL))
-$3],
-                 [$4])])])
+[AC_FOREACH([AC_Symbol], [$1],
+  [AC_SPECIALIZE([AC_NEED_DECL], AC_Symbol,
+                 [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_DECL_[]AC_Symbol))
+$2],
+                 [$3],
+                 [$4])])
 ])dnl AC_NEED_DECLS
 
-dnl This is the pure sh versions of the macro above.
+dnl This is the pure sh version of the macro above.
 dnl [for ac_sym in [$1]
 dnl do
 dnl AC_NEED_DECL($ac_sym,
-dnl             [$4],
-dnl             [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $2],
-dnl             [$3])dnl
+dnl             [$2],
+dnl             [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $3],
+dnl             [$4])dnl
 dnl done
 
 dnl ### Checking for library functions
index 8f58198a4d57b125070b516a4e95669903268297..4cdbe87f2f915d8033b1d3763c6cc974e45ef9d3 100644 (file)
@@ -2633,30 +2633,29 @@ is declared in a system header file, either @file{signal.h} or
 These macros are used to find declarations not covered by the particular
 test macros.
 
-@defmac AC_NEED_DECL (@var{symbol} @r{[}, @var{action-if-found}@r{[}, @var{action-if-not-found} @r{[},@var{includes} @r{]]]})
+@defmac AC_NEED_DECL (@var{symbol} @r{[}, @var{action-if-needed}@r{[}, @var{action-if-not-needed} @r{[},@var{includes} @r{]]]})
 @maindex NEED_DECL
-If @var{symbol} (a function or a variable) is declared in
-@file{stdio.h}, @file{stdlib.h}, @file{stddef.h}, @file{memory.h},
-@file{string.h}, @file{strings.h}, and @file{unistd.h}.  (plus
-@var{includes} if given), run the shell commands @var{action-if-found},
-otherwise @var{action-if-not-found}.
+If the declaration of @var{symbol} (a function or a variable) is needed
+because it is not declared in @var{includes}, run the shell commands
+@var{action-if-needed}, otherwise @var{action-if-not-needed}.  If no
+@var{includes} are given at all, by default @file{stdio.h},
+@file{stdlib.h}, @file{stddef.h}, @file{memory.h}, @file{string.h},
+@file{strings.h}, and @file{unistd.h} will be included.
 
 This macro actually tests whether it is valid to use @var{symbol} as an
 r-value, not if it is really declared, because it is much safer to avoid
 introducing extra declarations when not needed.
-
-Please, note that @var{action-if-found} when the symbol is declared, not
-when it is needed.
 @end defmac
 
-@defmac AC_NEED_DECLS (@var{symbol} @r{[}, @var{action-if-found}@r{[}, @var{action-if-not-found} @r{[},@var{includes} @r{]]]})
+@defmac AC_NEED_DECLS (@var{symbol} @r{[}, @var{action-if-needed}@r{[}, @var{action-if-not-needed} @r{[},@var{includes} @r{]]]})
 @maindex NEED_DECLS
-@cvindex NEED_@var{symbol}_DECL
+@cvindex NEED_DECL_@var{symbol}
 For each given @var{symbol} (whitespace-separated), define
-@code{NEED_@var{symbol}_DECL} (in all capitals) if @var{symbol} has to
-be declared to be used as an r-value.  If @var{action-if-found} is
+@code{NEED_DECL_@var{symbol}} (in all capitals) if @var{symbol} has to
+be declared to be used as an r-value.  If @var{action-if-needed} is
 given, it is additional shell code to execute when one of the function
-declarations is found, otherwise @var{action-if-not-found} is executed.
+declarations is needed, otherwise @var{action-if-not-needed} is
+executed.
 @end defmac
 
 
index da644b6287667081d7bb24f084dbf95031a034e5..df2b516b026a99920ffc53899250c425070e3e15 100644 (file)
@@ -264,8 +264,8 @@ if test -n "$decls"; then
   for decl in `for x in $decls; do echo $x; done | sort | uniq`; do
    sym="`echo ${decl} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
     echo "
-/* Define if you need the \`${decl}' declaration.  */
-#undef NEED_${sym}_DECL"
+/* Define if you need the declaration of \`${decl}'.  */
+#undef NEED_DECL_${sym}"
   done
 fi
 
index 26bc53abfbcc469c24cc14438273d81df0badc90..10e9633e4178a9d48de79d0d451fa619e4f09905 100755 (executable)
--- a/configure
+++ b/configure
@@ -913,6 +913,7 @@ Usage: $CONFIG_STATUS [OPTIONS] FILE...
 Files to instanciate:
   Configuration files:
     Makefile testsuite/Makefile 
+
 Report bugs to <bug-autoconf@gnu.org>."
 
 ac_cs_version="\
index 8f58198a4d57b125070b516a4e95669903268297..4cdbe87f2f915d8033b1d3763c6cc974e45ef9d3 100644 (file)
@@ -2633,30 +2633,29 @@ is declared in a system header file, either @file{signal.h} or
 These macros are used to find declarations not covered by the particular
 test macros.
 
-@defmac AC_NEED_DECL (@var{symbol} @r{[}, @var{action-if-found}@r{[}, @var{action-if-not-found} @r{[},@var{includes} @r{]]]})
+@defmac AC_NEED_DECL (@var{symbol} @r{[}, @var{action-if-needed}@r{[}, @var{action-if-not-needed} @r{[},@var{includes} @r{]]]})
 @maindex NEED_DECL
-If @var{symbol} (a function or a variable) is declared in
-@file{stdio.h}, @file{stdlib.h}, @file{stddef.h}, @file{memory.h},
-@file{string.h}, @file{strings.h}, and @file{unistd.h}.  (plus
-@var{includes} if given), run the shell commands @var{action-if-found},
-otherwise @var{action-if-not-found}.
+If the declaration of @var{symbol} (a function or a variable) is needed
+because it is not declared in @var{includes}, run the shell commands
+@var{action-if-needed}, otherwise @var{action-if-not-needed}.  If no
+@var{includes} are given at all, by default @file{stdio.h},
+@file{stdlib.h}, @file{stddef.h}, @file{memory.h}, @file{string.h},
+@file{strings.h}, and @file{unistd.h} will be included.
 
 This macro actually tests whether it is valid to use @var{symbol} as an
 r-value, not if it is really declared, because it is much safer to avoid
 introducing extra declarations when not needed.
-
-Please, note that @var{action-if-found} when the symbol is declared, not
-when it is needed.
 @end defmac
 
-@defmac AC_NEED_DECLS (@var{symbol} @r{[}, @var{action-if-found}@r{[}, @var{action-if-not-found} @r{[},@var{includes} @r{]]]})
+@defmac AC_NEED_DECLS (@var{symbol} @r{[}, @var{action-if-needed}@r{[}, @var{action-if-not-needed} @r{[},@var{includes} @r{]]]})
 @maindex NEED_DECLS
-@cvindex NEED_@var{symbol}_DECL
+@cvindex NEED_DECL_@var{symbol}
 For each given @var{symbol} (whitespace-separated), define
-@code{NEED_@var{symbol}_DECL} (in all capitals) if @var{symbol} has to
-be declared to be used as an r-value.  If @var{action-if-found} is
+@code{NEED_DECL_@var{symbol}} (in all capitals) if @var{symbol} has to
+be declared to be used as an r-value.  If @var{action-if-needed} is
 given, it is additional shell code to execute when one of the function
-declarations is found, otherwise @var{action-if-not-found} is executed.
+declarations is needed, otherwise @var{action-if-not-needed} is
+executed.
 @end defmac
 
 
index d019024f0bc466bc49c59046f9a36113d51df0b6..0b9c9d4340785a35746551ad2e7a008d9cd942b0 100644 (file)
@@ -2491,16 +2491,16 @@ dnl ])
 dnl ### Checking for declared symbols
 
 
-dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
+dnl AC_NEED_DECL(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
 dnl              [, INCLUDES,]]])
-dnl ------------------------------------------------------------
+dnl --------------------------------------------------------------
 dnl Check if SYMBOL (a variable or a function) is declared.
 dnl This macro is not a _CHECK_, because it is better not to declare
 dnl a symbol if you don't really need it.
 AC_DEFUN([AC_NEED_DECL],
-[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_decl_$1])dnl
-AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
-[AC_TRY_COMPILE([#include <stdio.h>
+[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_need_decl_$1])dnl
+AC_CACHE_CHECK([whether $1 needs to be declared], ac_Symbol,
+[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
 #ifdef HAVE_STRING_H
 # if !STDC_HEADERS && HAVE_MEMORY_H
 #  include <memory.h>
@@ -2522,36 +2522,36 @@ AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-$4],
+]),
 [#ifndef $1
 char *p = (char *) $1;
 #endif
 ],
-AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
+AC_VAR_SET(ac_Symbol, no), AC_VAR_SET(ac_Symbol, yes))])
 AC_SHELL_IFELSE(test AC_VAR_GET(ac_Symbol) = yes,
-               [$2], [$3])dnl
+                [$2], [$3])dnl
 AC_VAR_POPDEF([ac_Symbol])dnl
 ])dnl AC_NEED_DECL
 
-dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl               [, INCLUDES,]]])
-dnl -------------------------------------------------------------
+dnl AC_NEED_DECLS(SYMBOL, [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED
+dnl               [, INCLUDES]]])
+dnl ---------------------------------------------------------------
 AC_DEFUN([AC_NEED_DECLS],
-[AC_FOREACH([ac_Symbol], [$1],
-  [AC_SPECIALIZE([AC_NEED_DECL], ac_Symbol,
-                 [$2],
-                 [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_[]ac_Symbol[]_DECL))
-$3],
-                 [$4])])])
+[AC_FOREACH([AC_Symbol], [$1],
+  [AC_SPECIALIZE([AC_NEED_DECL], AC_Symbol,
+                 [AC_DEFINE_UNQUOTED(AC_TR_CPP(NEED_DECL_[]AC_Symbol))
+$2],
+                 [$3],
+                 [$4])])
 ])dnl AC_NEED_DECLS
 
-dnl This is the pure sh versions of the macro above.
+dnl This is the pure sh version of the macro above.
 dnl [for ac_sym in [$1]
 dnl do
 dnl AC_NEED_DECL($ac_sym,
-dnl             [$4],
-dnl             [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $2],
-dnl             [$3])dnl
+dnl             [$2],
+dnl             [AC_DEFINE_UNQUOTED(AC_TR_CPP(${ac_sym}_DECLARED)) $3],
+dnl             [$4])dnl
 dnl done
 
 dnl ### Checking for library functions