summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-01-30 14:46:50 (GMT)
committerYang Tse <yangsita@gmail.com>2013-01-30 14:46:50 (GMT)
commitb6dd41b6ef2e298be93d423015a3ad7a75f957bc (patch)
tree6f3ca9bb0f00043753afb7b312970365f1644e30
parent422717ba6f01052418688305b1917dc1c4ef2aea (diff)
downloadc-ares-b6dd41b6ef2e298be93d423015a3ad7a75f957bc.zip
c-ares-b6dd41b6ef2e298be93d423015a3ad7a75f957bc.tar.gz
c-ares-b6dd41b6ef2e298be93d423015a3ad7a75f957bc.tar.bz2
zz40-xc-ovr.m4: fix 'wc' detection - follow-up
- Take into account that 'wc' may return leading spaces and/or tabs. - Set initial IFS to space, tab and newline.
-rw-r--r--m4/zz40-xc-ovr.m428
1 files changed, 20 insertions, 8 deletions
diff --git a/m4/zz40-xc-ovr.m4 b/m4/zz40-xc-ovr.m4
index b5e9dfe..83b1d84 100644
--- a/m4/zz40-xc-ovr.m4
+++ b/m4/zz40-xc-ovr.m4
@@ -51,10 +51,18 @@ XC_CONFIGURE_PREAMBLE_VER_MINOR ##
xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR'
xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR'
-xc_configure_preamble_prev_IFS=$IFS
+#
+# Set IFS to space, tab and newline.
+#
+
+xc_space=' '
+xc_tab=' '
+xc_newline='
+'
+IFS="$xc_space$xc_tab$xc_newline"
#
-# Set internationalization behavior variables
+# Set internationalization behavior variables.
#
LANG='C'
@@ -64,6 +72,10 @@ export LANG
export LC_ALL
export LANGUAGE
+#
+# Some useful variables.
+#
+
xc_msg_warn='configure: WARNING:'
xc_msg_abrt='Can not continue.'
xc_msg_err='configure: error:'
@@ -263,9 +275,9 @@ AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
# Verify that 'tr' utility is found within 'PATH', otherwise abort.
#
-xc_tst_str='98s7u6c5c4e3s2s10'
+xc_tst_str='${xc_tab}98s7u6c5c4e3s2s10'
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
- | tr -d '0123456789' 2>/dev/null`
+ | tr -d "0123456789$xc_tab" 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
@@ -294,7 +306,7 @@ AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
xc_tst_str='unknown unknown unknown unknown'
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
- | wc -w 2>/dev/null | tr -d ' ' 2>/dev/null`
+ | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
x4)
:
@@ -322,7 +334,8 @@ AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
#
xc_tst_str='unknown'
-xc_tst_str=`cat <<_EOT 2>/dev/null | wc -l 2>/dev/null | tr -d ' ' 2>/dev/null
+xc_tst_str=`cat <<_EOT 2>/dev/null \
+ | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null
unknown
unknown
unknown
@@ -425,8 +438,7 @@ AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
-IFS=$xc_configure_preamble_prev_IFS
-
+dnl
xc_configure_preamble_result='yes'
])