Git fork

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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
d2407bb8 95bcd6f0

+7 -7
+1 -1
Makefile
··· 3205 3205 $(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh 3206 3206 $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ 3207 3207 -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),)|' < $< > $@ && \ 3209 3209 chmod +x $@ 3210 3210 3211 3211 # GNU make supports exporting all variables by "export" without parameters.
+3 -3
bin-wrappers/wrap-for-bin.sh
··· 22 22 23 23 case "$GIT_DEBUGGER" in 24 24 '') 25 - exec "${GIT_EXEC_PATH}/@PROG@" "$@" 25 + exec "@PROG@" "$@" 26 26 ;; 27 27 1) 28 28 unset GIT_DEBUGGER 29 - exec gdb --args "${GIT_EXEC_PATH}/@PROG@" "$@" 29 + exec gdb --args "@PROG@" "$@" 30 30 ;; 31 31 *) 32 32 GIT_DEBUGGER_ARGS="$GIT_DEBUGGER" 33 33 unset GIT_DEBUGGER 34 - exec ${GIT_DEBUGGER_ARGS} "${GIT_EXEC_PATH}/@PROG@" "$@" 34 + exec ${GIT_DEBUGGER_ARGS} "@PROG@" "$@" 35 35 ;; 36 36 esac
+3 -3
contrib/buildsystems/CMakeLists.txt
··· 1097 1097 foreach(script ${wrapper_scripts}) 1098 1098 file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) 1099 1099 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}") 1101 1101 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) 1102 1102 endforeach() 1103 1103 1104 1104 foreach(script ${wrapper_test_scripts}) 1105 1105 file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) 1106 1106 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}") 1108 1108 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) 1109 1109 endforeach() 1110 1110 1111 1111 file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) 1112 1112 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}") 1114 1114 file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content}) 1115 1115 1116 1116 #options for configuring test options