Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] mtd: add missing -lintl from util-linux when building statically
Date: Thu, 10 Sep 2015 23:26:26 +0300	[thread overview]
Message-ID: <20150910202626.GA1822@tarshish> (raw)
In-Reply-To: <55F190CE.9000501@imgtec.com>

Hi Vincent,

On Thu, Sep 10, 2015 at 03:16:46PM +0100, Vicente Olivert Riera wrote:
> On 09/10/2015 03:06 PM, Baruch Siach wrote:
> > On Thu, Sep 10, 2015 at 03:00:08PM +0100, Vicente Olivert Riera wrote:
> >> On 09/10/2015 02:45 PM, Baruch Siach wrote:
> >>> On Thu, Sep 10, 2015 at 11:44:50AM +0100, Vicente Olivert Riera wrote:
> >>>> mtd depends on util-linux when BR2_PACKAGE_MTD_MKFSUBIFS is selected.
> >>>> Also, util-linux depends on gettext and will need to link with -lintl if
> >>>> BR2_NEEDS_GETTEXT_IF_LOCALE is selected. So, when mtd tries to link with
> >>>> util-linux's uuid (-luuid) it should add -lintl as well, but it fails
> >>>> when building statically. The uuid.pc file lists -lintl as one of the
> >>>> needed libraries, but since mtd package doesn't have a configure phase
> >>>> we can't do the following:
> >>>>
> >>>> MTD_DEPENDENCIES += host-pkgconf
> >>>> MTD_CONF_ENV += LIBS=`$(PKG_CONFIG_HOST_BINARY) --libs uuid"`
> >>>
> >>> So why not something like:
> >>>
> >>> MTD_MKFS_UBIFS_LIBS = `$(PKG_CONFIG_HOST_BINARY) --libs uuid"`
> >>>
> >>> and use $(MTD_MKFS_UBIFS_LIBS) instead of hard coding -lintl in the sed 
> >>> expression.
> >>
> >> do you mean like this?:
> >>
> >> $(SED) '/^LDLIBS_mkfs\.ubifs/ s/$$/$$(MTD_MKFS_UBIFS_LIBS)/' $(@D)/Makefile
> >>
> >> That will end up with the string "$(MTD_MKFS_UBIFS_LIBS)" written in the
> >> Makefile.
> > 
> > What happens when you put a single $ in $(MTD_MKFS_UBIFS_LIBS)?
> 
> It fails with an error like this one:
> 
> >>> mtd 1.5.2 Building
> /bin/sed -i -e '/^LDLIBS_mkfs\.ubifs/ s/$/
> "`/br/output/host/usr/bin/pkg-config --libs uuid`"/'
> /br/output/build/mtd-1.5.2/Makefile
> /bin/sed: -e expression #1, char 31: unknown option to `s'
> make: *** [/br/output/build/mtd-1.5.2/.stamp_built] Error 1

The problem is that you need to use $(shell ...) when you want make to do 
command substitution. Also, since the output of pkg-config might include a 
library path with the '/' directory separator, you need to use a different 
character to delimit the sed 's' command. Please see 
http://patchwork.ozlabs.org/patch/516419/ for my suggested solution.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

      reply	other threads:[~2015-09-10 20:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 10:44 [Buildroot] [PATCH] mtd: add missing -lintl from util-linux when building statically Vicente Olivert Riera
2015-09-10 13:45 ` Baruch Siach
2015-09-10 14:00   ` Vicente Olivert Riera
2015-09-10 14:06     ` Baruch Siach
2015-09-10 14:16       ` Vicente Olivert Riera
2015-09-10 20:26         ` Baruch Siach [this message]

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=20150910202626.GA1822@tarshish \
    --to=baruch@tkos.co.il \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox