summaryrefslogtreecommitdiff
path: root/docs/api-notes/win32_build_on_cygwin_using_mingw.txt
blob: 9cf97284229cb214d04f0a6bf6fd2ef0afced6dc (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
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
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])

== MinGW C++ ==

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 (for xsltproc)
 * Mingw/mingw-zlib
 * Perl/Perl

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

You may also want to install the debugger, Devel/gdb.

== Base Directory ==

Choose a directory where you will unpack and compile OpenSSL, Zlib and Box Backup. We will call this the ''base directory''. An example might be:

  C:\Cygwin\Home\YourUsername

Make sure you know the full path to this directory.

If your user name has spaces in it, which is quite common on Windows,
please rename your home directory to one without any spaces, and change
your user's home directory in /etc/passwd to match.

== OpenSSL ==

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

Open a Cygwin shell, go to the base directory, and unpack OpenSSL:

	tar xzvf openssl-1.0.0a.tar.gz

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

	cd openssl-1.0.0a
	./Configure --prefix=/usr/i686-pc-mingw32/ mingw
	make
	make install

== PCRE ==

This step is only required to support regular expressions in including/excluding files from backups. However, this is a very useful feature.

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

Open a Cygwin shell, go to the base directory, and unpack PCRE:

	tar xjvf pcre-8.10.tar.bz2

Configure PCRE for MinGW compilation, and build and install it:
	
	cd pcre-8.10
	export CFLAGS="-mno-cygwin"
	export CXXFLAGS="-mno-cygwin"
	./configure --prefix=/usr/i686-pc-mingw32
	make 
	make install

== Readline (Optional) ==

If you want Readline support, download Readline version 6.1, unpack
and install thus:

	tar xzvf readline-6.1.tar.gz
	./configure --prefix=/usr/i686-pc-mingw32 \
		CFLAGS="-mno-cygwin" \
		CPPFLAGS="-mno-cygwin" \
		LDFLAGS="-mno-cygwin"
	make
	make install

== Download Box Backup ==

Go back to the base directory, and download the latest Box Backup sources:

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

Note: If you have problems during the configure or make stage, please try to eliminate one potential source of problems by running the following command to convert all line endings to Unix format:

	find -type f -not \( -wholename .*svn*. \) -exec dos2unix {} \;

== Compile Box Backup ==

Enter the source directory and configure like this:

	cd trunk
	./infrastructure/mingw/configure.sh [--enable-gnu-readline]
	make

== Installation ==

Create the destination directory, ''C:\Program Files\Box Backup\bbackupd''.

Write a configuration file, keys and certificate on a Unix machine, and copy them into the ''Box Backup'' directory, together with the following files from the ''base directory'':

 * boxbackup\release\bin\bbackupd\bbackupd.exe
 * boxbackup\release\bin\bbackupquery\bbackupquery.exe
 * boxbackup\release\bin\bbackupctl\bbackupctl.exe
 * openssl\out32dll\libeay32.dll
 * openssl\out32dll\ssleay32.dll
 * zlib\zlib1.dll

Ensure that the user running Box Backup can read from the ''Box Backup'' directory, and write to the ''bbackupd'' directory inside it.

Run Box Backup by double-clicking on it, and check that it connects to the server. If the window opens and closes immediately, it's probably due to a problem with the configuration file - check the Windows Event Viewer for details.

See also the service installation and upgrade instructions at 
[https://www.boxbackup.org/trac/wiki/CompilationOnWindows].