Author Topic: Need help building for Mac OS X  (Read 4955 times)

Offline Dano

  • Single posting newcomer
  • *
  • Posts: 3
Re: Need help building for Mac OS X
« Reply #15 on: February 28, 2018, 08:07:39 pm »
I was able to build using the 17.12 tag with some changes.

wxwidgets 3.1.1 built from source in monolithic debug with osx min ver set to 10.9?,  and make installed with only this change applied:
https://trac.wxwidgets.org/ticket/18025
however I also added some of the enter handling code to this hack to be sure it would handle the enter event (their webview demo wasn't working properly for me without this change)

then clone the tag and make changes:

src/sdk/scripting/squirrel/sqvm.cpp - move the #include "sqpcheader.h" line below the <> built in includes to avoid a macro conflict

src/sdk/configmanager.cpp - the path for the plugins is wrong, changed line 1563 to this (hardcoded for now)
ConfigManager::plugin_path_global = _T("/usr/local/lib/codeblocks/plugins"); //data_path_global + _T("/plugins");

src/plugins/contrib/FileManager/directorymonitor.cpp - don't have fam.h so I commented everything related to fam out. after compiling I renamed this dylib so it doesn't load. It will still load/not crash with the fam stuff commented out, but I didn't want to load the gutted plugin.

then ./bootstrap
./configure --enable-debug --with-contrib-plugins=all

then in
src/plugins/contrib/NassiShneiderman/Makefile
change libs to add boost_system:
LIBS = -lpthread -ldl -lboost_system
(no matter what boost flags I passed to the configure I couldn't get this to happen automagically)

>make
(wait, no errors)
>make install
>codeblocks

if I use the file->quit menu it also exits properly I think. Osx has its own program menu which also allows quitting, but that seems to cause problems.
I was able to build a hello world cpp and almost run (not debug) it, although for some reason the command being sent to the terminal was quoted in its entirety. I was able to run the command it is using without the extra tick marks.
GDB might work with the system integrity protection disabled, but by default I couldn't debug. This is a known mac gdb thing. I just got this compiling yesterday, and also my first time using codeblocks, so my knowledge is limited. I installed boost using homebrew and I'm sure I've already got a number of other libraries installed on this machine, so I can't say what other libraries might be needed.

So what can I do to help out with the mac version?  :)
I was looking for a fast cross platform ide to play around with... which is how I got here. ps, I'm NOT a mac expert. yet.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10891
    • Travis build status
Re: Need help building for Mac OS X
« Reply #16 on: February 28, 2018, 08:21:45 pm »
Find a way to fix this bug: http://trac.wxwidgets.org/ticket/17972 everything else isn't too tough to solve. But this one... :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Dano

  • Single posting newcomer
  • *
  • Posts: 3
Re: Need help building for Mac OS X
« Reply #17 on: March 01, 2018, 12:47:07 am »
I see. I played around (without debugger) in various ways but was unable to get anything toolbar controls showing so far. I thought it was strange that the documentation for the cocoa toolbar control says you must supply the types for the controls that can live inside of it in some delegate but wx didn't seem to be giving a full list and it was still showing up the tool icons, just not the "controls" that are added. It does seem to give space for the control, it just isn't there.. I'll probably learn a lot tracing through this, even if I'm not clever enough to figure it out. I need the tool functionality anyway if I'm going to make wx apps.

Probably finding a tutorial on how cocoa is supposed to do this natively is in order (for me :) ...). Thanks for the bug link

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10891
    • Travis build status
Re: Need help building for Mac OS X
« Reply #18 on: March 01, 2018, 01:26:36 am »
No idea. I have no knowledge of cocoa and I hope I don't have to acquire such any time soon. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Dano

  • Single posting newcomer
  • *
  • Posts: 3
Re: Need help building for Mac OS X
« Reply #19 on: March 01, 2018, 05:14:10 am »
Update:
file src/osx/cocoa/toolbar.mm
line numbers->~244

#if wxOSX_USE_NATIVE_TOOLBAR
    void SetToolbarItemRef( NSToolbarItem* ref )
    {
        //if ( m_controlHandle )
        //    [m_controlHandle setHidden:YES];
        if ( m_toolbarItem )
            [m_toolbarItem release];

        m_toolbarItem = ref;
    }
so in wxwidgets 3.1.1 release source I commented out these two lines so it looks as shown, and the combo box appeared in the toolbar as desired for the  http://trac.wxwidgets.org/ticket/17972 test. Maybe that will help. I made some other debugging changes too, but that was the change where it suddenly showed up. Hopefully the other changes I made are irrelevant. I don't know enough to tell if this is a good or safe fix.

Edit: tested on a clean repo and that was indeed the only change necessary to get the choice control in the toolbar :)
« Last Edit: March 01, 2018, 04:58:00 pm by Dano »

Offline Xaviou

  • Regular
  • ***
  • Posts: 275
    • X@v's wxStuff
Re: Need help building for Mac OS X
« Reply #20 on: April 04, 2018, 10:05:37 pm »

Hi.
Edit: I've replaced the dmg file (https://goo.gl/V84eWT) with one created using a bash script.
Could you probably do another one with the sources of the 17.12 release?
(https://mortenmacfly@svn.code.sf.net/p/codeblocks/code/tags/17.12)
I am sorry, but I didn't see this post before (it seems I don't receive all notifications emails).

I have just finalized the dmg file : it can be downloaded from this link

The build have been done with wx-3.0.4 and CB src have been patched with the following (if not applied, the build can't be finalized) :
src/sdk/scripting/squirrel/sqvm.cpp - move the #include "sqpcheader.h" line below the <> built in includes to avoid a macro conflict

I have tested to patch the wxWidgets sources like said in Dano's last post, but it didn't worked (the wxChoice didn't appeared) so I didn't used it for the build.

Again, I'm sorry I didn't respond before.

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10891
    • Travis build status
Re: Need help building for Mac OS X
« Reply #21 on: April 05, 2018, 12:36:29 am »
Update:
file src/osx/cocoa/toolbar.mm
line numbers->~244

#if wxOSX_USE_NATIVE_TOOLBAR
    void SetToolbarItemRef( NSToolbarItem* ref )
    {
        //if ( m_controlHandle )
        //    [m_controlHandle setHidden:YES];
        if ( m_toolbarItem )
            [m_toolbarItem release];

        m_toolbarItem = ref;
    }
so in wxwidgets 3.1.1 release source I commented out these two lines so it looks as shown, and the combo box appeared in the toolbar as desired for the  http://trac.wxwidgets.org/ticket/17972 test. Maybe that will help. I made some other debugging changes too, but that was the change where it suddenly showed up. Hopefully the other changes I made are irrelevant. I don't know enough to tell if this is a good or safe fix.

Edit: tested on a clean repo and that was indeed the only change necessary to get the choice control in the toolbar :)

Have you tried to this fix with Code::Blocks or only with the sample?
Why don't you post your findings on the ticket, so the wx devs could see them and try to do something about it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Xaviou

  • Regular
  • ***
  • Posts: 275
    • X@v's wxStuff
Re: Need help building for Mac OS X
« Reply #22 on: April 05, 2018, 09:00:56 pm »
Hi.

file src/osx/cocoa/toolbar.mm
line numbers->~244

#if wxOSX_USE_NATIVE_TOOLBAR
    void SetToolbarItemRef( NSToolbarItem* ref )
    {
        //if ( m_controlHandle )
        //    [m_controlHandle setHidden:YES];
        if ( m_toolbarItem )
            [m_toolbarItem release];

        m_toolbarItem = ref;
    }
I confirm it works with wxWidgets-3.1.1 but not with wxWidgets-3.0.4.
I made a recent build of Code::Blocks with this modification on wx-3.1.1 : if one want to test, the dmg can be downloaded from this link (rev11362)

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10891
    • Travis build status
Re: Need help building for Mac OS X
« Reply #23 on: April 05, 2018, 09:07:34 pm »
Thanks for testing. I'll post these in the ticket and lets see what wx devs think about it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]