@@ -744,7 +744,7 @@ build_options_config.set('GIT_TEST_OPTS', '')
744744build_options_config.set(' GIT_TEST_PERL_FATAL_WARNINGS' , '' )
745745build_options_config.set_quoted(' GIT_TEST_UTF8_LOCALE' , get_option (' test_utf8_locale' ))
746746build_options_config.set_quoted(' LOCALEDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' localedir' )))
747- build_options_config.set (' GITWEBDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' datadir' ) / ' gitweb' ))
747+ build_options_config.set_quoted (' GITWEBDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' datadir' ) / ' gitweb' ))
748748
749749if get_option (' sane_tool_path' ).length() != 0
750750 sane_tool_path = (host_machine .system() == ' windows' ? ' ;' : ' :' ).join(get_option (' sane_tool_path' ))
@@ -762,8 +762,6 @@ endif
762762libgit_c_args = [
763763 ' -DBINDIR="' + get_option (' bindir' ) + ' "' ,
764764 ' -DDEFAULT_GIT_TEMPLATE_DIR="' + get_option (' datadir' ) / ' git-core/templates' + ' "' ,
765- ' -DETC_GITATTRIBUTES="' + get_option (' gitattributes' ) + ' "' ,
766- ' -DETC_GITCONFIG="' + get_option (' gitconfig' ) + ' "' ,
767765 ' -DFALLBACK_RUNTIME_PREFIX="' + get_option (' prefix' ) + ' "' ,
768766 ' -DGIT_HOST_CPU="' + host_machine .cpu_family() + ' "' ,
769767 ' -DGIT_HTML_PATH="' + get_option (' datadir' ) / ' doc/git-doc"' ,
@@ -774,6 +772,18 @@ libgit_c_args = [
774772 ' -DSHELL_PATH="' + fs.as_posix(target_shell.full_path()) + ' "' ,
775773]
776774
775+ system_attributes = get_option (' gitattributes' )
776+ if system_attributes != ''
777+ libgit_c_args += ' -DETC_GITATTRIBUTES="' + system_attributes + ' "'
778+ else
779+ libgit_c_args += ' -DETC_GITATTRIBUTES="' + get_option (' sysconfdir' ) + ' /gitattributes"'
780+ endif
781+ system_config = get_option (' gitconfig' )
782+ if system_config != ''
783+ libgit_c_args += ' -DETC_GITCONFIG="' + system_config + ' "'
784+ else
785+ libgit_c_args += ' -DETC_GITCONFIG="' + get_option (' sysconfdir' ) + ' /gitconfig"'
786+ endif
777787editor_opt = get_option (' default_editor' )
778788if editor_opt != '' and editor_opt != ' vi'
779789 libgit_c_args += ' -DDEFAULT_EDITOR="' + editor_opt + ' "'
@@ -1585,10 +1595,19 @@ else
15851595 error (' Unsupported CSPRNG backend: ' + csprng_backend)
15861596endif
15871597
1598+ git_exec_path = ' libexec/git-core'
1599+ libexec = get_option (' libexecdir' )
1600+ if libexec != ' libexec' and libexec != ' .'
1601+ git_exec_path = libexec
1602+ endif
1603+
15881604if get_option (' runtime_prefix' )
15891605 libgit_c_args += ' -DRUNTIME_PREFIX'
15901606 build_options_config.set(' RUNTIME_PREFIX' , ' true' )
1591- git_exec_path = get_option (' libexecdir' ) / ' git-core'
1607+
1608+ if git_exec_path.startswith(' /' )
1609+ error (' runtime_prefix requires a relative libexecdir not:' , libexec)
1610+ endif
15921611
15931612 if compiler.has_header(' mach-o/dyld.h' )
15941613 libgit_c_args += ' -DHAVE_NS_GET_EXECUTABLE_PATH'
@@ -1625,7 +1644,6 @@ if get_option('runtime_prefix')
16251644 endif
16261645else
16271646 build_options_config.set(' RUNTIME_PREFIX' , ' false' )
1628- git_exec_path = get_option (' prefix' ) / get_option (' libexecdir' ) / ' git-core'
16291647endif
16301648libgit_c_args += ' -DGIT_EXEC_PATH="' + git_exec_path + ' "'
16311649
0 commit comments