    done
    ;;
  esac
+-$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
++if [ -z "$BUILD_STATIC" ]
++then
++  $CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS $OPTIONS
++else
++  $AR crs libc++abi.a *.o
++fi
+ 
+ if [ -z $RC_XBS ]
+ then

--- buildit	2013-12-20 23:07:47.000000000 +0100
+++ buildit	2013-12-20 23:10:06.000000000 +0100
@@ -67,10 +67,10 @@ case $TRIPLE in
 	;;
   *)
     RC_CFLAGS="-fPIC"

-        -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
-        -lpthread -lrt -lc -lstdc++"
+    SOEXT=dylib
+    AEXT=a
+    LDSHARED_FLAGS="-o libc++abi.1.0.dylib \
+        -shared -nodefaultlibs -Wl,-install_name,libc++abi.1.dylib \
+        -lpthread -lc"
+    LDSTATIC_FLAGS="-lpthread -lc"
     ;;
 esac
 
 if [ -z $RC_XBS ]
 then
     rm -f libc++abi.1.$SOEXT*
+    rm -f libc++abi.1.$AEXT*
 fi
 
 set -x
 
 for FILE in ../src/*.cpp; do
