pkg-config/glib-patches/osx-static-framework.patch
Dan Nicholson 753f0ba1e9 glib: Fix OSX build with internal glib
In the last internal glib update, the glib configure script changed the
OSX framework flags from the form of "-framework Foo" to
"-Wl,framework,Foo". Unfortunately, libtool only understands the prior
form and doesn't include the appropriate -framework flags in the
libglib-2.0.la file. This ultimately causes pkg-config to fail to link
properly:

Undefined symbols for architecture x86_64:
  "_CFRelease", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetCString", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetCStringPtr", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetLength", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFURLCopyFileSystemPath", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFURLCreateFromFSRef", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_FSFindFolder", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_kCFAllocatorSystemDefault", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
ld: symbol(s) not found for architecture x86_64

Upstream has fixed this by including the new style -framework flags in
the glib-2.0.pc file. We can't use that here as we're bootstrapping
pkg-config itself. Rather than work around this with an OSX platform
check in pkg-config's configure, carry a downstream patch to revert
glib's configure to using the old format.

https://bugs.freedesktop.org/show_bug.cgi?id=92902
2016-03-01 11:28:35 -08:00

31 lines
1.2 KiB
Diff

glib's configure changed to using the single form -Wl,-framework,Foo
format, but that means that libtool won't include the flags in the .la
file and won't get used when linking pkg-config. That breaks use of the
static internal glib on OSX.
Upstream this was handled by adding those flags to glib's .pc file. We
can't use that while bootstrapping pkg-config, so just revert to the
previous format downstream.
https://bugs.freedesktop.org/show_bug.cgi?id=92902
https://bugzilla.gnome.org/show_bug.cgi?id=566994
diff --git a/glib/configure.ac b/glib/configure.ac
index ffa7869..4ace471 100644
--- a/glib/configure.ac
+++ b/glib/configure.ac
@@ -224,12 +224,12 @@ AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes])
AS_IF([test "x$glib_have_carbon" = "xyes"], [
AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
- LDFLAGS="$LDFLAGS -Wl,-framework,Carbon"
+ LDFLAGS="$LDFLAGS -framework Carbon"
])
if test "x$glib_have_cocoa" = "xyes"; then
AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available])
- LDFLAGS="$LDFLAGS -Wl,-framework,Foundation"
+ LDFLAGS="$LDFLAGS -framework Foundation"
fi
dnl declare --enable-* args and collect ac_help strings