Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 124559 - sys-libs/zlib fails with zlib-1.2.1-fPIC.patch - wrong syntax
Summary: sys-libs/zlib fails with zlib-1.2.1-fPIC.patch - wrong syntax
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All NetBSD
: High normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 12:28 UTC by Benigno B. Junior (RETIRED)
Modified: 2006-04-12 10:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benigno B. Junior (RETIRED) gentoo-dev 2006-03-01 12:28:02 UTC
According to the bug #61868, "zlib-1.2.1-fPIC.patch" is needed. But this patch causes the configure script to fail with sh. On NetBDS, sh is not a link to /bin/bash.

 * Applying zlib-1.2.1-fPIC.patch ...                                     [ ok ]
 * Applying zlib-1.2.3-bsd-soname.patch ...                               [ ok ]
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/zlib-1.2.3/work/zlib-1.2.3 ...
./configure: 85: Syntax error: ";;" unexpected (expecting "fi")

Do we still need this patch?
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-03-02 03:58:17 UTC
Okay seems like we ended up using (probably for my soname patch rather than for the -fPIC patch) bash syntax.

A sed -i -e 's:/bin/sh:/bin/bash:' ${S}/configure is probably the quickest way to fix that, as we already know the configure file won't be fixed easily by upstream.
Comment 2 SpanKY gentoo-dev 2006-03-02 06:43:39 UTC
no, i'm not about to change it to /bin/bash

figure out which patch is the problem so we can fix it

as for the fPIC patch, of course we still need it
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-03-02 06:57:47 UTC
Okay the problem seems to be with bsd-soname patch as I thought. THe problem is that the sh shell provided by NetBSD (and probably OpenBSD too) doesn't seem to understand correctly the globbed case, that instead is handled fine by FreeBSD's sh.

Why can't we just use bash as we do everywhere else? That way we're safe that it's bash running the script.
Comment 4 SpanKY gentoo-dev 2006-03-02 19:26:32 UTC
if your sh cant handle this:
case foo in Linux | linux | GNU | GNU/* | *BSD | DragonFly) ;; esac
but it can handle this:
case foo in Linux | linux | GNU | GNU/*) ;; esac

then it sucks, plain and simple

post a tweaked version of your patch if you like, but i dont see any merit in changing it to /bin/bash
Comment 5 Benigno B. Junior (RETIRED) gentoo-dev 2006-03-05 06:52:02 UTC
There's a big misunderstanding here. The problem is the patch "zlib-1.2.1-fPIC.patch". Because it includes the line:
SFLAGS="${CFLAGS-"-O3"} -fPIC"

Which has a syntax error for NetBSD sh (cuz of ""). This line works fine:
SFLAGS="${CFLAGS--O3} -fPIC"

This is the things I tested:
root@phanty ~ # sh
# CFLAGS="-mtune=i686 -O2 -pipe"
# SFLAGS="${CFLAGS-"-O3"} -fPIC"
> ^C
# SFLAGS="${CFLAGS--O3} -fPIC"
# echo $SFLAGS
-mtune=i686 -O2 -pipe -fPIC
# unset CFLAGS                
# SFLAGS="${CFLAGS--O3} -fPIC"
# echo $SFLAGS
-O3 -fPIC

I've been reading some manuals, and I could not find this "-" alone. It seems to miss the colon, so:
SFLAGS="${CFLAGS:--O3} -fPIC"

would be more appropriate, wouldn't it?


Could any of you change this, please?
Comment 6 SpanKY gentoo-dev 2006-03-05 08:17:25 UTC
fixed in cvs