From 2a97a272f33b0a0ec8bffd85c61091366591aced Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 May 2015 14:53:21 +0200 Subject: Add bootstrap script, INSTALL file --- INSTALL | 32 ++++++++++++++++++++++++++++++++ bootstrap | 31 +++++++++++++++++++++++++++++++ build/.gitignore | 3 +-- build/buildfile | 4 +--- 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 INSTALL create mode 100755 bootstrap diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..9669735 --- /dev/null +++ b/INSTALL @@ -0,0 +1,32 @@ +Currently, to use build2 you will need a C++ compiler with C++14 support. +This may be relaxed later to only require C++11. For now, gcc 4.9.0 or +later and clang 3.5.0 or later are known to work. + +build2 is self-hosted, which means that unless you have obtained a pre- +built binary of build2 from somewhere else, you will need to bootstrap +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: + +1. Execute 'bootstrap' specifying the C++ compiler to be used if necessary + (default is 'g++'). For example: + + $ ./bootstrap --cxx clang++-3.5 + + Once the script completes successfully, the build2 binary is saved + as 'build/b-boot'. + +2. Next, build the build2 binary using the bootstrapped binary from step + 1 above, again specifying the C++ compiler if necessary, for example: + + $ build/b-boot config.cxx=clang++-3.5 + + The result of this command is saved as 'build/b'. + +3. Finally, rebuild the build2 binary using the binary built at step 2 + above, and verify that they are identical. For example: + + $ mv build/b build/b-prev + $ 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 diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..86dcc78 --- /dev/null +++ b/bootstrap @@ -0,0 +1,31 @@ +#!/bin/sh + +src="build/*.cxx build/config/*.cxx build/bin/*.cxx build/cxx/*.cxx" + +cxx=g++ + +while test $# -ne 0; do + case $1 in + --help) + echo "Usage: $0 [--help] [--cxx ]" 1>&2 + echo "See the INSTALL file for details." 1>&2 + exit 0 + ;; + --cxx) + shift + if test $# -eq 0; then + echo "error: c++ compiler executable expected after --cxx" 1>&2 + exit 1 + fi + cxx=$1 + shift + ;; + *) + echo "error: unknown option $1" 1>&2 + exit 1 + ;; + 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 diff --git a/build/.gitignore b/build/.gitignore index 6626bcb..62f3460 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,4 +1,3 @@ b -b-prev -b-save* +b-* config.build diff --git a/build/buildfile b/build/buildfile index 1224548..9ea95d5 100644 --- a/build/buildfile +++ b/build/buildfile @@ -2,13 +2,11 @@ config = config/{operation module utility} bin = bin/{target rule module} cxx = cxx/{target rule module} -exe{b b-prev}: cxx{b algorithm name operation spec scope variable target \ +exe{b}: cxx{b algorithm name operation spec scope variable target \ prerequisite rule file module context search diagnostics token lexer \ parser process timestamp path path-io utility filesystem dump options \ $config $bin $cxx} -.: exe{b b-prev} - #@@ TODO # # cli --include-with-brackets --include-prefix build --guard-prefix BUILD --hxx-suffix "" options.cli -- cgit v1.1