aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2017-04-08 22:23:32 +0300
committerDavid Bremner <david@tethera.net>2017-04-14 16:14:26 -0300
commit807a9cb8aa897462e247993a1cdfa96377aa20e4 (patch)
tree195a3fe006339909b3739b50587b5496460c393e /configure
parente08f5f76e406de2c6bdcf85952aaeb66ec0d37de (diff)
configure: Be more verbose when compiler sanity checks fail
When configure could not get past initial compiler sanity check the user was left with no explanation why this happened (usually the reason is that compilers are not installed). By printing the executed command line and re-executing it without output redirection user gets better information how to proceed (or ask for help) to resolve this problem. The shell builtin 'printf' is used to print the executed command line to ensure verbatim output.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 9 insertions, 2 deletions
diff --git a/configure b/configure
index 3447d868..ed7c2280 100755
--- a/configure
+++ b/configure
@@ -322,22 +322,29 @@ errors=0
printf "int main(void){return 0;}\n" > minimal.c
printf "Sanity checking C compilation environment... "
-if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
+test_cmdline="${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal"
+if ${test_cmdline} > /dev/null 2>&1
then
printf "OK.\n"
else
printf "Fail.\n"
errors=$((errors + 1))
+ printf Executed:; printf ' %s' ${test_cmdline}; echo
+ ${test_cmdline}
fi
printf "Sanity checking C++ compilation environment... "
-if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
+test_cmdline="${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal"
+if ${test_cmdline} > /dev/null 2>&1
then
printf "OK.\n"
else
printf "Fail.\n"
errors=$((errors + 1))
+ printf Executed:; printf ' %s' ${test_cmdline}; echo
+ ${test_cmdline}
fi
+unset test_cmdline
if [ $errors -gt 0 ]; then
cat <<EOF