[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
3-gary-new-AC_PROG_SED.patch
From: |
Gary V. Vaughan |
Subject: |
3-gary-new-AC_PROG_SED.patch |
Date: |
Thu, 22 Jan 2004 13:41:19 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Its been over 2 years since this message :-o
http://mail.gnu.org/archive/html/autoconf-patches/2002-01/msg00008.html
Resubmitting with docs and NEWS.
Okay to commit?
Cheers,
Gary.
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://www.oranda.demon.co.uk
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAD9L/FRMICSmD1gYRAjabAJ9gDgzDrNnvk/xTqVG55tlG/f7gGQCdElRL
kQz/FkM4xz/7nCbzgjqvWso=
=uPKj
-----END PGP SIGNATURE-----
X-UIDL: AFM!!k$2"!+!A"!(f)"!
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: <address@hidden>
Delivered-To: address@hidden
Received: (qmail 26240 invoked from network); 22 Jan 2004 13:30:13 -0000
Received: from unknown (HELO mail.eris.qinetiq.com) (128.98.1.1)
by mailhost.eris.qinetiq.com with SMTP; 22 Jan 2004 13:30:13 -0000
Received: (qmail 1972 invoked from network); 22 Jan 2004 13:44:38 -0000
Received: from mail3.bulldogcommunications.com (HELO ns1.bulldogdsl.com)
(212.158.192.11)
by ns0.eris.qinetiq.com with SMTP; 22 Jan 2004 13:44:38 -0000
Received: from lilith.local (unknown [212.158.244.14])
by ns1.bulldogdsl.com (Postfix) with ESMTP id 9433910527
for <address@hidden>; Thu, 22 Jan 2004 13:29:19 +0000 (GMT)
Received: (from address@hidden)
by lilith.local (8.12.9/8.12.9) id i0MDUjYu023779
for address@hidden; Thu, 22 Jan 2004 13:30:45 GMT
Date: Thu, 22 Jan 2004 13:30:45 GMT
From: "Gary V. Vaughan" <address@hidden>
Message-Id: <address@hidden>
To: address@hidden
X-UIDL: AFM!!k$2"!+!A"!(f)"!
Index: ChangeLog
from Gary V. Vaugan <address@hidden>
* lib/autoconf/programs.m4 (AC_PROG_SED): New macro to test for a
non-truncating sed or gsed program in PATH.
* tests/acprograms.at: Add it.
* doc/autoconf.texi (Particular Programs): Document it.
* NEWS: Updated.
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.323
diff -u -p -u -r1.323 NEWS
--- NEWS 12 Nov 2003 15:21:02 -0000 1.323
+++ NEWS 22 Jan 2004 13:24:09 -0000
@@ -1,5 +1,9 @@
* Major changes in Autoconf 2.59a
+** AC_PROG_SED
+ New macro that tests for a sed program that truncates as few characters
+ as possible.
+
* Major changes in Autoconf 2.59
Released 2003-11-04, by Akim Demaille
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.794
diff -u -p -u -r1.794 autoconf.texi
--- doc/autoconf.texi 14 Jan 2004 20:27:31 -0000 1.794
+++ doc/autoconf.texi 22 Jan 2004 13:24:15 -0000
@@ -3366,6 +3366,14 @@ Set output variable @code{RANLIB} to @sa
is found, and otherwise to @samp{:} (do nothing).
@end defmac
address@hidden AC_PROG_SED
address@hidden {PROG_SED}
address@hidden SED
+Set output variable @code{SED} to a @code{sed} on @samp{PATH} that
+truncates as few characters as possible. If @sc{GNU} Sed is found,
+use that instead.
address@hidden defmac
+
@defmac AC_PROG_YACC
@acindex{PROG_YACC}
@ovindex YACC
Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.17
diff -u -p -u -r1.17 programs.m4
--- lib/autoconf/programs.m4 22 May 2003 13:24:05 -0000 1.17
+++ lib/autoconf/programs.m4 22 Jan 2004 13:24:15 -0000
@@ -1,6 +1,6 @@
# This file is part of Autoconf. -*- Autoconf -*-
# Checking for programs.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -499,6 +499,63 @@ AC_DEFUN([AC_PROG_RANLIB],
AU_DEFUN([AC_RSH],
[AC_DIAGNOSE([obsolete], [$0: is no longer supported.
Remove this warning when you adjust the code.])])
+
+
+# AC_PROG_SED
+# -----------
+# Check for a fully functional sed program that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+if test -z "$SED"; then
+AC_CACHE_VAL(ac_cv_path_sed,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+_AS_PATH_WALK([$PATH],
+[for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then
+ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+ fi
+ done
+done])
+AS_TMPDIR([sed])
+_max=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for _sed in $_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $_sed && break
+ cat /dev/null > conftest.in
+ _count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ ac_cv_path_sed=$_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $_count -gt 10 && break
+ _count=`expr $_count + 1`
+ if test $_count -gt $_max; then
+ _max=$_count
+ ac_cv_path_sed=$_sed
+ fi
+ done
+done
+rm -rf "$tmp"
+])
+fi
+SED=$ac_cv_path_sed
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])
# AC_PROG_YACC
Index: tests/acprograms.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/acprograms.at,v
retrieving revision 1.4
diff -u -p -u -r1.4 acprograms.at
--- tests/acprograms.at 10 Sep 2003 16:54:12 -0000 1.4
+++ tests/acprograms.at 22 Jan 2004 13:24:15 -0000
@@ -4,7 +4,7 @@
## Do not edit by hand. ##
## --------------------- ##
-# Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
AT_BANNER([Testing autoconf/programs macros.])
@@ -16,6 +16,7 @@ AT_CHECK_MACRO([AC_PROG_LEX])
AT_CHECK_MACRO([AC_PROG_LN_S])
AT_CHECK_MACRO([AC_PROG_MAKE_SET])
AT_CHECK_MACRO([AC_PROG_RANLIB])
+AT_CHECK_MACRO([AC_PROG_SED])
AT_CHECK_MACRO([AC_PROG_YACC])
# Obsolete macros.
- 3-gary-new-AC_PROG_SED.patch,
Gary V. Vaughan <=