summaryrefslogtreecommitdiff
path: root/docs/api-notes/win32_build_on_cygwin_using_mingw.txt
blob: 9e2daa193ed9e392fbd595cef65ff2f992a91705 (plain)
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
How to build Box Backup on Win32 using Cygwin and MinGW
By Chris Wilson, 2009-03-31

(To read this document online with better formatting, browse to:
[http://www.boxbackup.org/trac/wiki/CompileWithMinGW])

Start by installing Cygwin on your Windows machine from [http://www.cygwin.org/cygwin/].

Make sure to select the following packages during installation:

* Devel/automake
* Devel/autoconf
* Devel/gcc-mingw
* Devel/gcc-mingw-core
* Devel/gcc-mingw-g++
* Devel/make
* Devel/mingw-runtime
* Lib/libxml2
* Lib/libxslt
* Mingw/mingw-zlib
* Perl/Perl

If you already have Cygwin installed, please re-run the installer and
ensure that those packages are installed.

Download OpenSSL from [http://www.openssl.org/source/openssl-0.9.7i.tar.gz]

Open a Cygwin shell, and unpack OpenSSL:

	tar xzvf openssl-0.9.7i.tar.gz

Configure OpenSSL for MinGW compilation, and build and install it:

	cd openssl-0.9.7i
	./Configure --prefix=/usr/i686-pc-mingw32/ mingw
	make
	make install

Download PCRE from 
[http://prdownloads.sourceforge.net/pcre/pcre-6.3.tar.bz2?download]

Open a Cygwin shell, and unpack PCRE:

	tar xjvf pcre-6.3.tar.bz2

Configure PCRE for MinGW compilation, and build and install it:
	
	cd pcre-6.3
	export CFLAGS="-mno-cygwin"
	./configure
	make winshared
	cp .libs/libpcre.a .libs/libpcreposix.a /lib/mingw
	cp pcreposix.h /usr/include/mingw

Now get the latest Box Backup sources

	svn co https://www.boxbackup.org/svn/box/trunk/ trunk

Enter the source directory and configure like this:

	cd trunk
	./infrastructure/mingw/configure.sh
	make

Note: In case you have any problems during the configure or make stage, please try to eliminate one potential source of problems by running "find -type f -not \( -wholename .*svn*. \) -exec dos2unix {} \;" in the trunk directory to fix potential line break problems.