diff options
Diffstat (limited to 'install')
-rwxr-xr-x | install | 51 |
1 files changed, 31 insertions, 20 deletions
@@ -16,7 +16,7 @@ # Use sudo when installing. # # -t -# Install toolchain only. +# Build and install toolchain only, no extras (brep). # # --cxx <path> # C++ compiler to use, g++ by default. @@ -27,6 +27,9 @@ # --cppflags <flags> # Extra C++ preprocessor flags to use. # +# --bpkgflags <flags> +# Extra flags to pass to bpkg. +# # For example: # # install /tmp/build2-toolchain-0.1.0.tar.gz https://pkg.cppget.org/1/alpha @@ -47,11 +50,12 @@ lib="/usr/local" # Library (libodb, etc) installation directory. ins="$tmp/build2-install" # Our installation directory. sudo= extras=brep # Extras to build. -extras_show=brep-loader # Extra programs (in bin/) to test with --version. +extras_show=brep-load # Extra programs (in bin/) to test with --version. pmc="build2-toolchain" # bpkg configuration directory cxx="g++" cxxflags="-W -Wall -Wno-unknown-pragmas" cppflags= +bpkgflags= while [ $# -gt 0 ]; do case $1 in @@ -88,6 +92,11 @@ while [ $# -gt 0 ]; do cppflags="$1" shift ;; + --bpkgflags) + shift + bpkgflags="$1" + shift + ;; *) if [ -z "$tca" ]; then tca=${1%/}; shift @@ -98,6 +107,8 @@ while [ $# -gt 0 ]; do esac done +echo "'$bpkgflags'" + if [ -z "$tca" ]; then error $usage fi @@ -122,7 +133,7 @@ elif [[ $tca != /* ]]; then tca=$owd/$tca fi -if [[ ( $rep != http://* || $tca == https://* ) && $rep != /* ]]; then +if [[ $rep != http://* && $rep != https://* && $rep != /* ]]; then rep=$owd/$rep fi @@ -138,6 +149,11 @@ fi tcb=`basename $tca .tar.gz` +# Remove installation directories so that any old stuff doesn't affect +# us due to rpath. +# +$sudo rm -rf $ins $ins-boot + # Unpack. # rm -rf $tcb @@ -148,13 +164,13 @@ tar xfz $tca # cd $tcb/build2 ./bootstrap --cxx $cxx --cxxflags "$cxxflags" -./build/b-boot \ +./build2/b-boot \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ config.bin.rpath=$ins-boot/lib update cd .. -./build2/build/b \ +./build2/build2/b \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ config.cxx.poptions="$cppflags -I$lib/include" \ @@ -164,17 +180,14 @@ cd .. config.install.root.sudo=$sudo \ configure -./build2/build/b update - -$sudo mkdir -p $ins-boot -$sudo rm -rf $ins-boot/* -./build2/build/b install +./build2/build2/b update +./build2/build2/b install function show () # <dir> <prog>... { local d=$1; shift for p in $*; do - if [ `which $p` != "$d/bin/$p" ]; then + if [ "`which $p`" != "$d/bin/$p" ]; then error "wrong $p path: `which $p`" fi @@ -198,7 +211,7 @@ rm -rf $pmc/* rm -rf $pmc.disabled cd $pmc -bpkg create \ +bpkg $bpkgflags create \ cxx \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ @@ -208,13 +221,11 @@ bpkg create \ config.install.root=$ins \ config.install.root.sudo=$sudo \ -bpkg add $rep -bpkg fetch -bpkg build --yes build2 bpkg +bpkg $bpkgflags add $rep +bpkg $bpkgflags fetch +bpkg $bpkgflags build --yes build2 bpkg -$sudo mkdir -p $ins -$sudo rm -rf $ins/* -bpkg install build2 bpkg +bpkg $bpkgflags install build2 bpkg cd $tmp mv $pmc $pmc.disabled @@ -228,8 +239,8 @@ mv $pmc.disabled $pmc # if [ ! -z "$extras" ]; then cd $pmc - bpkg build --yes $extras - bpkg install $extras + bpkg $bpkgflags build --yes $extras + bpkg $bpkgflags install $extras cd $tmp mv $pmc $pmc.disabled |