1 # This file is part of Autoconf. -*- Autoconf -*-
2 # M4 sugar for common shell constructs.
3 # Requires GNU M4 and M4sugar.
5 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
6 # 2009, 2010 Free Software Foundation, Inc.
8 # This file is part of Autoconf. This program is free
9 # software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the
11 # Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # Under Section 7 of GPL version 3, you are granted additional
20 # permissions described in the Autoconf Configure Script Exception,
21 # version 3.0, as published by the Free Software Foundation.
23 # You should have received a copy of the GNU General Public License
24 # and a copy of the Autoconf Configure Script Exception along with
25 # this program; see the files COPYINGv3 and COPYING.EXCEPTION
26 # respectively. If not, see <http://www.gnu.org/licenses/>.
28 # Written by Akim Demaille, Pavel Roskin, Alexandre Oliva, Lars J. Aas
29 # and many other people.
31 # Define AS_ECHO for compatibility with Autoconf before version 2.62.
32 m4_ifndef([AS_ECHO], [
36 # Output WORD followed by a newline. WORD must be a single shell word
37 # (typically a quoted string). The bytes of WORD are output as-is, even
38 # if it starts with "-" or contains "\".
39 m4_defun_init([AS_ECHO],
40 [AS_REQUIRE([_$0_PREPARE])],
46 # Like AS_ECHO(WORD), except do not output the trailing newline.
47 m4_defun_init([AS_ECHO_N],
48 [AS_REQUIRE([_AS_ECHO_PREPARE])],
54 # Arrange for $as_echo 'FOO' to echo FOO without escape-interpretation;
55 # and similarly for $as_echo_n, which omits the trailing newline.
56 # 'FOO' is an optional single argument; a missing FOO is treated as empty.
57 m4_defun([_AS_ECHO_PREPARE],
61 # Printing a long string crashes Solaris 7 /usr/bin/printf.
62 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
63 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
64 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
65 # Prefer a ksh shell builtin over an external printf program on Solaris,
66 # but without wasting forks for bash or zsh.
67 if test -z "$BASH_VERSION$ZSH_VERSION" \
68 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
70 as_echo_n='print -rn --'
71 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
75 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
76 as_echo_body='eval /usr/ucb/echo -n "$][1$as_nl"'
77 as_echo_n='/usr/ucb/echo -n'
79 as_echo_body='eval expr "X$][1" : "X\\(.*\\)"'
84 expr "X$arg" : "X\\(.*\\)$as_nl";
85 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
87 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
90 as_echo_n='sh -c $as_echo_n_body as_echo'
93 as_echo='sh -c $as_echo_body as_echo'