darwin: mklib: Use lipo rather than file to figure out architectures of object files

(cherry picked from commit ad7f9d71e2)
This commit is contained in:
Jeremy Huddleston 2009-12-20 21:34:27 -08:00 committed by Jeremy Huddleston
parent da5741cf53
commit 189ee75abb
1 changed files with 4 additions and 16 deletions

View File

@ -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}