diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-17 11:13:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-17 11:13:53 +0200 |
commit | 66746cb86340aceb1fa5dec197bafbc70158c020 (patch) | |
tree | 10c26fa9b68f7120af60a347682c9e555ea34d8f /bootstrap | |
parent | c75489e7c2a5a0558f8579581d1e1186b6bd89ce (diff) |
Update bootstrap process with libbutl dependency
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 52 |
1 files changed, 48 insertions, 4 deletions
@@ -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 |