Currently one of the Linux C::B build process at a high level is is to do the following:
./bootstrap
./configure
* make
On Windows with a GNU environment (okay GNU is not right) you have the same tools as Linux, so you can use the same process to build C::B. This appears to probably been done in the past by stahta01 as per the https://github.com/stahta01/cb_misc/tree/master/Patches/Git-am/MSys2/2015-10-16_MSys2_changes.patch file's existence, but I could be wrong.
This ticket is to get the "boostrap/configure/make" process to work with MSYS 2 MinGW64 and then later when time permits someone else can if they w3ant take the batton and do it for MingW32.
The process IMHO will work, but takes a while as the changes to the various Makefile.am files are not the same and as such take time to resolve and there are 228 Makefile.am files they may or may not need modifying.
This should then allow Windows C::B to be built in a CI environment using MSYS2. There is a Github MYS2 action, see https://github.com/eine/ghdl-packaging/blob/master/.github/workflows/mingw.yml
It is promising!
Here is another idea: we can use the C::B command line interface (batch build mode) tool to build the C::B source in the CI environment.
Last edit: ollydbg 2022-02-09
It is promising and I am working my way though the Makefile.am changes as the make step throws up errors. I will need to go through the changes in the Makefile.am changes once I finish as I have made some mistakes in the early ones yesterday as I did not know what I was doing and now know allot more and the right way to change the files in order not to break the MAC builds, which I did yesterday and this morning.
Update: Finished my first pass using the following configure option and then make successfully with no errors, but cannot run the resulting build as I need to do a "make install:
./configure --without-contrib-plugins
Now rebuilding with the following configure option in order to run the make install after the make :
./configure --prefix=$PWD/src/devel31_64 --without-contrib-plugins
Will update in the morning.
Last edit: Andrew Cottrell 2022-02-09
For C::B command line headless CI changes see ticket 1197 , but I got stuck on that one and started working on this ticket. Once I finish this I will go back to 1197.
Update: 10-Feb-2022 1:15PM:
Got a codeblocks exe that runs, but due to the "make install" not creating a correct Windows directory structure there are no plugins. More work/hacking files.
So I now know the process will work, but I have not got a working POC yet.
Do you link the CB executable to the wx library supplied(installed by pacman) by msys2?
msys2 has two kinds of wx library, one is 3.0.5(Package: mingw-w64-x86_64-wxWidgets - MSYS2 Packages), the other is 3.1.5(Package: mingw-w64-x86_64-wxmsw3.1 - MSYS2 Packages).
The MSYS2 wxwidget library 3.1 installed by pacman is not complete and does not have all of the required functions, so you need to build a CB monolithic wxwidget library as you do with the workspace build. I used the exact same one I built previously (wx 3.1.5).
I have raised the following MSYS2 ticket for the missing directory that I found:
https://github.com/msys2/MINGW-packages/issues/10691
The msys2's package wxWidgets3.1: Remove setting wxUSE_GRAPHICS_DIRECT2D by stahta01 · Pull Request #9396 · msys2/MINGW-packages is maintained by stahta01(Who is the same user name as in our C::B forum), you may ask him for help.
Thanks.
Last edit: ollydbg 2022-02-10
I have borrowed some of Tim's changes from 2015, but they are out of date, but have saved me allot of time at the beginning. I will see if Tim can do the code review once I get the build and install done so that I have a working C::B install in the devel31_64 directory.
I have the plugin DLL's now being copied into the plugin directory, but the DLL's have "lib" prepended to them, so not I have to figure out how to fix this or work around this.
This is the patch #1 that (I hope) includes all of the Makefile.am files. The files use a new CODEBLOCKS_NT_BUILD_INSTALLER variable that is defined to true in the bootstrap/configure patch that is needed for the make install to copy the plugins into the correct directory.
This is the second patch that has changes that need to be reviewed to see if there are better ways to accomplish that same thing or some other way of doing the equivalent.
This patch has changes to the following files and the changes in them:
bootstrap - updated tools to use versions from about 8 to 10 years ago as a minimum & do not show debian note on Windows or OSX
configure.ac - Enable DLL support for windows
m4/acinclude.m4 - add option for new command line parameter "--windows-installer-build" that creates the CODEBLOCKS_NT_BUILD_INSTALLER variable and also sets various directories used by "make install" instead of having to specify a bunch on the command line.
wx-config-cb-win64 - new file to use the environment variable WX_CB_BUILD_DIR that points at the local C::B monolithic wxWidget root directory and has changes so the --cppflags and --libs are for the C::B monolithic wxWidget.
The debatable change is the configure.ac tool version. Please let me know if I need to go back further or should not have done this.
With this patch and the first one if you follow the instructions in the attached build doc then you will end up with a working C::B exe and core plugins. Be aware that the process is not optimized and currently needs a manual change to ltmain.sh as per the attached build doc that I need to spend time figuring out how to work around it. With these two patches and the build doc it will allow other devs to help finish and polish the process as I am a newbie with automake and autoconf programing/configuration. The build doc includes notes of where work is required.
It may also be an idea to include the attached build doc in SVN. Let me know what you think about this.
Last edit: Andrew Cottrell 2022-02-11
Forgot to mention you need to apply the patch in ticket 1202 before these patches otherwise your plugins will not be found.
To make testing easier I have created a branch in the following GitHub repo that has the changes for this ticket, 1202, 1205 and 1207 along a number of bash scripts and build docs that will help with testing. The repo and branch is:
https://github.com/acotty/codeblocks_sfmirror/tree/MSYS2_BASH_BUILD
Please read the following doc for how to install MSYS2 and how to do the build:
https://github.com/acotty/codeblocks_sfmirror/blob/MSYS2_BASH_BUILD/Readme_Build_Windows_MSYS2_by_Makefile.txt
Last edit: Andrew Cottrell 2022-02-17
Miguel,
How do you want to proceed with this?
I have completed the changes and built and run C::B on Windows and Linux using the same source and the same process with the following very minor process for Windows as follows:
1. configure has an additional parameters for windows to create an installer as you should in theory (not tested) be able to build so that the output is in a directory structure like Linux so the files can be installed in the MSYS2 as a MSYS2 package
2. On Windows you need to run an update step like you do if you built C::B via the workspace.
There are allot of changes to the autotools files and can be broken down into the following groups at a high level:
1. Update autotools m4 files to the latest as these support MSYS2
2. Add support for the following new automake environment variables:
* CODEBLOCKS_NT_BUILD_INSTALLER
* CODEBLOCKS_NT_WINDOWS_INSTALLERDOC_FOUND
3. Add missing Makefile.am and/or configure to use new/existing Makefile.am. There are missing plugins or there are plugins that are not applicable for Windows and there are missing executables that were added (cb2make as an example)
4. The big one, all of the Makefile.am changes. These are changes are to build the files on MSYS2 and install the files in the src\devel31_64 directories
5. Other minor misc changes compared to 1 through 4 above.
All of the changes are in the https://github.com/acotty/codeblocks_sfmirror/tree/MSYS2_BASH_BUILD branch.
IMHO producing one patch file will be way way too big to review and check. Also producing a set if no one is going to look at them is a waste of time, so I would suggest grabbing the github repo and using a diff program like Meld on Linux or Winmerge on Windows to compare the SVN and the github directories for changes and look at the chanegs in the following groups based on the files extension and bootstrap in group 1:
1. .ac;.m4; .in; bootstrap
2. Makefile.am
3. .h;*.cpp
4. Additional files added in github (except the Andrew_Build_Helper_Files directory)
5. All files to see what else has changed.
I do not intend to get into this, as I said I want to stay far from MSYS2 and autotools. There are more veteran developers who use MSYS2 and understand autotools.
After [r12272] and [r12273] you may need to edit some Makefile.am so only required symbols are exported on MSW.
Related
Commit: [r12272]
Commit: [r12273]
I will not be doing anything until someone starts looking at the changes because if no one steps forward then I will be wasting my time and I have put allot of time into this and will be very very very unhappy if no one steps forward to look at the changes in a timely manor as I do not want to have to try and keep the changes up to date for 9 months like I have had to do with ticket 1119.
Mostly fixed by [r13573] to [r13578], please open a new ticket if needed.
Related
Commit: [r13573]
Commit: [r13578]