aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-15 15:53:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-15 15:53:11 +0200
commit62dd2b4cef3e8bd4506a92ab2d4f70e154d98e44 (patch)
tree2992c220a3b757ea2eb4923edf686ff0966223f0
parent53aa4375ca5a3a17a0869fbaa34a88817920ec56 (diff)
Adjust bootstrap.sh interface to be similar to .bat versions
-rw-r--r--bootstrap-mingw.bat2
-rw-r--r--bootstrap-msvc.bat2
-rwxr-xr-xbootstrap.sh38
3 files changed, 22 insertions, 20 deletions
diff --git a/bootstrap-mingw.bat b/bootstrap-mingw.bat
index 9b0a5f7..fe55991 100644
--- a/bootstrap-mingw.bat
+++ b/bootstrap-mingw.bat
@@ -20,6 +20,8 @@ echo example:
echo.
echo %0 g++ -O3
echo.
+echo See the INSTALL file for details.
+echo.
goto end
:start
diff --git a/bootstrap-msvc.bat b/bootstrap-msvc.bat
index 459fe1a..56623d4 100644
--- a/bootstrap-msvc.bat
+++ b/bootstrap-msvc.bat
@@ -25,6 +25,8 @@ echo For example:
echo.
echo %0 cl.exe /nologo
echo.
+echo See the INSTALL file for details.
+echo.
goto end
rem Clean up .obj files from all the directories passed as arguments.
diff --git a/bootstrap.sh b/bootstrap.sh
index 232f7e2..28da7f5 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -4,17 +4,20 @@
# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-usage="Usage: $0 [--help] [--cxx <compiler>] [--cxxflags <flags>] [<host>]"
+usage="Usage: $0 [-h] [--cxx <file>] [--libbutl <dir>] [--host <triplet>] [<options>]"
cxx=g++
-cxxflags=
libbutl=
host=
while test $# -ne 0; do
case $1 in
- --help)
+ -h|--help)
echo "$usage" 1>&2
+ echo 1>&2
+ echo "The script expects to find the libbutl/ or libbutl-*/ directory either" 1>&2
+ echo "in the current directory (build2 root) or one level up." 1>&2
+ echo 1>&2
echo "See the INSTALL file for details." 1>&2
exit 0
;;
@@ -28,16 +31,6 @@ while test $# -ne 0; do
cxx=$1
shift
;;
- --cxxflags)
- shift
- if test $# -eq 0; then
- echo "error: c++ compiler flags expected after --cxxflags" 1>&2
- echo "$usage" 1>&2
- exit 1
- fi
- cxxflags=$1
- shift
- ;;
--libbutl)
shift
if test $# -eq 0; then
@@ -52,10 +45,19 @@ while test $# -ne 0; do
libbutl=$1
shift
;;
- *)
+ --host)
+ shift
+ if test $# -eq 0; then
+ echo "error: host triplet expected after --host" 1>&2
+ echo "$usage" 1>&2
+ exit 1
+ fi
host=$1
shift
;;
+ *)
+ break
+ ;;
esac
done
@@ -72,8 +74,6 @@ else
host=$chost
fi
-echo "using $host as build2 host" 1>&2
-
# See if there is libbutl or libbutl-* in the current directory and
# one directory up.
#
@@ -104,8 +104,6 @@ if test -z "$libbutl"; then
exit 1
fi
-cppflags='-DBUILD2_HOST_TRIPLET="'$host'"'
-
src="build2/*.cxx"
src="$src build2/config/*.cxx"
src="$src build2/dist/*.cxx"
@@ -118,5 +116,5 @@ src="$src build2/test/*.cxx"
src="$src build2/install/*.cxx"
src="$src $libbutl/butl/*.cxx"
-echo $cxx -std=c++1y -I$libbutl -I. $cppflags $cxxflags -o build2/b-boot $src 1>&2
-exec $cxx -std=c++1y -I$libbutl -I. $cppflags $cxxflags -o build2/b-boot $src
+echo $cxx -I$libbutl -I. '-DBUILD2_HOST_TRIPLET="'$host'"' -std=c++1y $* -o build2/b-boot $src
+exec $cxx -I$libbutl -I. '-DBUILD2_HOST_TRIPLET="'$host'"' -std=c++1y $* -o build2/b-boot $src