From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH V6] nodejs: new package
Date: Fri, 8 Mar 2013 10:56:29 +0100 [thread overview]
Message-ID: <20130308105629.45bb99c2@skate> (raw)
In-Reply-To: <CAKduhSuoWX9o=OF2hTuiC=k--cVFen6bga+XUebfQsdGbq4Jew@mail.gmail.com>
Dear Daniel Price,
On Fri, 8 Mar 2013 01:32:23 -0800, Daniel Price wrote:
> Just as a quick followup to this patch: Thomas had previously
> commented about the call to qstrip at: "NODEJS_MODULES_LIST= $(call
> qstrip,\".
>
> I wanted to say that I have tested this both ways and again found that
> it was necessary to qstrip the whole thing. You can better appreciate
> why with a trivial example makefile as follows. Some other buildroot
> recipes use other mechanisms like string concatenation of a series of
> variables, but that seemed more ugly to me than this method.
>
> -------------8<-------------8<------------------
> TEST = $(FOO) $(BAR) $(BAZ)
>
> ifneq ($(TEST),)
> define MORESTUFF
> @echo "as seen by ifneq, TEST was not empty"
> endef
> endif
>
> all:
> @echo "number of characters in TEST:"
> @echo "$(TEST)" | wc -c
> $(MORESTUFF)
> -------------8<-------------8<------------------
>
> So in order to make this work as intended, one needs to qstrip $(TEST)
> to collapse out whitespace. I believe that this is because whitespace
> which trails a variable is preserved, and so in this example $(TEST)
> has two spaces in it.
Hum, indeed. But that's because qstrip uses strip. However, testing
your simple example with qstrip doesn't work (unless I'm doing
something wrong, of course) :
-------------8<-------------8<------------------
qstrip=$(strip $(subst ",,$(1))) #"
TEST = $(call qstrip,$(FOO) $(BAR) $(BAZ))
ifneq ($(TEST),)
define MORESTUFF
@echo "as seen by ifneq, TEST was not empty"
endef
endif
all:
@echo -n "number of characters in TEST: "
@echo -n "$(TEST)" | wc -c
$(MORESTUFF)
-------------8<-------------8<------------------
Shows:
-------------8<-------------8<------------------
$ make -f bleh.mk
number of characters in TEST: 1
as seen by ifneq, TEST was not empty
-------------8<-------------8<------------------
If I replace TEST = $(call qstrip,...) by TEST = $(strip ...) then it
works.
I'm confused.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2013-03-08 9:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 1:31 [Buildroot] [PATCH V6] nodejs: new package Daniel Price
2013-03-08 9:32 ` Daniel Price
2013-03-08 9:56 ` Thomas Petazzoni [this message]
2013-03-10 14:44 ` Thomas Petazzoni
2013-03-11 19:15 ` Dan Price
2013-03-18 8:45 ` Peter Korsgaard
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=20130308105629.45bb99c2@skate \
--to=thomas.petazzoni@free-electrons.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.