mxe/src/glib.mk

100 lines
4.3 KiB
Makefile
Raw Normal View History

2012-03-28 14:46:58 +01:00
# This file is part of MXE.
2012-03-29 11:14:15 +01:00
# See index.html for further information.
2009-02-28 03:05:01 +00:00
PKG := glib
$(PKG)_IGNORE :=
2014-08-09 19:07:35 +01:00
$(PKG)_VERSION := 2.41.2
$(PKG)_CHECKSUM := 07368426ac8da898e38bc15a97e125c8e66e8bd7
$(PKG)_SUBDIR := glib-$($(PKG)_VERSION)
$(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
2012-06-04 17:02:11 +01:00
$(PKG)_DEPS := gcc gettext pcre libiconv zlib libffi dbus
2009-02-28 03:05:01 +00:00
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://git.gnome.org/browse/glib/refs/tags' | \
2010-10-05 14:19:00 +01:00
$(SED) -n "s,.*tag/?id=\([0-9]\+\.[0-9]*[02468]\.[^']*\).*,\1,p" | \
2009-02-28 03:05:01 +00:00
head -1
endef
define $(PKG)_NATIVE_BUILD
2010-02-23 16:48:16 +00:00
cp -Rp '$(1)' '$(1).native'
# native build of libiconv (used by glib-genmarshal)
cd '$(1).native' && $(call UNPACK_PKG_ARCHIVE,libiconv)
$(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/libiconv-*.patch)),
(cd '$(1).native/$(libiconv_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
cd '$(1).native/$(libiconv_SUBDIR)' && ./configure \
--disable-shared \
2010-09-26 16:25:24 +01:00
--disable-nls
$(MAKE) -C '$(1).native/$(libiconv_SUBDIR)' -j '$(JOBS)'
2014-08-19 16:21:29 +01:00
# native build for glib-genmarshal, without gettext and zlib
2010-02-07 23:21:45 +00:00
cd '$(1).native' && ./configure \
2009-02-28 03:05:01 +00:00
--disable-shared \
--prefix='$(PREFIX)/$(TARGET)' \
--enable-regex \
2010-04-26 14:07:14 +01:00
--disable-threads \
2009-02-28 03:05:01 +00:00
--disable-selinux \
2012-06-04 17:02:11 +01:00
--disable-inotify \
2009-02-28 03:05:01 +00:00
--disable-fam \
--disable-xattr \
--disable-dtrace \
--with-libiconv=gnu \
--with-pcre=internal \
CPPFLAGS='-I$(1).native/$(libiconv_SUBDIR)/include' \
2010-09-26 16:25:24 +01:00
LDFLAGS='-L$(1).native/$(libiconv_SUBDIR)/lib/.libs'
$(SED) -i 's,#define G_ATOMIC.*,,' '$(1).native/config.h'
2010-04-26 14:07:14 +01:00
$(MAKE) -C '$(1).native/glib' -j '$(JOBS)'
$(MAKE) -C '$(1).native/gthread' -j '$(JOBS)'
2012-06-04 17:02:11 +01:00
$(MAKE) -C '$(1).native/gmodule' -j '$(JOBS)'
2010-04-26 14:07:14 +01:00
$(MAKE) -C '$(1).native/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec
2012-06-04 17:02:11 +01:00
$(MAKE) -C '$(1).native/gio/xdgmime' -j '$(JOBS)'
$(MAKE) -C '$(1).native/gio' -j '$(JOBS)' glib-compile-schemas
2012-06-04 17:02:11 +01:00
$(MAKE) -C '$(1).native/gio' -j '$(JOBS)' glib-compile-resources
$(INSTALL) -m755 '$(1).native/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/'
2012-06-04 17:02:11 +01:00
$(INSTALL) -m755 '$(1).native/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/'
endef
2009-03-05 15:55:13 +00:00
define $(PKG)_SYMLINK
ln -sf `which glib-genmarshal` '$(PREFIX)/$(TARGET)/bin/'
ln -sf `which glib-compile-schemas` '$(PREFIX)/$(TARGET)/bin/'
ln -sf `which glib-compile-resources` '$(PREFIX)/$(TARGET)/bin/'
endef
define $(PKG)_BUILD
cd '$(1)' && NOCONFIGURE=true ./autogen.sh
rm -f '$(PREFIX)/$(TARGET)/bin/glib-*'
# Detecting if these GLib tools are already available on host machine,
# either because of a host package installation or from an earlier MXE
# installation of GLib.
# If it is installed, we symlink it into the MXE bin/.
# If not, we build it.
$(if $(findstring y,\
$(shell [ -x "`which glib-genmarshal`" ] && \
[ -x "`which glib-compile-schemas`" ] && \
[ -x "`which glib-compile-resources`" ] && echo y)), \
$($(PKG)_SYMLINK), \
$($(PKG)_NATIVE_BUILD))
2009-02-28 03:05:01 +00:00
# cross build
cd '$(1)' && ./configure \
2013-12-15 13:52:58 +00:00
$(MXE_CONFIGURE_OPTS) \
2009-03-05 15:55:13 +00:00
--with-threads=win32 \
2009-02-28 03:05:01 +00:00
--with-pcre=system \
--with-libiconv=gnu \
2012-06-04 17:02:11 +01:00
--disable-inotify \
CXX='$(TARGET)-g++' \
PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \
GLIB_GENMARSHAL='$(PREFIX)/$(TARGET)/bin/glib-genmarshal' \
2012-06-04 17:02:11 +01:00
GLIB_COMPILE_SCHEMAS='$(PREFIX)/$(TARGET)/bin/glib-compile-schemas' \
GLIB_COMPILE_RESOURCES='$(PREFIX)/$(TARGET)/bin/glib-compile-resources'
$(MAKE) -C '$(1)/glib' -j '$(JOBS)' install sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(1)/gmodule' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(1)/gthread' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(1)/gobject' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
2010-04-27 23:24:06 +01:00
$(MAKE) -C '$(1)/gio' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= MISC_STUFF=
$(MAKE) -C '$(1)' -j '$(JOBS)' install-pkgconfigDATA
2013-02-10 04:02:21 +00:00
$(MAKE) -C '$(1)/m4macros' install
2009-02-28 03:05:01 +00:00
endef