gallium/draw: added comments, whitespace fixes
[mesa.git] / bin / mklib
index 244494500685c9defe6aeb0177f054fbbda4ab6e..3bec160b40cff6a230c886a201ad5e0e6c6c7678 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -724,22 +724,10 @@ case $ARCH in
 
            # examine first object to determine ABI
            set ${OBJECTS}
-            ABI_PPC=`file $1 | grep ' ppc'`
-            ABI_I386=`file $1 | grep ' i386'`
-            ABI_PPC64=`file $1 | grep ' ppc64'`
-            ABI_X86_64=`file $1 | grep ' x86_64'`
-            if [ "${ABI_PPC}" ] ; then
-                OPTS="${OPTS} -arch ppc"
-            fi
-            if [ "${ABI_I386}" ] ; then
-                OPTS="${OPTS} -arch i386"
-            fi
-            if [ "${ABI_PPC64}" ] ; then
-                OPTS="${OPTS} -arch ppc64"
-            fi
-            if [ "${ABI_X86_64}" ] ; then
-                OPTS="${OPTS} -arch x86_64"
-            fi
+            ABIS=`lipo -info $1 | sed s/.*://`
+            for ABI in $ABIS; do
+                OPTS="${OPTS} -arch ${ABI}"
+            done
 
             if [ "${ALTOPTS}" ] ; then
                 OPTS=${ALTOPTS}
@@ -971,5 +959,6 @@ esac
 #
 if [ ${INSTALLDIR} != "." ] ; then
     echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
+    test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
     mv ${FINAL_LIBS} ${INSTALLDIR}/
 fi