# HG changeset patch # User Volker Grabsch # Date 1348246199 25200 # Node ID daff1938f6b1a307bf3599b31161c04e9e059b43 # Parent 1a91124dd3429247cacab3d2acaaea406d855a6c# Parent abf2a94d035ffeb0bd52f6a2f5b33d82ee5e5ff3 Merge pull request #81 from tonytheodore/glib-optional-native Review: Build glib native tools only if they're not installed diff -r 1a91124dd342 -r daff1938f6b1 Makefile --- a/Makefile Fri Sep 21 18:45:05 2012 +0200 +++ b/Makefile Fri Sep 21 09:49:59 2012 -0700 @@ -191,6 +191,7 @@ @echo '[done] $(1)' .PHONY: build-only-$(1) +build-only-$(1): PKG = $(1) build-only-$(1): $(if $(value $(1)_BUILD), rm -rf '$(2)' diff -r 1a91124dd342 -r daff1938f6b1 src/glib.mk --- a/src/glib.mk Fri Sep 21 18:45:05 2012 +0200 +++ b/src/glib.mk Fri Sep 21 09:49:59 2012 -0700 @@ -15,8 +15,7 @@ head -1 endef -define $(PKG)_BUILD - cd '$(1)' && ./autogen.sh +define $(PKG)_NATIVE_BUILD cp -Rp '$(1)' '$(1).native' # native build of libiconv (used by glib-genmarshal) @@ -51,7 +50,23 @@ $(MAKE) -C '$(1).native/gio' -j '$(JOBS)' glib-compile-resources $(INSTALL) -m755 '$(1).native/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/' $(INSTALL) -m755 '$(1).native/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/' +endef +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)' && ./autogen.sh + rm -f '$(PREFIX)/$(TARGET)/bin/glib-*' + $(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)) # cross build cd '$(1)' && ./configure \ --host='$(TARGET)' \