Skip to content

Commit

Permalink
make build.sh script more portable
Browse files Browse the repository at this point in the history
  • Loading branch information
zmyrgel committed Sep 24, 2018
1 parent 2f13157 commit a5003bc
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -eu

#===============================================================================
Expand Down Expand Up @@ -119,8 +119,9 @@ stage1 () {
"${target_lib_static}"

feedback_mid "compiling gerbil core"
export GERBIL_HOME="${GERBIL_STAGE0}" # required by gxi-script
export GERBIL_TARGET="${GERBIL_BASE}" # required by build1.ss
GERBIL_HOME="${GERBIL_STAGE0}" # required by gxi-script
GERBIL_TARGET="${GERBIL_BASE}" # required by build1.ss
export GERBIL_HOME GERBIL_TARGET
"${GERBIL_STAGE0}/bin/gxi-script" "${GERBIL_BUILD}/build1.ss" || die

## finalize build
Expand All @@ -146,29 +147,33 @@ build_layout () {
## commands
build_tools () {
feedback_low "Building gerbil tools"
export PATH="${GERBIL_BASE}/bin:${PATH}"
export GERBIL_HOME="${GERBIL_BASE}" #required by build.ss
PATH="${GERBIL_BASE}/bin:${PATH}"
GERBIL_HOME="${GERBIL_BASE}" #required by build.ss
export PATH GERBIL_HOME
(cd tools && ./build.ss deps && ./build.ss)
}

build_stdlib () {
feedback_low "Building gerbil stdlib"
export PATH="${GERBIL_BASE}/bin:${PATH}"
export GERBIL_HOME="${GERBIL_BASE}" #required by gxi-build-script and build.ss
PATH="${GERBIL_BASE}/bin:${PATH}"
GERBIL_HOME="${GERBIL_BASE}" #required by gxi-build-script and build.ss
export PATH GERBIL_HOME
(cd std && ./build-deps-gen.ss && ./build.ss)
}

build_lang () {
feedback_low "Building gerbil languages"
export PATH="${GERBIL_BASE}/bin:${PATH}"
export GERBIL_HOME="${GERBIL_BASE}" #required by build.ss
PATH="${GERBIL_BASE}/bin:${PATH}"
GERBIL_HOME="${GERBIL_BASE}" #required by build.ss
export PATH GERBIL_HOME
(cd lang && ./build.ss)
}

build_tags () {
feedback_low "Build gerbil tags"
export PATH="${GERBIL_BASE}/bin:${PATH}"
export GERBIL_HOME="${GERBIL_BASE}" #required by gxtags
PATH="${GERBIL_BASE}/bin:${PATH}"
GERBIL_HOME="${GERBIL_BASE}" #required by gxtags
export PATH GERBIL_HOME
gxtags gerbil std lang
}

Expand All @@ -185,7 +190,7 @@ build_gerbil() {
}

## handling command line
if [ -z "${1+x}" ]; then
if [ "$#" -eq 0 ]; then
build_gerbil
else
case "$1" in
Expand Down

0 comments on commit a5003bc

Please sign in to comment.