Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: AndrewCot on February 17, 2022, 09:24:59 am

Title: Windows MSYS2 build via makefiles now working - please review and test
Post by: AndrewCot on February 17, 2022, 09:24:59 am
I have a C::B being able to be built with MSYS2 using the bootstrap/configure/make process similar to how it is done on Linux. I have successfully used the resulting C::B develop files to build a simple hello world and debug it (it's my quick and simple real world C::B simple test that I use). The SF ticket for this is 1199.

I have not created any updated patches as the changes are huge as there are allot of changes. To make building easier I have created a branch in the following GitHub repo that also includes tickets  1202, 1205 and 1207 and  a number of  bash scripts and build docs  that will  help with building. The repo and branch is:
 https://github.com/acotty/codeblocks_sfmirror/tree/MSYS2_BASH_BUILD (https://github.com/acotty/codeblocks_sfmirror/tree/MSYS2_BASH_BUILD)


The build doc that you need to follow is : https://github.com/acotty/codeblocks_sfmirror/blob/MSYS2_BASH_BUILD/Readme_Build_Windows_MSYS2_by_Makefile.txt (https://github.com/acotty/codeblocks_sfmirror/blob/MSYS2_BASH_BUILD/Readme_Build_Windows_MSYS2_by_Makefile.txt)


There are a few issues which I need help with as I am a newbie autoconf/automake/libtool user. The issues that I need help with are:The 4 items above are issues in the githuib repo, so if you can help post here or in the relevant github issue. If you find another issue please post here or create a new github issue . If you disagree with anything I have done then supply another way to do it or you will have to live with it as I do not have the time to come up with a new way to do things.


If you already have MSYS2 installed you can test the build instructions by renaming  the C:\msys64 directory to to say C:\msys64_orig and then follow the build guide and once finished rename the new C:\msys64 to say C:\msys64_CB_MAKE and rename the  C:\msys64_orig back to C:\msys64 so next time you want to do some testing you just have to rename the directories.
Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: ollydbg on February 17, 2022, 01:31:57 pm
Good work!!!
Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: Miguel Gimenez on February 17, 2022, 01:58:02 pm
The problem with make -jn is (probably) because all targets depend on sdk target being already built.

This happened with wxWidgets, the setup_h target must be fully made before continuing:
Code
mingw32-make -f makefile.gcc     MONOLITHIC=1 SHARED=1 BUILD=release setup_h
mingw32-make -f makefile.gcc -j8 MONOLITHIC=1 SHARED=1 BUILD=release
Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: AndrewCot on February 17, 2022, 09:58:46 pm
Thanks. I did not think of this as I was looking for some change in the auto tools.
Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: AndrewCot on February 19, 2022, 03:32:37 am
I tracked down the "make -jxx"failure root case, which was caused by a missing ".exe" in following line in the src\build_tools\autorevision\Makefile.am file:

Code
all-local: auto_revision.exe

I am working my way through the differences between the MSYS2 build I finally end up and the last nightly release and fixing the missing or additional files or if I cannot resolve the issue(s) then you may see posts or tickets or queries.

Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: AndrewCot on February 21, 2022, 07:24:21 am
As of this afternoon I have hopefully included everything that is in the nightly build along with the addition of the docs in the share/coodeblocks/docs directory if the doc files exist (they do with my local windows installer source tree).

The only issue I have left is the DLL's all start with "lib" otherwise it's ready for Windows prime time testing.

Please do not test it yet on Linux as I have not checked it build on Linux since the end of last week.
Title: Re: Windows MSYS2 build via makefiles now working - please review and test
Post by: AndrewCot on February 21, 2022, 09:26:14 am
I am working on getting the linux build working again with the changes I have done since I last built C::B on Linux.

Rant:Next time someone wants to use autotools and libtools for cross platform I would suggest to say NO as it's a PITA and see if there is any easier way of doing it, like have a look at CMAKE or .... or .... etc The reason is you end up with a Makefile.am iwth allot if "if windows .... else .... endif" blocks that in the long run are probably a PITA, but at least they work.