aboutsummaryrefslogtreecommitdiffstats
path: root/git-gui/generate-tclindex.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-29 09:03:01 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-29 09:03:01 -0700
commitfcfe60668e05ffde2610bfef9045797618c145ac (patch)
tree16afb5b7ca43ab64de02c79363b80515ff259e1d /git-gui/generate-tclindex.sh
parentMerge branch 'master' of https://github.com/j6t/gitk (diff)
parentMerge branch 'pks-meson-support' of github.com:pks-t/git-gui (diff)
downloadgit-fcfe60668e05ffde2610bfef9045797618c145ac.tar.gz
git-fcfe60668e05ffde2610bfef9045797618c145ac.zip
Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui: git-gui: wire up support for the Meson build system git-gui: stop including GIT-VERSION-FILE file git-gui: extract script to generate macOS app git-gui: extract script to generate macOS wrapper git-gui: extract script to generate "tclIndex" git-gui: extract script to generate "git-gui" git-gui: drop no-op GITGUI_SCRIPT replacement git-gui: make output of GIT-VERSION-GEN source'able git-gui: prepare GIT-VERSION-GEN for out-of-tree builds git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS
Diffstat (limited to 'git-gui/generate-tclindex.sh')
-rwxr-xr-xgit-gui/generate-tclindex.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/git-gui/generate-tclindex.sh b/git-gui/generate-tclindex.sh
new file mode 100755
index 0000000000..36e3a0bd90
--- /dev/null
+++ b/git-gui/generate-tclindex.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if test "$#" -lt 3
+then
+ echo >&2 "usage: $0 <BUILD_DIR> <BUILD_OPTIONS> <LIBFILE> [<LIBFILE>...]"
+ exit 1
+fi
+
+BUILD_DIR="$1"
+BUILD_OPTIONS="$2"
+shift 2
+LIBFILES="$(echo "$@" | sort | sed 's|lib/||g')"
+
+. "$BUILD_OPTIONS"
+
+cd "$BUILD_DIR"
+
+if {
+ echo "source lib/class.tcl;"
+ echo "auto_mkindex lib $LIBFILES"
+} | "$TCL_PATH"
+then
+ : ok
+else
+ echo >&2 " * $TCL_PATH failed; using unoptimized loading"
+ rm -f $@
+ echo '# Autogenerated by git-gui Makefile' >lib/tclIndex
+ echo >>lib/tclIndex
+ echo "class.tcl" >>lib/tclIndex
+ printf "%s\n" $LIBFILES >>lib/tclIndex
+ echo >>lib/tclIndex
+fi