Debian Codegraph @

INSTALL.windows

raw
1 Installation on Microsoft Windows:
2
3 There are three ways to create binaries of this package for Microsoft Windows:
4 1) Native binaries, built using the mingw tool chain.
5 2) Native binaries, built using the MS Visual C/C++ tool chain.
6 3) Binaries for the Cygwin environment.
7
8 Note: For the moment, the status of the target platforms is as follows:
9 - mingw, 32-bit: supported.
10 - mingw, 64-bit: not supported.
11 - MSVC, 32-bit: not supported.
12 - MSVC, 64-bit: not supported.
13 - Cygwin, 32-bit: supported.
14 - Cygwin, 64-bit: supported.
15
16 ===============================================================================
17 1) Native binaries, built using the mingw tool chain.
18
19 I recommend to use the Cygwin environment as the development environment (*)
20 and mingw only as the target (runtime, deployment) environment.
21 For this, you need to install
22 * Cygwin (from https://cygwin.com/),
23 * some packages available from the Cygwin package installer:
24 make
25 * the mingw cross-compilation tools and runtime package, available from
26 the Cygwin package installer (setup-x86_64.exe):
27 - for creating 32-bit binaries: packages
28 mingw64-i686-gcc-core,
29 mingw64-i686-gcc-g++,
30 mingw64-i686-headers,
31 mingw64-i686-runtime
32 - for creating 64-bit binaries: packages
33 mingw64-x86_64-gcc-core,
34 mingw64-x86_64-gcc-g++,
35 mingw64-x86_64-headers,
36 mingw64-x86_64-runtime
37
38 Building 32-bit binaries for mingw is achieved through the following
39 preparation, configure, and build commands:
40
41 PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
42 export PATH
43 ./configure --host=i686-w64-mingw32 --prefix=/usr/local/mingw32 \
44 CC=i686-w64-mingw32-gcc \
45 CXX=i686-w64-mingw32-g++ \
46 CPPFLAGS="-I/usr/local/mingw32/include -Wall" \
47 LDFLAGS="-L/usr/local/mingw32/lib"
48 make
49 make check
50
51 Building 64-bit binaries for mingw is achieved through the following
52 preparation, configure, and build commands:
53
54 PATH=/usr/local/mingw64/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
55 export PATH
56 ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/mingw64 \
57 CC=x86_64-w64-mingw32-gcc \
58 CXX=x86_64-w64-mingw32-g++ \
59 CPPFLAGS="-I/usr/local/mingw64/include -Wall" \
60 LDFLAGS="-L/usr/local/mingw64/lib"
61 make
62 make check
63
64 Installation:
65
66 make install
67
68 (*) Note: The MSYS2 environment as a development environment is *not*
69 supported. This environment contains an ignoble and ignominious hack:
70 In a program invocation, the program *by default* receives different
71 arguments than the ones that the caller has passed. See
72 <https://www.msys2.org/wiki/Porting/#filesystem-namespaces>.
73 All program invocations in this environment are therefore unreliable.
74
75 ===============================================================================
76 2) Native binaries, built using the MS Visual C/C++ tool chain.
77
78 Note that binaries created with MSVC have a distribution constraint: They
79 depend on a closed-source library ('msvcr90.dll' for MSVC 9.0,
80 'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of
81 a Windows installation.
82 You cannot distribute 'vcruntime*.dll' with the binaries - this would be a
83 violation of the GPL and of the Microsoft EULA.
84 You can distribute the binaries without including 'vcruntime*.dll'. Users
85 who don't have this library on their system will require to pull some files
86 (api-ms-win*.dll) through the Windows Update mechanism, see
87 https://support.microsoft.com/en-us/kb/2999226 .
88
89 This recipe requires MS Visual C/C++ 9.0 or newer.
90 You don't need the Visual Studio IDE, just the C/C++ tool chain.
91 As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
92 http://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file
93 visualcppbuildtools_full.exe).
94
95 This recipe requires also a Cygwin environment (with 'bash', the common POSIX
96 commands, and 'make') as a build environment. Building with 'nmake' is not
97 supported.
98 For this, you need to install
99 * Cygwin (from https://cygwin.com/),
100 * some packages available from the Cygwin package installer:
101 make
102
103 You also need the scripts 'ar-lib' and 'compile' from
104 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD
105 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD
106 respectively.
107 They may also be included in this package, in directory 'build-aux/'.
108 Save them; the instructions below assume that you stored them in $HOME/msvc/.
109 Make them executable:
110 chmod a+x ar-lib compile
111
112 Start a bash (from Cygwin).
113
114 Make sure that the MSVC tools ("cl" etc.) are found in PATH and the
115 environment variables INCLUDE and LIB are set appropriately.
116 In a typical MSVC 9.0 installation, it can be achieved by running
117 C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
118 In a typical MSVC 14.0 installation on Windows 10, it can be achieved
119 - for creating 32-bit binaries: through the following bash commands:
120
121 # Set environment variables for using MSVC 14,
122 # for creating native 32-bit Windows executables.
123
124 # Windows C library headers and libraries.
125 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
126 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
127 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
128 LIB="${WindowsCrtLibDir}x86;$LIB"
129
130 # Windows API headers and libraries.
131 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
132 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
133 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
134 LIB="${WindowsSdkLibDir}x86;$LIB"
135
136 # Visual C++ tools, headers and libraries.
137 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
138 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
139 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH"
140 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
141 LIB="${VCINSTALLDIR}"'\lib;'"${LIB}"
142
143 export INCLUDE LIB
144
145 - for creating 64-bit binaries: through the following bash commands:
146
147 # Set environment variables for using MSVC 14,
148 # for creating native 64-bit Windows executables.
149
150 # Windows C library headers and libraries.
151 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
152 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
153 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
154 LIB="${WindowsCrtLibDir}x64;$LIB"
155
156 # Windows API headers and libraries.
157 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
158 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
159 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
160 LIB="${WindowsSdkLibDir}x64;$LIB"
161
162 # Visual C++ tools, headers and libraries.
163 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
164 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
165 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH"
166 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
167 LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}"
168
169 export INCLUDE LIB
170
171 Building 32-bit binaries with MSVC is achieved through the following
172 preparation, configure, and build commands:
173
174 PATH=/usr/local/msvc32/bin:$PATH
175 export PATH
176
177 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
178 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
179 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
180 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
181
182 ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
183 CC="$HOME/msvc/compile cl -nologo" \
184 CFLAGS="-MD" \
185 CXX="$HOME/msvc/compile cl -nologo" \
186 CXXFLAGS="-MD" \
187 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \
188 LDFLAGS="-L/usr/local/msvc32/lib" \
189 LD="link" \
190 NM="dumpbin -symbols" \
191 STRIP=":" \
192 AR="$HOME/msvc/ar-lib lib" \
193 RANLIB=":"
194 make
195 make check
196
197 Building 64-bit binaries with MSVC is achieved through the following
198 preparation, configure, and build commands:
199
200 PATH=/usr/local/msvc64/bin:$PATH
201 export PATH
202
203 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
204 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
205 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
206 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
207
208 ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
209 CC="$HOME/msvc/compile cl -nologo" \
210 CFLAGS="-MD" \
211 CXX="$HOME/msvc/compile cl -nologo" \
212 CXXFLAGS="-MD" \
213 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \
214 LDFLAGS="-L/usr/local/msvc64/lib" \
215 LD="link" \
216 NM="dumpbin -symbols" \
217 STRIP=":" \
218 AR="$HOME/msvc/ar-lib lib" \
219 RANLIB=":"
220 make
221 make check
222
223 Installation:
224
225 make install
226
227 ===============================================================================
228 3) Binaries for the Cygwin environment.
229
230 The generic instructions in the INSTALL file apply. But here are more
231 specific ones.
232
233 You need to install
234 * Cygwin (from https://cygwin.com/),
235 * some packages available from the Cygwin package installer:
236 make
237 * the Cygwin [cross-]compilation tools package, available from
238 the Cygwin package installer (setup-x86_64.exe):
239 - for creating 32-bit binaries: packages
240 cygwin32-gcc-core,
241 cygwin32-gcc-g++,
242 cygwin32
243 - for creating 64-bit binaries: packages
244 gcc-core,
245 gcc-g++
246
247 Building 32-bit binaries for Cygwin must be done in a directory *outside*
248 the Cygwin /home and /usr hierarchies. It is achieved through the following
249 preparation, configure, and build commands:
250
251 PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH
252 export PATH
253 ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \
254 CC=i686-pc-cygwin-gcc \
255 CXX=i686-pc-cygwin-g++ \
256 CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \
257 LDFLAGS="-L/usr/local/cygwin32/lib"
258 make
259 make check
260
261 Building 64-bit binaries for Cygwin is achieved through the following
262 preparation, configure, and build commands:
263
264 PATH=/usr/local/cygwin64/bin:$PATH
265 export PATH
266 ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \
267 CC=x86_64-pc-cygwin-gcc \
268 CXX=x86_64-pc-cygwin-g++ \
269 CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \
270 LDFLAGS="-L/usr/local/cygwin64/lib"
271 make
272 make check
273
274 Installation:
275
276 make install
277
278 ===============================================================================
279 Dependencies:
280
281 This package depends on GNU libffcall, GNU libsigsegv, GNU libiconv. (See the
282 file DEPENDENCIES.) Before building this package, you need to build these three
283 dependencies, in the same development environment, with the same configure
284 options, and install them ("make install").
285 ===============================================================================