I was confused by the fact that when compiling Code::Blocks against wxGTK (wx_gtk2u) on OS X hunspell was properly found, while it wasn't when compiling against Carbon or Cocoa-based wxWidgets.
I then realized that the following code in configure.in:
WX_BASENAME=`$WX_CONFIG_WITH_ARGS --basename` case $WX_BASENAME in *wx_gtk*) ...
completely misses the part for "wx_osx_cocoau" (the basename in case of Cocoa-based wxWidgets 3.0) and lacks options in case of Carbon-based wxWidgets 2.8 (I don't have that system at hand at the moment to report the exact basename, but it falls under "wx_mac)").
In particular I miss the test for pkg-config and the test for
PKG_CHECK_MODULES([HUNSPELL], [hunspell])
Hunspell fails and I see no reason why it shouldn't work when the library is available.
As far as wx_mac is concerned, personally I don't have /Developer/Tools/Rez or /Developer/Tools/SetFile available and I have no clue what those four lines do anyway.
Configuring Code::Blocks with wxWidgets 3.0 ends up with
checking for wxWidgets platform... other
I ended up using the following workaround:
--- configure.ac.orig +++ configure.ac @@ -223,6 +223,27 @@ case $WX_BASENAME in AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile) MACSETFILE="\$(SETFILE)" ;; + *wx_osx*) + AC_MSG_RESULT(wxOSX) + + if test "x$BUILD_SPELLCHECKER_TRUE" = "x" ; then + + AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes, no) + ifdef([PKG_CHECK_MODULES],[],[ + define([PKG_CHECK_MODULES], + [ echo "You don't have pkg.m4 properly installed" >&2 + exit 1 + ]) + ]) + PKG_PROG_PKG_CONFIG + + if test "x$HAVE_PKG_CONFIG" = "xyes"; then + PKG_CHECK_MODULES([HUNSPELL], [hunspell]) + fi + fi + CB_HUNSPELL_CFLAGS="$HUNSPELL_CFLAGS" + CB_HUNSPELL_LIBS="$HUNSPELL_LIBS" + ;; *) AC_MSG_RESULT(other) ;;
but the patch should be nicer (less repetition) and it should also work with wx_mac, not just wx_osx.
See also https://trac.macports.org/ticket/40390.
PS: configure.in should probably be called configure.ac
Applied in SVN. Thanks!