Browse Source

fix build on Cygwin

Waldemar Brodkorb 4 years ago
parent
commit
e6ad01c198
4 changed files with 10 additions and 12 deletions
  1. 2 2
      mk/image.mk
  2. 3 3
      mk/package.mk
  3. 3 5
      mk/vars.mk
  4. 2 2
      scripts/make-module-ipkgs.sh

+ 2 - 2
mk/image.mk

@@ -139,7 +139,7 @@ else
 endif
 	@${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
 	    ../linux/kernel.control ${KERNEL_VERSION} ${ADK_TARGET_CPU_ARCH}
-	$(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
+	PATH='$(HOST_PATH)' $(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
 	$(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE)
 	$(CMD_TRACE) " done"
 	$(END_TRACE)
@@ -156,7 +156,7 @@ ${FW_DIR}/${ROOTFSUSERTARBALL}: ${TARGET_DIR}/.adk
 		$(CPIO) --quiet -o -Hustar --owner=0:0 | $(XZ) -c >$@
 
 ${STAGING_TARGET_DIR}/${INITRAMFS}_list: ${TARGET_DIR}/.adk
-	env PATH='${HOST_PATH}' $(BASH) ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
+	PATH='${HOST_PATH}' $(BASH) ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
 		${TARGET_DIR}/ >$@
 	( \
 		echo "nod /dev/console 0644 0 0 c 5 1"; \

+ 3 - 3
mk/package.mk

@@ -272,13 +272,13 @@ ifeq (,$(filter noscripts,$(7)))
 endif
 
 ifeq (,$(filter devonly,$(7)))
-	$${PKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
+	PATH='$(HOST_PATH)' $${PKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
 ifneq ($(ADK_BUILD_WITH_DEBUG),)
-	$${PKG_BUILD} $${IDIR_$(1)_DBG} $${PACKAGE_DIR} $(MAKE_TRACE)
+	PATH='$(HOST_PATH)' $${PKG_BUILD} $${IDIR_$(1)_DBG} $${PACKAGE_DIR} $(MAKE_TRACE)
 endif
 endif
 ifneq (,$(filter dev,$(7)))
-	$${PKG_BUILD} $${IDIR_$(1)_DEV} $${PACKAGE_DIR} $(MAKE_TRACE)
+	PATH='$(HOST_PATH)' $${PKG_BUILD} $${IDIR_$(1)_DEV} $${PACKAGE_DIR} $(MAKE_TRACE)
 endif
 
 clean-targets: clean-dev-$(1)

+ 3 - 5
mk/vars.mk

@@ -379,8 +379,7 @@ HOST_ENV=		CC='$(HOST_CC)' \
 PKG_SUFFIX:=		$(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
 
 ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
-PKG_BUILD:=		PATH='${HOST_PATH}' \
-			${BASH} ${SCRIPT_DIR}/ipkg-build
+PKG_BUILD:=		${BASH} ${SCRIPT_DIR}/ipkg-build
 PKG_INSTALL:=		PATH='${HOST_PATH}' \
 			IPKG_TMP=$(BUILD_DIR)/tmp \
 			IPKG_INSTROOT=$(TARGET_DIR) \
@@ -393,8 +392,7 @@ PKG_STATE_DIR:=		$(TARGET_DIR)/usr/lib/ipkg
 endif
 
 ifeq ($(ADK_TARGET_PACKAGE_OPKG),y)
-PKG_BUILD:=		PATH='${HOST_PATH}' \
-			${BASH} ${SCRIPT_DIR}/ipkg-build
+PKG_BUILD:=		${BASH} ${SCRIPT_DIR}/ipkg-build
 PKG_INSTALL:=		PATH='${HOST_PATH}' \
 			IPKG_TMP=$(BUILD_DIR)/tmp \
 			IPKG_INSTROOT=$(TARGET_DIR) \
@@ -407,7 +405,7 @@ PKG_STATE_DIR:=		$(TARGET_DIR)/usr/lib/opkg
 endif
 
 ifeq ($(ADK_TARGET_PACKAGE_TXZ),y)
-PKG_BUILD:=		PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg build
+PKG_BUILD:=		${BASH} ${SCRIPT_DIR}/tarpkg build
 PKG_INSTALL:=		PKG_INSTROOT='$(TARGET_DIR)' \
 			PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/tarpkg install
 PKG_STATE_DIR:=		$(TARGET_DIR)/usr/lib/pkg

+ 2 - 2
scripts/make-module-ipkgs.sh

@@ -80,7 +80,7 @@ for modname in ${!modpaths[@]}; do
 		Section: sys
 		Description: kernel module $modname
 	EOF
-	sh $(dirname $0)/make-ipkg-dir.sh $ipkgdir $ctrlfile $VER $ARCH
+	bash $(dirname $0)/make-ipkg-dir.sh $ipkgdir $ctrlfile $VER $ARCH
 
 	depline="kernel ($VER)"
 	for m in ${moddeps[$modname]}; do
@@ -99,5 +99,5 @@ EOF
 	chmod 0755 ${ipkgdir}/CONTROL/postinst
 	mkdir -p ${ipkgdir}/etc/modules.d
 	echo $modname >${ipkgdir}/etc/modules.d/${modlevels[$modname]}-$modname
-	env ${PKG_BUILD} ${ipkgdir} ${PACKAGE_DIR} || exit 1
+	${PKG_BUILD} ${ipkgdir} ${PACKAGE_DIR} || exit 1
 done