ccmingw-en
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ccmingw-en [2018/11/12 08:56] – external edit 127.0.0.1 | ccmingw-en [2021/09/20 14:52] (current) – removed rjversluis | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Cross Compile with MinGW====== | ||
- | [[develop-corner-it|{{ icons: | ||
- | [[: | ||
- | \\ | ||
- | ---- | ||
- | Rocrail cross compiled on Ubuntu for Windows | ||
- | -- | ||
- | Cross compiling for Windows from an Ubuntu computer is a bit challenging. | ||
- | |||
- | You will need to install several tools and packages before you can cross compile. | ||
- | |||
- | The important tools that you must have are: | ||
- | |||
- | * MinGW32, a cross-compiler for creating windows executables when compiling under Linux | ||
- | * wxAll sources for wxWidgets, the full set of wxWidgets source code that includes windows versions | ||
- | * Wine, a shell system that will run windows executables under Linux | ||
- | * Inno Setup, a free windows installer creation program that runs under windows | ||
- | |||
- | Perform the next steps carefully and in sequence to create a windows installer version of Rocrail. | ||
- | |||
- | |||
- | |||
- | |||
- | =====get the cross compiler: | ||
- | < | ||
- | sudo apt-get install mingw32 | ||
- | </ | ||
- | ====GdiPlus==== | ||
- | If GdiPlus is missing: (and it usually is) | ||
- | * From the source tree: Rocrail/ | ||
- | * https:// | ||
- | Copy the contents to / | ||
- | < | ||
- | unzip gdiplus.zip | ||
- | cd gdiplus | ||
- | sudo cp -r include/* / | ||
- | sudo cp -r lib/* / | ||
- | </ | ||
- | |||
- | |||
- | =====get wxWidgets===== | ||
- | * https:// | ||
- | < | ||
- | tar xvjf wxWidgets-3.0.1.tar.bz2 | ||
- | cd wxWidgets-3.0.1 | ||
- | # run configure like: | ||
- | |||
- | ./configure --prefix=/ | ||
- | </ | ||
- | |||
- | =====make the wx libraries: | ||
- | < | ||
- | make | ||
- | </ | ||
- | |||
- | =====install it:===== | ||
- | < | ||
- | sudo make install | ||
- | </ | ||
- | |||
- | |||
- | =====build the rocrail modules: | ||
- | < | ||
- | cd Rocrail | ||
- | cd rocs | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- PLATFORM=WIN32 all | ||
- | cd ../rocint | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- PLATFORM=WIN32 all | ||
- | cd ../rocrail | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- PLATFORM=WIN32 all | ||
- | cd ../roclcdr | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- PLATFORM=WIN32 all | ||
- | cd ../rocdigs | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- PLATFORM=WIN32 all | ||
- | cd .. | ||
- | </ | ||
- | |||
- | =====build the UNICODE rocview: (using the common makefile)===== | ||
- | < | ||
- | cd rocview | ||
- | make PLATFORM=WIN32 clean | ||
- | make TOOLPREFIX=i586-mingw32msvc- LIBSUFFIX=-i586-mingw32msvc PLATFORM=WIN32 MINGWINSTALL=/ | ||
- | cd .. | ||
- | </ | ||
- | |||
- | #note: The ' | ||
- | |||
- | |||
- | =====build all modules from the Rocrail main makefile: | ||
- | < | ||
- | make all PLATFORM=WIN32 TOOLPREFIX=i586-mingw32msvc- LIBSUFFIX=-i586-mingw32msvc MINGWINSTALL=/ | ||
- | </ | ||
- | |||
- | see also: http:// | ||
- | |||
- | =====strip the binaries===== | ||
- | < | ||
- | cd winbin | ||
- | i586-mingw32msvc-strip *.dll | ||
- | i586-mingw32msvc-strip *.exe | ||
- | cd .. | ||
- | </ | ||
- | |||
- | =====copy mingw runtime dll to winbin directory===== | ||
- | Extract / | ||
- | |||
- | < | ||
- | cd winbin | ||
- | sudo gunzip / | ||
- | cp / | ||
- | cd .. | ||
- | </ | ||
- | |||
- | =====run inno setup with wine and create the package===== | ||
- | Get and install wine from the official Wine HQ site [[http:// | ||
- | < | ||
- | sudo apt-get install wine | ||
- | </ | ||
- | |||
- | Get and install the Inno Setup windows exe **using wine** from the official Inno Setup site: | ||
- | |||
- | [[http:// | ||
- | \\ #note: if you want to use the distribution scripts: the installation path has to be exactly " | ||
- | |||
- | Create the package by changing to the rocrail directory and running Inno Setup with the **rocrail.iss** file (see makwin-full.sh on how to generate setup.iss from rocrail-template.iss) : | ||
- | |||
- | < | ||
- | cd rocrail/ | ||
- | wine " | ||
- | cd ../.. | ||
- | </ | ||
- | |||
- | ===== Cross compile with mingw-i686-w64 for Windows 32 ===== | ||
- | To cross compile using the 32/64 bits mingw compiler you first need to get the following packages, using your favourite package manager: | ||
- | |||
- | < | ||
- | gcc-mingw-w64-base | ||
- | gcc-mingw-w64-i686 | ||
- | mingw-w64-dev | ||
- | binutils-mingw-w64-i686 | ||
- | g++mingw-w64-i686 | ||
- | </ | ||
- | |||
- | If mingw32 was installed, the package manager will want to remove it because it is conflicting. Allow this. | ||
- | |||
- | |||
- | First, wxWidgets have to be configured for use with mingw-w64-i686. If you do not have the wxWidgets yet, get the wxAll and extract the files as per the instructions above. Use the following command to configure the make files for the wxWidgets, from a terminal in the wxWidgets directory: | ||
- | |||
- | < | ||
- | ./configure --prefix=/ | ||
- | </ | ||
- | |||
- | The LDFLAGS=-static will include the required dll files during linking. With this flag it is not needed to copy needed dll files manually to the Rocrail/ | ||
- | |||
- | |||
- | Now build and install the wx libraries: | ||
- | |||
- | < | ||
- | make | ||
- | |||
- | sudo make install | ||
- | </ | ||
- | |||
- | Rocrail and Rocview can be cross compiled using the main makefile (updated for mingw-w64-i686 at revision 3823) using the command: | ||
- | |||
- | < | ||
- | make all PLATFORM=WIN32 TOOLPREFIX=i686-w64-mingw32- LIBSUFFIX=-i686-w64-mingw32 MINGWINSTALL=/ | ||
- | </ | ||
- | |||
- | The binaries in the winbin directory need to be stripped and the mingw10.dll added in the usual way as described above. |
ccmingw-en.1542009373.txt.gz · Last modified: 2018/11/12 08:56 by 127.0.0.1