echo "$$FLAGS" >$@; \
fi
+ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
+ $(QUIET_GEN)$(RM) $@ && \
+ INSTLIBDIR='$(perllibdir_SQ)' && \
+ INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
+ INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
+ sed -e 's=@@PATHSEP@@=$(pathsep)=g' \
+ -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \
+ -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \
+ -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \
+ -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \
+ $< >$@+ && \
+ mv $@+ $@
+
+.PHONY: perllibdir
+perllibdir:
+ @echo '$(perllibdir_SQ)'
+
.PHONY: gitweb
gitweb:
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
$(OBJECTS): $(LIB_H)
endif
-exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX
-exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
+exec-cmd.sp exec-cmd.s exec-cmd.o: GIT-PREFIX
+exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
+ '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DPREFIX="$(prefix_SQ)"'
#include "cache.h"
-#include "exec_cmd.h"
+#include "exec-cmd.h"
#include "quote.h"
#include "argv-array.h"
- #define MAX_ARGS 32
- static const char *argv_exec_path;
+ #if defined(RUNTIME_PREFIX)
+
+ #if defined(HAVE_NS_GET_EXECUTABLE_PATH)
+ #include <mach-o/dyld.h>
+ #endif
+
+ #if defined(HAVE_BSD_KERN_PROC_SYSCTL)
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
+
+ #endif /* RUNTIME_PREFIX */
+
+ #define MAX_ARGS 32
+
+ static const char *system_prefix(void);
#ifdef RUNTIME_PREFIX
- static const char *argv0_path;
+
+ /**
+ * When using a runtime prefix, Git dynamically resolves paths relative to its
+ * executable.
+ *
+ * The method for determining the path of the executable is highly
+ * platform-specific.
+ */
+
+ /**
+ * Path to the current Git executable. Resolved on startup by
+ * 'git_resolve_executable_dir'.
+ */
+ static const char *executable_dirname;
static const char *system_prefix(void)
{