-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathINSTALL_Win32.txt
159 lines (122 loc) · 4.97 KB
/
INSTALL_Win32.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
How to compile OpenObex on Windows platform
===========================================
You should read INSTALL.txt before continuing reading this file.
1 Requirements
==============
The requirements to compile OpenObex on Windows are fairly low:
1. a compiler
2. the Platform SDK (now also called Windows SDK)
3. LibUSB-Win32[1]
4. CMake(>= 2.6)[2] or autoconf+automake
The supported compilers are:
* Microsoft Visual Studio 9 .NET 2008
* Microsoft Visual Studio 8 .NET 2005
* Microsoft Visual Studio 7.1 .NET 2003
* MinGW gcc
* Cygwin gcc
[1]: at http://libusb-win32.sf.net (if not compiling for cygwin)
[2]: at http://www.cmake.org
2 Compilation
=============
There are two ways to compile OpenObex. Step 2a describes building with
autoconf+automake, step 2b describes building with CMake. The latter is
recommended as it is a lot easier to setup and supports more environments.
2a Compilation using autoconf+automake
======================================
Compiling with autoconf+automake is restricted to a very specific environment,
an Unix-like one. Under Windows, this can only be provided by MSYS or Cygwin.
MSYS
----
You need to install the following extra packages from http://www.mingw.org:
* MSYS (1.0.10 works)
* msysDTK (1.0.1 works)
Libtool from msysDTK in incomplete, it needs an additional 'file' utility. You
can get this from http://gnuwin32.sf.net. Do NOT install it in the MSYS directory
but somewhere else that is already mounted and in $PATH (e.g. into the mingw
directory).
Additionally, download the following packages from http://www.gtk.org/download-windows.html:
* glib
* glib-dev
* pkg-config
Unpack them all into the same directory!
You need to prepare the build environment by editing /etc/fstab and mount the
GLIB installation dir to /glib and the libusb-win32 installation dir to /libusb.
MinGW should already be present unter /mingw.
Additionally, you create /pdsk/include and copy the following header files from
the Platform SDK to there:
ws2bth.h
bthdef.h
bthsdpdef.h
af_irda.h
If you check out from VCS and configure does not exist, you can create it with:
$ export ACLOCAL="aclocal -I /glib/share/aclocal"
$ autoreconf -v -f -i
Now you need some environment variables for configure:
$ export CFLAGS="-I/libusb/include -I/glib/include -I/psdk/include"
$ export LDFLAGS="-L/libusb/lib/gcc -L/glib/lib"
$ export PATH="$PATH:/glib/bin"
$ export PKG_CONFIG_PATH="/glib/lib/pkgconfig"
Now you can finally run configure:
$ ./configure --prefix=/mingw --disable-shared
This will build a static library. Due to a bug in libtool, you cannot build the
static and the shared version at the same time. To build the shared version, run:
$ ./configure --prefix=/mingw --disable-static
2b Compilation using CMake
==========================
Visual Studio
-------------
Using Visual Studion >= 8 (EXpress versions are sufficient) is the recommended
way of compiling under Windows.
You must open the console link that runs the proper vcvars.bat (see Start menu).
Then, you _MUST_ add the directories of the platform SDK include files, libraries
and executables to the environment variables INCLUDE, LIB and PATH.
Now, your build environment is set up. You can now call cmake with the proper
generator (see "cmake --help"). Using the "NMake Makefiles" generator, OpenObex
can be compiled directly in the command prompt window:
> mkdir build
> cd build
> cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
> nmake
MinGW
-----
Install MinGW, including core and mingw32-make, to e.g. C:\mingw.
To get Bluetooth and Irda support, you must copy the following files from the
Platform SDK include directory to usr/local/include in the MinGW installation
directory:
ws2bth.h
bthdef.h
bthsdpdef.h
af_irda.h
Either you add MinGW bin directory to PATH, or you call the mingw32-make with
full path, both variations work.
Then, at the command prompt:
> set PATH=%PATH%;C:\mingw\bin
> mkdir build
> cd build
> cmake -G"MinGW Makefiles" ..
> mingw32-make
You can also use MSYS as environment:
> mkdir build
> cd build
> cmake -G"MSYS Makefiles" ..
> make
Cygwin
------
You must not use the Windows version of CMake but a version compiled specially
for cygwin. You may also install cygwin version of libusb. Copy the same files
as for the MinGW case to /usr/local/include. Then cou can run in the cygwin
shell command window:
$ mkdir build
$ cd build
$ cmake -G"Unix Makefiles" ..
$ make
3 Installation
==============
You can run the installation directly by calling the "install" make target. With
the DESTDIR variable, you can add an additional prefix:
$ make install DESTDIR=/some/directory
Additionally, when you used CMake, you can create installation packages but a few
steps are needed:
* install NSIS
* install a ZIP program (e.g. info-zip)
Now you are ready to run the "pacakge" make target.