GNOME Bugzilla – Bug 723862
Add support for universal builds with fat libraries
Last modified: 2018-01-24 18:40:09 UTC
Universal builds in OS X with fat libraries uses a common typelibdir for all the architectures. GIRepository could add an architecture subdir to the default search path: typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL); typelib_arch_dir = g_build_filename (libdir, "girepository-1.0", arch_str, NULL); search_path = g_slist_prepend (search_path, typelib_dir); search_path = g_slist_prepend (search_path, typelib_arch_dir); Another option would be to include the architecture in the typelib filename, eg: GObject-2.0.i386.typelib GObject-2.0.x86_64.typelib Any thoughts?
Created attachment 273881 [details] [review] config: add support to set typelib and gir installations dirs
I have a simpler approach using configure options to set the typelib and gir directories --with-typelib-dir and --with-gir-dir. In universal builds both architectures can be built separately and merged into a fat library. The prosed solution consists in building each architecture using a different directory for typelib's and gir's with the architecture in the path. x86_64: --with-typelib-dir=$PREFIX/lib/x86_64 x86: --with-typelib-dir=$PREFIX/lib/x86 Since this path uses the configure define GOBJECT_INTROSPECTION_LIBDIR to build the default search path, when the x86_64 is loaded it will look for typelibs in $PREFIX/lib/x86_64/girepository-1.0
Created attachment 277564 [details] [review] add support to set custom gir and typelib dirs a simpler approach that uses typelib-suffix and gir-suffix to preserve datadir
Created attachment 277573 [details] [review] add support to set custom gir and typelib dirs Add INTROSPECTION_GIRSUFFIX and INTROSPECTION_TYPELIBSUFFIX in _GOBJECT_INTROSPECTION_CHECK_INTERNAL macro so it can be used to set: typelibsdir = $(datadir)/$(INTROSPECTION_TYPELIBSUFFIX)
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Considering that 32 bits architectures are going away, and that Apple is phasing out fat binaries, I think it's safe to say this is not going to happen.