Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[3f9ab6]: mac / ExternalPrograms / scripts / static / boost.sh Maximize Restore History

Download this file

boost.sh    139 lines (103 with data), 2.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# ------------------
# boost
# ------------------
# $Id: boost.sh 1902 2007-02-04 22:27:47Z ippei $
# Copyright (c) 2007-2008, Ippei Ukai
# prepare
# export REPOSITORYDIR="/PATH2HUGIN/mac/ExternalPrograms/repository" \
# ARCHS="ppc i386" \
# ppcTARGET="powerpc-apple-darwin8" \
# ppcOSVERSION="10.4" \
# ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \
# ppcOPTIMIZE="-mcpu=G3 -mtune=G4" \
# i386TARGET="i386-apple-darwin8" \
# i386OSVERSION="10.4" \
# i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \
# i386OPTIMIZE ="-march=prescott -mtune=pentium-m -ftree-vectorize" \
# OTHERARGs="";
BOOST_VER="1_35"
# install headers
rm -rf "$REPOSITORYDIR/include/boost";
cp -R "./boost" "$REPOSITORYDIR/include/";
# compile bjab
cd "./tools/jam/src";
sh "build.sh";
cd "../../../";
BJAM=$(ls ./tools/jam/src/bin.mac*/bjam)
# init
let NUMARCH="0"
for i in $ARCHS
do
NUMARCH=$(($NUMARCH + 1))
done
mkdir -p "$REPOSITORYDIR/lib";
# compile boost_thread
for ARCH in $ARCHS
do
mkdir -p "stage-$ARCH";
if [ $ARCH = "i386" -o $ARCH = "i686" ]
then
MACSDKDIR=$i386MACSDKDIR
OSVERSION=$i386OSVERSION
OPTIMIZE=$i386OPTIMIZE
boostARCHITECTURE="x86"
boostADDRESSMODEL="32"
elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ]
then
MACSDKDIR=$ppcMACSDKDIR
OSVERSION=$ppcOSVERSION
OPTIMIZE=$ppcOPTIMIZE
boostARCHITECTURE="power"
boostADDRESSMODEL="32"
elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ]
then
MACSDKDIR=$ppc64MACSDKDIR
OSVERSION=$ppcOSVERSION
OPTIMIZE=$ppc64OPTIMIZE
boostARCHITECTURE="power"
boostADDRESSMODEL="64"
elif [ $ARCH = "x86_64" ]
then
MACSDKDIR=$x64MACSDKDIR
OSVERSION=$x64OSVERSION
OPTIMIZE=$x64OPTIMIZE
boostARCHITECTURE="x86"
boostADDRESSMODEL="64"
fi
echo "WARNING: assumes the SDK version matches the macosx-version-min"
# hack that sends extra arguments to g++
$BJAM -a --stagedir="stage-$ARCH" --prefix=$REPOSITORYDIR --toolset="darwin" -n stage \
--with-thread variant=release link=static \
architecture="$boostARCHITECTURE" address-model="$boostADDRESSMODEL" macosx-version="$OSVERSION" \
| grep "^ " | sed 's/"//g' | sed s/g++/g++\ "$OPTIMIZE"/ | sed 's/-O3/-O2/g' \
| while read COMMAND
do
echo "running command: $COMMAND"
$COMMAND
done
done
# merge libboost_thread
for libname in "libboost_thread-mt-$BOOST_VER"
do
LIPOARGs=""
for ARCH in $ARCHS
do
liba="$libname.a"
if [ $NUMARCH -eq 1 ]
then
mv "stage-$ARCH/lib/$liba" "$REPOSITORYDIR/lib/$libname.a";
ranlib "$REPOSITORYDIR/lib/$libname.a";
continue
fi
LIPOARGs="$LIPOARGs stage-$ARCH/lib/$liba"
done
if [ $NUMARCH -gt 1 ]
then
lipo $LIPOARGs -create -output "$REPOSITORYDIR/lib/$libname.a";
ranlib "$REPOSITORYDIR/lib/$libname.a";
fi
done
if [ -f "$REPOSITORYDIR/lib/libboost_thread-mt-$BOOST_VER.a" ]
then
ln -sfn libboost_thread-mt-$BOOST_VER.a $REPOSITORYDIR/lib/libboost_thread-mt.a;
fi