autoconf-patches
[Top][All Lists]
Advanced

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

Using result of AC_PROG_SED as sed program in config.status


From: Albert Chin
Subject: Using result of AC_PROG_SED as sed program in config.status
Date: Wed, 29 Dec 2004 18:14:46 -0600
User-agent: Mutt/1.5.6i

Because some Makefile.in's can contain long lines (e.g. kdevelop from
KDE), using the normal 'sed' command can break substition or even
pass-thru when creating Makefile. It makes sense to use the sed
determined by AC_PROG_SED as the "best" sed to perform the
substitions.

-- 
albert chin (address@hidden)

-- snip snip
2004-12-29  Albert Chin-A-Young  <address@hidden>
            Stepan Kasal  <address@hidden>

        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS,
        _AC_OUTPUT_FILES): Use the "best" sed as determined by
        AC_PROG_SED to perform substitutions to work around
        limitation on some systems by the default sed when
        the input file contains very long lines. Even if no
        substitutions are made on these lines, the default sed
        command might truncate them.

Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.48
diff -u -3 -p -r1.48 status.m4
--- lib/autoconf/status.m4      21 Dec 2004 14:24:01 -0000      1.48
+++ lib/autoconf/status.m4      30 Dec 2004 00:09:57 -0000
@@ -918,9 +918,9 @@ dnl Here, there are 2 cmd per line, and 
       (echo [':t
   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b'] && cat "$tmp/subs.frag") 
>"$tmp/subs-$ac_sed_frag.sed"
       if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f '$tmp/subs-$ac_sed_frag.sed'"
+       ac_sed_cmds="$SED -f '$tmp/subs-$ac_sed_frag.sed'"
       else
-       ac_sed_cmds="$ac_sed_cmds | sed -f '$tmp/subs-$ac_sed_frag.sed'"
+       ac_sed_cmds="$ac_sed_cmds | $SED -f '$tmp/subs-$ac_sed_frag.sed'"
       fi
       ac_sed_frag=`expr $ac_sed_frag + 1`
       ac_beg=$ac_end
@@ -999,7 +999,7 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 dnl Neutralize VPATH when `$srcdir' = `.'.
-  sed "$ac_vpsub
+  \$SED "$ac_vpsub
 dnl Shell code in configure.ac might set extrasub.
 dnl FIXME: do we really want to maintain this feature?
 $extrasub
@@ -1273,8 +1273,9 @@ AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [
 # Produce config.status.  Called by AC_OUTPUT.
 # Pay special attention not to have too long here docs: some old
 # shells die.  Unfortunately the limit is not known precisely...
-m4_define([_AC_OUTPUT_CONFIG_STATUS],
-[AC_MSG_NOTICE([creating $CONFIG_STATUS])
+AC_DEFUN([_AC_OUTPUT_CONFIG_STATUS],
+[AC_REQUIRE([AC_PROG_SED])dnl
+AC_MSG_NOTICE([creating $CONFIG_STATUS])
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
 # Generated by $as_me.




reply via email to

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