X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=41a73b46ef7e5d1d43b68c854605d67a6aed0b9c;hb=f1faa0e12fd68379420b07ebf2eba43a5be1f2d3;hp=e8a990b01396d4b11de0d639a9be1e337cb656f2;hpb=23d64182d8328c300b368446aad20da9cec91aa3;p=musl diff --git a/configure b/configure index e8a990b0..41a73b46 100755 --- a/configure +++ b/configure @@ -111,6 +111,7 @@ fi CFLAGS_C99FSE= CFLAGS_AUTO= CFLAGS_MEMOPS= +CFLAGS_NOSSP= LDFLAGS_AUTO= OPTIMIZE_GLOBS= prefix=/usr/local/musl @@ -123,8 +124,9 @@ target= optimize=auto debug=no warnings=no -shared=yes +shared=auto static=yes +wrapper=auto for arg ; do case "$arg" in @@ -189,24 +191,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 <