X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=143dc92740aa36025870fdc255a5b0a76a6fee49;hb=c648cefb27984db60474ec1747cbfde83c2856d0;hp=0e396941ae208212690e00c1f7b3fb9f8dc91e86;hpb=de2b67f8d41e08caa56bf6540277f6561edb647f;p=musl diff --git a/configure b/configure index 0e396941..143dc927 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 # @@ -419,7 +421,7 @@ tryflag CFLAGS_AUTO -Wno-unknown-pragmas tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast fi -if test "x$visibility" == xauto ; then +if test "x$visibility" = xauto ; then # This test checks toolchain support for several things: # - the -include option # - the attributes/pragmas used in vis.h @@ -428,8 +430,8 @@ printf "checking whether global visibility preinclude works... " echo 'int (*fp)(void);' > "$tmpc" echo 'int foo(void) { }' >> "$tmpc" echo 'int bar(void) { fp = foo; return foo(); }' >> "$tmpc" -if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I src/internal -I./include \ - $CPPFLAGS $CFLAGS -DSHARED -fPIC -include vis.h \ +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \ + -DSHARED -fPIC -I./src/internal -include vis.h \ -nostdlib -shared -Wl,-Bsymbolic-functions \ -o /dev/null "$tmpc" >/dev/null 2>&1 ; then visibility=yes @@ -439,7 +441,7 @@ fi printf "%s\n" "$visibility" fi -if test "x$visibility" == xyes ; then +if test "x$visibility" = xyes ; then CFLAGS_AUTO="$CFLAGS_AUTO -include vis.h" CFLAGS_AUTO="${CFLAGS_AUTO# }" fi @@ -466,7 +468,7 @@ printf "using compiler runtime libraries: %s\n" "$LIBCC" # Figure out arch variants for archs with variants SUBARCH= -t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS_AUTO $CFLAGS" +t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" if test "$ARCH" = "x86_64" ; then trycppif __ILP32__ "$t" && ARCH=x32