diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-09-01 12:29:58 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-09-01 12:29:58 +0000 |
commit | 4e95e9543e620948c2323fbcf01f5ffb79cc805e (patch) | |
tree | 42a76bc9dcde112e3e2bdf7b11129cee543ebff7 /bootstrap | |
parent | 068f1e547afa22d1bbc988d832dbcca45abcd308 (diff) | |
download | pkgsrc-4e95e9543e620948c2323fbcf01f5ffb79cc805e.tar.gz |
Add support for --make-jobs, which passes down -j or MAKE_JOBS as
appropriate. The default continues to be 1.
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap/bootstrap | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index 2d24923b173..fa64ca4dadc 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: bootstrap,v 1.212 2014/08/14 00:21:24 cheusov Exp $ +# $NetBSD: bootstrap,v 1.213 2014/09/01 12:29:58 jperkin Exp $ # # Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org> # All rights reserved. @@ -61,6 +61,7 @@ usage="Usage: $0 "' [ --full ] [ --gzip-binary-kit <tarball> ] [ --help ] + [ --make-jobs <num> ] [ --mk-fragment <mk.conf> ] [ --pkgdbdir <pkgdbdir> ] [ --pkginfodir <pkginfodir> ] @@ -388,6 +389,7 @@ pkgmandir= sysconfdir= varbase= +make_jobs=1 full=no compiler="" quiet=no @@ -435,6 +437,8 @@ while [ $# -gt 0 ]; do binary_macpkg=`get_optarg "$1"` ;; --binary-macpkg) binary_macpkg="$2"; shift ;; + --make-jobs=*) make_jobs=`get_optarg "$1"` ;; + --make-jobs) make_jobs="$2"; shift ;; --full) full=yes ;; --quiet) quiet=yes ;; --help) echo "$usage"; exit ;; @@ -843,6 +847,11 @@ no) make_quiet_flags="" esac +test ${make_jobs} -gt 0 2>/dev/null +if [ $? -ne 0 ]; then + die "ERROR: --make-jobs must be a positive integer argument" +fi + # export OPSYS and MACHINE_ARCH for pkg_install. we only set # MACHINE_ARCH on platforms where we override bmake's value. OPSYS=${opsys} @@ -1089,14 +1098,14 @@ bmake="$wrkdir/bin/bmake $make_quiet_flags" # build 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 --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags)" +run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake -j$make_jobs)" # bootstrap ksh if necessary case "$need_ksh" in yes) echo_msg "Bootstrapping ksh" copy_src $pkgsrcdir/shells/pdksh/files ksh test -n "$CC" || CC=gcc # default to gcc if no compiler is specified - run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake)" + run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake -j$make_jobs)" run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} @@ -1114,7 +1123,7 @@ case "$need_awk" in yes) echo_msg "Bootstrapping awk" copy_src $pkgsrcdir/lang/nawk/files awk test -n "$CC" || CC=gcc # default to gcc if no compiler is specified - run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" + run_cmd "(cd $wrkdir/awk && $bmake -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} @@ -1125,7 +1134,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='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --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 --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake -j$make_jobs)" 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} @@ -1140,7 +1149,7 @@ CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \ LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \ LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ ---with-pkgdbdir=$pkgdbdir --infodir=$infodir --mandir=$mandir $pkg_install_args && $bmake)" +--with-pkgdbdir=$pkgdbdir --infodir=$infodir --mandir=$mandir $pkg_install_args && $bmake -j$make_jobs)" run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" @@ -1217,7 +1226,7 @@ echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} # build and register packages # usage: build_package <packagedirectory> [additional arguments] build_package() { - run_cmd "(cd $pkgsrcdir/$1 && $bmake USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)" + run_cmd "(cd $pkgsrcdir/$1 && $bmake MAKE_JOBS=${make_jobs} USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)" } # |