diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/build-scripts/updaterev.sh | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/build-scripts/updaterev.sh')
| -rwxr-xr-x | contrib/SDL-3.2.8/build-scripts/updaterev.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/build-scripts/updaterev.sh b/contrib/SDL-3.2.8/build-scripts/updaterev.sh new file mode 100755 index 0000000..508c6dd --- /dev/null +++ b/contrib/SDL-3.2.8/build-scripts/updaterev.sh | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Generate a header file with the current source revision | ||
| 4 | |||
| 5 | outdir=`pwd` | ||
| 6 | cd `dirname $0` | ||
| 7 | srcdir=.. | ||
| 8 | header=$outdir/include/SDL3/SDL_revision.h | ||
| 9 | dist= | ||
| 10 | vendor= | ||
| 11 | |||
| 12 | while [ "$#" -gt 0 ]; do | ||
| 13 | case "$1" in | ||
| 14 | (--dist) | ||
| 15 | dist=yes | ||
| 16 | shift | ||
| 17 | ;; | ||
| 18 | (--vendor) | ||
| 19 | vendor="$2" | ||
| 20 | shift 2 | ||
| 21 | ;; | ||
| 22 | (*) | ||
| 23 | echo "$0: Unknown option: $1" >&2 | ||
| 24 | exit 2 | ||
| 25 | ;; | ||
| 26 | esac | ||
| 27 | done | ||
| 28 | |||
| 29 | rev=`sh showrev.sh 2>/dev/null` | ||
| 30 | if [ "$rev" != "" ]; then | ||
| 31 | if [ -n "$dist" ]; then | ||
| 32 | echo "$rev" > "$outdir/VERSION.txt" | ||
| 33 | fi | ||
| 34 | echo "/* Generated by updaterev.sh, do not edit */" >"$header.new" | ||
| 35 | if [ -n "$vendor" ]; then | ||
| 36 | echo "#define SDL_VENDOR_INFO \"$vendor\"" >>"$header.new" | ||
| 37 | fi | ||
| 38 | echo "#ifdef SDL_VENDOR_INFO" >>"$header.new" | ||
| 39 | echo "#define SDL_REVISION \"SDL-$rev (\" SDL_VENDOR_INFO \")\"" >>"$header.new" | ||
| 40 | echo "#else" >>"$header.new" | ||
| 41 | echo "#define SDL_REVISION \"SDL-$rev\"" >>"$header.new" | ||
| 42 | echo "#endif" >>"$header.new" | ||
| 43 | if diff $header $header.new >/dev/null 2>&1; then | ||
| 44 | rm "$header.new" | ||
| 45 | else | ||
| 46 | mv "$header.new" "$header" | ||
| 47 | fi | ||
| 48 | fi | ||
