Blame README.windows

Packit b27855
Installation on Microsoft Windows:
Packit b27855
Packit b27855
There are three ways to create binaries of this package for Microsoft Windows:
Packit b27855
1) Native binaries, built using the mingw tool chain.
Packit b27855
2) Native binaries, built using the MS Visual C/C++ tool chain.
Packit b27855
3) Binaries for the Cygwin environment.
Packit b27855
Packit b27855
===============================================================================
Packit b27855
1) Native binaries, built using the mingw tool chain.
Packit b27855
Packit b27855
   I recommend to use the Cygwin environment as the development environment
Packit b27855
   and mingw only as the target (runtime, deployment) environment.
Packit b27855
   For this, you need to install
Packit b27855
     * Cygwin (from https://cygwin.com/),
Packit b27855
     * some packages available from the Cygwin package installer:
Packit b27855
         make
Packit b27855
     * the mingw cross-compilation tools and runtime package, available from
Packit b27855
       the Cygwin package installer (setup-x86_64.exe):
Packit b27855
       - for creating 32-bit binaries: packages
Packit b27855
           mingw64-i686-gcc-core,
Packit b27855
           mingw64-i686-gcc-g++,
Packit b27855
           mingw64-i686-headers,
Packit b27855
           mingw64-i686-runtime
Packit b27855
       - for creating 64-bit binaries: packages
Packit b27855
           mingw64-x86_64-gcc-core,
Packit b27855
           mingw64-x86_64-gcc-g++,
Packit b27855
           mingw64-x86_64-headers,
Packit b27855
           mingw64-x86_64-runtime
Packit b27855
Packit b27855
   Building 32-bit binaries for mingw is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
Packit b27855
      export PATH
Packit b27855
      ./configure --host=i686-w64-mingw32 --prefix=/usr/local/mingw32 \
Packit b27855
            CC=i686-w64-mingw32-gcc \
Packit b27855
            CXX=i686-w64-mingw32-g++ \
Packit b27855
            CPPFLAGS="-I/usr/local/mingw32/include -Wall" \
Packit b27855
            LDFLAGS="-L/usr/local/mingw32/lib"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Building 64-bit binaries for mingw is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/mingw64/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
Packit b27855
      export PATH
Packit b27855
      ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/mingw64 \
Packit b27855
            CC=x86_64-w64-mingw32-gcc \
Packit b27855
            CXX=x86_64-w64-mingw32-g++ \
Packit b27855
            CPPFLAGS="-I/usr/local/mingw64/include -Wall" \
Packit b27855
            LDFLAGS="-L/usr/local/mingw64/lib"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Installation:
Packit b27855
Packit b27855
      make install
Packit b27855
Packit b27855
===============================================================================
Packit b27855
2) Native binaries, built using the MS Visual C/C++ tool chain.
Packit b27855
Packit b27855
   Note that binaries created with MSVC have a distribution constraint: They
Packit b27855
   depend on a closed-source library ('msvcr90.dll' for MSVC 9.0,
Packit b27855
   'vcruntime140.dll' for MSVC 14.0, and so on) which is not normally part of
Packit b27855
   a Windows installation.
Packit b27855
   You cannot distribute 'vcruntime*.dll' with the binaries - this would be a
Packit b27855
   violation of the GPL and of the Microsoft EULA.
Packit b27855
   You can distribute the binaries without including 'vcruntime*.dll'. Users
Packit b27855
   who don't have this library on their system will require to pull some files
Packit b27855
   (api-ms-win*.dll) through the Windows Update mechanism, see
Packit b27855
   https://support.microsoft.com/en-us/kb/2999226 .
Packit b27855
Packit b27855
   This recipe requires MS Visual C/C++ 9.0 or newer.
Packit b27855
   You don't need the Visual Studio IDE, just the C/C++ tool chain.
Packit b27855
   As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
Packit b27855
   http://landinghub.visualstudio.com/visual-cpp-build-tools (it's the file
Packit b27855
   visualcppbuildtools_full.exe).
Packit b27855
Packit b27855
   This recipe requires also a Cygwin environment (with 'bash', the common POSIX
Packit b27855
   commands, and 'make') as a build environment. Building with 'nmake' is not
Packit b27855
   supported.
Packit b27855
   For this, you need to install
Packit b27855
     * Cygwin (from https://cygwin.com/),
Packit b27855
     * some packages available from the Cygwin package installer:
Packit b27855
         make
Packit b27855
Packit b27855
   You also need the scripts 'ar-lib' and 'compile' from
Packit b27855
     http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD
Packit b27855
     http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD
Packit b27855
   respectively.
Packit b27855
   They may also be included in this package, in directory 'build-aux/'.
Packit b27855
   Save them; the instructions below assume that you stored them in $HOME/msvc/.
Packit b27855
   Make them executable:
Packit b27855
      chmod a+x ar-lib compile
Packit b27855
Packit b27855
   Start a bash (from Cygwin).
Packit b27855
Packit b27855
   Make sure that the MSVC tools ("cl" etc.) are found in PATH and the
Packit b27855
   environment variables INCLUDE and LIB are set appropriately.
Packit b27855
   In a typical MSVC 9.0 installation, it can be achieved by running
Packit b27855
     C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
Packit b27855
   In a typical MSVC 14.0 installation on Windows 10, it can be achieved
Packit b27855
   - for creating 32-bit binaries: through the following bash commands:
Packit b27855
Packit b27855
      # Set environment variables for using MSVC 14,
Packit b27855
      # for creating native 32-bit Windows executables.
Packit b27855
Packit b27855
      # Windows C library headers and libraries.
Packit b27855
      WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
Packit b27855
      WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
Packit b27855
      INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
Packit b27855
      LIB="${WindowsCrtLibDir}x86;$LIB"
Packit b27855
Packit b27855
      # Windows API headers and libraries.
Packit b27855
      WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
Packit b27855
      WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
Packit b27855
      INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
Packit b27855
      LIB="${WindowsSdkLibDir}x86;$LIB"
Packit b27855
Packit b27855
      # Visual C++ tools, headers and libraries.
Packit b27855
      VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
Packit b27855
      VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
Packit b27855
      PATH=`cygpath -u "${VCINSTALLDIR}"`/bin:"$PATH"
Packit b27855
      INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
Packit b27855
      LIB="${VCINSTALLDIR}"'\lib;'"${LIB}"
Packit b27855
Packit b27855
      export INCLUDE LIB
Packit b27855
Packit b27855
   - for creating 64-bit binaries: through the following bash commands:
Packit b27855
Packit b27855
     # Set environment variables for using MSVC 14,
Packit b27855
     # for creating native 64-bit Windows executables.
Packit b27855
Packit b27855
     # Windows C library headers and libraries.
Packit b27855
     WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
Packit b27855
     WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
Packit b27855
     INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
Packit b27855
     LIB="${WindowsCrtLibDir}x64;$LIB"
Packit b27855
Packit b27855
     # Windows API headers and libraries.
Packit b27855
     WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
Packit b27855
     WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
Packit b27855
     INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
Packit b27855
     LIB="${WindowsSdkLibDir}x64;$LIB"
Packit b27855
Packit b27855
     # Visual C++ tools, headers and libraries.
Packit b27855
     VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
Packit b27855
     VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
Packit b27855
     PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH"
Packit b27855
     INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
Packit b27855
     LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}"
Packit b27855
Packit b27855
     export INCLUDE LIB
Packit b27855
Packit b27855
   Building 32-bit binaries with MSVC is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/msvc32/bin:$PATH
Packit b27855
      export PATH
Packit b27855
Packit b27855
      win32_target=_WIN32_WINNT_WINXP   # for MSVC 9.0
Packit b27855
      win32_target=_WIN32_WINNT_VISTA   # possibly for MSVC >= 10.0
Packit b27855
      win32_target=_WIN32_WINNT_WIN7    # possibly for MSVC >= 10.0
Packit b27855
      win32_target=_WIN32_WINNT_WIN8    # possibly for MSVC >= 10.0
Packit b27855
Packit b27855
      ./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
Packit b27855
            CC="$HOME/msvc/compile cl -nologo" \
Packit b27855
            CFLAGS="-MD" \
Packit b27855
            CXX="$HOME/msvc/compile cl -nologo" \
Packit b27855
            CXXFLAGS="-MD" \
Packit b27855
            CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc32/include" \
Packit b27855
            LDFLAGS="-L/usr/local/msvc32/lib" \
Packit b27855
            LD="link" \
Packit b27855
            NM="dumpbin -symbols" \
Packit b27855
            STRIP=":" \
Packit b27855
            AR="$HOME/msvc/ar-lib lib" \
Packit b27855
            RANLIB=":"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Building 64-bit binaries with MSVC is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/msvc64/bin:$PATH
Packit b27855
      export PATH
Packit b27855
Packit b27855
      win32_target=_WIN32_WINNT_WINXP   # for MSVC 9.0
Packit b27855
      win32_target=_WIN32_WINNT_VISTA   # possibly for MSVC >= 10.0
Packit b27855
      win32_target=_WIN32_WINNT_WIN7    # possibly for MSVC >= 10.0
Packit b27855
      win32_target=_WIN32_WINNT_WIN8    # possibly for MSVC >= 10.0
Packit b27855
Packit b27855
      ./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
Packit b27855
            CC="$HOME/msvc/compile cl -nologo" \
Packit b27855
            CFLAGS="-MD" \
Packit b27855
            CXX="$HOME/msvc/compile cl -nologo" \
Packit b27855
            CXXFLAGS="-MD" \
Packit b27855
            CPPFLAGS="-D_WIN32_WINNT=$win32_target -I/usr/local/msvc64/include" \
Packit b27855
            LDFLAGS="-L/usr/local/msvc64/lib" \
Packit b27855
            LD="link" \
Packit b27855
            NM="dumpbin -symbols" \
Packit b27855
            STRIP=":" \
Packit b27855
            AR="$HOME/msvc/ar-lib lib" \
Packit b27855
            RANLIB=":"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Installation:
Packit b27855
Packit b27855
      make install
Packit b27855
Packit b27855
===============================================================================
Packit b27855
3) Binaries for the Cygwin environment.
Packit b27855
Packit b27855
   The generic instructions in the INSTALL file apply. But here are more
Packit b27855
   specific ones.
Packit b27855
Packit b27855
   You need to install
Packit b27855
     * Cygwin (from https://cygwin.com/),
Packit b27855
     * some packages available from the Cygwin package installer:
Packit b27855
         make
Packit b27855
     * the Cygwin [cross-]compilation tools package, available from
Packit b27855
       the Cygwin package installer (setup-x86_64.exe):
Packit b27855
       - for creating 32-bit binaries: packages
Packit b27855
           cygwin32-gcc-core,
Packit b27855
           cygwin32-gcc-g++,
Packit b27855
           cygwin32
Packit b27855
       - for creating 64-bit binaries: packages
Packit b27855
           gcc-core,
Packit b27855
           gcc-g++
Packit b27855
Packit b27855
   Building 32-bit binaries for Cygwin is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/cygwin32/bin:/usr/i686-pc-cygwin/sys-root/usr/bin:$PATH
Packit b27855
      export PATH
Packit b27855
      ./configure --host=i686-pc-cygwin --prefix=/usr/local/cygwin32 \
Packit b27855
            CC=i686-pc-cygwin-gcc \
Packit b27855
            CXX=i686-pc-cygwin-g++ \
Packit b27855
            CPPFLAGS="-I/usr/local/cygwin32/include -Wall" \
Packit b27855
            LDFLAGS="-L/usr/local/cygwin32/lib"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Building 64-bit binaries for Cygwin is achieved through the following
Packit b27855
   preparation, configure, and build commands:
Packit b27855
Packit b27855
      PATH=/usr/local/cygwin64/bin:$PATH
Packit b27855
      export PATH
Packit b27855
      ./configure --host=x86_64-pc-cygwin --prefix=/usr/local/cygwin64 \
Packit b27855
            CC=x86_64-pc-cygwin-gcc \
Packit b27855
            CXX=x86_64-pc-cygwin-g++ \
Packit b27855
            CPPFLAGS="-I/usr/local/cygwin64/include -Wall" \
Packit b27855
            LDFLAGS="-L/usr/local/cygwin64/lib"
Packit b27855
      make
Packit b27855
      make check
Packit b27855
Packit b27855
   Installation:
Packit b27855
Packit b27855
      make install
Packit b27855
Packit b27855
===============================================================================