1 # BEGIN RUNTIME_PREFIX generated code.
3 # This finds our Git::* libraries relative to the script's runtime path.
4 sub __git_system_path {
6 my $gitexecdir_relative = '@@GITEXECDIR_REL@@';
8 # GIT_EXEC_PATH is supplied by `git` or the test suite.
10 if (exists $ENV{GIT_EXEC_PATH}) {
11 $exec_path = $ENV{GIT_EXEC_PATH};
13 # This can happen if this script is being directly invoked instead of run
16 $exec_path = $FindBin::Bin;
19 # Trim off the relative gitexecdir path to get the system path.
20 (my $prefix = $exec_path) =~ s/\Q$gitexecdir_relative\E$//;
23 return File::Spec->catdir($prefix, $relpath);
27 use lib split /@@PATHSEP@@/,
31 my $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@');
32 (-e $perllibdir) || die("Invalid system path ($relpath): $path");
37 # Export the system locale directory to the I18N module. The locale directory
38 # is only installed if NO_GETTEXT is set.
39 $Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@');
42 # END RUNTIME_PREFIX generated code.