From: Ivan Kuten <ivan.kuten@promwad.com>
To: buildroot@busybox.net
Subject: [Buildroot] PATCH [1/2] try2: make Makefile.autotools.in not to use hardcoded x11r7 name when patching
Date: Sat, 29 Sep 2007 02:25:30 +0300 [thread overview]
Message-ID: <46FD8D6A.40605@promwad.com> (raw)
In-Reply-To: <20070928203604.GW20951@aon.at>
>
> What about renaming them to DIR_OFFSET or DIR_PREFIX instead of
> NAME_PREFIX to make it more obvious that those are ment to be dirs.
>
See below.
>
> This may be obvious from the context, but is @D guaranteed to exist?
>
Not sure - need take a look.
2nd try, introducing DIR_PREFIX:
Index: package/Makefile.autotools.in
===================================================================
--- package/Makefile.autotools.in (revision 20098)
+++ package/Makefile.autotools.in (working copy)
@@ -58,6 +58,8 @@
# FOO_SUBDIR [default empty]
# relative path in the package source from which to run configure and
# make
+# FOO_DIR_PREFIX [default empty]
+# relative path to package *.mk file and corresponding patches
#
## The following variables contain hook target names
## by default they do nothing, they can be overriden in package makefiles
@@ -151,25 +153,15 @@
$(call MESSAGE,"Patching")
$(if $($(PKG)_PATCH),toolchain/patch-kernel.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
$(Q)(\
- if test -d package/$($(PKG)_NAME) ; then \
- if test "$(wildcard package/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
- toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
+ if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) ; then \
+ if test "$(wildcard $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
else \
- toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
- if test -d package/$($(PKG)_NAME)/$(NAMEVER) ; then \
- toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
+ if test -d package/$($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER) ; then \
+ toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
fi; \
fi; \
- else \
- echo "This must be wrong. Why do you need to special-case _any_ package here? Skipping until this is resolved properly."; \
- if false && test "$(wildcard package/x11r7/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
- toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
- else \
- toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
- if test -d package/x11r7/$($(PKG)_NAME)/$(NAMEVER) ; then \
- toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
- fi; \
- fi; \
fi; \
)
ifeq ($(strip $(BR2_UPDATE_CONFIG)),y)
@@ -258,15 +250,17 @@
################################################################################
# AUTOTARGETS -- the target generator macro; define a set of human-readable
# make targets, stamps, and default per-package variables.
-# Argument 1 is the (lowercase) package name.
+# Argument 1 is the package dir prefix.
+# Argument 2 is the (lowercase) package name.
################################################################################
define AUTOTARGETS
-$(call AUTOTARGETS_INNER,$(1),$(call UPPERCASE,$(1)))
+$(call AUTOTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(1))
endef
# AUTOTARGETS_INNER -- does the job for AUTOTARGETS; argument 1 is the
-# lowercase package name, argument 2 the uppercase package name
+# lowercase package name, argument 2 the uppercase package name,
+# argument 3 the package dir prefix
define AUTOTARGETS_INNER
# define package-specific variables to default values
@@ -290,6 +284,7 @@
$(2)_UNINSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) uninstall
$(2)_UNINSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) uninstall
$(2)_SUBDIR ?=
+$(2)_DIR_PREFIX =$(3)
# define sub-target stamps
--
Best regards,
Ivan
--------------------------------
Embedded Linux engineer,
Promwad Company: http://www.promwad.com/
Homepage : http://www.ivankuten.com/
--------------------------------
next prev parent reply other threads:[~2007-09-28 23:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-28 21:23 [Buildroot] PATCH [1/2] make Makefile.autotools.in not to use hardcoded x11r7 name when patching Ivan Kuten
2007-09-28 20:36 ` Bernhard Fischer
2007-09-28 23:25 ` Ivan Kuten [this message]
2007-09-28 22:40 ` [Buildroot] PATCH [1/2] try2: " Bernhard Fischer
2007-09-28 23:51 ` Ivan Kuten
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46FD8D6A.40605@promwad.com \
--to=ivan.kuten@promwad.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.