From 1c6a09fe7ef7628785d05e4f858bdd620a37bc3c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 2 Feb 2007 02:57:49 +0000 Subject: [PATCH] sync whiterussian sdk with kamikaze SVN-Revision: 6250 --- openwrt/package/sdk/files/include/host.mk | 14 ++-- openwrt/package/sdk/files/include/image.mk | 38 ++++++--- .../package/sdk/files/include/netfilter.mk | 10 ++- openwrt/package/sdk/files/include/package.mk | 83 ++++++++++--------- openwrt/package/sdk/files/include/prereq.mk | 13 +-- openwrt/package/sdk/files/include/shell.sh | 15 ++++ .../sdk/files/include/site/arm-linux-uclibc | 31 +++++++ openwrt/package/sdk/files/include/unpack.mk | 11 ++- openwrt/package/sdk/files/include/verbose.mk | 2 +- openwrt/package/sdk/files/rules.mk | 22 ++++- 10 files changed, 167 insertions(+), 72 deletions(-) create mode 100644 openwrt/package/sdk/files/include/site/arm-linux-uclibc diff --git a/openwrt/package/sdk/files/include/host.mk b/openwrt/package/sdk/files/include/host.mk index 3100ce4165..4a434711c3 100644 --- a/openwrt/package/sdk/files/include/host.mk +++ b/openwrt/package/sdk/files/include/host.mk @@ -5,11 +5,12 @@ # See /LICENSE for more information. # -include $(TOPDIR)/.host.mk +include $(TMP_DIR)/.host.mk export TAR -$(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk +$(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk + @mkdir -p $(TMP_DIR) @( \ HOST_OS=`uname`; \ case "$$HOST_OS" in \ @@ -22,11 +23,12 @@ $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk echo "HOST_OS:=$$HOST_OS" > $@; \ echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \ echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \ - TAR=`which gtar`; \ - [ -n "$$TAR" -a -x "$$TAR" ] || TAR=`which tar`; \ + TAR=`which gtar 2>/dev/null`; \ + [ -n "$$TAR" -a -x "$$TAR" ] || TAR=`which tar 2>/dev/null`; \ echo "TAR:=$$TAR" >> $@; \ - ZCAT=`which gzcat`; \ - [ -n "$$ZCAT" -a -x "$$ZCAT" ] || ZCAT=`which zcat`; \ + ZCAT=`which gzcat 2>/dev/null`; \ + [ -n "$$ZCAT" -a -x "$$ZCAT" ] || ZCAT=`which zcat 2>/dev/null`; \ echo "ZCAT:=$$ZCAT" >> $@; \ + echo "BASH:=$(shell which bash)" >> $@; \ ) diff --git a/openwrt/package/sdk/files/include/image.mk b/openwrt/package/sdk/files/include/image.mk index 59204581d0..4f638f0260 100644 --- a/openwrt/package/sdk/files/include/image.mk +++ b/openwrt/package/sdk/files/include/image.mk @@ -4,6 +4,9 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # + +include $(INCLUDE_DIR)/prereq.mk +include $(INCLUDE_DIR)/kernel.mk KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD) ifneq ($(CONFIG_BIG_ENDIAN),y) @@ -53,7 +56,7 @@ ifeq ($(CONFIG_TARGET_ROOTFS_EXT2FS),y) E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_FSPART)*1024))) define Image/mkfs/ext2 - $(STAGING_DIR)/bin/genext2fs -q -b $(E2SIZE) -I 1500 -d $(BUILD_DIR)/root/ $(KDIR)/root.ext2 + $(STAGING_DIR)/bin/genext2fs -U -b $(E2SIZE) -I 1500 -d $(BUILD_DIR)/root/ $(KDIR)/root.ext2 $(call Image/Build,ext2) endef endif @@ -72,10 +75,17 @@ define Image/mkfs/prepare endef define BuildImage -compile: +download: +prepare: +ifneq ($(IB),1) + compile: compile-targets $(call Build/Compile) +else + compile: +endif -install: +ifneq ($(IB),1) + install: compile install-targets $(call Image/Prepare) $(call Image/mkfs/prepare) $(call Image/BuildKernel) @@ -83,17 +93,25 @@ install: $(call Image/mkfs/squashfs) $(call Image/mkfs/tgz) $(call Image/mkfs/ext2) +else + install: compile install-targets + $(call Image/BuildKernel) + $(call Image/mkfs/jffs2) + $(call Image/mkfs/squashfs) + $(call Image/mkfs/tgz) + $(call Image/mkfs/ext2) +endif -clean: +ifneq ($(IB),1) + clean: clean-targets $(call Build/Clean) -endef +else + clean: +endif compile-targets: install-targets: clean-targets: +endef + -download: -prepare: -compile: compile-targets -install: compile install-targets -clean: clean-targets diff --git a/openwrt/package/sdk/files/include/netfilter.mk b/openwrt/package/sdk/files/include/netfilter.mk index ba1512e14a..94699e572f 100644 --- a/openwrt/package/sdk/files/include/netfilter.mk +++ b/openwrt/package/sdk/files/include/netfilter.mk @@ -17,6 +17,8 @@ IPT_CONNTRACK-$(CONFIG_IP_NF_TARGET_CONNMARK) += $(P_V4)ipt_CONNMARK IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_CONNTRACK) += $(P_V4)ipt_conntrack IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_HELPER) += $(P_V4)ipt_helper IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_STATE) += $(P_V4)ipt_state +IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_CONNMARK) += $(P_XT)xt_connmark +IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += $(P_XT)xt_CONNMARK IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += $(P_XT)xt_conntrack IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += $(P_XT)xt_helper IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_STATE) += $(P_XT)xt_state @@ -85,6 +87,13 @@ IPT_NAT-$(CONFIG_IP_NF_TARGET_MIRROR) += $(P_V4)ipt_MIRROR IPT_NAT-$(CONFIG_IP_NF_TARGET_REDIRECT) += $(P_V4)ipt_REDIRECT IPT_NAT-$(CONFIG_IP_NF_TARGET_NETMAP) += $(P_V4)ipt_NETMAP +IPT_NAT_DEFAULT-m := +IPT_NAT_DEFAULT-$(CONFIG_IP_NF_FTP) += $(P_V4)ip_conntrack_ftp +IPT_NAT_DEFAULT-$(CONFIG_IP_NF_NAT_FTP) += $(P_V4)ip_nat_ftp +IPT_NAT_DEFAULT-$(CONFIG_IP_NF_IRC) += $(P_V4)ip_conntrack_irc +IPT_NAT_DEFAULT-$(CONFIG_IP_NF_NAT_IRC) += $(P_V4)ip_nat_irc +IPT_NAT_DEFAULT-$(CONFIG_IP_NF_TFTP) += $(P_V4)ip_conntrack_tftp + IPT_NAT_EXTRA-m := IPT_NAT_EXTRA-$(CONFIG_IP_NF_AMANDA) += $(P_V4)ip_conntrack_amanda IPT_NAT_EXTRA-$(CONFIG_IP_NF_CT_PROTO_GRE) += $(P_V4)ip_conntrack_proto_gre @@ -102,7 +111,6 @@ IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += $(P_V4)ip_nat_snmp_basic IPT_NAT_EXTRA-$(CONFIG_IP_NF_SIP) += $(P_V4)ip_conntrack_sip IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip -IPT_NAT_EXTRA-$(CONFIG_IP_NF_TFTP) += $(P_V4)ip_conntrack_tftp IPT_QUEUE-m := IPT_QUEUE-$(CONFIG_IP_NF_QUEUE) += $(P_V4)ip_queue diff --git a/openwrt/package/sdk/files/include/package.mk b/openwrt/package/sdk/files/include/package.mk index e1d23c7544..7f29e5f9c9 100644 --- a/openwrt/package/sdk/files/include/package.mk +++ b/openwrt/package/sdk/files/include/package.mk @@ -14,23 +14,14 @@ include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/unpack.mk +PKG_CONFIG_PATH:=. export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME) -define shvar -V_$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) -endef - -define shexport -$(call shvar,$(1))=$$(call $(1)) -export $(call shvar,$(1)) -endef - define Build/DefaultTargets ifeq ($(DUMP),) ifeq ($(CONFIG_AUTOREBUILD),y) - _INFO:= - ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) .),$(PKG_BUILD_DIR)) - _INFO+=$(subst $(TOPDIR)/,,$(PKG_BUILD_DIR)) + ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(PKG_FILE_DEPEND)),$(PKG_BUILD_DIR)) + $$(info Forcing package rebuild) $(PKG_BUILD_DIR)/.prepared: package-clean endif endif @@ -132,7 +123,17 @@ define BuildPackage INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list ifdef Package/$(1)/install - compile-targets: $$(IPKG_$(1)) + ifeq ($(CONFIG_PACKAGE_$(1)),y) + install-targets: $$(INFO_$(1)) + endif + + ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER)$(SDK),) + compile-targets: $$(IPKG_$(1)) + else + compile-targets: $(1)-disabled + $(1)-disabled: + @echo "WARNING: skipping $(1) -- package not selected" + endif endif ifeq ($(FORCEREBUILD),y) @@ -142,58 +143,67 @@ define BuildPackage IDEPEND_$(1):=$$(strip $$(DEPENDS)) ifneq ($(DUMP),) - DUMPINFO += \ + dumpinfo: dumpinfo-$(1) + dumpinfo-$(1): FORCE + @$$(DUMPINFO_$(call shvar,$(1))) + + DUMPINFO_$(call shvar,$(1)) += \ echo "Package: $(1)"; ifneq ($(MENU),) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo "Menu: $(MENU)"; endif ifneq ($(SUBMENU),) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo "Submenu: $(SUBMENU)"; ifneq ($(SUBMENUDEP),) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo "Submenu-Depends: $(SUBMENUDEP)"; endif endif ifneq ($(DEFAULT),) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo "Default: $(DEFAULT)"; endif $(call shexport,Package/$(1)/description) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \ echo "Version: $(VERSION)"; \ echo "Depends: $$(IDEPEND_$(1))"; \ echo "Provides: $(PROVIDES)"; \ echo "Build-Depends: $(PKG_BUILD_DEPENDS)"; \ + echo "Section: $(SECTION)"; \ echo "Category: $(CATEGORY)"; \ echo "Title: $(TITLE)"; \ + echo "Maintainer: $(MAINTAINER)"; \ if isset $(call shvar,Package/$(1)/description); then \ echo -n "Description: "; \ getvar $(call shvar,Package/$(1)/description); \ else \ - echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g'; \ + echo "Description: $(patsubst \\,\\\\,$(DESCRIPTION))" | perl -ne 's/\\/\n/g, print'; \ fi; ifneq ($(URL),) - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo; \ echo "$(URL)"; endif - DUMPINFO += \ + DUMPINFO_$(call shvar,$(1)) += \ echo "@@"; $(call shexport,Package/$(1)/config) - DUMPINFO += \ - if isset $(call shvar,Package/$(1)/config); then echo "Config: "; getvar $(call shvar,Package/$(1)/config); fi; \ - echo "@@"; + DUMPINFO_$(call shvar,$(1)) += \ + if isset $(call shvar,Package/$(1)/config); then \ + echo "Config: "; \ + getvar $(call shvar,Package/$(1)/config); \ + echo "@@"; \ + fi; endif @@ -207,11 +217,11 @@ define BuildPackage echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control ( \ - DEPENDS=; \ + DEPENDS='$(EXTRA_DEPENDS)'; \ for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \ DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \ done; \ - echo "Depends: $(EXTRA_DEPENDS) $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \ + echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \ ) echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control @@ -249,16 +259,12 @@ define BuildPackage $$(eval $$(call Build/DefaultTargets,$(1))) ifdef Package/$(1)/install - ifneq ($$(CONFIG_PACKAGE_$(1)),) + ifneq ($$(CONFIG_PACKAGE_$(1))$(DEVELOPER)$(SDK),) ifneq ($(MAKECMDGOALS),prereq) ifneq ($(DUMP),1) ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p -x ipkg -x ipkg-install '$$(IPKG_$(1))' '$(PKG_BUILD_DIR)'),$$(IPKG_$(1))) - _INFO+=$(subst $(TOPDIR)/,,$$(IPKG_$(1))) $(PKG_BUILD_DIR)/.built: package-rebuild - endif - - ifneq ($$(_INFO),) - $$(info Rebuilding $$(_INFO)) + $$(info Rebuilding $(subst $(TOPDIR)/,,$$(IPKG_$(1)))) endif endif endif @@ -287,9 +293,10 @@ define Build/Configure/Default CXXFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \ PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \ $(2) \ - ./configure \ + $(PKG_CONFIG_PATH)/configure \ --target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ --build=$(GNU_HOST_NAME) \ @@ -316,11 +323,12 @@ define Build/Configure endef define Build/Compile/Default + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS) " \ + LDFLAGS="$(EXTRA_LDFLAGS) " \ $(MAKE) -C $(PKG_BUILD_DIR) \ $(TARGET_CONFIGURE_OPTS) \ CROSS="$(TARGET_CROSS)" \ - EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include " \ - EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib " \ + CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CPPFLAGS) " \ ARCH="$(ARCH)" \ $(1); endef @@ -330,8 +338,7 @@ define Build/Compile endef ifneq ($(DUMP),) - dumpinfo: FORCE - @$(DUMPINFO) + dumpinfo: else $(PACKAGE_DIR): mkdir -p $@ diff --git a/openwrt/package/sdk/files/include/prereq.mk b/openwrt/package/sdk/files/include/prereq.mk index eda7ca35a6..41596dcb8b 100644 --- a/openwrt/package/sdk/files/include/prereq.mk +++ b/openwrt/package/sdk/files/include/prereq.mk @@ -5,34 +5,29 @@ # See /LICENSE for more information. # -$(TMP_DIR): - mkdir -p $@ - prereq: if [ -f $(TMP_DIR)/.prereq-error ]; then \ echo; \ cat $(TMP_DIR)/.prereq-error; \ + rm -f $(TMP_DIR)/.prereq-error; \ echo; \ - rm -rf $(TMP_DIR); \ false; \ fi - rm -rf $(TMP_DIR) - mkdir -p $(TMP_DIR) -.SILENT: $(TMP_DIR) prereq +.SILENT: prereq define Require export PREREQ_CHECK=1 ifeq ($$(CHECK_$(1)),) prereq: prereq-$(1) - prereq-$(1): $(TMP_DIR) FORCE + prereq-$(1): FORCE echo -n "Checking '$(1)'... " if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \ echo 'ok.'; \ else \ echo 'failed.'; \ - echo -e "$(strip $(2))" >> $(TMP_DIR)/.prereq-error; \ + echo -e "$(strip $(2))" | perl -ne 's/\\\s*/\n/g,print' >> $(TMP_DIR)/.prereq-error; \ fi check-$(1): FORCE diff --git a/openwrt/package/sdk/files/include/shell.sh b/openwrt/package/sdk/files/include/shell.sh index 6ee0cf6030..1e60692b97 100644 --- a/openwrt/package/sdk/files/include/shell.sh +++ b/openwrt/package/sdk/files/include/shell.sh @@ -13,3 +13,18 @@ isset() { eval "var=\"\${$1}\"" [ -n "$var" ] } + +trapret() {( + local retvals="$1"; shift + local cmd="$1"; shift + for retval in $(echo $retvals); do + local trap_$retval=1 + done + "$cmd" "$@" || { + local retval="$?" + eval "trapped=\${trap_$retval}" + [ -n "$trapped" ] || { + return $retval + } + } +)} diff --git a/openwrt/package/sdk/files/include/site/arm-linux-uclibc b/openwrt/package/sdk/files/include/site/arm-linux-uclibc new file mode 100644 index 0000000000..8bd8b786d2 --- /dev/null +++ b/openwrt/package/sdk/files/include/site/arm-linux-uclibc @@ -0,0 +1,31 @@ +#!/bin/sh + +ac_cv_c_littleendian=${ac_cv_c_littleendian=yes} +ac_cv_c_bigendian=${ac_cv_c_bigendian=no} + +ac_cv_sizeof___int64=0 +ac_cv_sizeof_char=1 +ac_cv_sizeof_int=4 +ac_cv_sizeof_int16_t=2 +ac_cv_sizeof_int32_t=4 +ac_cv_sizeof_int64_t=8 +ac_cv_sizeof_long_int=4 +ac_cv_sizeof_long_long=8 +ac_cv_sizeof_long=4 +ac_cv_sizeof_off_t=8 +ac_cv_sizeof_short_int=2 +ac_cv_sizeof_short=2 +ac_cv_sizeof_size_t=4 +ac_cv_sizeof_u_int16_t=2 +ac_cv_sizeof_u_int32_t=4 +ac_cv_sizeof_u_int64_t=8 +ac_cv_sizeof_uint16_t=2 +ac_cv_sizeof_uint32_t=4 +ac_cv_sizeof_uint64_t=8 +ac_cv_sizeof_unsigned_int=4 +ac_cv_sizeof_unsigned_long=4 +ac_cv_sizeof_unsigned_short=2 +ac_cv_sizeof_void_p=4 + +. $TOPDIR/include/site/linux-uclibc + diff --git a/openwrt/package/sdk/files/include/unpack.mk b/openwrt/package/sdk/files/include/unpack.mk index e56f624152..e533476b52 100644 --- a/openwrt/package/sdk/files/include/unpack.mk +++ b/openwrt/package/sdk/files/include/unpack.mk @@ -1,13 +1,18 @@ ifeq ($(strip $(PKG_UNPACK)),) + ifneq ($(HOST_OS),Linux) + HOST_TAR:=trapret 2 $(TAR) + else + HOST_TAR:=$(TAR) + endif ifneq ($(strip $(PKG_CAT)),) # use existing PKG_CAT - PKG_UNPACK:=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) + PKG_UNPACK:=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) ifeq ($(PKG_CAT),unzip) - PKG_UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) + PKG_UNPACK:=unzip -d $(PKG_BUILD_DIR)/.. $(DL_DIR)/$(PKG_SOURCE) endif # replace zcat with $(ZCAT), because some system have it as gzcat ifeq ($(PKG_CAT),zcat) - PKG_UNPACK:=$(ZCAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) + PKG_UNPACK:=$(ZCAT) $(DL_DIR)/$(PKG_SOURCE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) endif else # try to autodetect file type diff --git a/openwrt/package/sdk/files/include/verbose.mk b/openwrt/package/sdk/files/include/verbose.mk index 34568a31f8..b4242f212a 100644 --- a/openwrt/package/sdk/files/include/verbose.mk +++ b/openwrt/package/sdk/files/include/verbose.mk @@ -18,7 +18,7 @@ ifeq ("$(origin V)", "command line") KBUILD_VERBOSE:=$(V) endif -ifneq ($(shell tty -s <&3 || echo x),x) +ifeq ($(IS_TTY),1) _Y:="\\33[33m"# yellow _N:="\\33[m"# normal endif diff --git a/openwrt/package/sdk/files/rules.mk b/openwrt/package/sdk/files/rules.mk index 98d9720c1f..42e9978591 100644 --- a/openwrt/package/sdk/files/rules.mk +++ b/openwrt/package/sdk/files/rules.mk @@ -9,7 +9,6 @@ include $(TOPDIR)/include/verbose.mk export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' -- -export BASH=$(shell which bash) ARCH:=$(strip $(subst ",, $(CONFIG_ARCH))) TARGET_OPTIMIZATION:=$(strip $(subst ",, $(CONFIG_TARGET_OPTIMIZATION))) @@ -30,7 +29,7 @@ BIN_DIR:=$(TOPDIR)/bin PACKAGE_DIR:=$(BIN_DIR)/packages IPKG_TARGET_DIR:=$(PACKAGE_DIR) BUILD_DIR:=$(TOPDIR)/build_$(ARCH) -TMP_DIR:=$(BUILD_DIR)/tmp +TMP_DIR:=$(TOPDIR)/tmp STAMP_DIR:=$(BUILD_DIR)/stamp TARGET_DIR:=$(BUILD_DIR)/root IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/ipkg @@ -43,7 +42,7 @@ endif IMAGE:=$(BUILD_DIR)/root_fs_$(ARCH) -TARGET_PATH:=$(STAGING_DIR)/usr/bin:$(STAGING_DIR)/bin:$(PATH) +TARGET_PATH:=$(STAGING_DIR)/usr/sbin:$(STAGING_DIR)/usr/bin:$(STAGING_DIR)/bin:$(PATH) TARGET_CFLAGS:=$(TARGET_OPTIMIZATION) export PATH:=$(TARGET_PATH) @@ -70,6 +69,10 @@ ifneq ($(CONFIG_CCACHE),) TARGET_CC:= ccache $(TARGET_CC) endif +EXTRA_CPPFLAGS := -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include +EXTRA_CFLAGS := $(EXTRA_CPPFLAGS) +EXTRA_LDFLAGS := -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib + TARGET_CONFIGURE_OPTS:= \ AR=$(TARGET_CROSS)ar \ AS="$(TARGET_CC) -c $(TARGET_CFLAGS)" \ @@ -79,7 +82,8 @@ TARGET_CONFIGURE_OPTS:= \ GCC="$(TARGET_CC)" \ CXX=$(TARGET_CROSS)g++ \ RANLIB=$(TARGET_CROSS)ranlib \ - STRIP=$(TARGET_CROSS)strip + STRIP=$(TARGET_CROSS)strip \ + OBJCOPY=$(TARGET_CROSS)objcopy # strip an entire directory RSTRIP:= \ @@ -116,6 +120,16 @@ else TAR_OPTIONS:=-xf - endif +define shvar +V_$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) +endef + +define shexport +$(call shvar,$(1))=$$(call $(1)) +export $(call shvar,$(1)) +endef + + all: FORCE: ; .PHONY: FORCE -- 2.30.2