GNOME Bugzilla – Bug 725894
build: Include gettext libraries for static compilation on Mac OS X
Last modified: 2017-04-03 10:01:48 UTC
If compiling GLib statically on Mac OS X, linking something against it fails due to unresolved symbols (such as CFArrayGetCount()) from the OS X Core Framework. These are used by external gettext. When using AM_GNU_GETTEXT, LIBS is normally modified to add the necessary framework linking flags; but this isn’t the case when using AM_GLIB_GNU_GETTEXT. This patch copies the necessary macro magic from gettext into AM_GLIB_GNU_GETTEXT, so that the framework link flags are present when statically compiling on Mac OS X. I am not 100% confident I’ve understood the problem exactly, since the intricacies of the differences between AM_GNU_GETTEXT and AM_GLIB_GNU_GETTEXT aren’t clear to me. Hopefully the patch is good though (it certainly fixes the problem for me).
Created attachment 271220 [details] [review] build: Include gettext libraries for static compilation on Mac OS X When compiling statically against the system-provided gettext on Mac OS X, GLib needs to be linked against CoreFramework, which provides some functions used by gettext. Fix this by including the necessary macro magic from upstream gettext.
See also: bug #668152.
Matthias, since you seem to be looking at OS X bugs at the moment, how about this one? Would be good to merge or drop the patch. I don’t have access to a system where I can test this any more, but we carried it for a while in a project which was on OS X, with no problems.
Considering that macOS 10.2 and 10.3 are ridiculously out of date, I'd probably just drop 95% of attachment 271220 [details] [review] and just add `-Wl,-framework -Wl,CoreFoundation` unconditionally to the linker flags on macOS.
(In reply to Emmanuele Bassi (:ebassi) from comment #4) > Considering that macOS 10.2 and 10.3 are ridiculously out of date, I'd > probably just drop 95% of attachment 271220 [details] [review] [review] and just add > `-Wl,-framework -Wl,CoreFoundation` unconditionally to the linker flags on > macOS. Given that this patch works (copied from AM_GNU_GETTEXT; and tested at the time of submission), I’d prefer to push this rather than reworking it and not being able to re-test. I don’t want to spend more time on this than necessary, given that AM_GLIB_GNU_GETTEXT is deprecated too.
(In reply to Philip Withnall from comment #5) > (In reply to Emmanuele Bassi (:ebassi) from comment #4) > > Considering that macOS 10.2 and 10.3 are ridiculously out of date, I'd > > probably just drop 95% of attachment 271220 [details] [review] [review] [review] and just add > > `-Wl,-framework -Wl,CoreFoundation` unconditionally to the linker flags on > > macOS. > > Given that this patch works (copied from AM_GNU_GETTEXT; and tested at the > time of submission) i.e. let’s not get pointlessly out of sync with AM_GNU_GETTEXT
I’m just going to push as per the reasoning in comment #5. Attachment 271220 [details] pushed as 3a926db - build: Include gettext libraries for static compilation on Mac OS X