2005-06-07 Stepan Kasal * lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS): Circumvent the problem with Solaris' sed by adding space to each line. 2005-06-06 Ralf Menzel (trivial change) * doc/autoconf.texi (Limitations of Usual Tools): Solaris' sed cannot handle \(...\)* Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.906 diff -u -r1.906 autoconf.texi --- doc/autoconf.texi 6 Jun 2005 08:01:32 -0000 1.906 +++ doc/autoconf.texi 7 Jun 2005 20:41:08 -0000 @@ -12110,6 +12110,17 @@ quite portable to modern hosts, but is not supported by some older @command{sed} implementations like SVR3. +Some @command{sed} implementations, e.g. the @command{sed} of Solaris 9, +restrict the special role of the asterisk to one-character regular expressions. +This may lead to unexpected behaviour: + address@hidden +$ @kbd{echo '1*23*4' | /usr/bin/sed 's/\(.\)*/x/g'} +x2x4 +$ @kbd{echo '1*23*4' | /usr/xpg4/bin/sed 's/\(.\)*/x/g'} +x address@hidden example + The @option{-e} option is portable. Some people prefer to use it: Index: lib/autoconf/status.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v retrieving revision 1.61 diff -u -r1.61 status.m4 --- lib/autoconf/status.m4 6 Jun 2005 09:36:11 -0000 1.61 +++ lib/autoconf/status.m4 7 Jun 2005 20:41:09 -0000 @@ -497,16 +497,20 @@ # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. # +# For the value ac_dB we take take advantage of the fact that we have appended +# a space to every line we work on. And ac_dB reinserts the space, because is +# is possible that some symbol was AC_DEFINEd several times. +# dnl Quote, for the `[ ]' and `define'. [ac_dA='s,^\([ ]*#[ ]*\)[^ ]*\([ ][ ]*' -ac_dB='\)\([ (].*\)*$,\1define\2' +ac_dB='\)[ (].*$,\1define\2' ac_dC=' ' -ac_dD=','] +ac_dD=' ,'] dnl ac_dD used to contain `;t' at the end. dnl This was an optimization which was making the code both slow and incorrect. dnl 1) Since the script has to be broken to chunks containing 100 commands, dnl this extra command means we have to call sed more times. -dnl 2) The code was incorrect: in the strange case that a sumbol has multiple +dnl 2) The code was incorrect: in the strange case that a symbol has multiple dnl different AC_DEFINEs, we want to honour the *last* one. [ac_word_regexp=[_$as_cr_Letters][_$as_cr_alnum]*] @@ -550,6 +554,10 @@ # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First command appends a space to every undef/define line of the header, +# to ease matching. +echo 's/$/ /' >conftest.defines # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. @@ -558,8 +566,7 @@ # sort them, since we want the *last* AC_DEFINE to be honored. dnl dnl Quote, for `[ ]' and `define'. -[rm -f conftest.defines conftest.tail -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +[ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* uniq confdefs.h | sed -n ' t rset @@ -572,8 +579,10 @@ s/[\\$`]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/${ac_dA}\1$ac_dB\2${ac_dC}\3$ac_dD/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/${ac_dA}\1$ac_dB${ac_dC}\2$ac_dD/p - ' >conftest.defines + ' >>conftest.defines ] +# Remove the space that was appended to ease matching. +echo 's/ $//' >>conftest.defines # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it.