-
Notifications
You must be signed in to change notification settings - Fork 10
MS Windows
Petr Vanek edited this page Oct 30, 2018
·
1 revision
MSYS2 is a software distro and building platform for Windows
MSYS2 comes with 3 sort-of independent shells:
- MSYS2 shell - a shell for regular work
- MINGW32 shell - a shell for cross compilation to get native Windows binaries. For 32bit Windows
- MINGW64 shell - a shell for cross compilation to get native Windows binaries. For 64bit Windows
Packages in MSYS2 are also created for 3 shells:
- standard packages with normal names -> MSYS2 shell
- prefixed with mingw-w64-i686 -> MINGW32 shell
- prefixed with mingw-w64-x86_64 -> MINGW64 shell
If you open a MINGWxx shell, your env will be configured to use environment only with mingw* prefixed packages.
In the following text I'm using MSYS2 for Windows 64 bit (but still it can create 32b binaries). If you have 32 bit Windows you should download MSYS2 for 32bit architecture and update package names below.
Use MSYS2 shell, install packages:
pacman -Syu
pacman -Su
pacman -S git
pacman -S make bison flex pkg-config
pacman -S pcre-devel
packages for cross compilation (used under MINGW env later)
The prefixes are:
- MINGW env for 32bit: mingw-w64-i686
- MINGW env for 64bit: mingw-w64-x86_64
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-doxygen
pacman -S mingw-w64-x86_64-graphviz
pacman -S mingw-w64-x86_64-libiconv
pacman -S mingw-w64-x86_64-openssl
pacman -S mingw-w64-x86_64-mpfr
pacman -S mingw-w64-x86_64-pcre
pacman -S mingw-w64-x86_64-dlfcn
pacman -S mingw-w64-i686-cmake
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-i686-doxygen
pacman -S mingw-w64-i686-graphviz
pacman -S mingw-w64-i686-libiconv
pacman -S mingw-w64-i686-openssl
pacman -S mingw-w64-i686-mpfr
pacman -S mingw-w64-i686-pcre
pacman -S mingw-w64-i686-dlfcn
Start the MINGWxx environment
git clone ...
cd qore
mkdir build
cd build
# for example:
cmake -G "Unix Makefiles" .. -DCMAKE_INSTALL_PREFIX=~/release
make
make install
Bundle all DLLs into the target lib. Call from CMAKE_INSTALL_PREFIX/bin
cp `ldd qore.exe |grep mingw64|cut -d " " -f 3` .
export PATH=$PATH=<the value used in Qore's CMAKE_INSTALL_PREFIX + /bin>
git clone ..
cd <module-dir>
<cmake or autotools>
make
make install