Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/ncurses: fix builds with both shared and static libs
@ 2014-12-21 20:28 Yann E. MORIN
  2014-12-21 21:02 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2014-12-21 20:28 UTC (permalink / raw)
  To: buildroot

When both shared and static libs are enabled, we have two shell
constructs to run, but they are not properly separated, leading to build
failures like:

    ln -sf libncursesw.a /home/idnc_sk/IOLINUX/builds/micro-x86_64-corei7/
    output/host/usr/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libcurse
    s.a for lib in libncurses libmenu libpanel libform; do ln -sf ${lib}w.
    so /home/idnc_sk/IOLINUX/builds/micro-x86_64-corei7/output/host/usr/x8
    6_64-buildroot-linux-uclibc/sysroot/usr/lib/${lib}.so; done
    /bin/bash: -c: line 0: syntax error near unexpected token `do'
    /bin/bash: -c: line 0: `ln -sf libncursesw.a /home/idnc_sk/IOLINUX/bui
    lds/micro-x86_64-corei7/output/host/usr/x86_64-buildroot-linux-uclibc/
    sysroot/usr/lib/libcurses.a for lib in libncurses libmenu libpanel lib
    form; do ln -sf ${lib}w.so /home/idnc_sk/IOLINUX/builds/micro-x86_64-c
    orei7/output/host/usr/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/${
    lib}.so; done'

As can be seen, there is a missing semi-colon ';' between the symlink
command and the for loop:

    ln -sf libncursesw.a [...]/libcurses.a for lib in [...]

Fix that by adding a semi-colon after each first shell constructs, to
properly separate the two. If the second one is not enabled (i.e. for a
static-only build), there is a trailing semi-colon, but that's perfectly
valid shell syntax.

Reported-by: idnc_sk on IRC
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/ncurses/ncurses.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 47378f7..5f9e4bd 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -86,10 +86,10 @@ define NCURSES_LINK_PC
 endef
 
 NCURSES_LINK_TARGET_LIBS = \
-	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(TARGET_DIR))) \
+	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(TARGET_DIR));) \
 	$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED,$(TARGET_DIR)))
 NCURSES_LINK_STAGING_LIBS = \
-	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(STAGING_DIR))) \
+	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(STAGING_DIR));) \
 	$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED,$(STAGING_DIR)))
 
 NCURSES_LINK_STAGING_PC = $(call NCURSES_LINK_PC,$(STAGING_DIR))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] package/ncurses: fix builds with both shared and static libs
  2014-12-21 20:28 [Buildroot] [PATCH] package/ncurses: fix builds with both shared and static libs Yann E. MORIN
@ 2014-12-21 21:02 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2014-12-21 21:02 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 21 Dec 2014 21:28:43 +0100, Yann E. MORIN wrote:
> When both shared and static libs are enabled, we have two shell
> constructs to run, but they are not properly separated, leading to build
> failures like:
> 
>     ln -sf libncursesw.a /home/idnc_sk/IOLINUX/builds/micro-x86_64-corei7/
>     output/host/usr/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libcurse
>     s.a for lib in libncurses libmenu libpanel libform; do ln -sf ${lib}w.
>     so /home/idnc_sk/IOLINUX/builds/micro-x86_64-corei7/output/host/usr/x8
>     6_64-buildroot-linux-uclibc/sysroot/usr/lib/${lib}.so; done
>     /bin/bash: -c: line 0: syntax error near unexpected token `do'
>     /bin/bash: -c: line 0: `ln -sf libncursesw.a /home/idnc_sk/IOLINUX/bui
>     lds/micro-x86_64-corei7/output/host/usr/x86_64-buildroot-linux-uclibc/
>     sysroot/usr/lib/libcurses.a for lib in libncurses libmenu libpanel lib
>     form; do ln -sf ${lib}w.so /home/idnc_sk/IOLINUX/builds/micro-x86_64-c
>     orei7/output/host/usr/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/${
>     lib}.so; done'
> 
> As can be seen, there is a missing semi-colon ';' between the symlink
> command and the for loop:
> 
>     ln -sf libncursesw.a [...]/libcurses.a for lib in [...]
> 
> Fix that by adding a semi-colon after each first shell constructs, to
> properly separate the two. If the second one is not enabled (i.e. for a
> static-only build), there is a trailing semi-colon, but that's perfectly
> valid shell syntax.
> 
> Reported-by: idnc_sk on IRC
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-21 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-21 20:28 [Buildroot] [PATCH] package/ncurses: fix builds with both shared and static libs Yann E. MORIN
2014-12-21 21:02 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox