Mon Aug 30 06:21:50 2010 UTC ()
Set WRKOBJDIR=${workdir}/pkgsrc to target mk.conf if --workdir is specified.


(obache)
diff -r1.158 -r1.159 pkgsrc/bootstrap/bootstrap

cvs diff -r1.158 -r1.159 pkgsrc/bootstrap/bootstrap (expand / switch to unified diff)

--- pkgsrc/bootstrap/bootstrap 2010/08/13 18:57:36 1.158
+++ pkgsrc/bootstrap/bootstrap 2010/08/30 06:21:49 1.159
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#! /bin/sh 1#! /bin/sh
2 2
3# $NetBSD: bootstrap,v 1.158 2010/08/13 18:57:36 joerg Exp $ 3# $NetBSD: bootstrap,v 1.159 2010/08/30 06:21:49 obache Exp $
4# 4#
5# 5#
6# Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved. 6# Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved.
7# 7#
8# Redistribution and use in source and binary forms, with or without 8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions 9# modification, are permitted provided that the following conditions
10# are met: 10# are met:
11# 1. Redistributions of source code must retain the above copyright 11# 1. Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer. 12# notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright 13# 2. Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the 14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution. 15# documentation and/or other materials provided with the distribution.
16# 3. All advertising materials mentioning features or use of this software 16# 3. All advertising materials mentioning features or use of this software
@@ -352,36 +352,37 @@ if [ -n "$PKG_PATH" ]; then @@ -352,36 +352,37 @@ if [ -n "$PKG_PATH" ]; then
352fi 352fi
353 353
354build_start=`date` 354build_start=`date`
355echo_msg "bootstrap command: $0 $@" 355echo_msg "bootstrap command: $0 $@"
356echo_msg "bootstrap started: $build_start" 356echo_msg "bootstrap started: $build_start"
357 357
358# ensure system locations are empty; we will set them later when we know 358# ensure system locations are empty; we will set them later when we know
359# whether they will be system wide or user specific 359# whether they will be system wide or user specific
360prefix= 360prefix=
361pkgdbdir= 361pkgdbdir=
362pkgmandir= 362pkgmandir=
363sysconfdir= 363sysconfdir=
364varbase= 364varbase=
 365workdir=
365 366
366full=no 367full=no
367compiler="" 368compiler=""
368quiet=no 369quiet=no
369mk_fragment= 370mk_fragment=
370 371
371while [ $# -gt 0 ]; do 372while [ $# -gt 0 ]; do
372 case $1 in 373 case $1 in
373 --workdir=*) wrkdir=`get_optarg "$1"` ;; 374 --workdir=*) wrkdir=`get_optarg "$1"`; workdir=${wrkdir} ;;
374 --workdir) wrkdir="$2"; shift ;; 375 --workdir) wrkdir="$2"; shift; workdir=${wrkdir} ;;
375 --prefix=*) prefix=`get_optarg "$1"` ;; 376 --prefix=*) prefix=`get_optarg "$1"` ;;
376 --prefix) prefix="$2"; shift ;; 377 --prefix) prefix="$2"; shift ;;
377 --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;; 378 --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;;
378 --pkgdbdir) pkgdbdir="$2"; shift ;; 379 --pkgdbdir) pkgdbdir="$2"; shift ;;
379 --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;; 380 --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;;
380 --pkgmandir) pkgmandir="$2"; shift ;; 381 --pkgmandir) pkgmandir="$2"; shift ;;
381 --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;; 382 --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;;
382 --sysconfdir) sysconfdir="$2"; shift ;; 383 --sysconfdir) sysconfdir="$2"; shift ;;
383 --varbase=*) varbase=`get_optarg "$1"` ;; 384 --varbase=*) varbase=`get_optarg "$1"` ;;
384 --varbase) varbase="$2"; shift ;; 385 --varbase) varbase="$2"; shift ;;
385 --fetch-cmd=*) fetch_cmd=`get_optarg "$1"` ;; 386 --fetch-cmd=*) fetch_cmd=`get_optarg "$1"` ;;
386 --fetch-cmd) fetch_cmd="$2"; shift ;; 387 --fetch-cmd) fetch_cmd="$2"; shift ;;
387 --compiler=*) compiler=`get_optarg "$1"` ;; 388 --compiler=*) compiler=`get_optarg "$1"` ;;
@@ -1044,26 +1045,29 @@ if test -n "$CPPFLAGS"; then @@ -1044,26 +1045,29 @@ if test -n "$CPPFLAGS"; then
1044 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} 1045 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF}
1045fi 1046fi
1046if test -n "$LDFLAGS"; then 1047if test -n "$LDFLAGS"; then
1047 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} 1048 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF}
1048fi 1049fi
1049if test -n "$LIBS"; then 1050if test -n "$LIBS"; then
1050 echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} 1051 echo "LIBS+= $LIBS" >> ${TARGET_MKCONF}
1051fi 1052fi
1052 1053
1053# opsys specific fiddling 1054# opsys specific fiddling
1054opsys_finish 1055opsys_finish
1055 1056
1056echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} 1057echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF}
 1058if [ ! -z "${workdir}" ]; then
 1059 echo "WRKOBJDIR= ${workdir}/pkgsrc" >> ${TARGET_MKCONF}
 1060fi
1057 1061
1058echo "" >> ${TARGET_MKCONF} 1062echo "" >> ${TARGET_MKCONF}
1059echo "" >> ${BOOTSTRAP_MKCONF} 1063echo "" >> ${BOOTSTRAP_MKCONF}
1060if test -n "${mk_fragment}"; then 1064if test -n "${mk_fragment}"; then
1061 cat "${mk_fragment}" >> ${TARGET_MKCONF} 1065 cat "${mk_fragment}" >> ${TARGET_MKCONF}
1062 echo "" >> ${TARGET_MKCONF} 1066 echo "" >> ${TARGET_MKCONF}
1063fi 1067fi
1064echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} 1068echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF}
1065echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} 1069echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF}
1066 1070
1067# register packages 1071# register packages
1068# usage: register_package <packagedirectory> [additional arguments] 1072# usage: register_package <packagedirectory> [additional arguments]
1069build_package() { 1073build_package() {