Skip to content

Commit d2407bb

Browse files
pks-tgitster
authored andcommitted
Makefile: write absolute program path into bin-wrappers
Write the absolute program path into our bin-wrappers. This allows us to simplify the Meson build instructions we are about to introduce a bit. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 95bcd6f commit d2407bb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3205,7 +3205,7 @@ all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PR
32053205
$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh
32063206
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
32073207
-e 's|@BUILD_DIR@|$(shell pwd)|' \
3208-
-e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
3208+
-e 's|@PROG@|$(shell pwd)/$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
32093209
chmod +x $@
32103210

32113211
# GNU make supports exporting all variables by "export" without parameters.

bin-wrappers/wrap-for-bin.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
2222

2323
case "$GIT_DEBUGGER" in
2424
'')
25-
exec "${GIT_EXEC_PATH}/@PROG@" "$@"
25+
exec "@PROG@" "$@"
2626
;;
2727
1)
2828
unset GIT_DEBUGGER
29-
exec gdb --args "${GIT_EXEC_PATH}/@PROG@" "$@"
29+
exec gdb --args "@PROG@" "$@"
3030
;;
3131
*)
3232
GIT_DEBUGGER_ARGS="$GIT_DEBUGGER"
3333
unset GIT_DEBUGGER
34-
exec ${GIT_DEBUGGER_ARGS} "${GIT_EXEC_PATH}/@PROG@" "$@"
34+
exec ${GIT_DEBUGGER_ARGS} "@PROG@" "$@"
3535
;;
3636
esac

contrib/buildsystems/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,20 +1097,20 @@ set(wrapper_test_scripts
10971097
foreach(script ${wrapper_scripts})
10981098
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10991099
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1100-
string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}")
1100+
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/${script}${EXE_EXTENSION}" content "${content}")
11011101
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
11021102
endforeach()
11031103

11041104
foreach(script ${wrapper_test_scripts})
11051105
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11061106
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1107-
string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
1107+
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/t/helper/${script}${EXE_EXTENSION}" content "${content}")
11081108
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
11091109
endforeach()
11101110

11111111
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11121112
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1113-
string(REPLACE "@PROG@" "git-cvsserver" content "${content}")
1113+
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/git-cvsserver" content "${content}")
11141114
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})
11151115

11161116
#options for configuring test options

0 commit comments

Comments
 (0)