summaryrefslogtreecommitdiff
path: root/mk/package.mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-02-24 17:41:36 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2011-02-24 17:41:36 +0100
commit0aabef127155575e8c8d660605f9401ab15356aa (patch)
treeb8cd5f06c60cd4e95fd7a2923dabb3b831dd93b3 /mk/package.mk
parent0b09c2710166bd95ac9033b048bb6cbf7b4de7c2 (diff)
allow native build of a lot of packages
STAGING_TARGET_DIR is used for package Makefile's for include and library search path's. STAGING_DIR is used for common code in mk/ or Makefile/rules.mk. STAGING_TARGET_DIR is /usr when native builds are used.
Diffstat (limited to 'mk/package.mk')
-rw-r--r--mk/package.mk17
1 files changed, 8 insertions, 9 deletions
diff --git a/mk/package.mk b/mk/package.mk
index 9b2b77559..df05e98ae 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -18,12 +18,11 @@ CONFIGURE_ENV+= GCC_HONOUR_COPTS=s \
CPPFLAGS='$(strip ${TARGET_CPPFLAGS})' \
LDFLAGS='$(strip ${TARGET_LDFLAGS})' \
${HOST_CONFIGURE_OPTS} \
- PKG_CONFIG_LIBDIR='${STAGING_TARGET_DIR}/usr/lib/pkgconfig'
-ifeq ($(ADK_NATIVE),)
-CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
- cross_compiling=yes \
+ PKG_CONFIG_LIBDIR='${STAGING_TARGET_DIR}/usr/lib/pkgconfig' \
ac_cv_func_realloc_0_nonnull=yes \
ac_cv_func_malloc_0_nonnull=yes
+ifeq ($(ADK_NATIVE),)
+CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} cross_compiling=yes
endif
CONFIGURE_PROG?= configure
@@ -172,10 +171,10 @@ ifeq (${ADK_INSTALL_PACKAGE_INIT_SCRIPTS},y)
done
endif
@mkdir -p $${PACKAGE_DIR} '$${STAGING_PKG_DIR}' \
- '$${STAGING_TARGET_DIR}/scripts'
+ '$${STAGING_DIR}/scripts'
ifeq (,$(filter noremove,$(7)))
@if test -s '$${STAGING_PKG_DIR}/$(1)'; then \
- cd '$${STAGING_TARGET_DIR}'; \
+ cd '$${STAGING_DIR}'; \
while read fn; do \
rm -f "$$$$fn"; \
done <'$${STAGING_PKG_DIR}/$(1)'; \
@@ -195,8 +194,8 @@ endif
find usr ! -type d 2>/dev/null | \
grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' | \
tee '$${STAGING_PKG_DIR}/$(1)' | \
- $(TOOLS_DIR)/cpio -padlmu '$${STAGING_TARGET_DIR}'
- @cd '$${STAGING_TARGET_DIR}'; grep 'usr/lib/.*\.la$$$$' \
+ $(TOOLS_DIR)/cpio -padlmu '$${STAGING_DIR}'
+ @cd '$${STAGING_DIR}'; grep 'usr/lib/.*\.la$$$$' \
'$${STAGING_PKG_DIR}/$(1)' | while read fn; do \
chmod u+w $$$$fn; \
$(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_TARGET_DIR)/usr/lib,g" $$$$fn; \
@@ -223,7 +222,7 @@ clean-targets: clean-dev-$(1)
clean-dev-$(1):
ifeq (,$(filter noremove,$(7)))
@if test -s '$${STAGING_PKG_DIR}/$(1)'; then \
- cd '$${STAGING_TARGET_DIR}'; \
+ cd '$${STAGING_DIR}'; \
while read fn; do \
rm -f "$$$$fn"; \
done <'$${STAGING_PKG_DIR}/$(1)'; \