move MREMAP_MAYMOVE and MREMAP_FIXED out of bits
[musl] / configure
index 03c193d..e80fdfb 100755 (executable)
--- a/configure
+++ b/configure
@@ -123,7 +123,7 @@ target=
 optimize=auto
 debug=no
 warnings=no
-shared=yes
+shared=auto
 static=yes
 wrapper=auto
 
@@ -204,7 +204,7 @@ fi
 # musl-gcc wrapper, and for critical bug detection in some gcc versions.
 #
 printf "checking whether compiler is gcc... "
-if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then
+if fnmatch '*gcc\ version*' "$(LC_ALL=C $CC -v 2>&1)" ; then
 cc_is_gcc=yes
 else
 cc_is_gcc=no
@@ -250,6 +250,7 @@ x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
 x86_64*) ARCH=x86_64 ;;
 mips*) ARCH=mips ;;
 microblaze*) ARCH=microblaze ;;
+or1k*) ARCH=or1k ;;
 powerpc*) ARCH=powerpc ;;
 sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
 unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
@@ -298,12 +299,9 @@ fi
 tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
 
 #
-# If debugging is explicitly enabled, don't auto-enable optimizations
+# Enable debugging if requessted.
 #
-if test "$debug" = yes ; then
-CFLAGS_AUTO=-g
-test "$optimize" = auto && optimize=no
-fi
+test "$debug" = yes && CFLAGS_AUTO=-g
 
 #
 # Possibly add a -O option to CFLAGS and select modules to optimize with
@@ -412,12 +410,15 @@ fi
 tryflag CFLAGS_AUTO -fno-stack-protector
 tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
 
+test "$shared" = "no" || {
 # Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions
 LDFLAGS_DUMMY=
 tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || {
+test "$shared" = "yes" && fail "$0: error: linker cannot build shared library"
 printf "warning: disabling dynamic linking support\n"
 shared=no
 }
+}
 
 # Find compiler runtime library
 test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
@@ -495,27 +496,6 @@ printf "no\n"
 fail "$0: error: unsupported long double type"
 fi
 
-#
-# Check for known bug in GCC 4.9.0 that results in a broken libc.
-#
-if test "$cc_is_gcc" = yes ; then
-printf "checking for gcc constant folding bug with weak aliases... "
-echo 'static int x = 0;' > "$tmpc"
-echo 'extern int y __attribute__((__weak__, __alias__("x")));' >> "$tmpc"
-echo 'extern int should_appear;' >> "$tmpc"
-echo 'int foo() { return y ? should_appear : 0; }' >> "$tmpc"
-case "$($CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include \
-  $CPPFLAGS $CFLAGS_AUTO $CFLAGS -S -o - "$tmpc" 2>/dev/null)" in
-*should_appear*)
-printf "no\n"
-;;
-*)
-printf "yes\n"
-fail "$0: error: broken compiler; try CFLAGS=-fno-toplevel-reorder"
-;;
-esac
-fi
-
 printf "creating config.mak... "
 
 cmdline=$(quote "$0")