aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL23
-rwxr-xr-xbootstrap52
2 files changed, 71 insertions, 4 deletions
diff --git a/INSTALL b/INSTALL
index 9669735..b37563e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,6 +8,13 @@ it. To accomplish this, use the 'bootstrap' shell script found in the
root directory of the build2 project. The following is a recommended
sequence of steps:
+0. Get libbutl unless one is already present in the build2 directory
+ (whether one is bundled depends on how you obtained build2 source
+ code). Place it next to build2, so that you have:
+
+ libbutl/ (or libbutl-x.y.z/)
+ build2/ (or build2-x.y.z/)
+
1. Execute 'bootstrap' specifying the C++ compiler to be used if necessary
(default is 'g++'). For example:
@@ -21,6 +28,11 @@ sequence of steps:
$ build/b-boot config.cxx=clang++-3.5
+ If you had to obtain libbutl at step 0, then you will also have to
+ specify its location, for example:
+
+ $ build/b-boot config.import.libbutl=../libbutl ...
+
The result of this command is saved as 'build/b'.
3. Finally, rebuild the build2 binary using the binary built at step 2
@@ -30,3 +42,14 @@ sequence of steps:
$ build/b-prev config.cxx=clang++-3.5 clean
$ build/b-prev config.cxx=clang++-3.5 configure update
$ diff -b build/b build/b-prev
+
+ If you had to obtain libbutl, then this becomes ('...' stands for
+ any extra configuration you may have, like the C++ compiler above):
+
+ $ mv build/b build/b-prev
+ $ build/b-prev config.import.libbutl=../libbutl ... clean
+ $ cd ../libbutl
+ $ ../build2/build/b-prev ... configure
+ $ cd ../build2
+ $ build/b-prev config.import.libbutl=../libbutl ... configure update
+ $ diff build/b build/b-prev
diff --git a/bootstrap b/bootstrap
index 86dcc78..e36d079 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,8 +1,7 @@
#!/bin/sh
-src="build/*.cxx build/config/*.cxx build/bin/*.cxx build/cxx/*.cxx"
-
cxx=g++
+libbutl=
while test $# -ne 0; do
case $1 in
@@ -20,6 +19,19 @@ while test $# -ne 0; do
cxx=$1
shift
;;
+ --libbutl)
+ shift
+ if test $# -eq 0; then
+ echo "error: libbutl path expected after --libbutl" 1>&2
+ exit 1
+ fi
+ if test ! -d "$1"; then
+ echo "error: libbutl directory '$1' does not exist" 1>&2
+ exit 1
+ fi
+ libbutl=$1
+ shift
+ ;;
*)
echo "error: unknown option $1" 1>&2
exit 1
@@ -27,5 +39,37 @@ while test $# -ne 0; do
esac
done
-echo $cxx -std=c++14 -I. -o build/b-boot $src 1>&2
-exec $cxx -std=c++14 -I. -o build/b-boot $src
+# See if there is libbutl or libbutl-* in the current directory and
+# one directory up.
+#
+if test -z "$libbutl"; then
+ if test -d libbutl; then
+ libbutl=libbutl
+ else
+ libbutl=`echo libbutl-*`
+ if test ! -d "$libbutl"; then
+ libbutl=
+ fi
+ fi
+fi
+
+if test -z "$libbutl"; then
+ if test -d ../libbutl; then
+ libbutl=../libbutl
+ else
+ libbutl=`echo ../libbutl-*`
+ if test ! -d "$libbutl"; then
+ libbutl=
+ fi
+ fi
+fi
+
+if test -z "$libbutl"; then
+ echo "error: unable to find libbutl, use --libbutl to specify its location" 1>&2
+ exit 1
+fi
+
+src="build/*.cxx build/config/*.cxx build/bin/*.cxx build/cxx/*.cxx $libbutl/butl/*.cxx"
+
+echo $cxx -std=c++1y -I$libbutl -I. -o build/b-boot $src 1>&2
+exec $cxx -std=c++1y -I$libbutl -I. -o build/b-boot $src