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

This commit is contained in:
Jeremy Huddleston
2009-12-20 21:34:27 -08:00
parent 4a1e103858
commit ad7f9d71e2

View File

@@ -724,22 +724,10 @@ case $ARCH in
# examine first object to determine ABI # examine first object to determine ABI
set ${OBJECTS} set ${OBJECTS}
ABI_PPC=`file $1 | grep ' ppc'` ABIS=`lipo -info $1 | sed s/.*://`
ABI_I386=`file $1 | grep ' i386'` for ABI in $ABIS; do
ABI_PPC64=`file $1 | grep ' ppc64'` OPTS="${OPTS} -arch ${ABI}"
ABI_X86_64=`file $1 | grep ' x86_64'` done
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
if [ "${ALTOPTS}" ] ; then if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS} OPTS=${ALTOPTS}