apply-patches.sh: Use the "APPLY_PATCHES" variable to call the script
authorFabio Porcedda <fabio.porcedda@gmail.com>
Wed, 22 Oct 2014 16:20:10 +0000 (18:20 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 24 Oct 2014 23:31:32 +0000 (01:31 +0200)
To easy up adding optional parameters when calling the
"apply-patches.sh" add and use the "APPLY_PATCHES" variable to execute
the script.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
17 files changed:
boot/at91bootstrap/at91bootstrap.mk
boot/at91bootstrap3/at91bootstrap3.mk
boot/barebox/barebox.mk
boot/uboot/uboot.mk
linux/linux-ext-rtai.mk
linux/linux.mk
package/Makefile.in
package/cvs/cvs.mk
package/gcc/gcc.mk
package/input-tools/input-tools.mk
package/mii-diag/mii-diag.mk
package/netcat-openbsd/netcat-openbsd.mk
package/pkg-autotools.mk
package/pkg-generic.mk
package/setserial/setserial.mk
package/sysvinit/sysvinit.mk
package/thttpd/thttpd.mk

index d379580a6d89ee592e39649449e97c1c53964765..e3f9dc0386b59c179bd4c822568e6b51922abe39 100644 (file)
@@ -24,7 +24,7 @@ endef
 
 ifneq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR)),)
 define AT91BOOTSTRAP_APPLY_CUSTOM_PATCHES
-       support/scripts/apply-patches.sh $(@D) $(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR) \
+       $(APPLY_PATCHES) $(@D) $(BR2_TARGET_AT91BOOTSTRAP_CUSTOM_PATCH_DIR) \
                at91bootstrap-$(AT91BOOTSTRAP_VERSION)-\*.patch
 endef
 
index 91b668443c8935e443de05a1b12c93dbfea8a56f..bc8d9126d7159f3e9f860ab25e023481f83c0139 100644 (file)
@@ -21,7 +21,7 @@ AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
 
 ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
 define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
-       support/scripts/apply-patches.sh $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
+       $(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
                at91bootstrap3-\*.patch
 endef
 
index 2cf4d15a3f8c0be73033c0f6374053824e0687f2..0fb7cec098710c7716c51e08405264845da97c94 100644 (file)
@@ -26,7 +26,7 @@ BAREBOX_LICENSE_FILES = COPYING
 
 ifneq ($(call qstrip,$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
 define BAREBOX_APPLY_CUSTOM_PATCHES
-       support/scripts/apply-patches.sh $(@D) \
+       $(APPLY_PATCHES) $(@D) \
                $(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \
                barebox-$(BAREBOX_VERSION)-\*.patch
 endef
index 0c6c96c429e563562e2cdb8918c9076cc2584a32..1f8818c41b935696fb2460c8d397cc5ed9896871 100644 (file)
@@ -87,7 +87,7 @@ UBOOT_POST_EXTRACT_HOOKS += UBOOT_COPY_OLD_LICENSE_FILE
 
 ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
 define UBOOT_APPLY_CUSTOM_PATCHES
-       support/scripts/apply-patches.sh $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \
+       $(APPLY_PATCHES) $(@D) $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR) \
                uboot-\*.patch
 endef
 
index dcfab498319c18d432c28ca394ce23952ec6556d..bf998d5fdd8b02c0765b7525026601fc750f54c4 100644 (file)
@@ -25,7 +25,7 @@ ifeq ($(RTAI_PATCH),)
 define RTAI_PREPARE_KERNEL
        kver=`$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelversion` ; \
        if test -f $(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/hal-linux-$${kver}-*patch ; then \
-               support/scripts/apply-patches.sh $(LINUX_DIR)           \
+               $(APPLY_PATCHES) $(LINUX_DIR)                           \
                        $(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/     \
                        hal-linux-$${kver}-*patch ; \
        else \
@@ -35,7 +35,7 @@ define RTAI_PREPARE_KERNEL
 endef
 else
 define RTAI_PREPARE_KERNEL
-       support/scripts/apply-patches.sh        \
+       $(APPLY_PATCHES)                        \
                $(LINUX_DIR)                    \
                $(dir $(RTAI_PATCH))            \
                $(notdir $(RTAI_PATCH))
index 812274110be74622cb09a2a87b8f866bf83841d6..abd3772130b6e2691151aa9842aa0f3a44c83e5e 100644 (file)
@@ -154,11 +154,11 @@ LINUX_POST_DOWNLOAD_HOOKS += LINUX_DOWNLOAD_PATCHES
 define LINUX_APPLY_PATCHES
        for p in $(LINUX_PATCHES) ; do \
                if echo $$p | grep -q -E "^ftp://|^http://" ; then \
-                       support/scripts/apply-patches.sh $(@D) $(DL_DIR) `basename $$p` ; \
+                       $(APPLY_PATCHES) $(@D) $(DL_DIR) `basename $$p` ; \
                elif test -d $$p ; then \
-                       support/scripts/apply-patches.sh $(@D) $$p linux-\*.patch ; \
+                       $(APPLY_PATCHES) $(@D) $$p linux-\*.patch ; \
                else \
-                       support/scripts/apply-patches.sh $(@D) `dirname $$p` `basename $$p` ; \
+                       $(APPLY_PATCHES) $(@D) `dirname $$p` `basename $$p` ; \
                fi \
        done
 endef
index 490a960e91c06db05bc78da3ff751e6c08763fb9..dd6253711b65edb44a7ae77420180c93519ee3d0 100644 (file)
@@ -222,6 +222,8 @@ FLEX := $(shell which flex || type -p flex)
 BISON := $(shell which bison || type -p bison)
 SED := $(shell which sed || type -p sed) -i -e
 
+APPLY_PATCHES = support/scripts/apply-patches.sh
+
 HOST_CPPFLAGS  = -I$(HOST_DIR)/usr/include
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += $(HOST_CPPFLAGS)
index f1a63c818645b1b947f9436434a414f90e8be675..dfc935f23f438a25f4fea8d4dfb2904f82fdb043 100644 (file)
@@ -38,7 +38,7 @@ define CVS_DEBIAN_PATCHES
                 do $(SED) 's,^\+\+\+ .*cvs-$(CVS_VERSION)/,+++ cvs-$(CVS_VERSION)/,' $$i; \
                 done; \
                ); \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches \*; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches \*; \
        fi
 endef
 endif
index 7bed159c04b84257b8305da9eed2a00f2d625f45..1352bdf2f08f5f9ad0e324415d8ac2f21229bc99 100644 (file)
@@ -37,14 +37,14 @@ endef
 ifeq ($(ARCH),powerpc)
 ifneq ($(BR2_SOFT_FLOAT),)
 define HOST_GCC_APPLY_POWERPC_PATCH
-       support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
+       $(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
 endef
 endif
 endif
 
 define HOST_GCC_APPLY_PATCHES
        if test -d package/gcc/$(GCC_VERSION); then \
-         support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch ; \
+         $(APPLY_PATCHES) $(@D) package/gcc/$(GCC_VERSION) \*.patch ; \
        fi;
        $(HOST_GCC_APPLY_POWERPC_PATCH)
 endef
index e7b1561b8d77a0189352c95d0033ca1f566f63d5..9fb94bf56d68f9bd48c68c4baf3cbb968d1e12c7 100644 (file)
@@ -17,7 +17,7 @@ INPUT_TOOLS_TARGETS_$(BR2_PACKAGE_INPUT_TOOLS_JSTEST)      += jstest
 
 define INPUT_TOOLS_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches \*.patch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches \*.patch; \
        fi
 endef
 
index af2d877608d84496f30078dd965030eacbd24e0e..aec13be7986f113577435e0c82dffa3c5d65a65d 100644 (file)
@@ -15,7 +15,7 @@ MII_DIAG_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS)
 
 define MII_DIAG_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches \*.patch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches \*.patch; \
        fi
 endef
 
index 64fb7f0831bdaa3224ba9c05dd203d4ed4a6afb3..bf5c4b741b20040376e603f9603d71d2aa4e0d44 100644 (file)
@@ -18,7 +18,7 @@ endif
 
 define NETCAT_OPENBSD_APPLY_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches *.dpatch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches *.dpatch; \
        fi
 endef
 
index 80adc8bf74ff440024884ef8614019021d8b87b9..3c6bb0d8b2b40645643c8bc32548f3c94b1d79c1 100644 (file)
@@ -204,11 +204,11 @@ define LIBTOOL_PATCH_HOOK
                        ltmain_version=`sed -n '/^[     ]*VERSION=/{s/^[        ]*VERSION=//;p;q;}' $$$$i | \
                        sed -e 's/\([0-9].[0-9]*\).*/\1/' -e 's/\"//'`; \
                        if test $$$${ltmain_version} = '1.5'; then \
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v1.5.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v1.5.patch; \
                        elif test $$$${ltmain_version} = "2.2"; then\
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
                        elif test $$$${ltmain_version} = "2.4"; then\
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
                        fi \
                done \
        fi
@@ -238,11 +238,11 @@ define AUTORECONF_HOOK
                        ltmain_version=`sed -n '/^[     ]*VERSION=/{s/^[        ]*VERSION=//;p;q;}' $$$$i | \
                        sed -e 's/\([0-9].[0-9]*\).*/\1/' -e 's/\"//'`; \
                        if test $$$${ltmain_version} = "1.5"; then \
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v1.5.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v1.5.patch; \
                        elif test $$$${ltmain_version} = "2.2"; then\
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
                        elif test $$$${ltmain_version} = "2.4"; then\
-                               support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
+                               $$(APPLY_PATCHES) $$$${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
                        fi \
                done \
        fi
index 259ee02801926f9103123e38e2316633d47f4133..7a6d5e67b7d4dc8903d38229a34bb39df779933b 100644 (file)
@@ -146,14 +146,14 @@ $(BUILD_DIR)/%/.stamp_patched:
        @$(call step_start,patch)
        @$(call MESSAGE,"Patching")
        $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-       $(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
+       $(foreach p,$($(PKG)_PATCH),$(APPLY_PATCHES) $(@D) $(DL_DIR) $(notdir $(p))$(sep))
        $(Q)( \
        for D in $(PATCH_BASE_DIRS); do \
          if test -d $${D}; then \
            if test -d $${D}/$($(PKG)_VERSION); then \
-             support/scripts/apply-patches.sh $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \
+             $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION) \*.patch \*.patch.$(ARCH) || exit 1; \
            else \
-             support/scripts/apply-patches.sh $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \
+             $(APPLY_PATCHES) $(@D) $${D} \*.patch \*.patch.$(ARCH) || exit 1; \
            fi; \
          fi; \
        done; \
index 55be4c1a0b79b46588b5f4841da92bad47ff9a59..ffdf129bf65f230eed3e585a4c9790d17857a763 100644 (file)
@@ -18,7 +18,7 @@ define SETSERIAL_APPLY_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
                touch $(@D)/gorhack.h; \
                rm $(@D)/debian/patches/01_makefile.dpatch; \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches *.dpatch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches *.dpatch; \
        fi
 endef
 
index d588122e7c851c9a5122e15bb15769446f412dba..bdba38f21381aea3d3812f9bc77189aea591e415 100644 (file)
@@ -18,7 +18,7 @@ endif
 
 define SYSVINIT_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches \*.patch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches \*.patch; \
        fi
 endef
 
index a621ae032060521e90d7bfe367aeaf8adbbbb939..781043c757395b1b2e3d026e5ba6188d19182274 100644 (file)
@@ -14,7 +14,7 @@ THTTPD_LICENSE_FILES = thttpd.c
 ifneq ($(THTTPD_PATCH),)
 define THTTPD_DEBIAN_PATCHES
        if [ -d $(@D)/debian/patches ]; then \
-               support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches \*.patch; \
+               $(APPLY_PATCHES) $(@D) $(@D)/debian/patches \*.patch; \
        fi
 endef
 endif