X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=435988258db6cf513a485e65c2daf9b3ef621a01;hb=e9f4fd1185badfc005fcfe5c7de27d58baec057c;hp=6310e0b9320c5a8c89db79595ab02df948f488b4;hpb=aba17aa3599c06af39ca7a89188070f4184945c5;p=musl diff --git a/configure b/configure index 6310e0b9..43598825 100755 --- a/configure +++ b/configure @@ -172,6 +172,8 @@ case "$arg" in --host=*|--target=*) target=${arg#*=} ;; --build=*) build=${arg#*=} ;; -* ) echo "$0: unknown option $arg" ;; +AR=*) AR=${arg#*=} ;; +RANLIB=*) RANLIB=${arg#*=} ;; CC=*) CC=${arg#*=} ;; CFLAGS=*) CFLAGS=${arg#*=} ;; CPPFLAGS=*) CPPFLAGS=${arg#*=} ;; @@ -322,6 +324,7 @@ microblaze*) ARCH=microblaze ;; or1k*) ARCH=or1k ;; powerpc64*|ppc64*) ARCH=powerpc64 ;; powerpc*|ppc*) ARCH=powerpc ;; +riscv64*) ARCH=riscv64 ;; sh[1-9bel-]*|sh|superh*) ARCH=sh ;; s390x*) ARCH=s390x ;; unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; @@ -491,6 +494,13 @@ fnmatch '-march=*|*\ -march=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -march=i48 fnmatch '-mtune=*|*\ -mtune=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic fi +# +# GCC defines -w as overriding any -W options, regardless of order, but +# clang has a bunch of annoying warnings enabled by default and needs -w +# to start from a clean slate. So use -w if building with clang. +# +test "$cc_family" = clang && tryflag CFLAGS_AUTO -w + # # Even with -std=c99, gcc accepts some constructs which are constraint # violations. We want to treat these as errors regardless of whether @@ -573,6 +583,20 @@ printf "using compiler runtime libraries: %s\n" "$LIBCC" SUBARCH= t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" +if test "$ARCH" = "i386" ; then +printf "checking whether compiler can use ebx in PIC asm constraints... " +cat > "$tmpc" </dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_EBX_ASM" +fi +fi + if test "$ARCH" = "x86_64" ; then trycppif __ILP32__ "$t" && ARCH=x32 fi @@ -629,6 +653,15 @@ if test "$ARCH" = "powerpc" ; then trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \ "$0: error: compiler's floating point configuration is unsupported" trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf +printf "checking whether compiler can use 'd' constraint in asm... " +echo 'double f(double x) { __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); return x; }' > "$tmpc" +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_PPC_D_ASM" +CFLAGS_AUTO="${CFLAGS_AUTO# }" +fi fi test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ @@ -640,6 +673,11 @@ trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le trycppif _SOFT_FLOAT "$t" && fail "$0: error: soft-float not supported on powerpc64" fi +if test "$ARCH" = "riscv64" ; then +trycppif __riscv_float_abi_soft "$t" && SUBARCH=${SUBARCH}-sf +trycppif __riscv_float_abi_single "$t" && SUBARCH=${SUBARCH}-sp +fi + if test "$ARCH" = "sh" ; then tryflag CFLAGS_AUTO -Wa,--isa=any trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb @@ -714,6 +752,8 @@ cat << EOF # This version of config.mak was generated by: # $cmdline # Any changes made here will be lost if configure is re-run +AR = ${AR:-\$(CROSS_COMPILE)ar} +RANLIB = ${RANLIB:-\$(CROSS_COMPILE)ranlib} ARCH = $ARCH SUBARCH = $SUBARCH ASMSUBARCH = $ASMSUBARCH