mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] configure: check for -march and -mtune passed via CC
@ 2015-04-21 17:34 Andre McCurdy
  2015-04-21 17:38 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Andre McCurdy @ 2015-04-21 17:34 UTC (permalink / raw)
  To: musl; +Cc: Andre McCurdy

Some build environments pass -march and -mtune as part of CC, therefore
update configure to check both CC and CFLAGS before making the decision
to fall back to generic -march and -mtune options for x86.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 configure | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index e35c9b6..f325cda 100755
--- a/configure
+++ b/configure
@@ -391,10 +391,12 @@ tryflag CFLAGS_AUTO -Wa,--noexecstack
 # extensions enabled by default. This is bad for making static binaries.
 # We cheat and use i486 rather than i386 because i386 really does not
 # work anyway (issues with atomic ops).
+# Some build environments pass -march and -mtune options via CC, so
+# check both CC and CFLAGS.
 #
 if test "$ARCH" = "i386" ; then
-fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -march=i486
-fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic
+fnmatch '-march=*|*\ -march=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -march=i486
+fnmatch '-mtune=*|*\ -mtune=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic
 fi
 
 #
-- 
1.9.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-21 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 17:34 [PATCH] configure: check for -march and -mtune passed via CC Andre McCurdy
2015-04-21 17:38 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).