changeset 2743:abf2a94d035f

package glib: build native tools only when not installed
author Tony Theodore <tonyt@logyst.com>
date Tue, 18 Sep 2012 17:37:36 +1000
parents 9276054dea28
children daff1938f6b1
files src/glib.mk
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)' \