summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-05-12 14:22:57 -0400
committerRich Felker <dalias@aerifal.cx>2014-05-12 14:22:57 -0400
commit8945667fadc2eb71b7924bb4c5a69507fd362f4a (patch)
tree5b8d888279344404e86caffe5b0483396c46ab0e /configure
parentac0acd569e01735fc6052d43fdf57f3a07c93f3d (diff)
downloadmusl-8945667fadc2eb71b7924bb4c5a69507fd362f4a.tar.gz
musl-8945667fadc2eb71b7924bb4c5a69507fd362f4a.tar.bz2
musl-8945667fadc2eb71b7924bb4c5a69507fd362f4a.tar.xz
musl-8945667fadc2eb71b7924bb4c5a69507fd362f4a.zip
add configure check for working compiler
without this, broken choices of CC/CPPFLAGS/CFLAGS don't show up until late in the configure process where they are confusingly reported as a different failure such as incorrect long double type.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure b/configure
index e8a990b0..5d956723 100755
--- a/configure
+++ b/configure
@@ -189,6 +189,15 @@ trycc ${CROSS_COMPILE}cc
printf "%s\n" "$CC"
test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
+printf "checking whether C compiler works... "
+echo "typedef int x;" > "$tmpc"
+if output=$($CC $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then
+printf "yes\n"
+else
+printf "no; compiler output follows:\n%s\n" "$output"
+exit 1
+fi
+
#
# Only build musl-gcc wrapper if toolchain does not already target musl
#