1 Installation on Microsoft Windows:
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.
8 ===============================================================================
9 1) Native binaries, built using the mingw tool chain.
11 I recommend to use the Cygwin environment as the development environment (*)
12 and mingw only as the target (runtime, deployment) environment.
13 For this, you need to install
14 * Cygwin (from https://cygwin.com/),
15 * some packages available from the Cygwin package installer:
17 * the mingw cross-compilation tools and runtime package, available from
18 the Cygwin package installer (setup-x86_64.exe):
19 - for creating 32-bit binaries: packages
20 mingw64-i686-gcc-core,
24 - for creating 64-bit binaries: packages
25 mingw64-x86_64-gcc-core,
26 mingw64-x86_64-gcc-g++,
27 mingw64-x86_64-headers,
28 mingw64-x86_64-runtime
30 Building 32-bit binaries for mingw is achieved through the following
31 preparation, configure, and build commands:
33 PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
35 ./configure --host=i686-w64-mingw32 --prefix=/usr/local/mingw32 \
36 CC=i686-w64-mingw32-gcc \
37 CXX=i686-w64-mingw32-g++ \
38 CPPFLAGS="-I/usr/local/mingw32/include -Wall" \
39 LDFLAGS="-L/usr/local/mingw32/lib"
43 Building 64-bit binaries for mingw is achieved through the following
44 preparation, configure, and build commands:
46 PATH=/usr/local/mingw64/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
48 ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/mingw64 \
49 CC=x86_64-w64-mingw32-gcc \
50 CXX=x86_64-w64-mingw32-g++ \
51 CPPFLAGS="-I/usr/local/mingw64/include -Wall" \
52 LDFLAGS="-L/usr/local/mingw64/lib"
60 (*) Note: The MSYS2 environment as a development environment is *not*
61 supported. This environment contains an ignoble and ignominious hack:
62 In a program invocation, the program *by default* receives different
63 arguments than the ones that the caller has passed. See
64 <https://www.msys2.org/wiki/Porting/#filesystem-namespaces>.
65 All program invocations in this environment are therefore unreliable.
67 ===============================================================================
68 2) Native binaries, built using the MS Visual C/C++ tool chain.
70 Note that binaries created with MSVC have a distribution constraint: They
71 depend on a closed-source library ('msvcr90.dll' for MSVC 9.0,
72 'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of
73 a Windows installation.
74 You cannot distribute 'vcruntime*.dll' with the binaries - this would be a
75 violation of the GPL and of the Microsoft EULA.
76 You can distribute the binaries without including 'vcruntime*.dll'. Users
77 who don't have this library on their system will require to pull some files
78 (api-ms-win*.dll) through the Windows Update mechanism, see
79 https://support.microsoft.com/en-us/kb/2999226 .
81 This recipe requires MS Visual C/C++ 9.0 or newer.
82 You don't need the Visual Studio IDE, just the C/C++ tool chain.
83 As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
84 https://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file
85 visualcppbuildtools_full.exe).
87 This recipe requires also a Cygwin environment (with 'bash', the common POSIX
88 commands, and 'make') as a build environment. Building with 'nmake' is not
90 For this, you need to install
91 * Cygwin (from https://cygwin.com/),
92 * some packages available from the Cygwin package installer:
95 You also need the scripts 'ar-lib' and 'compile' from
96 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD
97 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD
99 They may also be included in this package, in directory 'build-aux/'.
100 Save them; the instructions below assume that you stored them in $HOME/msvc/.
101 Make them executable:
102 chmod a+x ar-lib compile
104 Start a bash (from Cygwin).
106 Make sure that the MSVC tools ("cl" etc.) are found in PATH and the
107 environment variables INCLUDE and LIB are set appropriately.
108 In a typical MSVC 9.0 installation, it can be achieved by running
109 C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
110 In a typical MSVC 14.0 installation on Windows 10, it can be achieved
111 - for creating 32-bit binaries: through the following bash commands:
113 # Set environment variables for using MSVC 14,
114 # for creating native 32-bit Windows executables.
116 # Windows C library headers and libraries.
117 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
118 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
119 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
120 LIB="${WindowsCrtLibDir}x86;$LIB"
122 # Windows API headers and libraries.
123 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
124 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
125 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
126 LIB="${WindowsSdkLibDir}x86;$LIB"
128 # Visual C++ tools, headers and libraries.
129 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
130 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
131 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH"
132 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
133 LIB="${VCINSTALLDIR}"'\lib;'"${LIB}"
137 - for creating 64-bit binaries: through the following bash commands:
139 # Set environment variables for using MSVC 14,
140 # for creating native 64-bit Windows executables.
142 # Windows C library headers and libraries.
143 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
144 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
145 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
146 LIB="${WindowsCrtLibDir}x64;$LIB"
148 # Windows API headers and libraries.
149 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
150 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
151 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
152 LIB="${WindowsSdkLibDir}x64;$LIB"
154 # Visual C++ tools, headers and libraries.
155 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
156 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
157 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH"
158 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
159 LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}"
163 Building 32-bit binaries with MSVC is achieved through the following
164 preparation, configure, and build commands:
166 PATH=/usr/local/msvc32/bin:$PATH
169 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
170 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
171 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
172 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
174 ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
175 CC="$HOME/msvc/compile cl -nologo" \
177 CXX="$HOME/msvc/compile cl -nologo" \
179 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \
180 LDFLAGS="-L/usr/local/msvc32/lib" \
182 NM="dumpbin -symbols" \
184 AR="$HOME/msvc/ar-lib lib" \
189 Building 64-bit binaries with MSVC is achieved through the following
190 preparation, configure, and build commands:
192 PATH=/usr/local/msvc64/bin:$PATH
195 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
196 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
197 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
198 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
200 ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
201 CC="$HOME/msvc/compile cl -nologo" \
203 CXX="$HOME/msvc/compile cl -nologo" \
205 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \
206 LDFLAGS="-L/usr/local/msvc64/lib" \
208 NM="dumpbin -symbols" \
210 AR="$HOME/msvc/ar-lib lib" \
219 ===============================================================================
220 3) Binaries for the Cygwin environment.
222 The generic instructions in the INSTALL file apply. But here are more
226 * Cygwin (from https://cygwin.com/),
227 * some packages available from the Cygwin package installer:
229 * the Cygwin [cross-]compilation tools package, available from
230 the Cygwin package installer (setup-x86_64.exe):
231 - for creating 32-bit binaries: packages
235 - for creating 64-bit binaries: packages
239 Building 32-bit binaries for Cygwin must be done in a directory *outside*
240 the Cygwin /home and /usr hierarchies. It is achieved through the following
241 preparation, configure, and build commands:
243 PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH
245 ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \
246 CC=i686-pc-cygwin-gcc \
247 CXX=i686-pc-cygwin-g++ \
248 CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \
249 LDFLAGS="-L/usr/local/cygwin32/lib"
253 Building 64-bit binaries for Cygwin is achieved through the following
254 preparation, configure, and build commands:
256 PATH=/usr/local/cygwin64/bin:$PATH
258 ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \
259 CC=x86_64-pc-cygwin-gcc \
260 CXX=x86_64-pc-cygwin-g++ \
261 CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \
262 LDFLAGS="-L/usr/local/cygwin64/lib"
270 ===============================================================================
273 This package depends on GNU libiconv. (See the file DEPENDENCIES.) Before
274 building this package, you need to build GNU libiconv, in the same development
275 environment, with the same configure options, and install it ("make install").
276 ===============================================================================