Subject: mail/nmh build fails on netbsd-1-6 due to busted configure POSIX_SIGNALS checks
To: None <tech-pkg@NetBSD.org>
From: Greg A. Woods <woods@planix.com>
List: tech-pkg
Date: 05/04/2006 16:59:07
--pgp-sign-Multipart_Thu_May__4_16:59:05_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

I've encountered problems building this newer PKGREVISION of mail/nmh on
my netbsd-1-6 alpha.

    $ uname -smr 
    NetBSD 1.6.2_STABLE alpha

The previous revision (nmh-1.0.4nb5) worked just fine, but this one
blows up real good in the compile.


===> Building for nmh-1.0.4nb6
CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
creating Makefile
for subdir in h config sbr zotnet mts uip etc man; do  (cd $subdir && /usr/bin/make CC='cc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H'  CFLAGS='-O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe' LDFLAGS='-static -Wl,-R/usr/pkg/lib' LIBS=''  prefix='/usr/pkg' exec_prefix='/usr/pkg' bindir='/usr/pkg/bin'  etcdir='/etc/nmh' libdir='/usr/pkg/libexec/nmh' mandir='/usr/pkg/man'  mailspool='/var/mail' sendmailpath='/usr/sbin/sendmail'  default_editor='vi' default_pager='less' all) || exit 1;  done
cc -c -DHAVE_CONFIG_H -DNMHBINDIR='"/usr/pkg/bin"' -DNMHETCDIR='"/etc/nmh"' -DNMHLIBDIR='"/usr/pkg/libexec/nmh"'  -DDEFAULT_EDITOR='"vi"' -DDEFAULT_PAGER='"less"' -I.. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe config.c
./version.sh 1.0.4 > version.c
cc -c -DHAVE_CONFIG_H -I.. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe version.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe add.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe addrsbr.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe ambigsw.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe atooi.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe brkstring.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe check_charset.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe closefds.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe concat.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_del.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_find.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_foil.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_read.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_replace.c
cc -c -DHAVE_CONFIG_H -I.. -I. -I.. -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe context_save.c
In file included from context_save.c:9:
../h/signals.h:22: warning: `sigemptyset' redefined
/usr/include/signal.h:136: warning: this is the location of the previous definition
../h/signals.h:23: warning: `sigfillset' redefined
/usr/include/signal.h:137: warning: this is the location of the previous definition
context_save.c: In function `context_save':
context_save.c:33: incompatible types in assignment
context_save.c:34: invalid operands to binary |
context_save.c:35: invalid operands to binary |
context_save.c:36: invalid operands to binary |
context_save.c:37: invalid operands to binary |
*** Error code 1


It appears as though POSIX_SIGNALS should be defined, but isn't.  This
seems to be due to the configure checks for the likes of sigaction,
sigprocmask, sighold, sigrelse, et al are not including <signal.h>.


configure:2714: checking for sigaction
configure:2742: cc -o conftest -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe  -static -Wl,-R/usr/pkg/lib conftest.
c  1>&5
/var/tmp/ccEFHJs4.o: In function `main':
/build/package-obj/mail/nmh/work/nmh-1.0.4/configure:2736: warning: warning: reference to compatibility sigaction(); 
include <signal.h> for correct reference
ld: `.gnu.warning.sigaction' referenced in section `.text' of /usr/lib/libc.a(sigaction.o): defined in discarded sect
ion `.gnu.warning.sigaction' of /usr/lib/libc.a(sigaction.o)

ld: BFD 2.16.1 internal error, aborting at elf64-alpha.c line 4888 in elf64_alpha_relocate_section

ld: Please report this bug.

configure: failed program was:
#line 2719 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char sigaction(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sigaction();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_sigaction) || defined (__stub___sigaction)
choke me
#else
sigaction();
#endif

; return 0; }


Does anyone have any hints/suggestions (besides maybe netbsd-specific
patching of configure or tricking it with the appropriate environment
settings)?  I wonder if moving the signal.h check up to before the
sig*() checks would suffice.

-- 
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Thu_May__4_16:59:05_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: FZuwk2n1epKMxuEmKiyb9Fzs0VF4Iyet

iQA/AwUBRFprGmZ9cbd4v/R/EQKlzgCeJU2h3SQa0hf+DqCcljtjZaFcpkAAoMlF
s32JUwTfAnt5I7P3E2dMRXrs
=6PSh
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Thu_May__4_16:59:05_2006-1--