Update
[mono-project.git] / web / mono-build-mac-fw-release.sh
blobab4bf563c1e9c3dc77465aad9d76c5a077079de9
1 #!/bin/sh
3 # this horrid little script updates a mono revision
4 # Author: Andy Satori <dru@satori-assoc.com>
5 # Modifications: kangaroo
6 # Changes June 10/2004
7 # - Updated for beta3 0.96
8 # Changes June 2/2004
9 # - Updated for beta2 0.95
10 # - Updated to boehm.gc.a6
11 # - Updated to glib-2.4.1
13 set -e
15 INITIALDIR=$PWD
16 VERSION=0.96
17 PREFIX=/Library/Frameworks/Mono.framework/Versions/$VERSION
19 export C_INCLUDE_PATH=$C_INCLUDE_PATH:$PREFIX/include
20 export LDFLAGS=-L$PREFIX/lib
21 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/X11R6/lib:$PREFIX/lib
23 if test ! -d "$INITIALDIR/Dependancies"; then
24 mkdir $INITIALDIR/Dependancies
27 # make the directories as need for the Framework (which isn't really
28 # a framework, but it looks like one and makes a nice placeholder until
29 # someone smarter than I am can come in and make it better)
31 if test ! -d "/Library/Frameworks/Mono.framework"; then
32 mkdir /Library/Frameworks/Mono.framework
33 mkdir /Library/Frameworks/Mono.framework/Versions
36 if test ! -d "/Library/Frameworks/Mono.framework/Versions/$VERSION"; then
37 mkdir /Library/Frameworks/Mono.framework/Versions/$VERSION
40 # set up the environment for the build
41 export PATH=$PREFIX/bin:/usr/X11R6/bin:$PATH
42 export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal/"
43 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/X11R6/lib/pkgconfig
46 cd $INITIALDIR/Dependancies
48 # pkg-config
50 echo +++ processing pkg-config
52 if test ! -f "$PREFIX/bin/pkg-config"; then
53 if test ! -d "pkgconfig-0.15.0"; then
54 curl http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz -O
55 tar xzf pkgconfig-0.15.0.tar.gz
56 rm pkgconfig-0.15.0.tar.gz
59 cd pkgconfig-0.15.0
61 ./configure --prefix=$PREFIX
62 make
63 make install
64 make clean
66 cd ..
69 # gettext
71 echo +++ processing gettext
73 if test ! -f "$PREFIX/bin/gettext"; then
75 if test ! -d "gettext-0.14.1"; then
76 curl http://ftp.gnu.org/pub/gnu/gettext/gettext-0.14.1.tar.gz -O
77 tar xzf gettext-0.14.1.tar.gz
78 rm gettext-0.14.1.tar.gz
81 cd gettext-0.14.1
83 ./configure --prefix=$PREFIX
84 make
85 make install
86 make clean
88 cd ..
91 # glib2
93 echo +++ processing glib2
95 if test ! -f "$PREFIX/lib/libgobject-2.0.la"; then
96 if test ! -d "glib-2.4.1"; then
97 curl ftp://ftp.gtk.org/pub/gtk/v2.4/glib-2.4.1.tar.gz -O
98 tar xzf glib-2.4.1.tar.gz
99 rm glib-2.4.1.tar.gz
102 cd glib-2.4.1
104 ./configure --prefix=$PREFIX
105 make
106 make install
107 make clean
109 cd ..
112 # boehm gc, is now built-in (since 0.95)
114 # icu ( http://oss.software.ibm.com/icu/index.html )
116 echo +++ processing ICU
118 if test ! -f "$PREFIX/lib/libicuuc.dylib.28.0"; then
119 if test ! -d "icu"; then
120 curl ftp://www-126.ibm.com/pub/icu/2.8/icu-2.8.tgz -O --disable-epsv
121 tar xzf icu-2.8.tgz
122 rm icu-2.8.tgz
125 cd icu/source
127 ./runConfigureICU MacOSX --with-data-packaging=library --prefix=$PREFIX --libdir=$PREFIX/lib/
128 gnumake
129 make install
130 make clean
132 cd $PREFIX/lib
134 # libicudata
135 install_name_tool -id $PREFIX/lib/libicudata.dylib.28 libicudata.dylib.28.0
137 # libicui18n
138 install_name_tool -id $PREFIX/lib/libicui18n.dylib.28 libicui18n.dylib.28.0
139 install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicui18n.dylib.28.0
140 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicui18n.dylib.28.0
142 # libicuio
143 install_name_tool -id $PREFIX/lib/libicuio.dylib.28 libicuio.dylib.28.0
144 install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicuio.dylib.28.0
145 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicuio.dylib.28.0
146 install_name_tool -change libicui18n.dylib.28 $PREFIX/lib/libicui18n.dylib.28 libicuio.dylib.28.0
148 # libicule
149 install_name_tool -id $PREFIX/lib/libicule.dylib.28 libicule.dylib.28.0
150 install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicule.dylib.28.0
151 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicule.dylib.28.0
153 # libiculx
154 install_name_tool -id $PREFIX/lib/libiculx.dylib.28 libiculx.dylib.28.0
155 install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libiculx.dylib.28.0
156 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libiculx.dylib.28.0
157 install_name_tool -change libicule.dylib.28 $PREFIX/lib/libicule.dylib.28 libiculx.dylib.28.0
159 # libicutoolutil
160 install_name_tool -id $PREFIX/lib/libicutoolutil.dylib.28 libicutoolutil.dylib.28.0
161 install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicutoolutil.dylib.28.0
162 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicutoolutil.dylib.28.0
164 # libicuuc
165 install_name_tool -id $PREFIX/lib/libicuuc.dylib.28 libicuuc.dylib.28.0
166 install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicuuc.dylib.28.0
168 cd $INITIALDIR
171 # mono
173 echo +++ patching libintl to not be statically linked
174 perl -pi -e "s/old_library='libintl.a'/old_library=''/" $PREFIX/lib/libintl.la
175 echo +++ processing mono run-time libraries
177 if test ! -f "$PREFIX/bin/mono"; then
178 if test ! -d "$INITIALDIR/Bootstrap"; then
179 mkdir $INITIALDIR/Bootstrap
181 cd $INITIALDIR/Bootstrap
183 if test ! -d "mono-$VERSION"; then
184 curl http://www.go-mono.com/archive/beta3/mono-$VERSION.tar.gz -O
185 tar xzf mono-$VERSION.tar.gz
186 rm mono-$VERSION.tar.gz
189 cd mono-$VERSION
191 ./configure --prefix=$PREFIX
192 make
193 make install
194 make clean
196 cd ..
199 # setup the Current symlink
201 cd /Library/Frameworks/Mono.framework/Versions
203 if test -e "/Library/Frameworks/Mono.framework/Versions/Current"; then
204 rm Current
206 ln -s $VERSION Current
207 echo +++ Setup the rest of the framework
208 cd /Library/Frameworks/Mono.framework
209 ln -s Versions/Current/lib Libraries
210 ln -s Versions/Current/include Headers
211 ln -s Versions/Current/bin Commands
212 for binfile in Commands/*; do
213 sudo rm -f /usr/bin/`echo $binfile | perl -pe 's/\.exe//' | perl -pe 's/Commands\///'`
214 sudo ln -s /Library/Frameworks/Mono.framework/`echo $binfile | perl -pe 's/\.exe//'` /usr/bin/`echo $binfile | perl -pe 's/\.exe//' | perl -pe 's/Commands\///'`
215 done
217 # update the installer source file