root/cherokee/trunk/doc/cookbook_cross_compilation.txt

Revision 2466, 2.8 kB (checked in by taher, 1 week ago)

--

Line 
1 == link:index.html[Index] -> link:cookbook.html[Cookbook]
2
3 Cookbook: How to cross compile Cherokee
4 ---------------------------------------
5
6 [[linux2win32]]
7 Cherokee-Win32 from Linux
8 ~~~~~~~~~~~~~~~~~~~~~~~~~
9
10 First of all, you will have to install the cross compiler:
11
12 ----
13 # apt-get install mingw32 mingw32-binutils
14 ----
15
16 Then, you'll have to install the pthread library:
17
18 ----
19 $ cd /var/tmp
20 $ mkdir pthread-win32
21 $ cd pthread-win32
22 $ wget ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
23 $ unzip pthreads-w32-2-8-0-release.exe
24 # cp ./Pre-built.2/lib/libpthreadGCE2.a /usr/i586-mingw32msvc/lib/libpthread.a
25 # cp Pre-built.2/include/* /usr/i586-mingw32msvc/include/
26 ----
27
28 And now, we are ready to compile it. We only have to set a few environment
29 variables:
30
31 ----
32 PATH=/usr/i586-mingw32msvc/bin:$PATH
33 CC=i586-mingw32msvc-gcc
34 LD=i586-mingw32msvc-ld
35 AR=i586-mingw32msvc-ar
36 RC=i586-mingw32msvc-windres
37 ----
38
39 Check out the last version of Cherokee trunk:
40
41 ----
42 $ svn co svn://svn.cherokee-project.com/cherokee/trunk cherokee
43 ----
44
45 and execute a quite long "configure" command:
46
47 ----
48 $ ac_cv_func_malloc_0_nonnull=yes   \
49   ac_cv_func_realloc_0_nonnull=yes  \
50 ./configure                         \
51   --host=i586-mingw32msvc           \
52   --prefix=/usr/i586-mingw32msvc    \
53   --disable-readdir_r               \
54   --disable-tls                     \
55   --enable-static-module=all        \
56   --enable-trace                    \
57   --enable-static                   \
58   --enable-shared=no                \
59   --enable-beta                     \
60   CC=i586-mingw32msvc-gcc
61 ----
62
63 Once reached this point, we are ready to build it by simply typing:
64
65 ----
66 $ make
67 ----
68
69
70 [[osx2win32]]
71 Cherokee-Win32 from OS X
72 ~~~~~~~~~~~~~~~~~~~~~~~~
73
74 First of all, you will have to install MinGW for OS X and to check out the
75 latest version of the source code, then fetch, uncompress and install
76 pthreads-win32:
77
78 ----
79 unzip pthreads-w32-2-8-0-release.exe
80 cp Pre-built.2/lib/libpthreadGCE2.a \
81      /usr/local/i386-mingw32-3.4.5/lib/libpthread.a
82 cp Pre-built.2/include/* \
83          /usr/local/i386-mingw32-3.4.5/lib/gcc/*/*/include/
84 ----
85
86 Then you will have to set a few environment variables:
87
88 ----
89          CC=i386-mingw32-gcc
90          LD=i386-mingw32-ld
91          AR=i386-mingw32-ar
92          RC=i386-mingw32-windres
93 ----
94
95 and run the configuration script::
96
97 ----
98 ac_cv_func_malloc_0_nonnull=yes           \
99 ac_cv_func_realloc_0_nonnull=yes          \
100 ./configure                               \
101   --host=i386-mingw32                     \
102   --prefix=/usr/local/i386-mingw32-3.4.5/ \
103   --enable-static                         \
104   --enable-shared=no                      \
105   --enable-static-module=all              \
106   --disable-readdir_r                     \
107   --disable-tls                           \
108   --enable-beta                           \
109   --enable-trace                          \
110   CC=i386-mingw32-gcc
111 ----
112
Note: See TracBrowser for help on using the browser.