source phases/build_dependencies.sh
source phases/build_otr.sh
#source phases/build_vv_dependencies.sh source phases/build_purple.sh
source phases/make_frameworks.sh
# Check that we're in the Dependencies directory if !
expr
"$ROOTDIR" :
'.*/Dependencies$' &>
/dev/null
; then error
"Please run this script from the Dependencies directory." TARGET_BASE="apple-darwin10" # Arrays for archs and host systems, sometimes an -arch just isnt enough! ARCHS=( "x86_64" "i386" ) HOSTS=( "x86_64-${TARGET_BASE}" "i686-${TARGET_BASE}" ) NUMBER_OF_CORES=`sysctl
-n
hw.activecpu
` # Also try /Developer-old, just in case XCode 4 is installed DEVELOPER=$(xcode-select
-print-path
) # SDK_ROOT="${DEVELOPER}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk" SDK_ROOT="/Developer/SDKs/MacOSX10.6.sdk/" BASE_CFLAGS="-fstack-protector -isysroot $SDK_ROOT \ -mmacosx-version-min=$MIN_OS_VERSION \ -I$ROOTDIR/build/include \ BASE_LDFLAGS="-mmacosx-version-min=$MIN_OS_VERSION \ -Wl,-syslibroot,$SDK_ROOT \ -Wl,-headerpad_max_install_names \ -I$ROOTDIR/build/include \ for (( i=0; i<
${#ARCHS[@]}; i++
)) ; do if [[ $1 == ${ARCHS[i]} ]] ; then tempArchs
[$((i-offset))]=${ARCHS[i]} tempHosts
[$((i-offset))]=${HOSTS[i]} ARCHS=( ${tempArchs[@]} ) HOSTS=( ${tempHosts[@]} ) for ARCH
in ${ARCHS[@]} ; do ARCH_FLAGS="${ARCH_FLAGS:= } -arch ${ARCH}" ARCH_CFLAGS="${BASE_CFLAGS} ${ARCH_FLAGS:= }" ARCH_LDFLAGS="${BASE_LDFLAGS} ${ARCH_FLAGS:= }" # handle commandline options STRAIGHT_TO_LIBPURPLE=false for option
in ${@:1} ; do warning
"Packages will be reconfigured!" warning
"x86_64 target removed! Libpurple will not be universal!" warning
"i386 target removed! libpurple will not be universal!" BASE_CFLAGS="-I$ROOTDIR/build/include -L$ROOTDIR/build/lib" BASE_LDFLAGS="-Wl,-headerpad_max_install_names \ -I$ROOTDIR/build/include -L$ROOTDIR/build/lib" warning
"libpurple will be built for your native arcticture only!" asserttools
"$DEVELOPER/usr/bin/distcc" asserttools
"$DEVELOPER/usr/bin/pump" export DISTCC_HOSTS="${DISTCC_HOSTS:=} ${option##*=},lzo,cpp" asserttools
"$DEVELOPER/usr/bin/llvm-gcc" export CC="$DEVELOPER/usr/bin/llvm-gcc" export CXX="$DEVELOPER/usr/bin/llvm-g++" warning
"Building with LLVM! This is unsupported and will probably break things!" HG_UPDATE_PARAM="${HG_UPDATE_PARAM} -r ${HG_REV}" HG_UPDATE_PARAM="${HG_UPDATE_PARAM} ${HG_BRANCH}" STRAIGHT_TO_LIBPURPLE=true echo 'The following options are valid: --configure : Force a configure during the build process --disable-[arch] : Eliminate [arch] from the build process --build-native : Build only for your current architecture (currently breaks liboil on x86_64) --build-otr : Build libotr and dependancies instead --enable-distcchost=[host] : Add a host to the distcc conf. Enables distcc build. `man distcc` for more information. --enable-llvm : Enable building with llvm-gcc. WARNING: This is currently broken! --libpurple-rev=[rev] : Force a specific libpurple revision --libpurple-branch=[branch] : Force a secific libpurple branch --libpurple-only : Assume all dependencies are already built and start the build with libpurple itself --download-libpurple : Download the libpurple Mercurial repository Note that explicitly setting any arch flags implies a forced reconfigure.' echo "Unknown command. Run ${0} --help for a list of commands." if [ "$DISTCC_HOSTS" !
= "" ]; then export DISTCC_HOSTS="--randomize ${DISTCC_HOSTS} localhost/${NUMBER_OF_CORES}" export DISTCC_COMPILER=$(${CC:=$DEVELOPER/usr/bin/gcc} --version
|head
-n1
) export CC="$DEVELOPER/usr/bin/distcc ${CC:=$DEVELOPER/usr/bin/gcc}" export CXX="$DEVELOPER/usr/bin/distcc ${CXX:=$DEVELOPER/usr/bin/g++}" NUMBER_OF_CORES=`$DEVELOPER/usr/bin/distcc
-j
` eval `$DEVELOPER/usr/bin/pump
--startup
` # Try to find the right gcc, even when XCode4 is installed # this file contans the stdio and stderr of the most recent build LOG_FILE="${ROOTDIR}/build.log" ERR_FILE="${ROOTDIR}/error.log" # set -arch flags now, after the user has had a chance to disable one or more # assert that the developer can, in fact, build libpurple. Why waste his time if he can't? # Ok, so we keep running into issues where MacPorts will volunteer to supply # dependencies that we want to build ourselves. # Getting hg's path before we export our own (safer?) path will ensure it works, # even if it's being managed by MacPorts, Fink, or similar. export PATH=$ROOTDIR/build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
$DEVELOPER/usr/bin:
$DEVELOPER/usr/sbin
export PKG_CONFIG="$ROOTDIR/build/bin/pkg-config" export PKG_CONFIG_PATH="$ROOTDIR/build/lib/pkgconfig:/usr/lib/pkgconfig" # Make the source and build directories while we're here if $STRAIGHT_TO_LIBPURPLE; then # TODO: Make this parameterizable if [ "$DISTCC_HOSTS" !
= "" ]; then $DEVELOPER/usr/bin/pump
--shutdown
#ugly. gotta be a better way if [[ !
$BUILD_OTR ]] ; then