Source
ARM_MULTILIB_ARCHS=`/usr/bin/lipo -info $ARM_SYSROOT/usr/lib/libSystem.dylib | cut -d':' -f 3 | sed -e 's/x86_64//' -e 's/i386//' -e 's/ppc7400//' -e 's/ppc64//' -e 's/^ *//' -e 's/ $//'`
# APPLE LOCAL file B&I
set -x
# -arch arguments are different than configure arguments. We need to
# translate them.
TRANSLATE_ARCH="sed -e s/ppc/powerpc/ -e s/i386/i686/ -e s/armv6/arm/"
OMIT_X86_64="sed -e s/x86_64//"
# Build GCC the "Apple way".
# Parameters:
# The first parameter is a space-separated list of the architectures
# the compilers will run on. For instance, "ppc i386". If the
# current machine isn't in the list, it will (effectively) be added.
HOSTS=`echo $1 | $TRANSLATE_ARCH `
# The second parameter is a space-separated list of the architectures the
# compilers will generate code for. If the current machine isn't in
# the list, a compiler for it will get built anyway, but won't be
# installed.
TARGETS=`echo $2 | $TRANSLATE_ARCH | $OMIT_X86_64`
# The GNU makefile target ('bootstrap' by default).
BOOTSTRAP=${BOOTSTRAP-bootstrap}
if [ "$BOOTSTRAP" != bootstrap ]; then
bootstrap=--disable-bootstrap
fi
# Language front-ends to build. This also affects
# whether the C++ driver and driver-driver are installed
LANGUAGES=${LANGUAGES-c,objc,c++,obj-c++}
# The B&I build script (~rc/bin/buildit) accepts an '-othercflags'
# command-line flag, and captures the argument to that flag in
# $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
# We will allow this to override the default $CFLAGS and $CXXFLAGS.
CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
# This isn't a parameter; it is the architecture of the current machine.
BUILD=`arch | $TRANSLATE_ARCH`
# The third parameter is the path to the compiler sources. There should
# be a shell script named 'configure' in this directory. This script
# makes a copy...
ORIG_SRC_DIR="$3"
# The fourth parameter is the location where the compiler will be installed,
# normally "/usr". You can move it once it's built, so this mostly controls
# the layout of $DEST_DIR.
DEST_ROOT="$4"
# The fifth parameter is the place where the compiler will be copied once
# it's built.
DEST_DIR="$5"
# The sixth parameter is a directory in which to place information (like
# unstripped executables and generated source files) helpful in debugging
# the resulting compiler.
SYM_DIR="$6"