1 | Cross-compiling RegLookup to Windows with MinGW |
---|
2 | =============================================== |
---|
3 | |
---|
4 | MinGW can be used to compile Windows binaries from UNIX environments. |
---|
5 | The following instructions outline the steps required to build |
---|
6 | reglookup.exe and reglookup-recover.exe. This process is experimental |
---|
7 | and Windows binaries have not been well tested. You have been warned. |
---|
8 | |
---|
9 | Prerequisites |
---|
10 | ------------- |
---|
11 | |
---|
12 | - Before you start, ensure you have MinGW installed. Under Debian, |
---|
13 | install the `mingw32' package. |
---|
14 | |
---|
15 | - Download pre-compiled libiconv packages from here: |
---|
16 | http://gnuwin32.sourceforge.net/packages/libiconv.htm |
---|
17 | |
---|
18 | You will need to download the "Binaries" and "Developer files" |
---|
19 | packages, whose files are named libiconv-VERSION-bin.zip and |
---|
20 | libiconv-VERSION-lib.zip respectively. |
---|
21 | |
---|
22 | - Unpack both zip files into a designated top-level directory. |
---|
23 | Suggested commands: |
---|
24 | $ mkdir /usr/local/src/libiconv-VERSION-bin /usr/local/src/libiconv-VERSION-lib |
---|
25 | $ cd /usr/local/src/libiconv-VERSION-bin |
---|
26 | $ unzip .../path/to/libiconv-VERSION-bin.zip |
---|
27 | $ cd /usr/local/src/libiconv-VERSION-lib |
---|
28 | $ unzip .../path/to/libiconv-VERSION-lib.zip |
---|
29 | |
---|
30 | |
---|
31 | Building |
---|
32 | -------- |
---|
33 | |
---|
34 | Review the top level RegLookup Makefile to ensure the settings match |
---|
35 | your environment. Find the conditional block which looks like: |
---|
36 | |
---|
37 | ################################################################################ |
---|
38 | # MinGW cross-compiling build settings |
---|
39 | ifdef BUILD_MINGW |
---|
40 | |
---|
41 | ## These may need to be changed |
---|
42 | CC=i586-mingw32msvc-cc |
---|
43 | LIBICONV_PATH=/usr/local/src/libiconv-1.9.2-1-lib |
---|
44 | |
---|
45 | ## These probably do not need to be changed |
---|
46 | BIN_EXT=.exe |
---|
47 | INC:=$(INC) -I$(LIBICONV_PATH)/include |
---|
48 | EXTRA_OBJ=$(LIBICONV_PATH)/lib/libiconv.dll.a |
---|
49 | |
---|
50 | endif |
---|
51 | ################################################################################ |
---|
52 | |
---|
53 | |
---|
54 | If either the CC or LIBICONV_PATH settings are incorrect for your |
---|
55 | system, either update the Makefile, or override these options at build |
---|
56 | time when you run make. For instance, the above settings in the |
---|
57 | Makefile are correct, you can execute the build by running: |
---|
58 | |
---|
59 | $ make BUILD_MINGW=1 |
---|
60 | |
---|
61 | Alternatively, you may override the variables above with: |
---|
62 | |
---|
63 | $ make BUILD_MINGW=1 CC=my-mingw-binary LIBICONV_PATH=.../path/to/libiconv-VERSION-lib |
---|
64 | |
---|
65 | Once the build is complete, you'll find the .exe files under the |
---|
66 | build/bin directory. |
---|
67 | |
---|
68 | |
---|
69 | Installation |
---|
70 | ------------ |
---|
71 | Naturally, there is no install Makefile target for the MinGW build |
---|
72 | process, since we aren't installing on the local system. To install |
---|
73 | these binaries on a Windows machine, simply copy over the reglookup.exe |
---|
74 | and reglookup-recover.exe files from the build/bin directory to the |
---|
75 | desired host. In addition, you will need to install the libiconv2.dll |
---|
76 | file on that host (either in the same directory as the reglookup |
---|
77 | executables, or somewhere in the DLL search path). This file is |
---|
78 | available in the libiconv-VERSION-bin.zip file you downloaded earlier, |
---|
79 | under the `bin' subdirectory. |
---|
80 | |
---|