After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725894 - build: Include gettext libraries for static compilation on Mac OS X
build: Include gettext libraries for static compilation on Mac OS X
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-03-07 13:16 UTC by Philip Withnall
Modified: 2017-04-03 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Include gettext libraries for static compilation on Mac OS X (3.29 KB, patch)
2014-03-07 13:16 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-03-07 13:16:15 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).
Comment 1 Philip Withnall 2014-03-07 13:16:19 UTC
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.
Comment 2 Philip Withnall 2014-03-20 12:46:56 UTC
See also: bug #668152.
Comment 3 Philip Withnall 2017-03-09 14:13:51 UTC
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.
Comment 4 Emmanuele Bassi (:ebassi) 2017-03-09 14:19:23 UTC
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.
Comment 5 Philip Withnall 2017-03-30 09:29:34 UTC
(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.
Comment 6 Philip Withnall 2017-03-30 09:31:52 UTC
(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
Comment 7 Philip Withnall 2017-04-03 10:01:41 UTC
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