Subject: Re: pkg/17776
To: Grant Beattie <grant@netbsd.org>
From: Julien T. Letessier <mezis@free.fr>
List: tech-pkg
Date: 07/08/2003 10:32:54
On Jun 24, 2003, at 22:09, grant beattie  was heard saying:

> Several tools bundled with Solaris (grep, sed) have a particular or limited
> set of options, whereas many makefiles/configure scripts/whatever rely on
> some options only found in the GNU equivalents.

(...)

> Julien, do you know which packages require GNU grep? I have a fix for this,
> but I don't know which packages are affected.

(...)

> whoops, this PR mail went to the old Sun address :-)

Never mind. And, I didn't encounter any problems with 'grep' since I use
XPG4's *grep -- I guess this PR can be closed (except if someone else has
encounterd some similar problem).

Other packages do have problems with, for instance, 'sed' or 'awk'.

More generally, many scripts (even autoconf'ed scripts) have hardcoded calls
to basic tools (eg 'sed' and 'awk') that can't be overriden by variables, for
instance. On SunOS, the tools in /usr/bin can't handle very long argument
lists, which renders them unusable in some cases --- the QT3 build process,
for instance, generates *huge* calls to 'awk'.

There are several solutions to this:

- the very ugly one: patch the scripts, replacing eg. 'sed' by '${SED}',
generating a huge amount of (unmaintainable) patch noise.

- the ugly one: prepend /usr/xpg4/bin to the PATH. It's ugly because the stuff
installed in /usr/pkg shouldn't be overriden by system stuff, and because it
hides functionnality and would make things hard to debug.

- the less ugly one (solarpack's choice): at pre-configure time, link the
proper tool (/usr/xpg4/bin/awk or /usr/pkg/bin/gawk, for instance) in
${BUILDLINK_DIR}/bin. This makes things more general (ie. can be applied to
various tools) and only requires patching the Makefiles; it could even be
centralized in some way

Examples:

parallel/pvm has hard-coded calls to 'make' but requires 'gmake'
functionnality...

+ pre-configure:
+       ${LN} -s ${GMAKE} ${BUILDLINK_DIR}/bin/make

x11/qt3-* call 'awk' with long lines that can't be handled by XPG4's 'awk'...

+ pre-configure:
+       ${LN} -s ${AWK} ${BUILDLINK_DIR}/bin/awk

What's your opinion about this?
If you think it's pretty enough, I've got a whole bunch of stuff to commit :)

Cheers,
-- 
Julien T. Letessier              aim:jletessier
Graduate ENSIMAG Student         http://www.mezis.net
CLIPS-IMAG DEA Intern            mailto:contact(at)mezis.net

()  ascii ribbon campaign - against html mail & vCards
/\                        - against microsoft attachments
                          - against webmail ads