]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
don't advertise shell function adversely
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 18 Sep 2008 14:51:50 +0000 (16:51 +0200)
committerPaolo Bonzini <bonzini@gnu.org>
Fri, 10 Oct 2008 13:33:28 +0000 (15:33 +0200)
2008-10-08  Paolo Bonzini  <bonzini@gnu.org>

* doc/autoconf.texi: Be less wary of shell functions.

ChangeLog
NEWS
doc/autoconf.texi

index 93058495d55d56ba85fc6d591d38a9867c697129..2ead8c69bc4bb78a4cd4ecad56f453e86b6652fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-10  Paolo Bonzini  <bonzini@gnu.org>
+
+       * doc/autoconf.texi: Be less wary of shell functions.
+
 2008-10-10  Paolo Bonzini  <bonzini@gnu.org>
 
        * m4sugar/m4sh.m4 (_AS_MKDIR_P): New, from AS_MKDIR_P.  Adjust
diff --git a/NEWS b/NEWS
index ac822d57724a32c17726f88160d25cfa1a5c7174..97bcb6ac86f693cb91143beb11a72a7725b32388 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ GNU Autoconf NEWS - User visible changes.
 ** Autotest testsuites do not attempt to write startup error messages
    to the log file before that is opened (regression introduced in 2.63).
 
+** Configure scripts now use shell functions.
+
 ** The following m4sugar macros are new:
    m4_default_quoted
 
index 5753d37bce320dc1e758bf303aa80b68c901d5c0..2ea542c8c843c155ea0d64012731200e8f4e5cd0 100644 (file)
@@ -1059,11 +1059,10 @@ to their lowest common denominator of features.
 Naturally, you might then think of shell scripts; who needs
 @command{autoconf}?  A set of properly written shell functions is enough to
 make it easy to write @command{configure} scripts by hand.  Sigh!
-Unfortunately, shell functions do not belong to the least common
-denominator; therefore, where you would like to define a function and
-use it ten times, you would instead need to copy its body ten times.
-Even in 2007, where shells without any function support are far and
-few between, there are pitfalls to avoid when making use of them.
+Unfortunately, even in 2008, where shells without any function support are
+far and few between, there are pitfalls to avoid when making use of them.
+Also, finding a Bourne shell that accepts shell functions is not trivial,
+even though there is almost always one on interesting porting targets.
 
 So, what is really needed is some kind of compiler, @command{autoconf},
 that takes an Autoconf program, @file{configure.ac}, and transforms it
@@ -12673,9 +12672,9 @@ that are not found in all Bourne-compatible shells; restrict yourself
 to the lowest common denominator.  Even @code{unset} is not supported
 by all shells!
 
-Shell functions are considered portable nowadays, though Autoconf still
-does not use them (Autotest does).  However, some pitfalls have to be
-avoided for portable use of shell functions (@pxref{Shell Functions}).
+Shell functions are considered portable nowadays.  However, some pitfalls
+have to be avoided for portable use of shell functions (@pxref{Shell
+Functions}).
 
 Some ancient systems have quite
 small limits on the length of the @samp{#!} line; for instance, 32
@@ -13645,8 +13644,8 @@ $ @kbd{pdksh -c 'echo $(( 010 ))'}
 
 When it is available, using arithmetic expansion provides a noticeable
 speedup in script execution; but testing for support requires
-@command{eval} to avoid syntax errors.  If shell function support has
-also been detected, then this construct can be used to assign @samp{foo}
+@command{eval} to avoid syntax errors.  If shell function support can
+be assumed, then this construct can be used to assign @samp{foo}
 to an arithmetic result, provided all numeric arguments are provided in
 decimal and without a leading zero:
 
@@ -14149,8 +14148,8 @@ f: not found
 @end example
 
 @noindent
-For this reason, Autotest uses the prefix @samp{at_func_} for its
-functions.
+For this reason, Autoconf (actually M4sh, @pxref{Programming in M4sh})
+uses the prefix @samp{as_func_} for its functions.
 
 Handling of positional parameters and shell options varies among shells.
 For example, Korn shells reset and restore trace output (@samp{set -x})