2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2007-01-10 07:54:04 +01:00
|
|
|
#
|
|
|
|
# libglib2
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-06-06 01:53:25 +02:00
|
|
|
|
2019-05-28 21:48:11 +02:00
|
|
|
LIBGLIB2_VERSION_MAJOR = 2.60
|
|
|
|
LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).3
|
2012-09-25 20:34:08 +02:00
|
|
|
LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
|
2009-12-26 17:00:41 +01:00
|
|
|
LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
|
2018-04-09 22:21:59 +02:00
|
|
|
LIBGLIB2_LICENSE = LGPL-2.1+
|
2013-06-03 18:03:33 +02:00
|
|
|
LIBGLIB2_LICENSE_FILES = COPYING
|
2008-03-06 19:15:25 +01:00
|
|
|
LIBGLIB2_INSTALL_STAGING = YES
|
2012-02-28 21:52:03 +01:00
|
|
|
|
libglib2: force arm mode when building with thumb1
Fixes #8491
glib/valgrind.h contains inline asm not compatible with thumb1, so build it
in arm mode:
CC libglib_2_0_la-gstringchunk.lo
/tmp/ccSVEXME.s: Assembler messages:
/tmp/ccSVEXME.s:587: Error: shifts in CMP/MOV instructions are only supported
in unified syntax -- `mov r12,r12,ror#3'
/tmp/ccSVEXME.s:587: Error: shifts in CMP/MOV instructions are only supported
in unified syntax -- `mov r12,r12,ror#13'
/tmp/ccSVEXME.s:588: Error: shifts in CMP/MOV instructions are only supported
in unified syntax -- `mov r12,r12,ror#29'
/tmp/ccSVEXME.s:588: Error: shifts in CMP/MOV instructions are only supported
in unified syntax -- `mov r12,r12,ror#19'
/tmp/ccSVEXME.s:589: Error: lo register required -- `orr r10,r10,r10'
Makefile:2087: recipe for target 'libglib_2_0_la-gslice.lo' failed
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-30 08:19:59 +01:00
|
|
|
# glib/valgrind.h contains inline asm not compatible with thumb1
|
|
|
|
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
|
|
|
|
LIBGLIB2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
|
|
|
|
endif
|
|
|
|
|
2014-09-27 21:32:44 +02:00
|
|
|
HOST_LIBGLIB2_CONF_OPTS = \
|
2019-05-28 21:48:11 +02:00
|
|
|
-Ddtrace=false \
|
|
|
|
-Dfam=false \
|
|
|
|
-Dselinux=disabled \
|
|
|
|
-Dsystemtap=false \
|
|
|
|
-Dxattr=false \
|
|
|
|
-Dinternal_pcre=false \
|
|
|
|
-Dinstalled_tests=false \
|
|
|
|
-Dtests=false
|
2009-11-01 23:39:44 +01:00
|
|
|
|
2016-03-22 22:38:01 +01:00
|
|
|
LIBGLIB2_DEPENDENCIES = \
|
2017-07-03 22:51:50 +02:00
|
|
|
host-pkgconf host-libglib2 \
|
|
|
|
libffi pcre util-linux zlib $(TARGET_NLS_DEPENDENCIES)
|
2008-08-31 22:23:41 +02:00
|
|
|
|
2016-03-22 22:38:01 +01:00
|
|
|
HOST_LIBGLIB2_DEPENDENCIES = \
|
2016-10-10 23:39:08 +02:00
|
|
|
host-gettext \
|
|
|
|
host-libffi \
|
|
|
|
host-pcre \
|
|
|
|
host-pkgconf \
|
|
|
|
host-util-linux \
|
|
|
|
host-zlib
|
2016-03-22 22:38:01 +01:00
|
|
|
|
package/libglib2: explicitly specify gio module path
Since the switch to pkgconf 1.5.3 in commit
4e423669399ad8389edd81761ea5c9cc26bf312d, the glib-networking package
has been failing to build with:
glib-networking: installs files in /home/naourr/work/instance-0/output/host/i686-buildroot-linux-uclibc/sysroot//home/naourr/work/instance-0/output
This error is due to glib-networking having installed its GIO GnuTLS
module into an invalid location. This invalid location is
$(DESTDIR)$(GIO_MODULE_DIR). GIO_MODULE_DIR is found by using:
pkg-config --variable giomoduledir gio-2.0
Unfortunately, despite the pkgconf fix in commit
7125fc5c1a8a96ff8eee057789358702e1b55835 ("package/pkgconf: add patch
to restore pre-1.5.3 behavior for sysroot prefixing"), the value
returned by pkg-config for giomoduledir remains prefixed by the
sysroot.
This is due to the fact that giomoduledir is defined by default with
the value ${libdir}/gio/modules. When running pkg-config --variable
giomoduledir gio-2.0 with the new pkg-config version, what happens is
that libdir is resolved first, and libdir is one of the variable for
which we add the sysroot prefix. Then later, giomoduledir is
resolved. For this variable, we don't prefix with the
sysroot. However, when resolving the value of giomoduledir, it re-uses
the value of libdir that was already resolved, and this value includes
the sysroot prefix.
There is no simple way to solve this problem within pkg-config. So for
the time being, we take a simple route: make sure giomoduledir isn't
defined in terms of ${libdir}. This is easily done by passing
--with-gio-module-dir to libglib2 configure script.
Fixes:
http://autobuild.buildroot.net/results/4167159c4a03f5a72dbd7e286aedb3845164cc22/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-12-27 11:33:51 +01:00
|
|
|
# We explicitly specify a giomodule-dir to avoid having a value
|
|
|
|
# containing ${libdir} in gio-2.0.pc. Indeed, a value depending on
|
|
|
|
# ${libdir} would be prefixed by the sysroot by pkg-config, causing a
|
|
|
|
# bogus installation path once combined with $(DESTDIR).
|
2016-03-22 22:38:01 +01:00
|
|
|
LIBGLIB2_CONF_OPTS = \
|
2019-05-28 21:48:11 +02:00
|
|
|
-Dinternal_pcre=false \
|
|
|
|
-Dgio_module_dir=/usr/lib/gio/modules \
|
|
|
|
-Dtests=false
|
2009-11-01 23:39:44 +01:00
|
|
|
|
2008-08-31 22:23:41 +02:00
|
|
|
ifneq ($(BR2_ENABLE_LOCALE),y)
|
2012-02-27 13:38:55 +01:00
|
|
|
LIBGLIB2_DEPENDENCIES += libiconv
|
2008-08-31 22:23:41 +02:00
|
|
|
endif
|
2008-03-06 19:15:25 +01:00
|
|
|
|
2016-02-21 10:50:06 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
|
|
|
|
LIBGLIB2_DEPENDENCIES += elfutils
|
|
|
|
endif
|
|
|
|
|
2009-01-16 22:18:08 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBICONV),y)
|
2019-05-28 21:48:11 +02:00
|
|
|
LIBGLIB2_CONF_OPTS += -Diconv=gnu
|
2012-02-27 13:38:55 +01:00
|
|
|
LIBGLIB2_DEPENDENCIES += libiconv
|
2009-01-16 22:18:08 +01:00
|
|
|
endif
|
|
|
|
|
2019-03-19 16:31:49 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
|
2019-05-28 21:48:11 +02:00
|
|
|
LIBGLIB2_CONF_OPTS += -Dselinux=enabled
|
2019-03-19 16:31:49 +01:00
|
|
|
LIBGLIB2_DEPENDENCIES += libselinux
|
|
|
|
else
|
2019-05-28 21:48:11 +02:00
|
|
|
LIBGLIB2_CONF_OPTS += -Dselinux=disabled
|
2019-03-19 16:31:49 +01:00
|
|
|
endif
|
|
|
|
|
2016-03-10 15:52:36 +01:00
|
|
|
# Purge gdb-related files
|
|
|
|
ifneq ($(BR2_PACKAGE_GDB),y)
|
|
|
|
define LIBGLIB2_REMOVE_GDB_FILES
|
|
|
|
rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Purge useless binaries from target
|
2010-07-24 13:21:28 +02:00
|
|
|
define LIBGLIB2_REMOVE_DEV_FILES
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
|
2016-03-10 15:52:36 +01:00
|
|
|
rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext)
|
2016-05-08 16:37:09 +02:00
|
|
|
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,gdbus-codegen glib-compile-schemas glib-compile-resources glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
|
2016-03-10 15:52:36 +01:00
|
|
|
$(LIBGLIB2_REMOVE_GDB_FILES)
|
2010-07-24 13:21:28 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
|
|
|
|
|
2019-06-13 21:17:55 +02:00
|
|
|
# Newer versions of libglib2 prefix glib-genmarshal, gobject-query,
|
|
|
|
# glib-mkenums, glib_compile_schemas, glib_compile_resources and gdbus-codegen
|
|
|
|
# with ${bindir}. Unfortunately, this will resolve to the host systems /bin/
|
|
|
|
# directory, which will cause compilation issues if the host does not have these
|
|
|
|
# programs. By removing the ${bindir}/ prefix, these programs are resolved in
|
|
|
|
# PATH instead.
|
2019-05-28 21:48:11 +02:00
|
|
|
define LIBGLIB2_REMOVE_BINDIR_PREFIX_FROM_PC_FILE
|
2019-06-13 21:17:55 +02:00
|
|
|
$(SED) 's%$${bindir}/%%g' $(addprefix $(STAGING_DIR)/usr/lib/pkgconfig/, glib-2.0.pc gio-2.0.pc)
|
2019-05-28 21:48:11 +02:00
|
|
|
endef
|
|
|
|
LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_BINDIR_PREFIX_FROM_PC_FILE
|
|
|
|
|
2016-03-10 15:52:36 +01:00
|
|
|
# Remove schema sources/DTDs, we use staging ones to compile them.
|
|
|
|
# Do so at target finalization since other packages install additional
|
|
|
|
# ones and we want to deal with it in a single place.
|
|
|
|
define LIBGLIB2_REMOVE_TARGET_SCHEMAS
|
|
|
|
rm -f $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.xml \
|
|
|
|
$(TARGET_DIR)/usr/share/glib-2.0/schemas/*.dtd
|
2010-07-24 21:29:56 +02:00
|
|
|
endef
|
|
|
|
|
2016-03-10 15:52:36 +01:00
|
|
|
# Compile schemas at target finalization since other packages install
|
|
|
|
# them as well, and better do it in a central place.
|
|
|
|
# It's used at run time so it doesn't matter defering it.
|
|
|
|
define LIBGLIB2_COMPILE_SCHEMAS
|
2017-07-05 13:14:19 +02:00
|
|
|
$(HOST_DIR)/bin/glib-compile-schemas \
|
2016-03-10 15:52:36 +01:00
|
|
|
$(STAGING_DIR)/usr/share/glib-2.0/schemas \
|
|
|
|
--targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
|
|
|
|
endef
|
|
|
|
|
2016-06-22 21:07:37 +02:00
|
|
|
LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
|
|
|
|
LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
|
2010-07-24 21:29:56 +02:00
|
|
|
|
2019-05-28 21:48:11 +02:00
|
|
|
$(eval $(meson-package))
|
|
|
|
$(eval $(host-meson-package))
|
2009-01-26 19:17:57 +01:00
|
|
|
|
2017-07-05 13:14:19 +02:00
|
|
|
LIBGLIB2_HOST_BINARY = $(HOST_DIR)/bin/glib-genmarshal
|