User Tools

Site Tools


ccmingw-en

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ccmingw-en [2018/11/12 08:56] – external edit 127.0.0.1ccmingw-en [2021/09/20 14:52] (current) – removed rjversluis
Line 1: Line 1:
-======Cross Compile with MinGW====== 
-[[develop-corner-it|{{ icons:it.png|Versione italiana}}]][[:english#objects|{{  :objects.png}}]][[:english|{{  :rocrail-logo-35.png}}]] 
-[[:develop-corner-en|Developer corner]]  
  
- \\ 
----- 
-Rocrail cross compiled on Ubuntu for Windows 
--- 
-Cross compiling for Windows from an Ubuntu computer is a bit challenging.  You  __must__  compile Rocrail for Ubuntu before you try to cross compile for Windows.   
- 
-You will need to install several tools and packages before you can cross compile.  Make sure they are installed and working properly before you try to 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:===== 
-<code> 
-sudo apt-get install mingw32 
-</code> 
-====GdiPlus==== 
-If GdiPlus is missing: (and it usually is) 
-  * From the source tree: Rocrail/extras/i586mingw32/gdiplus.zip 
-  * https://github.com/rocrail/Rocrail/blob/master/extras/i586mingw32/gdiplus.zip?raw=true 
-Copy the contents to /usr/i586-mingw32msvc: 
-<code> 
-unzip gdiplus.zip 
-cd gdiplus 
-sudo cp -r include/* /usr/i586-mingw32msvc/include/ 
-sudo cp -r lib/* /usr/i586-mingw32msvc/lib/ 
-</code> 
- 
- 
-=====get wxWidgets===== 
-  * https://sourceforge.net/projects/wxwindows/files/3.0.1/wxWidgets-3.0.1.tar.bz2 
-<code> 
-tar xvjf wxWidgets-3.0.1.tar.bz2 
-cd wxWidgets-3.0.1 
-# run configure like: 
- 
-./configure --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --target=i586-mingw32msvc --with-msw --enable-unicode --enable-mslu --disable-shared --enable-graphics_ctx --enable-monolithic  
-</code> 
- 
-=====make the wx libraries:===== 
-<code> 
-make 
-</code> 
- 
-=====install it:===== 
-<code> 
-sudo make install 
-</code> 
- 
- 
-=====build the rocrail modules:===== 
-<code> 
-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 .. 
-</code> 
- 
-=====build the UNICODE rocview: (using the common makefile)===== 
-<code> 
-cd rocview 
-make PLATFORM=WIN32 clean 
-make TOOLPREFIX=i586-mingw32msvc- LIBSUFFIX=-i586-mingw32msvc PLATFORM=WIN32 MINGWINSTALL=/usr/i586-mingw32msvc all 
-cd .. 
-</code> 
- 
-#note: The 'i586-mingw32msvc' text must be according to your installation of mingw, change when needed. 
- 
- 
-=====build all modules from the Rocrail main makefile:===== 
-<code> 
-make all PLATFORM=WIN32 TOOLPREFIX=i586-mingw32msvc- LIBSUFFIX=-i586-mingw32msvc MINGWINSTALL=/usr/i586-mingw32msvc 
-</code> 
- 
-see also: http://www.wxwidgets.org/wiki/index.php/Cross-Compiling_Under_Linux 
- 
-=====strip the binaries===== 
-<code> 
-cd winbin 
-i586-mingw32msvc-strip *.dll 
-i586-mingw32msvc-strip *.exe 
-cd .. 
-</code> 
- 
-=====copy mingw runtime dll to winbin directory===== 
-Extract /usr/share/doc/mingw32-runtime/mingwm10.dll.gz to winbin 
- 
-<code> 
-cd winbin 
-sudo gunzip /usr/share/doc/mingw32-runtime/mingwm10.dll.gz 
-cp /usr/share/doc/mingw32-runtime/mingwm10.dll . 
-cd .. 
-</code> 
- 
-=====run inno setup with wine and create the package===== 
-Get and install wine from the official Wine HQ site [[http://www.winehq.org/|Wine Headquarters]] or as distribution package: 
-<code> 
-sudo apt-get install wine 
-</code> 
- 
-Get and install the Inno Setup windows exe **using wine** from the official Inno Setup site: 
- 
-[[http://www.innosetup.com/isinfo.php|Inno Setup Website]] 
-\\ #note: if you want to use the distribution scripts: the installation path has to be exactly "c:\Program Files\Inno Setup 5" 
- 
-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) : 
- 
-<code> 
-cd rocrail/package 
-wine "c:\\Program Files\\Inno Setup 5\\ISCC.exe" rocrail.iss 
-cd ../.. 
-</code> 
- 
-===== 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: 
- 
-<code> 
-gcc-mingw-w64-base 
-gcc-mingw-w64-i686 
-mingw-w64-dev 
-binutils-mingw-w64-i686 
-g++mingw-w64-i686 
-</code> 
- 
-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: 
- 
-<code> 
-./configure --prefix=/usr/i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-msw --enable-unicode --enable-mslu --disable-shared --enable-graphics_ctx LDFLAGS=-static --enable-monolithic  
-</code> 
- 
-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/Rocview directory. 
- 
- 
-Now build and install the wx libraries: 
- 
-<code> 
-make 
- 
-sudo make install 
-</code> 
- 
-Rocrail and Rocview can be cross compiled using the main makefile (updated for mingw-w64-i686 at revision 3823) using the command: 
- 
-<code> 
-make all PLATFORM=WIN32 TOOLPREFIX=i686-w64-mingw32- LIBSUFFIX=-i686-w64-mingw32 MINGWINSTALL=/usr/i686-w64-mingw32 
-</code> 
- 
-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