# HG changeset patch # User Tony Theodore # Date 1347953856 -36000 # Node ID abf2a94d035ffeb0bd52f6a2f5b33d82ee5e5ff3 # Parent 9276054dea28f2d6a663514f18d72957b9b2ec31 package glib: build native tools only when not installed diff -r 9276054dea28 -r abf2a94d035f src/glib.mk --- a/src/glib.mk Tue Sep 18 17:35:15 2012 +1000 +++ b/src/glib.mk Tue Sep 18 17:37:36 2012 +1000 @@ -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)' \