>From 99fd54d6f2b7c84a02c1ca0d5f1397d709c14313 Mon Sep 17 00:00:00 2001 From: Laine Gholson Date: Mon, 24 Oct 2016 17:49:58 -0500 Subject: [PATCH] configure: check whether linker works too and move flag sanity checks to a seperate test --- configure | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 707eb12..e7d565c 100755 --- a/configure +++ b/configure @@ -236,8 +236,17 @@ 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 +echo 'int main(void) { return 0; }' > "$tmpc" +if output=$($CC -o /dev/null "$tmpc" 2>&1) ; then +printf "yes\n" +else +printf "no; compiler output follows:\n%s\n" "$output" +exit 1 +fi + +printf 'checking whether *FLAGS are sane... ' +echo 'int main(void) { return 0; }' > "$tmpc" +if output=$($CC $CFLAGS $CPPFLAGS $LDFLAGS -o /dev/null "$tmpc" 2>&1) ; then printf "yes\n" else printf "no; compiler output follows:\n%s\n" "$output" -- 2.10.1