From: Akim Demaille Date: Mon, 10 Jul 2000 10:55:48 +0000 (+0000) Subject: * acspecific.m4 (_AC_PROG_ECHO): Modernize. X-Git-Tag: autoconf-2.50~735 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0e9f9300b0779b890abe282eef836840ec0f1df;p=thirdparty%2Fautoconf.git * acspecific.m4 (_AC_PROG_ECHO): Modernize. --- diff --git a/ChangeLog b/ChangeLog index f7c835aa9..6c7250305 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-07-10 Akim Demaille + + * acspecific.m4 (_AC_PROG_ECHO): Modernize. + 2000-07-10 Akim Demaille Stop being ridiculous :*( diff --git a/acspecific.m4 b/acspecific.m4 index 5db7b7201..c3a311488 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -62,19 +62,15 @@ # Don't try to cache, since the results of this macro are needed to # display the checking message. In addition, caching something used once # has little interest. -# Idea borrowed from dist 3.0. +# Idea borrowed from dist 3.0. Use `*c*,', not `*c,' because if `\c' +# failed there is also a new-line to match. define([_AC_PROG_ECHO], -[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ECHO_N= ECHO_C=' -' ECHO_T=' ' - else - ECHO_N=-n ECHO_C= ECHO_T= - fi -else - ECHO_N= ECHO_C='\c' ECHO_T= -fi +[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac AC_SUBST(ECHO_C)dnl AC_SUBST(ECHO_N)dnl AC_SUBST(ECHO_T)dnl diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 5db7b7201..c3a311488 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -62,19 +62,15 @@ # Don't try to cache, since the results of this macro are needed to # display the checking message. In addition, caching something used once # has little interest. -# Idea borrowed from dist 3.0. +# Idea borrowed from dist 3.0. Use `*c*,', not `*c,' because if `\c' +# failed there is also a new-line to match. define([_AC_PROG_ECHO], -[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ECHO_N= ECHO_C=' -' ECHO_T=' ' - else - ECHO_N=-n ECHO_C= ECHO_T= - fi -else - ECHO_N= ECHO_C='\c' ECHO_T= -fi +[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac AC_SUBST(ECHO_C)dnl AC_SUBST(ECHO_N)dnl AC_SUBST(ECHO_T)dnl