summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/msvc/README
blob: eedec271a13ceb64d53b350e57c63e461c5e5357 (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
Rockbox Utility with Visual Studio
==================================

This document describes how to build Rockbox Utility using Visual Studio.

*Note*: building with Visual Studio is only useful for debugging / development.
Since several parts used by Rockbox Utility can't be compiled using Visual
Studio at all using DLLs is required. For distributing we want a statically
linked binary, which does not work this way. Building with MinGW is much easier
in general, since using VS requires the use of MinGW as well.

All of the steps described below are to be performed in the folder this file is
located in on a command prompt (cmd.exe on Windows). All paths stated are the
default paths on an english Windows XP setup. You might need to adjust them to
your system.

Steps
-----
Building with VS requires several steps:
1. Prepare your build environment
2. Build DLLs using MinGW for the parts that cannot be compiled with VS and
   create LIB files from the DLLs. This requires using tools from VS.
3. Create a VS project file
4. Build the remaining code using VS.

Preparing the build environment
-------------------------------
The DLLs can be cross compiled on Linux. Everything else has to be done on
Windows. If you decide to cross compile, you need to install:
- Linux
  - MinGW toolchain
- Windows
  - MinGW with (at least) the mingw32-make package.
  - Visual Studio 2008 (other versions might work but are not tested. Express
    version is sufficient).
  - Windows Platform SDK (in case you're using the Express version of VS,
    otherwise this is included in VS)
  - Qt SDK for VS.

If you decide to not cross compile the DLLs you need to install additionally to
the programs listed above on Windows:
- MinGW with the following packages (and their dependencies):
  - mingw32-gcc
  - mingw32-make
  - msys-coreutils
  - msys-sed
  - msys-bash
  - msys-grep

On Windows, open a command prompt and set up your path:

  set PATH=c:\MinGW\bin;c:\MinGW\msys\1.0\bin;%PATH%
  c:\Program Files\Microsoft Visual Studio 9\Common7\Tools\vsvars.bat


Building DLLs and LIBs
----------------------
On Linux, run

  make CROSS=i686-pc-mingw32-

Adjust the CROSS variable to the prefix of your cross compiler. This will
create the DLL files only. Copy the resulting DLL and DEF files to the Windows
machine, then proceed with the Windows instructions below. The Makefile will
not remake the DLLs if they are already present.

On Windows, run

  mingw32-make

This will build the DLL files (if missing) and create LIB files from them.


Create translations
-------------------
Create the translations .qm files. This is only necessary if qmake has been
called without -config dbg (in which case translations will be left out and not
compiled into the binary)

  c:\QtSDK\Desktop\Qt\4.7.4\msvc2008\bin\lrelease.exe ..\rbutilqt.pro


Create a VS project file
------------------------
To create a project file for VS, run

  c:\QtSDK\Desktop\Qt\4.7.4\msvc2008\bin\qmake.exe -tp vc ..

This creates a file RockboxUtility.vcproj.


Build using VS
--------------
Open the generated project file and build as usual with VS.


LICENSE INFORMATION
===================
This folder contains additional files necessary for building.

- stdbool.h: taken form clang 2.8
- stdint.h, inttypes.h: taken from the msinttypes project
  (http://code.google.com/p/msinttypes) r26.

See the source files for detailed license information.