Sat Feb 6 05:51:51 2010 UTC ()
Honor LIBS environment variable, part of PR#41130.


(obache)
diff -r1.153 -r1.154 pkgsrc/bootstrap/bootstrap

cvs diff -r1.153 -r1.154 pkgsrc/bootstrap/bootstrap (expand / switch to unified diff)

--- pkgsrc/bootstrap/bootstrap 2010/02/06 04:30:49 1.153
+++ pkgsrc/bootstrap/bootstrap 2010/02/06 05:51:50 1.154
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#! /bin/sh 1#! /bin/sh
2 2
3# $NetBSD: bootstrap,v 1.153 2010/02/06 04:30:49 obache Exp $ 3# $NetBSD: bootstrap,v 1.154 2010/02/06 05:51:50 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
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 27# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
28# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 29# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
30# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 31# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35# 35#
36#set -x 36#set -x
37 37
38# the following environment variables are honored: 38# the following environment variables are honored:
39# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS 39# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS, LIBS
40# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS 40# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS
41 41
42 42
43BOOTSTRAP_VERSION=20060721 43BOOTSTRAP_VERSION=20060721
44 44
45# Don't let the bootstrap program get confused by a pre-existing mk.conf 45# Don't let the bootstrap program get confused by a pre-existing mk.conf
46# file. 46# file.
47MAKECONF=/dev/null 47MAKECONF=/dev/null
48export MAKECONF 48export MAKECONF
49 49
50ignorecasecheck=no 50ignorecasecheck=no
51unprivileged=no 51unprivileged=no
52 52
@@ -935,40 +935,40 @@ yes) echo_msg "Bootstrapping awk" @@ -935,40 +935,40 @@ yes) echo_msg "Bootstrapping awk"
935 copy_src $pkgsrcdir/lang/nawk/files awk 935 copy_src $pkgsrcdir/lang/nawk/files awk
936 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified 936 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
937 run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" 937 run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
938 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" 938 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
939 echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} 939 echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF}
940 echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} 940 echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF}
941 ;; 941 ;;
942esac 942esac
943 943
944# bootstrap sed if necessary 944# bootstrap sed if necessary
945case "$need_sed" in 945case "$need_sed" in
946yes) echo_msg "Bootstrapping sed" 946yes) echo_msg "Bootstrapping sed"
947 copy_src $pkgsrcdir/textproc/nbsed/files sed 947 copy_src $pkgsrcdir/textproc/nbsed/files sed
948 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)" 948 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)"
949 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" 949 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
950 echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} 950 echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF}
951 echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} 951 echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
952 ;; 952 ;;
953esac 953esac
954 954
955# bootstrap pkg_install 955# bootstrap pkg_install
956echo_msg "Bootstrapping pkgtools" 956echo_msg "Bootstrapping pkgtools"
957copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install 957copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install
958run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ 958run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \
959CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \ 959CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \
960LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \ 960LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
961LIBS='-lnbcompat' $shprog ./configure $configure_quiet_flags -C \ 961LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
962--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ 962--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
963--with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)" 963--with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)"
964run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" 964run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
965run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" 965run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
966run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" 966run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
967echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} 967echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
968echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} 968echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
969echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} 969echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
970 970
971if [ -n "${fetch_cmd}" ]; then 971if [ -n "${fetch_cmd}" ]; then
972 echo "FETCH_CMD= $fetch_cmd" >> ${TARGET_MKCONF} 972 echo "FETCH_CMD= $fetch_cmd" >> ${TARGET_MKCONF}
973fi 973fi
974 974
@@ -1010,26 +1010,29 @@ if test -n "$XARGS"; then @@ -1010,26 +1010,29 @@ if test -n "$XARGS"; then
1010 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} 1010 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF}
1011fi 1011fi
1012if test -n "$CFLAGS"; then 1012if test -n "$CFLAGS"; then
1013 echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} 1013 echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF}
1014 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} 1014 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF}
1015 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} 1015 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF}
1016fi 1016fi
1017if test -n "$CPPFLAGS"; then 1017if test -n "$CPPFLAGS"; then
1018 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} 1018 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF}
1019fi 1019fi
1020if test -n "$LDFLAGS"; then 1020if test -n "$LDFLAGS"; then
1021 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} 1021 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF}
1022fi 1022fi
 1023if test -n "$LIBS"; then
 1024 echo "LIBS+= $LIBS" >> ${TARGET_MKCONF}
 1025fi
1023 1026
1024# opsys specific fiddling 1027# opsys specific fiddling
1025opsys_finish 1028opsys_finish
1026 1029
1027echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} 1030echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF}
1028 1031
1029echo "" >> ${TARGET_MKCONF} 1032echo "" >> ${TARGET_MKCONF}
1030echo "" >> ${BOOTSTRAP_MKCONF} 1033echo "" >> ${BOOTSTRAP_MKCONF}
1031if test -n "${mk_fragment}"; then 1034if test -n "${mk_fragment}"; then
1032 cat "${mk_fragment}" >> ${TARGET_MKCONF} 1035 cat "${mk_fragment}" >> ${TARGET_MKCONF}
1033 echo "" >> ${TARGET_MKCONF} 1036 echo "" >> ${TARGET_MKCONF}
1034fi 1037fi
1035echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} 1038echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF}