PPC port cleaned up, static linking works well now.
[musl] / configure
index 19c241e..288d65d 100755 (executable)
--- a/configure
+++ b/configure
@@ -58,7 +58,7 @@ else eval "fnmatch '*/' \"\${$1}\"" && eval "$1=\${$1%/}" ; fi
 tryflag () {
 printf "checking whether compiler accepts %s... " "$2"
 echo "typedef int x;" > "$tmpc"
-if $CC "$2" -c -o /dev/null "$tmpc" 2>/dev/null ; then
+if $CC "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
 printf "yes\n"
 eval "$1=\"\${$1} \$2\""
 eval "$1=\${$1# }"
@@ -72,7 +72,7 @@ fi
 tryldflag () {
 printf "checking whether linker accepts %s... " "$2"
 echo "typedef int x;" > "$tmpc"
-if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" 2>/dev/null ; then
+if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
 printf "yes\n"
 eval "$1=\"\${$1} \$2\""
 eval "$1=\${$1# }"
@@ -203,6 +203,7 @@ i?86*) ARCH=i386 ;;
 x86_64*) ARCH=x86_64 ;;
 mips-*|mipsel-*) ARCH=mips ;;
 microblaze-*) ARCH=microblaze ;;
+powerpc-*) ARCH=powerpc ;;
 unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
 *) fail "$0: unknown or unsupported target \"$target\"" ;;
 esac
@@ -299,7 +300,8 @@ shared=no
 # Find compiler runtime library
 test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
 test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
-test -z "$LIBCC" && tryldflag LIBCC -lpcc
+test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
+                 && tryldflag LIBCC "$try_libcc"
 printf "using compiler runtime libraries: %s\n" "$LIBCC"