NetBSD Problem Report #41130

From www@NetBSD.org  Fri Apr  3 16:20:06 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id AEA1D63B946
	for <gnats-bugs@gnats.netbsd.org>; Fri,  3 Apr 2009 16:20:06 +0000 (UTC)
Message-Id: <20090403162006.7869663B8C8@www.NetBSD.org>
Date: Fri,  3 Apr 2009 16:20:06 +0000 (UTC)
From: telarson@west.com
Reply-To: telarson@west.com
To: gnats-bugs@NetBSD.org
Subject: cleanup/portability patch for bootstrap script
X-Send-Pr-Version: www-1.0

>Number:         41130
>Category:       pkg
>Synopsis:       cleanup/portability patch for bootstrap script
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 03 16:25:00 +0000 2009
>Closed-Date:    
>Last-Modified:  Wed Feb 17 04:26:20 +0000 2010
>Originator:     Tim Larson
>Release:        n/a
>Organization:
>Environment:
n/a
>Description:
Alphabetize a big case statement for readability.

Minor additions to support A/UX.
>How-To-Repeat:

>Fix:
root@marcie 21# cvs diff bootstrap/bootstrap
Index: bootstrap/bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.141
diff -u -p -r1.141 bootstrap
--- bootstrap/bootstrap 5 Feb 2009 18:53:03 -0000       1.141
+++ bootstrap/bootstrap 3 Apr 2009 16:13:32 -0000
@@ -36,7 +36,7 @@
 #set -x

 # the following environment variables are honored:
-# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS
+# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS, LIBS
 # tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS


@@ -443,6 +443,26 @@ bmakexenv=
 bmakexargs=
 need_extras=no
 case "$opsys" in
+AIX)
+       root_group=system
+       need_bsd_install=yes
+       need_awk=yes
+       need_sed=yes
+       need_fixed_strip=yes
+       set_opsys=no
+       machine_arch=`get_machine_arch_aix`
+       ;;
+AUX)  # not customized much
+       echo "This platform ($opsys) is not well tested yet...good luck"
+       root_group=root
+       need_bsd_install=yes
+       need_awk=yes
+       need_sed=yes
+       need_mkdir=yes
+       set_opsys=no
+       CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -I/opt/include"
+       LIBS="$LIBS -lposix"
+       ;;
 Darwin)
        root_group=wheel
        need_bsd_install=no
@@ -499,6 +519,31 @@ HPUX)
        set_opsys=no
        machine_arch=`uname -m | sed 's/^9000.*$/hppa/'`
        ;;
+Interix)
+       is_root () {
+               if id -G | grep -q 131616; then
+                       return 1
+               fi
+               return 0
+       }
+       mkdir_p () {
+               mkdir -p "$@" # allows umask to take effect
+       }
+       default_install_mode=0775
+       root_user=`id -u`
+       root_group=131616
+       need_bsd_install=yes
+       need_awk=yes
+       need_sed=yes
+       set_opsys=no
+       need_xargs=yes
+       # only used for unprivileged builds
+       groupsprog="id -gn"
+       # for bootstrap only; pkgsrc uses CPPFLAGS
+       CC="gcc -D_ALL_SOURCE"; export CC
+       ac_cv_header_poll_h=no; export ac_cv_header_poll_h
+       ac_cv_func_poll=no; export ac_cv_func_poll
+       ;;
 IRIX*)
        if [ -d "/usr/freeware/bin" ]; then
                overpath="/usr/freeware/bin:$overpath"
@@ -550,6 +595,23 @@ OpenBSD)
        set_opsys=no
        machine_arch=`uname -m`
        ;;
+OSF1)
+       root_group=system
+       need_bsd_install=yes
+       need_awk=yes
+       need_sed=yes
+       need_ksh=yes
+       set_opsys=no
+       ;;
+QNX)
+       root_group=root
+       need_bsd_install=yes
+       set_opsys=no
+       groupsprog="id -gn"
+       whoamiprog="id -un"
+       fetch_cmd="/usr/bin/ftp"
+       machine_arch=`uname -p | sed -e 's/x86/i386/'`
+       ;;
 SunOS)
        if [ -d "/usr/xpg4/bin" ]; then
                overpath="/usr/xpg4/bin:$overpath"
@@ -565,40 +627,6 @@ SunOS)
        machine_arch=`uname -p | sed -e 's/i86pc/i386/'`
        check_compiler=yes
        ;;
-AIX)
-       root_group=system
-       need_bsd_install=yes
-       need_awk=yes
-       need_sed=yes
-       need_fixed_strip=yes
-       set_opsys=no
-       machine_arch=`get_machine_arch_aix`
-       ;;
-Interix)
-       is_root () {
-               if id -G | grep -q 131616; then
-                       return 1
-               fi
-               return 0
-       }
-       mkdir_p () {
-               mkdir -p "$@" # allows umask to take effect
-       }
-       default_install_mode=0775
-       root_user=`id -u`
-       root_group=131616
-       need_bsd_install=yes
-       need_awk=yes
-       need_sed=yes
-       set_opsys=no
-       need_xargs=yes
-       # only used for unprivileged builds
-       groupsprog="id -gn"
-       # for bootstrap only; pkgsrc uses CPPFLAGS
-       CC="gcc -D_ALL_SOURCE"; export CC
-       ac_cv_header_poll_h=no; export ac_cv_header_poll_h
-       ac_cv_func_poll=no; export ac_cv_func_poll
-       ;;
 UnixWare)
        root_group=sys
        need_bsd_install=no
@@ -610,23 +638,6 @@ UnixWare)
        set_opsys=no
        CC="gcc -DUNIXWARE"; export CC
        ;;
-OSF1)
-       root_group=system
-       need_bsd_install=yes
-       need_awk=yes
-       need_sed=yes
-       need_ksh=yes
-       set_opsys=no
-       ;;
-QNX)
-       root_group=root
-       need_bsd_install=yes
-       set_opsys=no
-       groupsprog="id -gn"
-       whoamiprog="id -un"
-       fetch_cmd="/usr/bin/ftp"
-       machine_arch=`uname -p | sed -e 's/x86/i386/'`
-       ;;
 *)
        echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc"
        root_group=wheel
@@ -696,7 +707,11 @@ check_prog lnprog ln
 check_prog lsprog ls
 check_prog rmdirprog rmdir
 check_prog sedprog sed
-check_prog shprog sh
+if [ ${opsys} = "AUX" ]; then
+       check_prog shprog ksh
+else
+       check_prog shprog sh
+fi
 check_prog whoamiprog whoami

 mkdir_p_early ${wrkdir}
@@ -731,6 +746,14 @@ fi

 mkdir_p_early ${wrkdir}/bin

+# /bin/sh in A/UX is really really bad - won't run this script
+# don't do this earlier, because A/UX mkdir will choke on the dir creation
+if [ ${opsys} = "AUX" -a ! -f ./AuxKsh ]; then
+       touch ./AuxKsh
+       echo_msg "restarting bootstrap under ksh"
+       exec /bin/ksh $0
+fi
+
 # build install-sh
 run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh"
 run_cmd "$chmodprog +x $wrkdir/bin/install-sh"
@@ -788,7 +811,7 @@ VARBASE=$varbase; export VARBASE

 # set up an example mk.conf file
 TARGET_MKCONF=${wrkdir}/mk.conf.example
-echo_msg "Creating default mk.conf. in ${wrkdir}"
+echo_msg "Creating default mk.conf in ${wrkdir}"
 echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF}
 echo "# `date`" >> ${TARGET_MKCONF}
 echo "" >> ${TARGET_MKCONF}
@@ -888,9 +911,12 @@ bootstrap_bmake
 bmake="$wrkdir/bin/bmake $make_quiet_flags"

 # build libnbcompat
+bootstrap_libnbcompat() {
 echo_msg "Building libnbcompat"
 copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat
 run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags)"
+}
+bootstrap_libnbcompat

 # bootstrap ksh if necessary
 case "$need_ksh" in
@@ -926,7 +952,7 @@ esac
 case "$need_sed" in
 yes)   echo_msg "Bootstrapping sed"
        copy_src $pkgsrcdir/textproc/nbsed/files sed
-       run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='-lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)"
+       run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)"
        run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
        echo "TOOLS_PLATFORM.sed?=              $prefix/bin/nbsed" >> ${TARGET_MKCONF}
        echo "TOOLS_PLATFORM.sed?=              $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
@@ -939,7 +965,7 @@ copy_src $pkgsrcdir/pkgtools/pkg_install
 run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \
 CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \
 LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
-LIBS='-lnbcompat' $shprog ./configure $configure_quiet_flags -C \
+LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
 --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
 --with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)"
 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
@@ -1085,6 +1111,10 @@ echo ""
 [ ! -z "${binary_gzip_kit}" ] && mkbinarykit_tgz
 [ ! -z "${binary_macpkg}" ] && mkbinarykit_macpkg

+if [ ${opsys} = "AUX" -a -f ./AuxKsh ]; then
+       rm ./AuxKsh
+fi
+
 echo_msg "bootstrap started: $build_start"
 echo_msg "bootstrap ended:   `date`"

>Release-Note:

>Audit-Trail:
From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41130 CVS commit: pkgsrc/bootstrap
Date: Sat, 6 Feb 2010 04:30:52 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sat Feb  6 04:30:52 UTC 2010

 Modified Files:
 	pkgsrc/bootstrap: bootstrap

 Log Message:
 Sort $opsys case alphabetically.
 part of PR#41130.


 To generate a diff of this commit:
 cvs rdiff -u -r1.152 -r1.153 pkgsrc/bootstrap/bootstrap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41130 CVS commit: pkgsrc/bootstrap
Date: Sat, 6 Feb 2010 05:51:51 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sat Feb  6 05:51:51 UTC 2010

 Modified Files:
 	pkgsrc/bootstrap: bootstrap

 Log Message:
 Honor LIBS environment variable, part of PR#41130.


 To generate a diff of this commit:
 cvs rdiff -u -r1.153 -r1.154 pkgsrc/bootstrap/bootstrap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41130 CVS commit: pkgsrc/bootstrap
Date: Sat, 6 Feb 2010 05:54:18 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sat Feb  6 05:54:18 UTC 2010

 Modified Files:
 	pkgsrc/bootstrap: bootstrap

 Log Message:
 remove redundant period in message, part of PR#41130.


 To generate a diff of this commit:
 cvs rdiff -u -r1.154 -r1.155 pkgsrc/bootstrap/bootstrap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 15 Feb 2010 21:55:31 +0000
State-Changed-Why:
Is this fully committed?


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/41130 (cleanup/portability patch for bootstrap script)
Date: Tue, 16 Feb 2010 10:04:21 +0900

 On Tue, 16 Feb 2010 06:55:33 +0900, <dholland@netbsd.org> wrote:

 > Synopsis: cleanup/portability patch for bootstrap script
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Mon, 15 Feb 2010 21:55:31 +0000
 > State-Changed-Why:
 > Is this fully committed?

 A/UX related parts are not commited yet.

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 17 Feb 2010 04:26:20 +0000
State-Changed-Why:
thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.