-
Notifications
You must be signed in to change notification settings - Fork 37
/
xcode.sh
executable file
·138 lines (114 loc) · 4.01 KB
/
xcode.sh
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
138
#!/bin/bash
##################################################################
# #
# This file provides a cross-compilation for Mac OS #
# #
##################################################################
WXW_VERSION="2.9.4" # Version wxWidgets
FT2_VERSION="2.4.11" # Version FreeType2
##################################################################
# Detect MyRuLib version
##################################################################
MRL_VERSION=`cat configure | grep PACKAGE_VERSION= | sed "s/.*=//" | sed "s/'//g"`
WXW_FILENAME="wxWidgets-$WXW_VERSION"
FT2_FILENAME="freetype-$FT2_VERSION"
MRL_FILENAME="myrulib-$MRL_VERSION"
MAC_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
MAC_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"
SOURCE_DIR=`pwd`
cd ~
mkdir $MRL_FILENAME
cd $MRL_FILENAME
BUILD_DIR=`pwd`
##################################################################
# wxWidgets
##################################################################
EXISTS_WXW=`$BUILD_DIR/bin/wx-config --version`
if test "x$EXISTS_WXW" != "x$WXW_VERSION" ; then
cd $BUILD_DIR
rm -rf $WXW_FILENAME
rm $WXW_FILENAME.tar.bz2
curl -LO http://sourceforge.net/projects/wxwindows/files/$WXW_VERSION/$WXW_FILENAME.tar.bz2
tar -xvjf $WXW_FILENAME.tar.bz2
ln -s $WXW_FILENAME wxWidgets
cd $WXW_FILENAME
mkdir build_mac
cd build_mac
arch_flags="-arch i386"
../configure \
CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" \
LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" \
--with-osx_cocoa \
--with-macosx-sdk="$MAC_SDK_PATH" \
--with-macosx-version-min=10.8 \
--prefix=$BUILD_DIR \
--enable-unicode \
--disable-shared \
--without-expat \
--without-regex \
--without-libtiff \
--disable-richtext \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-zlib=builtin \
make
make install
fi
##################################################################
# FreeType2
##################################################################
arch_flags="-arch i386 -isysroot $MAC_SDK_PATH -mmacosx-version-min=10.8"
EXISTS_FT2=`$BUILD_DIR/bin/freetype-config --ftversion`
if test "x$EXISTS_FT2" != "x$FT2_VERSION" ; then
cd $BUILD_DIR
rm -rf $FT2_FILENAME
rm $FT2_FILENAME.tar.bz2
curl -LO http://sourceforge.net/projects/freetype/files/freetype2/$FT2_VERSION/$FT2_FILENAME.tar.bz2
tar -xvjf $FT2_FILENAME.tar.bz2
cd $FT2_FILENAME
mkdir build_mac
cd build_mac
../configure \
CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" \
LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" \
--prefix=$BUILD_DIR \
--enable-universal-binary \
--disable-shared
make
make install
fi
##################################################################
# MyRuLib
##################################################################
arch_flags="-arch i386 -isysroot $MAC_SDK_PATH -mmacosx-version-min=10.8"
cd $SOURCE_DIR
rm -rf build_mac
mkdir build_mac
cd build_mac
../configure \
CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" \
LDFLAGS="-static-libgcc -static-libstdc++ $arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" \
--with-wx-prefix=$BUILD_DIR \
--with-expat \
--with-bzip2 \
--with-locale
make
cd $SOURCE_DIR
rm -rf build_cr3
mkdir build_cr3
cd build_cr3
../configure \
CXXFLAGS="$arch_flags -I$BUILD_DIR/$WXW_FILENAME/src/\
-I$BUILD_DIR/$WXW_FILENAME/src/jpeg\
-I$BUILD_DIR/$WXW_FILENAME/src/png\
-I$BUILD_DIR/$WXW_FILENAME/src/zlib" \
CFLAGS="$arch_flags" CPPFLAGS="$arch_flags" \
LDFLAGS="-static-libgcc -static-libstdc++ $arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" \
--with-wx-prefix=$BUILD_DIR \
--with-ft-prefix=$BUILD_DIR \
--disable-freetypetest \
--with-expat \
--with-bzip2 \
--with-locale \
--with-reader
make