Subject: pkg/23683: bootstrap-pkgsrc -> hp-ux
To: None <gnats-bugs@gnats.netbsd.org>
From: None <eric@cirr.com>
List: netbsd-bugs
Date: 12/06/2003 23:08:45
>Number:         23683
>Category:       pkg
>Synopsis:       bootstrap-pkgsrc can now work on hpux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 07 05:10:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Eric Schnoebelen
>Release:        HP-UX B.11.11
>Organization:
Central Iowa (Model) Railroad, Plano, TX US
>Environment:
HP-UX peake B.11.11 U 9000/782 2005225191 unlimited-user license
>Description:
	bootstrap-pkgsrc doesn't work on HP-UX
>How-To-Repeat:
	???
>Fix:
	The following patches allow bootstrap pkgsrc to successfully
build and install on HP-UX 11.11 (and probably 11.0)

	One question: Why did configure in libnbcompat want QUAD support
to depend upon having both long long and an 8 octet off_t?  That
requirement keeps 32 bit HPUX from building strtoll() when it otherwise
has the needed features.

Index: bootstrap
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bootstrap,v
retrieving revision 1.79
diff -b -u -w -r1.79 bootstrap
--- bootstrap	18 Oct 2003 09:56:06 -0000	1.79
+++ bootstrap	6 Dec 2003 06:33:38 -0000
@@ -233,6 +233,15 @@
 	set_opsys=no
 	whoamiprog=/usr/ucb/whoami
 	;;
+HP-UX)
+	root_group=root
+	need_pax=yes
+	need_mtree=yes
+	need_bsd_install=yes
+	need_sed=yes
+	set_opsys=no
+	;;
+
 *)
 	echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc"
 	root_group=wheel
Index: bmake/configure
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/configure,v
retrieving revision 1.2
diff -b -u -w -r1.2 configure
--- bmake/configure	20 Feb 2003 18:25:20 -0000	1.2
+++ bmake/configure	6 Dec 2003 06:33:45 -0000
@@ -2536,7 +2536,7 @@
   case "${withval}" in
 yes)   { echo "configure: error: bad value ${withval} given for bmake _PATH_DEFSYSPATH" 1>&2; exit 1; } ;;
 no)    ;;
-*)     CPPFLAGS="$CPPFLAGS \"-D_PATH_DEFSYSPATH=\\\"$with_default_sys_path\\\"\"" ;;
+*)     CPPFLAGS="$CPPFLAGS -D_PATH_DEFSYSPATH=\\\"$with_default_sys_path\\\"" ;;
 esac
 fi
 
@@ -2546,7 +2546,7 @@
   case "${withval}" in
 yes)   { echo "configure: error: bad value ${withval} given for bmake _PATH_PREFIX_SYSPATH" 1>&2; exit 1; } ;;
 no)    ;;
-*)     CPPFLAGS="$CPPFLAGS \"-D_PATH_PREFIX_SYSPATH=\\\"$with_prefix_sys_path\\\"\"" ;;
+*)     CPPFLAGS="$CPPFLAGS -D_PATH_PREFIX_SYSPATH=\\\"$with_prefix_sys_path\\\"" ;;
 esac
 fi
 
Index: bmake/configure.in
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/configure.in,v
retrieving revision 1.2
diff -b -u -w -r1.2 configure.in
--- bmake/configure.in	20 Feb 2003 18:25:20 -0000	1.2
+++ bmake/configure.in	6 Dec 2003 06:33:45 -0000
@@ -142,7 +142,7 @@
 [case "${withval}" in
 yes)   AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_DEFSYSPATH) ;;
 no)    ;;
-*)     CPPFLAGS="$CPPFLAGS \"-D_PATH_DEFSYSPATH=\\\"$with_default_sys_path\\\"\"" ;;
+*)     CPPFLAGS="$CPPFLAGS -D_PATH_DEFSYSPATH=\\\"$with_default_sys_path\\\"" ;;
 esac])
 dnl
 dnl Or just to prefix it 
@@ -152,7 +152,7 @@
 [case "${withval}" in
 yes)   AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_PREFIX_SYSPATH) ;;
 no)    ;;
-*)     CPPFLAGS="$CPPFLAGS \"-D_PATH_PREFIX_SYSPATH=\\\"$with_prefix_sys_path\\\"\"" ;;
+*)     CPPFLAGS="$CPPFLAGS -D_PATH_PREFIX_SYSPATH=\\\"$with_prefix_sys_path\\\"" ;;
 esac])
 dnl
 dnl Some folk don't like this one
Index: bmake/makefile.boot.in
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/makefile.boot.in,v
retrieving revision 1.4
diff -b -u -w -r1.4 makefile.boot.in
--- bmake/makefile.boot.in	3 Dec 2002 04:06:05 -0000	1.4
+++ bmake/makefile.boot.in	6 Dec 2003 06:33:45 -0000
@@ -14,7 +14,7 @@
 MK=${prefix}/share/mk
 MKSRC=${srcdir}/mk
 
-CFLAGS=-I. -I$(srcdir) @DEFS@ @CPPFLAGS@ -DMAKE_BOOTSTRAP ${XDEFS}
+CFLAGS=-I. -I$(srcdir) @DEFS@ @CPPFLAGS@ -DMAKE_BOOTSTRAP ${XDEFS} @CFLAGS@
 MDEFS="-D@force_machine@MACHINE=\"@machine@\"" "-DMACHINE_ARCH=\"@machine_arch@\""
 
 OBJ=arch.o buf.o compat.o cond.o dir.o for.o hash.o job.o main.o make.o \
@@ -31,7 +31,9 @@
 	rm -f *.[ado] */*.[ado] 
 
 bootstrap:	bmake.boot
-	CC="$(CC)" MAKESYSPATH=${MK} ./bmake.boot -f Makefile 
+	CC="$(CC)" CFLAGS="$(CFLAGS)" MAKESYSPATH=${MK} \
+		./bmake.boot -f Makefile bmake
+
 install:	install-bin install-man install-mk
 
 install-bin:
Index: bmake/sigcompat.c
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/sigcompat.c,v
retrieving revision 1.1.1.1
diff -b -u -w -r1.1.1.1 sigcompat.c
--- bmake/sigcompat.c	19 Sep 2002 10:40:11 -0000	1.1.1.1
+++ bmake/sigcompat.c	6 Dec 2003 06:33:46 -0000
@@ -125,14 +125,14 @@
 #endif
 
 #ifndef MASK_T
-# ifdef __hpux__
+# if defined(__hpux__) || defined(_HPUX_SOURCE)
 #   define MASK_T long
 # else
 #   define MASK_T int
 # endif
 #endif
-/* I just hate HPsUX */
-#if defined(__HPUX_VERSION) && __HPUX_VERSION > 9
+/* the bloody documentation doesn't match the implementation on HP-UX */
+#if defined(_HPUX_SOURCE)
 # define  PAUSE_MASK_T int
 #else
 # define PAUSE_MASK_T MASK_T
Index: bmake/util.c
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/util.c,v
retrieving revision 1.1.1.1
diff -b -u -w -r1.1.1.1 util.c
--- bmake/util.c	19 Sep 2002 10:40:13 -0000	1.1.1.1
+++ bmake/util.c	6 Dec 2003 06:33:47 -0000
@@ -105,7 +105,7 @@
 }
 #endif
 
-#ifdef __hpux
+#if defined(__hpux) && !defined(_HPUX_SOURCE)
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/syscall.h>
@@ -167,7 +167,7 @@
 {
    return setresgid(egid, rgid, -1);
 }
-#endif /* __hpux */
+#endif /* __hpux && !_HPUX_SOURCE */
 
 #if defined(__hpux__) || defined(__hpux)
 
@@ -224,7 +224,7 @@
 };
 #endif /* __hpux__ || __hpux */
 
-#ifdef __hpux
+#if defined(__hpux) && !defined(_HPUX_SOURCE)
 
 int
 utimes(file, tvp)
@@ -347,7 +347,7 @@
     }
 } /* end getwd */
 
-#endif /* __hpux */
+#endif /* __hpux && !defined(_HPUX_SOURCE) */
 
 #if !defined(HAVE_GETCWD)
 char *
Index: libnbcompat/Makefile.in
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/libnbcompat/Makefile.in,v
retrieving revision 1.1.1.2
diff -b -u -w -r1.1.1.2 Makefile.in
--- libnbcompat/Makefile.in	15 Sep 2003 04:15:14 -0000	1.1.1.2
+++ libnbcompat/Makefile.in	6 Dec 2003 06:33:48 -0000
@@ -81,7 +81,7 @@
 	done
 
 clean:
-	rm -f *.a *.o bits nbcompat/nbtypes.h nbcompat/nbcompat.h
+	rm -f *.a *.o bits nbcompat/nbtypes.h nbcompat/nbconfig.h
 
 distclean: clean
 	rm -f Makefile config.log config.status configure.lineno
#
#	Question: why was the quad support dependent upon 8 octet off_t's?
#
Index: libnbcompat/configure
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/libnbcompat/configure,v
retrieving revision 1.1.1.2
diff -b -u -w -r1.1.1.2 configure
--- libnbcompat/configure	16 Sep 2003 16:58:09 -0000	1.1.1.2
+++ libnbcompat/configure	6 Dec 2003 06:34:07 -0000
@@ -7990,7 +7990,7 @@
 	LIBOBJS="$LIBOBJS statfs.$ac_objext"
 fi
 
-if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
+if test $ac_cv_type_long_long = yes ; then
 
 
 	echo "$as_me:$LINENO: checking *printf() support for %lld" >&5
Index: libnbcompat/configure.ac
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/libnbcompat/configure.ac,v
retrieving revision 1.1.1.2
diff -b -u -w -r1.1.1.2 configure.ac
--- libnbcompat/configure.ac	16 Sep 2003 16:58:09 -0000	1.1.1.2
+++ libnbcompat/configure.ac	6 Dec 2003 06:34:07 -0000
@@ -210,7 +210,7 @@
 	AC_LIBOBJ(statfs)
 fi
 
-if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
+if test $ac_cv_type_long_long = yes ; then
 
 dnl		We assume that if sprintf() supports %lld or %qd,
 dnl		then all of *printf() does. If not, disable long long
Index: libnbcompat/nbcompat.h
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/libnbcompat/nbcompat.h,v
retrieving revision 1.1.1.5
diff -b -u -w -r1.1.1.5 nbcompat.h
--- libnbcompat/nbcompat.h	18 Oct 2003 09:27:40 -0000	1.1.1.5
+++ libnbcompat/nbcompat.h	6 Dec 2003 06:34:08 -0000
@@ -471,10 +471,10 @@
 # if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
 long long strtoll(const char *, char **, int);
 #  if ! defined(QUAD_MIN)
-#   define QUAD_MIN	(-0x7fffffffffffffffL-1)
+#   define QUAD_MIN	(-0x7fffffffffffffffLL-1)
 #  endif
 #  if ! defined(QUAD_MAX)
-#   define QUAD_MAX	(0x7fffffffffffffffL)
+#   define QUAD_MAX	(0x7fffffffffffffffLL)
 #  endif
 # endif
 #else	/* ! HAVE_QUAD_SUPPORT */
>Release-Note:
>Audit-Trail:
>Unformatted: