I'm unhappy with some of the most recent patches for mac:
The first one https://cgit.jenslody.de/codeblocks/commit/?id=632970a8d8c4c0b798960c7152bb6c0a57714c1d (https://cgit.jenslody.de/codeblocks/commit/?id=632970a8d8c4c0b798960c7152bb6c0a57714c1d) doubles code for wx_osx, but only for hunspell, what about the other conditionals ?
Does it work, if we use the same conditionals for wx_gtk, wx_osx, wx_mac, etc ?
diff --git a/configure.ac b/configure.ac
index f0ebdd4..dbaf6e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,6 +237,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)
;;
This one removes flags that are not supported by clang (on mac?, which version). If I remember correctly, they are no problem on linux with clang.
A proper solution would be to remove them only for compilers, that do not support them.
https://cgit.jenslody.de/codeblocks/commit/?id=9613c554588da2d4851d6de9c16a0b5bce8b579c (https://cgit.jenslody.de/codeblocks/commit/?id=9613c554588da2d4851d6de9c16a0b5bce8b579c)
diff --git a/acinclude.m4 b/acinclude.m4
index 1a6d145..ed0820b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -69,12 +69,10 @@ AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [turn on debugging (defau
if test "x$enable_debug" = "xyes"; then
CFLAGS="-g -DDEBUG -DCB_AUTOCONF $CFLAGS"
CXXFLAGS="-g -DDEBUG -DCB_AUTOCONF $CXXFLAGS"
- LDFLAGS="-Wl,--no-undefined"
AC_MSG_RESULT(yes)
else
CFLAGS="-O2 -ffast-math -DCB_AUTOCONF $CFLAGS"
CXXFLAGS="-O2 -ffast-math -DCB_AUTOCONF $CXXFLAGS"
- LDFLAGS="-Wl,--no-undefined"
AC_MSG_RESULT(no)
fi
])
I do not have a recent mac to test, I only have SnowLeopard on a VM, so that's the only stuff I can test.
But Apple changed/restricted so much in the last years (as far as I know), that it might work here, but not with newer releases.
New patch, that includes the check-link macro, as it is not installed on all platforms, requires at least autoconf 2.64:
commit ed4eaf496c3c1297119d3888ecc3152d32bcb458
Author: None <github@jenslody.de>
Date: Mon May 4 00:12:48 2015 +0200
- check whether the linker accepts "--no-undefined", should fix https://sourceforge.net/p/codeblocks/tickets/9 correctly
Index: acinclude.m4
===================================================================
--- acinclude.m4
+++ acinclude.m4
@@ -59,6 +59,23 @@
AM_CONDITIONAL(CODEBLOCKS_DARWIN, test x$darwin = xtrue )
])
+dnl copied and renamed from autoconf-archive AX_CHECK_LINK_FLAG
+AC_DEFUN([CODEBLOCKS_CHECK_LINK_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
+AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
+ ax_check_save_flags=$LDFLAGS
+ LDFLAGS="$LDFLAGS $4 $1"
+ AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ LDFLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl CODEBLOCKS_CHECK_LINK_FLAG
+
dnl check whether to enable debugging
AC_DEFUN([CODEBLOCKS_CHECK_DEBUG],
[
Index: configure.ac
===================================================================
--- configure.ac
+++ configure.ac
@@ -21,8 +21,6 @@
AM_CONDITIONAL([LINUX], [test `uname` = "Linux"])
AM_CONDITIONAL([DARWIN], [test `uname` = "Darwin"])
-CODEBLOCKS_CHECK_DEBUG
-
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CPP
@@ -33,6 +31,10 @@
AC_PROG_MAKE_SET
AC_PROG_AWK
+CODEBLOCKS_CHECK_LINK_FLAG([-Wl,--no-undefined],[LDFLAGS="-Wl,--no-undefined $LDFLAGS"])
+
+CODEBLOCKS_CHECK_DEBUG
+
CODEBLOCKS_SETUP_FOR_TARGET
AC_DISABLE_STATIC