aboutsummaryrefslogtreecommitdiffstats
path: root/generate-script.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-15 17:54:32 -0800
committerJunio C Hamano <gitster@pobox.com>2024-12-15 17:54:33 -0800
commit29e5596eb8f82015ddb8666079039ae851b8d182 (patch)
treeff7f5beb1f53e84bf04628c480959dcadbd2fe46 /generate-script.sh
parentMerge branch 'jt/fix-fattening-promisor-fetch' (diff)
parentIntroduce support for the Meson build system (diff)
downloadgit-29e5596eb8f82015ddb8666079039ae851b8d182.tar.gz
git-29e5596eb8f82015ddb8666079039ae851b8d182.zip
Merge branch 'ps/build'
Build procedure update plus introduction of Meson based builds. * ps/build: (24 commits) Introduce support for the Meson build system Documentation: add comparison of build systems t: allow overriding build dir t: better support for out-of-tree builds Documentation: extract script to generate a list of mergetools Documentation: teach "cmd-list.perl" about out-of-tree builds Documentation: allow sourcing generated includes from separate dir Makefile: simplify building of templates Makefile: write absolute program path into bin-wrappers Makefile: allow "bin-wrappers/" directory to exist Makefile: refactor generators to be PWD-independent Makefile: extract script to generate gitweb.js Makefile: extract script to generate gitweb.cgi Makefile: extract script to massage Python scripts Makefile: extract script to massage Shell scripts Makefile: use "generate-perl.sh" to massage Perl library Makefile: extract script to massage Perl scripts Makefile: consistently use PERL_PATH Makefile: generate doc versions via GIT-VERSION-GEN Makefile: generate "git.rc" via GIT-VERSION-GEN ...
Diffstat (limited to 'generate-script.sh')
-rwxr-xr-xgenerate-script.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/generate-script.sh b/generate-script.sh
new file mode 100755
index 0000000000..a149e4f0ba
--- /dev/null
+++ b/generate-script.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 3
+then
+ echo >&2 "USAGE: $0 <INPUT> <OUTPUT> <GIT-BUILD-OPTIONS>"
+ exit 1
+fi
+
+INPUT="$1"
+OUTPUT="$2"
+BUILD_OPTIONS="$3"
+
+. "$BUILD_OPTIONS"
+
+sed -e "1s|#!.*/sh|#!$SHELL_PATH|" \
+ -e "s|@SHELL_PATH@|$SHELL_PATH|" \
+ -e "s|@DIFF@|$DIFF|" \
+ -e "s|@LOCALEDIR@|$LOCALEDIR|g" \
+ -e "s/@USE_GETTEXT_SCHEME@/$USE_GETTEXT_SCHEME/g" \
+ -e "$BROKEN_PATH_FIX" \
+ -e "s|@GITWEBDIR@|$GITWEBDIR|g" \
+ -e "s|@PERL_PATH@|$PERL_PATH|g" \
+ -e "s|@PAGER_ENV@|$PAGER_ENV|g" \
+ "$INPUT" >"$OUTPUT"
+
+case "$(basename "$INPUT")" in
+git-mergetool--lib.sh|git-sh-i18n.sh|git-sh-setup.sh)
+ ;;
+*)
+ chmod a+x "$OUTPUT"
+ ;;
+esac