-
Notifications
You must be signed in to change notification settings - Fork 14
/
library-build-notes.txt
179 lines (157 loc) · 5.81 KB
/
library-build-notes.txt
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# set up working directory
#
export PREFIX=<path to your working directory>
cd $PREFIX
mkdir armv6 armv7 armv9 i386 universal
#
# download:
#
# gnupgp, libpgp-error, libgcrypt: http://www.gnupg.org/download/index.en.html
# libssh2: http://www.libssh2.org/
# unpack each into working directory
#
# configure and build for armv6
#
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.2.sdk
export CC=$DEVROOT/usr/bin/gcc
export LD=$DEVROOT/usr/bin/ld
export CPP=$DEVROOT/usr/bin/cpp
export CXX=$DEVROOT/usr/bin/g++
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$PREFIX/armv6/lib"
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv6/include"
export CXXFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv6"
pushd gnupgp-1.4.11
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv6
make && make install
popd
pushd libgpg-error-1.10
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv6 --enable-shared=no
make && make install
popd
pushd libgcrypt-1.4.6
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv6 --enable-shared=no
--with-gpg-error-prefix=$PREFIX/armv6
make && make install
pushd libssh2-1.2.7
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv6 --with-libgcrypt-prefix=$PREFIX/armv6
make && make install
popd
#
# configure and build for armv7
#
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.2.sdk
export CC=$DEVROOT/usr/bin/gcc
export LD=$DEVROOT/usr/bin/ld
export CPP=$DEVROOT/usr/bin/cpp
export CXX=$DEVROOT/usr/bin/g++
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$PREFIX/armv7/lib"
export CFLAGS="-arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv7/include"
export CXXFLAGS="-arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv7"
pushd gnupgp-1.4.11
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv7
make && make install
popd
pushd libgpg-error-1.10
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv7 --enable-shared=no
make && make install
popd
pushd libgcrypt-1.4.6
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv7 --enable-shared=no
--with-gpg-error-prefix=$PREFIX/armv7
make && make install
pushd libssh2-1.2.7
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv7 --with-libgcrypt-prefix=$PREFIX/armv7
make && make install
popd
#
# configure and build for armv9
#
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.2.sdk
export CC=$DEVROOT/usr/bin/gcc
export LD=$DEVROOT/usr/bin/ld
export CPP=$DEVROOT/usr/bin/cpp
export CXX=$DEVROOT/usr/bin/g++
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch armv9 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$PREFIX/armv9/lib"
export CFLAGS="-arch armv9 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv9/include"
export CXXFLAGS="-arch armv9 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PREFIX/armv9"
pushd gnupgp-1.4.11
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv9
make && make install
popd
pushd libgpg-error-1.10
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv9 --enable-shared=no
make && make install
popd
pushd libgcrypt-1.4.6
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv9 --enable-shared=no
--with-gpg-error-prefix=$PREFIX/armv9
make && make install
pushd libssh2-1.2.7
./configure --host=arm-apple-darwin10 --prefix=$PREFIX/armv9 --with-libgcrypt-prefix=$PREFIX/armv9
make && make install
popd
#
# configure and build for simulator (i386)
#
export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
export INSTALLPREFIX=$PREFIX/i386
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator3.2.sdk
export CC=$DEVROOT/usr/bin/gcc-4.2
export LD=$DEVROOT/usr/bin/ld
export CPP=$DEVROOT/usr/bin/cpp-4.2
export CXX=$DEVROOT/usr/bin/g++-4.2
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp-4.2
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch i386 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$INSTALLPREFIX/lib"
export CFLAGS="-arch i386 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$INSTALLPREFIX/include"
export CXXFLAGS="-arch i386 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$INSTALLPREFIX/include/"
export CFLAGS=-m32
export CPPFLAGS=-m32
pushd gnupg-1.4.11
make clean
./configure --host=i386-apple-darwin --prefix=$INSTALLPREFIX
make && make install
popd
pushd libgpg-error-1.10
make clean
./configure --host=i386-apple-darwin --prefix=$INSTALLPREFIX --enable-shared=no
make && make install
popd
pushd libgcrypt-1.4.6
make clean
./configure --host=i386-apple-darwin --prefix=$INSTALLPREFIX --enable-shared=no --with-gpg-error-prefix=$INSTALLPREFIX --disable-asm
make && make install
popd
pushd libssh2-1.2.7
make clean
./configure --host=i386-apple-darwin --prefix=$INSTALLPREFIX --with-libgcrypt-prefix=$INSTALLPREFIX/../libraries/libgcrypt-1.4.6
make && make install
popd
#
# make universal binary
#
lipo -create i386/lib/libgcrypt.a armv6/lib/libgcrypt.a armv7/lib/libgcrypt.a-output armv9/lib/libgcrypt.a universal/libgcrypt.a
lipo -create i386/lib/libgpg-error.a armv6/lib/libgpg-error.a armv7/lib/libgpg-error.a armv9/lib/libgpg-error.a -output universal/libgpg-error.a
lipo -create i386/lib/libssh2.a armv6/lib/libssh2.a armv7/lib/libssh2.a armv9/lib/libssh2.a -output universal/libssh2.a