aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 8c6669a..96a9842 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
: ${CC=gcc}
+: ${HOSTCC=$CC}
: ${AR=ar}
: ${MAKE=make}
: ${BIN=lpm}
@@ -39,7 +40,7 @@ fi
# Build the pre-packaged lua file into the executbale.
if [[ "$@" == *"-DLPM_STATIC"* ]]; then
- [[ ! -e "lua.exe" ]] && { gcc -Ilib/lua -o lua.exe lib/lua/onelua.c -lm || exit -1; }
+ [[ ! -e "lua.exe" ]] && { $HOSTCC -Ilib/lua -o lua.exe lib/lua/onelua.c -lm || exit -1; }
./lua.exe -e 'io.open("src/lpm.lua.c", "wb"):write("unsigned char lpm_luac[] = \""..string.dump(loadfile("src/lpm.lua")):gsub(".",function(c) return string.format("\\x%02X",string.byte(c)) end).."\";unsigned int lpm_luac_len = sizeof(lpm_luac)-1;")'
fi