DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Buriez, Patrice" <patrice.buriez@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] kni: fixed compilation error on Ubuntu 14.04 LTS (kernel 3.13.0-30.54)
Date: Fri, 01 Aug 2014 15:15:54 +0200	[thread overview]
Message-ID: <2889487.riKpfTWg1F@xps13> (raw)
In-Reply-To: <8BBE948C60307D47AD16B5B5B92A387E32E1A2B4@IRSMSX106.ger.corp.intel.com>

2014-07-24 16:31, Buriez, Patrice:
> > Why not this simpler form?
> > $(shell lsb_release -si 2>/dev/null)
> 
> I didn't want "make" to stop on error or to display a warning if lsb_release is not available on other distributions.
> I must admit that I focused on identifying the exact 5-tuple UBUNTU_KERNEL_CODE that was triggering the compilation error.
> Then I tried to keep the Makefile as simple and readable as possible, and took no shortcut.
> If your simpler form works the same, then indeed it's nicer than mine. ;-)
> 
> > > +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(shell lsb_release -sr))
> > 
> > Or you can use | tr -d . instead of subst and keep the flow from left to right.
> 
> Agreed. I seldom use tr and didn't figure out that it would perfectly fit here. Thanks!
> 
> > > +UBUNTU_KERNEL_CODE := $(shell cut -d' ' -f2 /proc/version_signature |cut -d- -f1,2)
> >                                                                         ^
> >                                                          space missing here
> 
> I usually pipe into the next command with no space in between. So that's somewhat on purpose.
> Is your comment cosmetic or about readability?
> Or are there situations that would fail, unless the space is provided between the pipe and the command?

Yes, only cosmetic.

> > > +UBUNTU_KERNEL_CODE := $(subst -,$(comma),$(UBUNTU_KERNEL_CODE))
> > > +UBUNTU_KERNEL_CODE := $(subst .,$(comma),$(UBUNTU_KERNEL_CODE))
> > 
> > Would be simpler with | tr -d .-
> 
> Agreed again (with the $(comma) from your next email, and without the -d in order to actually translate, not delete. ;-)

Yes "tr .- $(comma)" :)

> Again, I mainly focused on extracting and transmitting the 5-tuple UBUNTU_KERNEL_CODE from shell to compiler.
> I agree this can be rewritten in nicer ways, but it works, and hopefully does not break compilation on other distributions.

Acked and applied with above modifications.

Thanks
-- 
Thomas

  parent reply	other threads:[~2014-08-01 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 14:28 Pablo de Lara
2014-07-24 14:54 ` Thomas Monjalon
2014-07-24 14:59   ` Thomas Monjalon
     [not found]   ` <8BBE948C60307D47AD16B5B5B92A387E32E1A2B4@IRSMSX106.ger.corp.intel.com>
2014-08-01 13:15     ` Thomas Monjalon [this message]
2014-07-24 15:20 ` Chris Wright
2014-07-24 15:25   ` Thomas Monjalon
2014-07-24 15:43     ` Chris Wright

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=2889487.riKpfTWg1F@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=patrice.buriez@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).