mirror of
https://github.com/vlang/v.git
synced 2025-09-11 08:25:42 -04:00
thirdparty: update thirdparty-linux-amd64_tcc.sh, to also record its own full invocation command, and commit the changes automatically
This commit is contained in:
parent
9fb0f8b5aa
commit
e411ee1411
@ -1,4 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
## NOTE: this script does *not* use a shebang **deliberately**, in order to
|
||||
## access the same shell, to capture its own launching command with `fc`,
|
||||
## and to record it later in the new commit message in thirdpart/tcc.
|
||||
|
||||
## WARNING: THE ORIGINAL OF THIS SCRIPT IS IN:
|
||||
## https://github.com/vlang/v/blob/master/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh ,
|
||||
## I.E. IN THE MAIN V REPOSITORY. IF YOU NEED TO MAKE CHANGES, CHANGE THAT.
|
||||
##
|
||||
## THE `build.sh` FILE IN `vlang/tccbin` REPO IS A COPY, RECORDED AT THE TIME
|
||||
## OF REBUILDING, FOR EASIER/RELIABLE REPRODUCTION OF HISTORIC VERSIONS.
|
||||
## IT IS NOT INTENDED TO BE MODIFIED.
|
||||
|
||||
BUILD_CMD=`fc -nl -0`
|
||||
## remove whitespaces before/after the actual command:
|
||||
BUILD_CMD="$(echo "${BUILD_CMD}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||
|
||||
set -e
|
||||
|
||||
@ -13,9 +27,10 @@ export TCC_COMMIT="${TCC_COMMIT:-mob}"
|
||||
export TCC_FOLDER="${TCC_FOLDER:-thirdparty/tcc.$TCC_COMMIT}"
|
||||
export CC="${CC:-gcc}"
|
||||
|
||||
echo " BUILD_CMD: \`$BUILD_CMD\`"
|
||||
echo " CC: $CC"
|
||||
echo "TCC_COMMIT: $TCC_COMMIT"
|
||||
echo "TCC_FOLDER: $TCC_FOLDER"
|
||||
echo "TCC_FOLDER: \`$TCC_FOLDER\`"
|
||||
echo ===============================================================
|
||||
|
||||
rm -rf tinycc/
|
||||
@ -69,4 +84,11 @@ uname -a > $TCC_FOLDER/build_machine_
|
||||
## show the builtin search paths for sanity checking:
|
||||
$TCC_FOLDER/tcc.exe -v -v
|
||||
|
||||
pushd .
|
||||
cd $TCC_FOLDER
|
||||
git add .
|
||||
git commit -m "build with \`$BUILD_CMD\`"
|
||||
popd
|
||||
|
||||
echo "tcc commit: $TCC_COMMIT , full hash: $TCC_COMMIT_FULL_HASH . The tcc executable is ready in $TCC_FOLDER/tcc.exe "
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user