Backport two patches from upstream glib to handle -Wformat-nonliteral
included by default with GCC 6. Ideally the snapshot should be updated,
but this fix the issue until that happens.
https://bugs.freedesktop.org/show_bug.cgi?id=95326
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
When glib is built static, the threads and clock code are not
initialized since DllMain is never run. Instead, initialize them from
the glib constructor.
https://bugzilla.gnome.org/show_bug.cgi?id=678387
pkg-config doesn't use message translation, so there's no need to build
it into the bundled glib. Furthermore, when not using glibc, this drags
in extra dependencies on gettext, libintl and iconv. Remove their usage
in two steps:
1. Don't include libintl.h directly from code. glibintl.h
conditionalizes the include of libintl.h based on the ENABLE_NLS define
and creates fallback macros when it's unwanted.
2. Remove the usage of the gettext macros in glib's configure.ac. This
ensures that the unwanted dependencies aren't searched for. Two defines
are kept around to keep the code happy.
Since we're going to use glib as a convenience library, we need to make
sure it builds as if --enable-static was passed. This only matters on
Windows where a couple extra macros are defined and the DLL machinery is
disabled.
We just want to be able to build glib from the within the pkg-config
tree. Everything else is just extra weight and is better used from an
actual glib checkout. Unnecessary files include:
* documentation
* translations
* tests
* ChangeLogs
* non-autotools win32 build files
* various other build and/or internal files
Grab a snapshot of a tag from a local glib checkout, remove a bunch of
files and apply some patches. The idea is to make the snapshot of glib
be repeatable.