Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  firmware: Sync with upstream (coolsnowwolf#10459)
  include: sync with upstream (coolsnowwolf#10454)
  dnsmasq: bump to v2.87
  • Loading branch information
zesming committed Nov 20, 2022
2 parents 41a52f3 + 3c707a2 commit 05b8392
Show file tree
Hide file tree
Showing 47 changed files with 352 additions and 623 deletions.
6 changes: 3 additions & 3 deletions include/autotools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define autoreconf
$(patsubst %,rm -f %;,$(2)) \
$(foreach p,$(3), \
if [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
[ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
[ -d $(p)/autom4te.cache ] && rm -rf $(p)/autom4te.cache; \
[ -e $(p)/config.rpath ] || \
ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
Expand Down Expand Up @@ -113,7 +113,7 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
endif

ifneq ($(filter libtool,$(PKG_FIXUP)),)
PKG_BUILD_DEPENDS += libtool gettext libiconv
PKG_BUILD_DEPENDS += libtool
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
Hooks/Configure/Pre += autoreconf_target
endif
Expand All @@ -124,7 +124,7 @@ ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),)
endif

ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
PKG_BUILD_DEPENDS += libtool gettext libiconv
PKG_BUILD_DEPENDS += libtool
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
Hooks/Configure/Pre += autoreconf_target
endif
Expand Down
2 changes: 2 additions & 0 deletions include/bpf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ BPF_CFLAGS := \
-Wno-unused-label \
-O2 -emit-llvm -Xclang -disable-llvm-passes

ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
ifeq ($(DUMP),)
CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
ifeq ($(CLANG_VER_VALID),)
$(error ERROR: LLVM/clang version too old. Minimum required: $(CLANG_MIN_VER), found: $(CLANG_VER))
endif
endif
endif

define CompileBPF
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
Expand Down
2 changes: 1 addition & 1 deletion include/cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
CMAKE_HOST_INSTALL_PREFIX ?= $(HOST_BUILD_PREFIX)
CMAKE_HOST_INSTALL_PREFIX = $(HOST_BUILD_PREFIX)

ifeq ($(HOST_USE_NINJA),1)
CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Ninja"
Expand Down
3 changes: 2 additions & 1 deletion include/depends.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*"

find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | $(MKHASH) md5
find_md5_reproducible=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -print0 | xargs -0 $(MKHASH) md5 | sort | $(MKHASH) md5

define rdep
.PRECIOUS: $(2)
Expand All @@ -27,7 +28,7 @@ ifneq ($(wildcard $(2)),)
{ [ \! -f "$(3)" ] || diff $(3) $(3).1 >/dev/null; } && \
) \
{ \
[ -f "$(2)_check.1" ] && mv "$(2)_check.1"; \
[ -f "$(2)_check.1" ] && mv "$(2)_check.1" "$(2)_check"; \
$(TOPDIR)/scripts/timestamp.pl $(DEP_FINDPARAMS) $(4) -n $(2) $(1) && { \
$(call debug_eval,$(SUBDIR),r,echo "No need to rebuild $(2)";) \
touch -r "$(2)" "$(2)_check"; \
Expand Down
17 changes: 15 additions & 2 deletions include/download.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ define dl_tar_pack
$$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
endef

gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1))

# Used in Build/CoreTargets and HostBuild/Core as an integrity check for
# downloaded files. It will add a FORCE rule if the sha256 hash does not
# match, so that the download can be more thoroughly handled by download.pl.
define check_download_integrity
expected_hash:=$(strip $(if $(filter-out x,$(HASH)),$(HASH),$(MIRROR_HASH)))
$$(if $$(and $(FILE),$$(wildcard $(DL_DIR)/$(FILE)), \
$$(filter undefined,$$(flavor DownloadChecked/$(FILE)))), \
$$(eval DownloadChecked/$(FILE):=1) \
$$(if $$(filter-out $$(call gen_sha256sum,$(FILE)),$$(expected_hash)), \
$(DL_DIR)/$(FILE): FORCE) \
)
endef

ifdef CHECK
check_escape=$(subst ','\'',$(1))
#')
Expand All @@ -78,8 +93,6 @@ else
check_warn = $(if $(filter-out undefined,$(origin F_$(1))),$(filter ,$(shell $(call F_$(1),$(2),$(3),$(4)) >&2)),$(check_warn_nofix))
endif

gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1))

ifdef FIXUP
F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2)
F_hash_mismatch = $(F_hash_deprecated)
Expand Down
11 changes: 6 additions & 5 deletions include/host-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/quilt.mk

BUILD_TYPES += host
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
Expand Down Expand Up @@ -51,6 +51,7 @@ HOST_CONFIGURE_VARS = \
CFLAGS="$(HOST_CFLAGS)" \
CXX="$(HOSTCXX)" \
CPPFLAGS="$(HOST_CPPFLAGS)" \
CXXFLAGS="$(HOST_CXXFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
CONFIG_SHELL="$(SHELL)"

Expand Down Expand Up @@ -180,7 +181,7 @@ ifndef DUMP
clean-build: host-clean-build
endif

$(DL_DIR)/$(FILE): FORCE
$(call check_download_integrity)

$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
Expand All @@ -197,13 +198,13 @@ ifndef DUMP

ifneq ($(CONFIG_AUTOREMOVE),)
host-compile:
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
$(XARGS) rm -rf
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \
$(XARGS) -0 rm -rf
endif
endef
endif

define HostBuild
$(HostBuild/Core)
$(if $(if $(PKG_HOST_ONLY),,$(STAMP_PREPARED)),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
endef
6 changes: 6 additions & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ define Build/copy-file
cat "$(1)" > "$@"
endef

define Build/edimax-header
$(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1)
@mv $@.new $@
endef

define Build/elecom-product-header
$(eval product=$(word 1,$(1)))
$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
Expand Down Expand Up @@ -291,6 +296,7 @@ define Build/fit
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
$(if $(DEVICE_DTS_LOADADDR),-s $(DEVICE_DTS_LOADADDR)) \
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtb)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
Expand Down
2 changes: 2 additions & 0 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ define Device/Init
DEVICE_DTS_CONFIG :=
DEVICE_DTS_DELIMITER :=
DEVICE_DTS_DIR :=
DEVICE_DTS_LOADADDR :=
DEVICE_DTS_OVERLAY :=
DEVICE_FDT_NUM :=
SOC :=
Expand All @@ -413,6 +414,7 @@ DEFAULT_DEVICE_VARS := \
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
DEVICE_DTS_CONFIG DEVICE_DTS_DELIMITER DEVICE_DTS_DIR DEVICE_DTS_OVERLAY \
DEVICE_DTS_LOADADDR \
DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
UBOOT_PATH IMAGE_SIZE \
Expand Down
2 changes: 1 addition & 1 deletion include/kernel-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ifneq ($(DUMP),1)
endif

KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),)))
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),)))
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk
Expand Down
17 changes: 11 additions & 6 deletions include/kernel-defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ define Kernel/Configure/Default
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
}
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) $(if $(findstring uml,$(BOARD)),ARCH=$(ARCH)) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
endef

Expand All @@ -129,6 +129,10 @@ define Kernel/CompileModules/Default
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
+$(KERNEL_MAKE) olddefconfig
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
# If .config did not change, use the previous timestamp to avoid package rebuilds
cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \
mv $(LINUX_DIR)/.config.modules.save $(LINUX_DIR)/.config; \
$(CP) $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save
endef

OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
Expand Down Expand Up @@ -165,19 +169,20 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
define Kernel/CompileImage/Initramfs
$(call Kernel/Configure/Initramfs)
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init)
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
ifeq ($(CONFIG_EXTERNAL_CPIO),y)
ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),)
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
else
( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
endif
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -n -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
endif
Expand Down
18 changes: 7 additions & 11 deletions include/kernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ else
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
endif

ifeq (,$(findstring -android,$(LINUX_VERSION)))
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
else
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)-android
endif
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)

ifneq ($(TARGET_BUILD),1)
Expand Down Expand Up @@ -105,7 +101,7 @@ endif
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)

KERNEL_MAKE_FLAGS = \
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(filter-out -fno-plt,$(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))) $(call qstrip,$(CONFIG_KERNEL_CFLAGS))" \
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
CROSS_COMPILE="$(KERNEL_CROSS)" \
ARCH="$(LINUX_KARCH)" \
Expand All @@ -129,17 +125,17 @@ ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL
KERNELRELEASE=$(LINUX_VERSION)
endif

ifneq ($(HOST_OS),Linux)
KERNEL_MAKE_FLAGS += CONFIG_STACK_VALIDATION=
export SKIP_STACK_VALIDATION:=1
endif

KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)

ifdef CONFIG_USE_SPARSE
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
endif

ifneq ($(HOST_OS),Linux)
KERNEL_MAKEOPTS += CONFIG_STACK_VALIDATION=
export SKIP_STACK_VALIDATION:=1
endif

PKG_EXTMOD_SUBDIRS ?= .

PKG_SYMVERS_DIR = $(KERNEL_BUILD_DIR)/symvers
Expand Down
30 changes: 20 additions & 10 deletions include/nls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,37 @@ ifeq ($(CONFIG_BUILD_NLS),y)
INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-full
INTL_FULL:=1

# iconv stub
else
ICONV_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-stub
ICONV_PREFIX:=
ICONV_FULL:=

INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-stub
INTL_PREFIX:=
INTL_FULL:=
endif

PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext

ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
ifeq ($(CONFIG_BUILD_NLS),y)
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
else
ICONV_CFLAGS:=
ICONV_CPPFLAGS:=
ICONV_LDFLAGS:=
endif

INTL_DEPENDS:=+BUILD_NLS:libintl-full
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
ifeq ($(CONFIG_BUILD_NLS),y)
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
else
INTL_CFLAGS:=
INTL_CPPFLAGS:=
INTL_LDFLAGS:=
endif

TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
Expand Down
3 changes: 2 additions & 1 deletion include/package-bin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

ifeq ($(DUMP),)
define BuildTarget/bin
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS))))
ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT))
ifdef Package/$(1)/install
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
$(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
Expand Down
3 changes: 2 additions & 1 deletion include/package-ipkg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ ifeq ($(DUMP),)
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))

ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(filter-out *,$$(VARIANT)),$(firstword $(ALL_VARIANTS))))
ifeq ($(BUILD_VARIANT),$$(if $$(TARGET_VARIANT),$$(TARGET_VARIANT),$(BUILD_VARIANT)))
do_install=
ifdef Package/$(1)/install
do_install=yes
Expand Down
11 changes: 6 additions & 5 deletions include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_BUILD_PARALLEL ?=
PKG_USE_MIPS16 ?= 1
PKG_IREMAP ?= 1
PKG_SKIP_DOWNLOAD=$(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT)

MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j))

Expand Down Expand Up @@ -84,7 +85,7 @@ ifneq ($(PREV_STAMP_PREPARED),)
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
CONFIG_AUTOREBUILD:=
else
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
endif
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
Expand Down Expand Up @@ -183,7 +184,7 @@ define Build/CoreTargets
$(call Build/Autoclean)
$(call DefaultTargets)

$(DL_DIR)/$(FILE): FORCE
$(call check_download_integrity)

download:
$(foreach hook,$(Hooks/Download),
Expand Down Expand Up @@ -258,13 +259,13 @@ define Build/CoreTargets
ifneq ($(CONFIG_AUTOREMOVE),)
compile:
-touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
$(XARGS) rm -rf
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \
$(XARGS) -0 rm -rf
endif
endef

define Build/DefaultTargets
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(PKG_SKIP_DOWNLOAD),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(DUMP),,$(Build/CoreTargets))

define Build/DefaultTargets
Expand Down
Loading

0 comments on commit 05b8392

Please sign in to comment.