X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=e80fdfb3f690cd94d2204befdd0925c81bf33870;hb=2d67ae923d11d766d9a6cea714fa487b52579f6a;hp=1a092f523b1b31138622b2d1c42761fa6575a871;hpb=5c27c4458f11adaba261353f84bcde4f79f0bdbd;p=musl diff --git a/configure b/configure index 1a092f52..e80fdfb3 100755 --- a/configure +++ b/configure @@ -123,8 +123,9 @@ target= optimize=auto debug=no warnings=no -shared=yes +shared=auto static=yes +wrapper=auto for arg ; do case "$arg" in @@ -189,24 +190,43 @@ trycc ${CROSS_COMPILE}cc 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 +printf "yes\n" +else +printf "no; compiler output follows:\n%s\n" "$output" +exit 1 +fi + # -# Only build musl-gcc wrapper if toolchain does not already target musl +# Need to know if the compiler is gcc to decide whether to build the +# musl-gcc wrapper, and for critical bug detection in some gcc versions. # -if test -z "$wrapper" ; then printf "checking whether compiler is gcc... " -if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then -echo yes +if fnmatch '*gcc\ version*' "$(LC_ALL=C $CC -v 2>&1)" ; then +cc_is_gcc=yes +else +cc_is_gcc=no +fi +echo "$cc_is_gcc" + +# +# Only build musl-gcc wrapper if toolchain does not already target musl +# +if test "$wrapper" = auto ; then printf "checking whether to build musl-gcc wrapper... " +if test "$cc_is_gcc" = yes ; then wrapper=yes while read line ; do case "$line" in */ld-musl-*) wrapper=no ;; esac done < "$tmpc" +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +fail "$0: error: compiler's floating point configuration is unsupported" +fi +else +SUBARCH=${SUBARCH}-nofpu +fi +fi test "$SUBARCH" \ && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH" @@ -475,7 +518,7 @@ libdir = $libdir includedir = $includedir syslibdir = $syslibdir CC = $CC -CFLAGS= $CFLAGS_AUTO $CFLAGS +CFLAGS = $CFLAGS_AUTO $CFLAGS CFLAGS_C99FSE = $CFLAGS_C99FSE CFLAGS_MEMOPS = $CFLAGS_MEMOPS CPPFLAGS = $CPPFLAGS