Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: blauzahn on February 10, 2018, 02:58:12 pm

Title: Building C::B against wx 3.1.1 trunk under linux from within cb
Post by: blauzahn on February 10, 2018, 02:58:12 pm
I regularly compile current trunks of wxWidgets and cb via make. 

Now I want to compile cb from within cb in order to debug cb itself on antergos (x86_64) with wx-3.1.1 because of:


http://forums.codeblocks.org/index.php/topic,22390.0.html
 (http://forums.codeblocks.org/index.php/topic,22390.0.html)

The workspace and project files for wx31 seem to be incomplete compared with wx30 though. So I created the missing files and changed the files
still referring to wx31 to point to wx31 instead. To automate this, I put the commands as a phony target into a Makefile that resides in the
directory above the cb sources which are in $(SRCDIR).

If appropriate, they maybe can help an admin to update wx31 support within trunk.

target of my Makefile to fix wx31 unix projects:

Code
fix_wx31_unix_projects:
@echo create missing CodeBlocks_wx31-unix.workspace...
@(cd $(SRCDIR)/src && \
  cat CodeBlocks_wx30-unix.workspace |\
    sed -e 's/\(.*Workspace title.*\)wx3\.0\.x\(.*\)/\1wx3.1.x\2/g' \
        -e 's/\(.*filename.*_\)wx30\(-unix.*\)/\1wx31\2/g' \
  > CodeBlocks_wx31-unix.workspace \
        )

@echo create missing ContribPlugins_wx31-unix.workspace...
@(cd $(SRCDIR)/src && \
  cat ContribPlugins_wx30-unix.workspace |\
    sed -e 's/\(.*Workspace title.*\)wx3\.0\.x\(.*\)/\1wx3.1.x\2/g' \
        -e 's/\(.*filename.*_\)wx30\(-unix.*\)/\1wx31\2/g' \
  > ContribPlugins_wx31-unix.workspace \
)

@echo create missing CodeBlocks_wx31-unix.cbp...
@(cd $(SRCDIR)/src && \
  cat CodeBlocks_wx30-unix.cbp |\
  sed -e 's/\(.*filename.*\)wx30\(.*\)/\1wx31\2/g' \
      -e 's/\(.*\)wx3\.0\.x\(.*\)/\1wx3.1.x\2/g' \
      -e 's/\(.*WX_VERSION.*value.*\)"30"\(.*\)/\1"31"\2/g' \
      -e 's/\(.*WX_CONFIG.*value.*\)=3\.0\(.*\)/\1=3.1\2/g' \
      -e 's/\(.*Option object_output.*\)objs30\(.*\)/\1objs31\2/g' \
      -e 's/\(.*\)devel30\(.*\)/\1devel31\2/g' \
  > CodeBlocks_wx31-unix.cbp \
)

@echo 'replacing in projects *_wx31_unix.cbp user variable 3.0 by 3.1 ...'
@(cd $(SRCDIR)/src && \
for project in `find . -name '*_wx31-unix.cbp'`; do \
  cat $$project |\
  sed -e 's/\(.*WX_CONFIG.*value.*\)=3\.0\(.*\)/\1=3.1\2/g' >ttt && mv ttt $$project;\
done \
)

Apart from what is described there:


http://wiki.codeblocks.org/index.php/Installing_Code::Blocks#Working_on_Code::Blocks_sources_from_within_Code::Blocks.21
 (http://wiki.codeblocks.org/index.php/Installing_Code::Blocks#Working_on_Code::Blocks_sources_from_within_Code::Blocks.21)

some pre-build steps seem necessary. I again put them as phony targets into the said Makefile above cb sources:

Code
prepare_for_compiling_cb_in_cb:
(cd $(SRCDIR) && ./bootstrap)
(cd $(SRCDIR) && ./configure --prefix=/usr/local --with-contrib-plugins=all,-NassiShneiderman)
(cd $(SRCDIR)/src/base && $(MAKE))   ## for tinyxml
(cd $(SRCDIR)/src/build_tools && $(MAKE))  ## for autorevision:

Now I can compile and link cb from within cb.

Then I updated the ressources via the existing shell-script  update31,
and set the global-variable cb release_type base to -g

When I start debugging cb (target src) with the default args:
Code
--debug-log --multiple-instance -ns -ni -v -p debug

I still get a SIGABRT. gdb backtrace is:

Code
> bt
#0  0x00007ffff4349428 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff434b02a in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff5cd5ab0 in wxAbort() () from /usr/local/lib/libwx_baseu-3.1.so.1
#3  0x00007ffff5d8eb03 in wxLog::OnLog(unsigned long, wxString const&, wxLogRecordInfo const&) () from /usr/local/lib/libwx_baseu-3.1.so.1
#4  0x00007ffff5cfe1d6 in ?? () from /usr/local/lib/libwx_baseu-3.1.so.1
#5  0x00007ffff5cfa126 in wxAppConsoleBase::CheckBuildOptions(char const*, char const*) () from /usr/local/lib/libwx_baseu-3.1.so.1
#6  0x000000000048aa04 in wxCreateApp () at /home/foo/Downloads/software/codeblocks/trunk/src/src/app.cpp:322
#7  0x00007ffff5d7d1e9 in wxEntryStart(int&, wchar_t**) () from /usr/local/lib/libwx_baseu-3.1.so.1
#8  0x00007ffff5d7d2c3 in wxInitialize(int&, wchar_t**) () from /usr/local/lib/libwx_baseu-3.1.so.1
#9  0x00007ffff5d7d2db in wxEntry(int&, wchar_t**) () from /usr/local/lib/libwx_baseu-3.1.so.1
#10 0x000000000048a9dd in main (argc=8, argv=0x7fffffffe2e8) at /home/foo/Downloads/software/codeblocks/trunk/src/src/app.cpp:322

I see this SIGABRT also on ubuntu. As far as I can see, I do not have stale files from previous installations.

Did I miss something? Any help appreciated.

Thank you.

Title: Re: Building C::B against wx 3.1.1 trunk under linux from within cb
Post by: oBFusCATed on February 10, 2018, 04:51:20 pm
The workspace and project files for wx31 seem to be incomplete compared with wx30 though.
There are no project/workspace files for wx31 on linux. Only on windows.
There is no need to use the wx31 files. I just adjust the WX_CONFIG variable in the build options to point to the correct wx and I'm good to go.

Also I regularly build against wx-master and I've not seen any problems.