summaryrefslogtreecommitdiffstats
path: root/src/glib.mk
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2012-09-18 07:37:36 (GMT)
committerTony Theodore <tonyt@logyst.com>2012-09-18 07:37:36 (GMT)
commitd660d05e3723179b9f680375f325471ff9848ede (patch)
treeb323fcb8e9a6e33c15d3c6df90c875b3a1c2dc80 /src/glib.mk
parent8de88aa4ddebb09a0364f4c5da95cc58265e3888 (diff)
downloadmxe-d660d05e3723179b9f680375f325471ff9848ede.zip
mxe-d660d05e3723179b9f680375f325471ff9848ede.tar.gz
mxe-d660d05e3723179b9f680375f325471ff9848ede.tar.bz2
package glib: build native tools only when not installed
Diffstat (limited to 'src/glib.mk')
-rw-r--r--src/glib.mk19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/glib.mk b/src/glib.mk
index 5269366..3e828f7 100644
--- a/src/glib.mk
+++ b/src/glib.mk
@@ -15,8 +15,7 @@ define $(PKG)_UPDATE
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 @@ define $(PKG)_BUILD
$(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)' \