| @@ -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 |
352 | fi | | 352 | fi |
353 | | | 353 | |
354 | build_start=`date` | | 354 | build_start=`date` |
355 | echo_msg "bootstrap command: $0 $@" | | 355 | echo_msg "bootstrap command: $0 $@" |
356 | echo_msg "bootstrap started: $build_start" | | 356 | echo_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 |
360 | prefix= | | 360 | prefix= |
361 | pkgdbdir= | | 361 | pkgdbdir= |
362 | pkgmandir= | | 362 | pkgmandir= |
363 | sysconfdir= | | 363 | sysconfdir= |
364 | varbase= | | 364 | varbase= |
| | | 365 | workdir= |
365 | | | 366 | |
366 | full=no | | 367 | full=no |
367 | compiler="" | | 368 | compiler="" |
368 | quiet=no | | 369 | quiet=no |
369 | mk_fragment= | | 370 | mk_fragment= |
370 | | | 371 | |
371 | while [ $# -gt 0 ]; do | | 372 | while [ $# -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} |
1045 | fi | | 1046 | fi |
1046 | if test -n "$LDFLAGS"; then | | 1047 | if test -n "$LDFLAGS"; then |
1047 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} | | 1048 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} |
1048 | fi | | 1049 | fi |
1049 | if test -n "$LIBS"; then | | 1050 | if test -n "$LIBS"; then |
1050 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} | | 1051 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} |
1051 | fi | | 1052 | fi |
1052 | | | 1053 | |
1053 | # opsys specific fiddling | | 1054 | # opsys specific fiddling |
1054 | opsys_finish | | 1055 | opsys_finish |
1055 | | | 1056 | |
1056 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} | | 1057 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} |
| | | 1058 | if [ ! -z "${workdir}" ]; then |
| | | 1059 | echo "WRKOBJDIR= ${workdir}/pkgsrc" >> ${TARGET_MKCONF} |
| | | 1060 | fi |
1057 | | | 1061 | |
1058 | echo "" >> ${TARGET_MKCONF} | | 1062 | echo "" >> ${TARGET_MKCONF} |
1059 | echo "" >> ${BOOTSTRAP_MKCONF} | | 1063 | echo "" >> ${BOOTSTRAP_MKCONF} |
1060 | if test -n "${mk_fragment}"; then | | 1064 | if 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} |
1063 | fi | | 1067 | fi |
1064 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} | | 1068 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} |
1065 | echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} | | 1069 | echo ".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] |
1069 | build_package() { | | 1073 | build_package() { |