1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 15:18:05 +11:00

Fix for tools/zasm.sh being dependent on readlink -f (an issue on macOS, preventing builds) (#28)

* Fix for tools/zasm.sh being dependent on readlink -f (an issue on macOS, preventing builds)

* Wrap zasm.sh shebang in /usr/bin/env ; remove comment about BSDs
This commit is contained in:
Keith Stellyes 2019-10-10 12:21:37 -07:00 committed by Virgil Dupras
parent 6281e2036f
commit 4180b5873d

View File

@ -1,7 +1,11 @@
#!/bin/sh #!/usr/bin/env bash
# readlink -f doesn't work with macOS's implementation
# so, if we can't get readlink -f to work, try python with a realpath implementation
ABS_PATH=$(readlink -f "$0" || python -c "import sys, os; print(os.path.realpath('$0'))")
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call # wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
DIR=$(dirname $(readlink -f "$0")) DIR=$(dirname "${ABS_PATH}")
ZASMBIN="${DIR}/emul/zasm/zasm" ZASMBIN="${DIR}/emul/zasm/zasm"
CFSPACK="${DIR}/cfspack/cfspack" CFSPACK="${DIR}/cfspack/cfspack"
INCCFS=$(mktemp) INCCFS=$(mktemp)