Skip to content

Commit

Permalink
zz40-xc-ovr.m4: emit witness message in configure BODY
Browse files Browse the repository at this point in the history
This avoids witness message in output when running configure --help,
while sending the message to config.log for other configure runs.
  • Loading branch information
yangtse committed Jan 26, 2013
1 parent d9c3505 commit 44cf225
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions m4/zz40-xc-ovr.m4
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
echo "checking whether some basic commands and utilities are available... yes"
IFS=$xc_configure_preamble_prev_IFS
xc_configure_preamble_result='yes'
])


Expand Down Expand Up @@ -449,6 +449,36 @@ m4_define([$0],[])dnl
])


dnl _XC_OVR_ZZ40_WITNESS
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that allows knowing wether macro
dnl XC_CONFIGURE_PREAMBLE has expanded before configure
dnl body begins, and if it has suceeded when configure
dnl finally runs. Results are recorded in config.log

AC_DEFUN([_XC_OVR_ZZ40_WITNESS],
[dnl
m4_divert_text([BODY],
[dnl
#
# Witness that XC_CONFIGURE_PREAMBLE has been used.
#
if test -z "$xc_configure_preamble_result"; then
AC_MSG_WARN([a macro expansion problem has been detected])
if test -z "$PATH_SEPARATOR"; then
AC_MSG_ERROR([variable 'PATH_SEPARATOR' not set (internal problem)])
fi
else
AC_MSG_CHECKING([whether some basic commands and utilities are available])
AC_MSG_RESULT([$xc_configure_preamble_result])
fi
])dnl
])


dnl XC_OVR_ZZ40
dnl -------------------------------------------------
dnl Placing a call to this macro in configure.ac will
Expand All @@ -458,7 +488,8 @@ dnl provided elsewhere.
dnl
dnl This is the proper and intended way in which macro
dnl XC_CONFIGURE_PREAMBLE will expand early enough in
dnl generated configure script.
dnl generated configure script, as well as witness of
dnl its usage into configure body.

AC_DEFUN([XC_OVR_ZZ40],
[dnl
Expand Down Expand Up @@ -487,6 +518,8 @@ AC_BEFORE([$0],[AC_CONFIG_HEADERS])dnl
AC_BEFORE([$0],[AC_CONFIG_MACRO_DIR])dnl
AC_BEFORE([$0],[AC_CONFIG_MACRO_DIRS])dnl
dnl
AC_REQUIRE([_XC_OVR_ZZ40_WITNESS])dnl
dnl
m4_pattern_forbid([^_*XC])dnl
m4_define([$0],[])dnl
])
Expand Down

0 comments on commit 44cf225

Please sign in to comment.