]> xenbits.xensource.com Git - seabios.git/commitdiff
Verify CC is valid during build tests.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 18 Feb 2013 15:28:55 +0000 (10:28 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 24 Feb 2013 17:01:34 +0000 (12:01 -0500)
Update test-build.sh to report if it can't run the c compiler at all.
Without this test, a totally non-working build environment will yield
an "invalid LD" message which can be confusing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
tools/test-build.sh

index ce0aca993f40bd0d88705d5ae39f8425bae6e611..081f9fd258388dd4a20dcdc1799793d2821de765 100755 (executable)
@@ -41,9 +41,16 @@ SECTIONS
 }
 EOF
 $CC -O -g -c $TMPFILE1 -o $TMPFILE1o > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+    echo "Unable to execute the C compiler ($CC)." >&2
+    echo "" >&2
+    echo "Please install a working compiler and retry." >&2
+    echo -1
+    exit 0
+fi
 $LD -T $TMPFILE1_ld $TMPFILE1o -o $TMPFILE2o > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-    echo "The version of LD on this system does not properly handle" >&2
+    echo "The version of LD on this system ($LD) does not properly handle" >&2
     echo "alignments.  As a result, this project can not be built." >&2
     echo "" >&2
     echo "The problem may be the result of this LD bug report:" >&2