Author Topic: Build for Mac OS X - offer to help and request for help  (Read 2736 times)

Offline federix

  • Single posting newcomer
  • *
  • Posts: 4
Build for Mac OS X - offer to help and request for help
« on: February 05, 2016, 04:19:20 pm »
Hi all,

I'd be interested in building Code::Blocks for Mac OS X and sharing the results with the community here, but I have incurred in one issue (so far) while building

directorymonitor.cpp:27:10: fatal error: 'fam.h' file not found
#include <fam.h> //USES EITHER GAMIN OR FAM (IDENTICAL FILE MONITORING APIS)

Have I missed a requirement? Also, I was reading on the web that FAM is old and unmaintained. Are you using Gamin instead? Do you I have to install it on Mac OS X? Anybody know how? I did a quick search and it does not seem trivial...

Thanks

Fed

Offline federix

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build for Mac OS X - offer to help and request for help
« Reply #1 on: February 05, 2016, 06:04:04 pm »
Ok, so I managed to move forward in the compile process by leaving out a couple of plugins...

-FileManager,-NassiShneiderman

The FileManager one just needs an implementation of the DirectoryMonitor.cpp file that uses FS Events API from Mac OS X. Also, I think it may be a good idea to write an abstraction of that class to use iNotify instead of FAM/Gamin, so that then FS Events API and the Windows directory notification (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx) can be easily implemented on top of that abstraction.

For the NassiShneiderman plugin, I have no idea tbh  ;D

Unfortunately though I got this problem that I cannot move forward from


Code: [Select]
Making all in wxspellchecker
depbase=`echo ../HunspellInterface.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
if /bin/sh ../../../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../../../src/include  -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__   -I./include -I./.. -I../../../../../src/sdk/wxscintilla/include -ansi -DTIXML_USE_STL  -O2 -ffast-math -DCB_AUTOCONF -std=c++11 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -DHUNSPELL_STATIC -MT ../HunspellInterface.lo -MD -MP -MF "$depbase.Tpo" -c -o ../HunspellInterface.lo ../HunspellInterface.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../../../../src/include -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -I./include -I./.. -I../../../../../src/sdk/wxscintilla/include -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -std=c++11 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -DHUNSPELL_STATIC -MT ../HunspellInterface.lo -MD -MP -MF ../.deps/HunspellInterface.Tpo -c ../HunspellInterface.cpp  -fno-common -DPIC -o ../.libs/HunspellInterface.o
../HunspellInterface.cpp:19:10: fatal error: 'hunspell/hunspell.hxx' file not found
#include "hunspell/hunspell.hxx"
         ^

Can't see why it cannot find the include for hunspell.hxx, it's definitely there. Could it be a ./configure issue?

Thx

Offline federix

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build for Mac OS X - offer to help and request for help
« Reply #2 on: February 05, 2016, 06:16:25 pm »
For this file

CodeBlocks/src/plugins/contrib/SpellChecker/HunspellInterface.cpp

it seems like the following include path is missing

-I../hunspell/src

from the g++ command to make it work...

Weird!

F

Offline Easior Lars

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: Build for Mac OS X - offer to help and request for help
« Reply #3 on: February 05, 2016, 11:47:58 pm »
For NassiShneiderman and SpellChecker plugins, you could brew install pkg-config, boost and hunspell by homebrew. Anyway, there are more discussions on how to build CB on Mac OS at http://forums.codeblocks.org/index.php/topic,20882.0.html.
« Last Edit: February 05, 2016, 11:52:40 pm by Easior Lars »
Development Environments:GCC+CodeBlocks+wxWidgets
Developing Languages:Bash+Python+C/CPP+LaTeX
Developer Utils:Emacs+GIT+OpenSSH+GPG
OS:Mac OS X, Gentoo/Kali Linux/Fedora/CentOS, MS Windows
Blog:http://easior.i11r.com

Offline dkulp

  • Single posting newcomer
  • *
  • Posts: 7
Re: Build for Mac OS X - offer to help and request for help
« Reply #4 on: February 06, 2016, 01:58:50 am »

For my command line builds, I'm doing:

Code: [Select]
export CXXFLAGS="-stdlib=libc++ -std=c++11 -mmacosx-version-min=10.7"
  export OBJCXXFLAGS="-stdlib=libc++ -std=c++11"
  export CPPFLAGS="-mmacosx-version-min=10.7"

  export LDFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7 -Wl,-headerpad_max_install_names"
  export CXX=clang++
  export CXXCPP="clang++ -E"
  export CC=clang
  export CPP="clang -E"

./configure --prefix=/Users/dkulp/Applications/codeblocks --with-contrib-plugins=all,-FileManager,-NassiShneiderman,-spellchecker

The maxosx-version-min is needed to run on the older OSX's.   The headerpad is needed to be able to repackage some of the plugins in the .app.

Offline federix

  • Single posting newcomer
  • *
  • Posts: 4
Re: Build for Mac OS X - offer to help and request for help
« Reply #5 on: February 06, 2016, 12:18:11 pm »
For NassiShneiderman and SpellChecker plugins, you could brew install pkg-config, boost and hunspell by homebrew. Anyway, there are more discussions on how to build CB on Mac OS at http://forums.codeblocks.org/index.php/topic,20882.0.html.

Thanks for this - just to be clear then, the hunspell.h file in Code::Blocks source is not what we are looking for to build? Because there is a header file by that name in the source, but you're suggesting I should install the hunspell package from homebrew...

Offline Easior Lars

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: Build for Mac OS X - offer to help and request for help
« Reply #6 on: February 06, 2016, 01:22:41 pm »
Thanks for this - just to be clear then, the hunspell.h file in Code::Blocks source is not what we are looking for to build? Because there is a header file by that name in the source, but you're suggesting I should install the hunspell package from homebrew...
In fact, there is a complete copy of hunspell source in CB source tree. I think that it is used to build CB on MS Windows platform to resolve the dependence problem on hunspell. I don't like that way.
« Last Edit: February 06, 2016, 01:33:16 pm by Easior Lars »
Development Environments:GCC+CodeBlocks+wxWidgets
Developing Languages:Bash+Python+C/CPP+LaTeX
Developer Utils:Emacs+GIT+OpenSSH+GPG
OS:Mac OS X, Gentoo/Kali Linux/Fedora/CentOS, MS Windows
Blog:http://easior.i11r.com

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9414
Re: Build for Mac OS X - offer to help and request for help
« Reply #7 on: February 06, 2016, 03:17:14 pm »
I think that it is used to build CB on MS Windows platform to resolve the dependence problem on hunspell. I don't like that way.
Yes, that's for Windows only. We don't have a packaging system on windows, so that's the best you can do, unless you want to put binary 3rd party libs into the SVN source tree. Which is what we want to avoid.

So for Unix, please use the dev packages of your distro. Same applied for the Mac with homebrew...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline frankofrank

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build for Mac OS X - offer to help and request for help
« Reply #8 on: November 07, 2016, 08:23:19 pm »
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9414
Re: Build for Mac OS X - offer to help and request for help
« Reply #9 on: November 07, 2016, 09:39:53 pm »
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank
Wherever you want, but please choose a trustworthy platform. Then post the link here.

Gesendet von meinem Nexus 6P mit Tapatalk

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Xaviou

  • Almost regular
  • **
  • Posts: 240
    • X@v's Web
Re: Build for Mac OS X - offer to help and request for help
« Reply #10 on: November 08, 2016, 09:53:07 pm »
Hi
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank
I'm interested in testing your build : is it possible ?

And I'm also interested by your build process (in case you agree to share it).

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : http://x.psoud.free.fr/

Offline frankofrank

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build for Mac OS X - offer to help and request for help
« Reply #11 on: November 09, 2016, 08:38:21 pm »
Ok,

I want to help, so this is my first attempt at compiling:

https://goo.gl/dmpyBH


the build process was a little tricky :)

1) configure with options:
CXX=clang++  CXXFLAGS="-mmacosx-version-min=10.11   -std=gnu++11    -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0   -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__"  CC=clang   ./configure     --with-platform=macosx  --with-contrib-plugins=all,-FileManager,-NassiShneiderman,-spellchecker --enable-debug  --enable-source-formatter  --enable-class-wizard  --enable-code-completion  --enable-compiler  --enable-debugger  --enable-mime-handler --enable-open-files-list --enable-occurrences-highlighting     --with-wx-prefix=/usr/local/Cellar/wxmac/3.0.2_2

2) make  --> build codeblocks and libcodeblocks.dylib, but plugins was built in .so - there is a bug in libtool !

3) I have built plugins in .dylib using CodeBlocks_wx30_64.workspace in c::b 13.12 (with some changes)

4) I created CodeBlocks.app using mac_pack (with some changes)

regards
frankofrank





Offline frankofrank

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Build for Mac OS X - offer to help and request for help
« Reply #12 on: November 12, 2016, 10:12:57 am »
Hi!

This is my second attempt, with plugins=all,-FileManager,-NassiShneiderman

https://goo.gl/TWxmuP

steps are easy:

1) configure
CXX=clang++  CXXFLAGS="-mmacosx-version-min=10.11   -std=gnu++11    -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__"  CC=clang   CB_HUNSPELL_LIBS=-lhunspell-1.4    ./configure  --prefix=`pwd`/src/output  --with-platform=macosx  --with-contrib-plugins=all,-FileManager,-NassiShneiderman  --enable-source-formatter  --enable-class-wizard  --enable-code-completion  --enable-compiler  --enable-debugger  --enable-mime-handler  --enable-open-files-list  --enable-occurrences-highlighting    --with-wx-prefix=/usr/local/Cellar/wxmac/3.0.2_2

2) make

3) make install

4) copy all files from ./src/output to CodeBlocks.app


So, how can I put some changes to svn? Do I need permission to do that?

Regards,
frankofrank

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 9796
Re: Build for Mac OS X - offer to help and request for help
« Reply #13 on: November 12, 2016, 01:24:02 pm »
<debugger plugin maintainer>
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4890
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Build for Mac OS X - offer to help and request for help
« Reply #14 on: November 12, 2016, 03:14:25 pm »
Do I need permission to do that?
Hi, frankofrank, your contribution is great! I see a lot of Mac users around me, but they don't have a suitable C::B on their Mac system.
You can submit patches, and the C::B devs have rights to apply your patches to our SVN.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.