Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1432662694-13524-1-git-send-email-alexinbeijing@gmail.com>
Date: Tue, 26 May 2015 19:51:34 +0200
From: Alex Dowad <alexinbeijing@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] When building, don't use flags which cause compiler warning

A number of gcc flags are ignored by clang, and it prints annoying warnings
to let you know. There is no reason to use these flags with a compiler which
doesn't support them.
---

Dear muslers,

Not sure what you'll think of this... but please have a look.

Thanks,
Alex Dowad

 configure | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index cf9227a..30daa97 100755
--- a/configure
+++ b/configure
@@ -80,11 +80,16 @@ fi
 tryflag () {
 printf "checking whether compiler accepts %s... " "$2"
 echo "typedef int x;" > "$tmpc"
-if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
-printf "yes\n"
-eval "$1=\"\${$1} \$2\""
-eval "$1=\${$1# }"
-return 0
+if output=$($CC $2 -c -o /dev/null "$tmpc" 2>&1) ; then
+  if fnmatch '*warning*' "$output"; then
+    printf "disabled due to compiler warning\n"
+    return 1
+  else
+    printf "yes\n"
+    eval "$1=\"\${$1} \$2\""
+    eval "$1=\${$1# }"
+    return 0
+  fi
 else
 printf "no\n"
 return 1
-- 
2.0.0.GIT

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.