Subject: pkg/34940: update bmake to better build on HP-UX
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <eric@cirr.com>
List: pkgsrc-bugs
Date: 10/29/2006 22:10:01
>Number:         34940
>Category:       pkg
>Synopsis:       Minor updates to the bmake better build on HP-UX
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 29 22:10:01 +0000 2006
>Originator:     Eric Schnoebelen
>Release:        HP-UX B.11.11
>Organization:
Eric Schnoebelen		eric@cirr.com		http://www.cirr.com
  "The nice thing about Windows is - It does not just crash, it 
   displays a dialog box and lets you press 'OK' first." - Arno Schaefer
>Environment:
HP-UX peake B.11.11 A 9000/785 2006709503 two-user license
  B3899BA	B.11.11.06	HP C/ANSI C Developer's Bundle for HP-UX 11.i (S700) 
  B3911DB	C.03.37.01	HP aC++ Compiler (S700) 
  FEATURE11-11	B.11.11.0209.5	Feature Enablement Patches for HP-UX 11i, Sept 2002 
  HPUX11i-TCOE	B.11.11.0306	HP-UX Technical Computing OE Component 
  HPUXBase64	B.11.11		HP-UX 64-bit Base OS 
  HPUXBaseAux	B.11.11.0312	HP-UX Base OS Auxiliary 
  HWEnable11i	B.11.11.0312.4	Hardware Enablement Patches for HP-UX 11i v1, December 2003 

[ok, the above is only really useful/interesting to an HP-UX weenie, or
the HP WTEC.]

>Description:
	Attempting to build pkgsrc/devel/bmake (as part of bootstrap)
fails.  The primary cause is that bmake tries to build it's own version
of sigsetmask, and has the prototype wrong.
>How-To-Repeat:
	[log into an HP-UX system; extract pkgsrc]
	cd pkgsrc/bootstrap; sudo ./bootstrap
>Fix:
The following is a belt and suspenders type fix.  The macros that
devel/bmake/files/sigcompat.c are updated to reflect "modern" HP ANSI C
usage (namely "__hpux" instead of "__hpux__").  Further more,
configure/configure.in/config.h.in are update to actually check for and
define HAVE_SIGSETMASK, since sigcompat.c is coded to make use of that
CPP macro.

Oh, and there's a small change to machine.sh to have the HP-UX output
return the (presumably) desired hp-ux11 output, rather than hp-uxb,
which is rather meaningless.

Diffs:
Index: files/config.h.in
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/config.h.in,v
retrieving revision 1.1
diff -b -u -w -r1.1 config.h.in
--- files/config.h.in	31 Oct 2005 21:34:24 -0000	1.1
+++ files/config.h.in	29 Oct 2006 22:00:14 -0000
@@ -71,6 +71,9 @@
 /* Define to 1 if you have the `sigaction' function. */
 #undef HAVE_SIGACTION
 
+/* Define to 1 if you have the `sigsetmask' function. */
+#undef HAVE_SIGSETMASK
+
 /* Define to 1 if you have the `sigvec' function. */
 #undef HAVE_SIGVEC
 
Index: files/configure
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/configure,v
retrieving revision 1.3
diff -b -u -w -r1.3 configure
--- files/configure	1 Mar 2006 16:54:46 -0000	1.3
+++ files/configure	29 Oct 2006 22:00:14 -0000
@@ -5818,6 +5818,7 @@
 	select \
 	setenv \
 	sigaction \
+	sigsetmask \
 	sigvec \
 	snprintf \
 	strdup \
Index: files/configure.in
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/configure.in,v
retrieving revision 1.2
diff -b -u -w -r1.2 configure.in
--- files/configure.in	10 Nov 2005 00:09:34 -0000	1.2
+++ files/configure.in	29 Oct 2006 22:00:14 -0000
@@ -106,6 +106,7 @@
 	select \
 	setenv \
 	sigaction \
+	sigsetmask \
 	sigvec \
 	snprintf \
 	strdup \
Index: files/machine.sh
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/machine.sh,v
retrieving revision 1.1
diff -b -u -w -r1.1 machine.sh
--- files/machine.sh	31 Oct 2005 21:34:24 -0000	1.1
+++ files/machine.sh	29 Oct 2006 22:00:14 -0000
@@ -61,6 +61,7 @@
 	;;
 HP-UX)
 	MACHINE_ARCH=`IFS="/-."; set $machine; echo $1`
+	OSMAJOR=`IFS=.; set $OSREL; echo $2`
 	;;
 Interix)
 	MACHINE=i386
Index: files/sigcompat.c
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/sigcompat.c,v
retrieving revision 1.1
diff -b -u -w -r1.1 sigcompat.c
--- files/sigcompat.c	31 Oct 2005 21:34:25 -0000	1.1
+++ files/sigcompat.c	29 Oct 2006 22:00:14 -0000
@@ -126,7 +126,7 @@
 #endif
 
 #ifndef MASK_T
-# ifdef __hpux__
+# if defined(__hpux__) || defined(__hpux)
 #   define MASK_T long
 # else
 #   define MASK_T int