nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Portability issues in nmh 1.5-RC2


From: David Levine
Subject: Re: [Nmh-workers] Portability issues in nmh 1.5-RC2
Date: Mon, 07 May 2012 17:02:15 -0400

Tom wrote:

> I've been trying to get 1.5-RC2 working on an ancient HPUX box, and I've
> run into a couple of portability issues that perhaps you'd be interested
> in taking back patches for.
> 
> The first problem I hit is that there are some places in the code relying
> on the C99-ism of declarations in the midst of a code block.  This is
> relatively painless to fix, and it will hit anyone else trying to use a
> strict-ANSI-C compiler, so please consider the attached patch for that.
> I'm not sure if nmh has any formal policy about what compilers are being
> targeted, but the code is otherwise C89 compatible, so I'm hoping this is
> just an oversight.  (BTW, I think you could check for this sort of issue
> with a modern gcc version, if you tried building with CFLAGS=-ansi.)

Looks like -ansi -pedantic is what we need.  I'll apply your patches
and add that after cleaning up the other things it complains about.

> Another problem I ran into is that the regression test scripts use some
> shell features that the bare-bones /bin/sh on this machine doesn't
> recognize.  My first hack at making that work was to edit all the
> "#! /bin/sh" lines in the test scripts, which was a real PITA.  After
> a bit of reflection I realized it could be solved much more simply,
> along the lines of
> 
> diff -c nmh-1.5-RC2.orig/Makefile.in nmh-1.5-RC2/Makefile.in
> *** nmh-1.5-RC2.orig/Makefile.in      Sun May  6 13:43:02 2012
> --- nmh-1.5-RC2/Makefile.in   Mon May  7 16:12:33 2012
> ***************
> *** 657,662 ****
> --- 657,663 ----
>                   address@hidden@/test/testdir \
>                   auxexecdir=3D$(auxexecdir) bindir=3D$(bindir) \
>                   mandir=3D$(mandir) sysconfdir=3D$(sysconfdir)
> + TESTS_SHELL =3D /bin/sh
>  =20
>   TESTS =3D test/bad-input/test-header \
>       test/burst/test-burst \
> ***************
> *** 3657,3663 ****
>           if test -f ./$$tst; then dir=3D./; \
>           elif test -f $$tst; then dir=3D; \
>           else dir=3D"$(srcdir)/"; fi; \
> !         if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
>             all=3D`expr $$all + 1`; \
>             case " $(XFAIL_TESTS) " in \
>             *$$ws$$tst$$ws*) \
> --- 3658,3664 ----
>           if test -f ./$$tst; then dir=3D./; \
>           elif test -f $$tst; then dir=3D; \
>           else dir=3D"$(srcdir)/"; fi; \
> !         if $(TESTS_ENVIRONMENT) $(TESTS_SHELL) $${dir}$$tst; then \
>             all=3D`expr $$all + 1`; \
>             case " $(XFAIL_TESTS) " in \
>             *$$ws$$tst$$ws*) \
> 
> which then means only one line has to be patched to point to a different
> shell.  I didn't find exactly where these lines are coming from in the
> pre-Makefile.in files, but please consider doing something like that.
> 
>                       regards, tom lane

I think just adding $(TESTS_SHELL) to the end of TEST_ENVIRONMENT
in Makefile.am will do the trick.  I would be interested to know
what shell incompatibilities you ran into so we could fix them.
I tested with heirloom-sh but that apparently wasn't good enough.

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]