summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2016-09-27 15:01:59 +0800
committerTobias Klauser <tklauser@distanz.ch>2016-09-29 09:23:30 +0200
commit4749393697360d02b2612673473163214ff99be1 (patch)
tree7bb6f9ff5fe84881a7bfc1a0ce587d96d3c23995
parent4432dd2ffea4fdc7e2c81ac2859af1e24277dfea (diff)
build: configure: fix checking CC containing -i option
On CentOS 6, the configure process may hang there reading stdin if the we have CC='gcc -isystem'. This can be reproduced with bash -c 'which gcc -i' Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rwxr-xr-xconfigure17
1 files changed, 12 insertions, 5 deletions
diff --git a/configure b/configure
index 5b2afe0..572fc6d 100755
--- a/configure
+++ b/configure
@@ -120,6 +120,13 @@ tools_remove()
TOOLS_NOBUILD=${TOOLS_NOBUILD# }
}
+check_command()
+{
+ local cmd="$1"
+
+ [ "x$(which "$cmd" 2>> config.log)" == "x" ]
+}
+
check_toolchain()
{
if [ "x$CROSS_COMPILE" != "x" ] ; then
@@ -128,7 +135,7 @@ check_toolchain()
fi
echo -n "[*] Checking compiler $CC ... "
- if [ "x$(which $CC 2>> config.log)" == "x" ] ; then
+ if check_command $CC ; then
echo "[NO]"
MISSING_TOOLCHAIN=1
else
@@ -137,7 +144,7 @@ check_toolchain()
fi
echo -n "[*] Checking linker $LD ... "
- if [ "x$(which $LD 2>> config.log)" == "x" ] ; then
+ if check_command $LD ; then
echo "[NO]"
MISSING_TOOLCHAIN=1
else
@@ -146,7 +153,7 @@ check_toolchain()
fi
echo -n "[*] Checking $PKG_CONFIG ... "
- if [ "x$(which $PKG_CONFIG 2>> config.log)" == "x" ] ; then
+ if check_command $PKG_CONFIG ; then
echo "[NO]"
MISSING_TOOLCHAIN=1
else
@@ -160,7 +167,7 @@ check_flex()
{
echo -n "[*] Checking flex ... "
- if [ "x$(which flex 2>> config.log)" == "x" ] ; then
+ if check_command flex ; then
echo "[NO]"
MISSING_DEFS=1
tools_remove "trafgen"
@@ -174,7 +181,7 @@ check_bison()
{
echo -n "[*] Checking bison ... "
- if [ "x$(which bison 2>> config.log)" == "x" ] ; then
+ if check_command bison ; then
echo "[NO]"
MISSING_DEFS=1
tools_remove "trafgen"