GNOME Bugzilla – Bug 774180
Don't use --no-undefined on Darwin
Last modified: 2016-11-27 20:50:21 UTC
The macOS linker doesn't like --no-undefined. I see there's already a rule in configure.ac to leave out the flag for the BSD linker, so here's a patch adding Darwin to the same check.
Created attachment 339435 [details] [review] build: Don't set --no-undefined on Darwin Darwin's linker, just like the BSD linkers, doesn't like this option.
Thanks for a bug report and patch. The current development version uses CMake. Do you know what CMAKE_C_COMPILER_ID, eventually CMAKE_C_COMPILER is reported there, thus your change can cover future versions of the evolution-data-server (and the other three evolution core products), please?
(In reply to Milan Crha from comment #2) > Do you know what CMAKE_C_COMPILER_ID, eventually CMAKE_C_COMPILER is > reported there, thus your change can cover future versions of the > evolution-data-server (and the other three evolution core products), please? Ouch, no, the development version has this done differently. It enables it only for "GNU" and "Clang" compiler IDs.
Created commit 5b42ffd in eds gnome-3-22 (3.22.3+) Created commit_0fd310f in evo gnome-3-22 (3.22.3+) [1] [1] https://git.gnome.org/browse/evolution/commit/?id=0fd310f
(In reply to Milan Crha from comment #3) > (In reply to Milan Crha from comment #2) > > Do you know what CMAKE_C_COMPILER_ID, eventually CMAKE_C_COMPILER is > > reported there, thus your change can cover future versions of the > > evolution-data-server (and the other three evolution core products), please? > > Ouch, no, the development version has this done differently. It enables it > only for "GNU" and "Clang" compiler IDs. Huh, I think it should be looking at the linker rather than the compiler to determine whether to use the flag. I'm using Clang for this, but neither GCC nor Clang combined with the Darwin linker will take the flag. Thanks for committing!
Unfortunately there is no such variable available, or at least listed for the version 3.0 of CMake, which is the minimum version the evolution & others require: https://cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html
I would suggest doing what AX_CHECK_LINK_FLAG does in autotools, perhaps this is a good starter? https://cmake.org/pipermail/cmake/2011-July/045525.html