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 ===============================================================================
61 2) Native binaries, built using the MS Visual C/C++ tool chain.
63 Note that binaries created with MSVC have a distribution constraint: They
64 depend on a closed-source library ('msvcr90.dll' for MSVC 9.0,
65 'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of
66 a Windows installation.
67 You cannot distribute 'vcruntime*.dll' with the binaries - this would be a
68 violation of the GPL and of the Microsoft EULA.
69 You can distribute the binaries without including 'vcruntime*.dll'. Users
70 who don't have this library on their system will require to pull some files
71 (api-ms-win*.dll) through the Windows Update mechanism, see
72 https://support.microsoft.com/en-us/kb/2999226 .
74 This recipe requires MS Visual C/C++ 9.0 or newer.
75 You don't need the Visual Studio IDE, just the C/C++ tool chain.
76 As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
77 https://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file
78 visualcppbuildtools_full.exe).
80 This recipe requires also a Cygwin environment (with 'bash', the common POSIX
81 commands, and 'make') as a build environment. Building with 'nmake' is not
83 For this, you need to install
84 * Cygwin (from https://cygwin.com/),
85 * some packages available from the Cygwin package installer:
88 You also need the scripts 'ar-lib' and 'compile' from
89 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD
90 https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD
92 They may also be included in this package, in directory 'build-aux/'.
93 Save them; the instructions below assume that you stored them in $HOME/msvc/.
95 chmod a+x ar-lib compile
97 Start a bash (from Cygwin).
99 Make sure that the MSVC tools ("cl" etc.) are found in PATH and the
100 environment variables INCLUDE and LIB are set appropriately.
101 In a typical MSVC 9.0 installation, it can be achieved by running
102 C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
103 In a typical MSVC 14.0 installation on Windows 10, it can be achieved
104 - for creating 32-bit binaries: through the following bash commands:
106 # Set environment variables for using MSVC 14,
107 # for creating native 32-bit Windows executables.
109 # Windows C library headers and libraries.
110 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
111 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
112 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
113 LIB="${WindowsCrtLibDir}x86;$LIB"
115 # Windows API headers and libraries.
116 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
117 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
118 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
119 LIB="${WindowsSdkLibDir}x86;$LIB"
121 # Visual C++ tools, headers and libraries.
122 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
123 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
124 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH"
125 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
126 LIB="${VCINSTALLDIR}"'\lib;'"${LIB}"
130 - for creating 64-bit binaries: through the following bash commands:
132 # Set environment variables for using MSVC 14,
133 # for creating native 64-bit Windows executables.
135 # Windows C library headers and libraries.
136 WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
137 WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
138 INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
139 LIB="${WindowsCrtLibDir}x64;$LIB"
141 # Windows API headers and libraries.
142 WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
143 WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
144 INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
145 LIB="${WindowsSdkLibDir}x64;$LIB"
147 # Visual C++ tools, headers and libraries.
148 VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
149 VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
150 PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH"
151 INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
152 LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}"
156 Building 32-bit binaries with MSVC is achieved through the following
157 preparation, configure, and build commands:
159 PATH=/usr/local/msvc32/bin:$PATH
162 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
163 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
164 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
165 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
167 ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
168 CC="$HOME/msvc/compile cl -nologo" \
170 CXX="$HOME/msvc/compile cl -nologo" \
172 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \
173 LDFLAGS="-L/usr/local/msvc32/lib" \
175 NM="dumpbin -symbols" \
177 AR="$HOME/msvc/ar-lib lib" \
182 Building 64-bit binaries with MSVC is achieved through the following
183 preparation, configure, and build commands:
185 PATH=/usr/local/msvc64/bin:$PATH
188 win32_target=_WIN32_WINNT_WINXP # for MSVC 9.0
189 win32_target=_WIN32_WINNT_VISTA # possibly for MSVC >= 10.0
190 win32_target=_WIN32_WINNT_WIN7 # possibly for MSVC >= 10.0
191 win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
193 ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
194 CC="$HOME/msvc/compile cl -nologo" \
196 CXX="$HOME/msvc/compile cl -nologo" \
198 CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \
199 LDFLAGS="-L/usr/local/msvc64/lib" \
201 NM="dumpbin -symbols" \
203 AR="$HOME/msvc/ar-lib lib" \
212 ===============================================================================
213 3) Binaries for the Cygwin environment.
215 The generic instructions in the INSTALL file apply. But here are more
219 * Cygwin (from https://cygwin.com/),
220 * some packages available from the Cygwin package installer:
222 * the Cygwin [cross-]compilation tools package, available from
223 the Cygwin package installer (setup-x86_64.exe):
224 - for creating 32-bit binaries: packages
228 - for creating 64-bit binaries: packages
232 Building 32-bit binaries for Cygwin must be done in a directory *outside*
233 the Cygwin /home and /usr hierarchies. It is achieved through the following
234 preparation, configure, and build commands:
236 PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH
238 ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \
239 CC=i686-pc-cygwin-gcc \
240 CXX=i686-pc-cygwin-g++ \
241 CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \
242 LDFLAGS="-L/usr/local/cygwin32/lib"
246 Building 64-bit binaries for Cygwin is achieved through the following
247 preparation, configure, and build commands:
249 PATH=/usr/local/cygwin64/bin:$PATH
251 ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \
252 CC=x86_64-pc-cygwin-gcc \
253 CXX=x86_64-pc-cygwin-g++ \
254 CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \
255 LDFLAGS="-L/usr/local/cygwin64/lib"
263 ===============================================================================
266 This package depends on GNU libiconv. (See the file DEPENDENCIES.) Before
267 building this package, you need to build GNU libiconv, in the same development
268 environment, with the same configure options, and install it ("make install").
269 ===============================================================================