@@ -743,7 +743,7 @@ build_options_config.set('GIT_TEST_OPTS', '')
743743build_options_config.set(' GIT_TEST_PERL_FATAL_WARNINGS' , '' )
744744build_options_config.set_quoted(' GIT_TEST_UTF8_LOCALE' , get_option (' test_utf8_locale' ))
745745build_options_config.set_quoted(' LOCALEDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' localedir' )))
746- build_options_config.set (' GITWEBDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' datadir' ) / ' gitweb' ))
746+ build_options_config.set_quoted (' GITWEBDIR' , fs.as_posix(get_option (' prefix' ) / get_option (' datadir' ) / ' gitweb' ))
747747
748748if get_option (' sane_tool_path' ).length() != 0
749749 sane_tool_path = (host_machine .system() == ' windows' ? ' ;' : ' :' ).join(get_option (' sane_tool_path' ))
@@ -761,8 +761,6 @@ endif
761761libgit_c_args = [
762762 ' -DBINDIR="' + get_option (' bindir' ) + ' "' ,
763763 ' -DDEFAULT_GIT_TEMPLATE_DIR="' + get_option (' datadir' ) / ' git-core/templates' + ' "' ,
764- ' -DETC_GITATTRIBUTES="' + get_option (' gitattributes' ) + ' "' ,
765- ' -DETC_GITCONFIG="' + get_option (' gitconfig' ) + ' "' ,
766764 ' -DFALLBACK_RUNTIME_PREFIX="' + get_option (' prefix' ) + ' "' ,
767765 ' -DGIT_HOST_CPU="' + host_machine .cpu_family() + ' "' ,
768766 ' -DGIT_HTML_PATH="' + get_option (' datadir' ) / ' doc/git-doc"' ,
@@ -773,6 +771,20 @@ libgit_c_args = [
773771 ' -DSHELL_PATH="' + fs.as_posix(target_shell.full_path()) + ' "' ,
774772]
775773
774+ system_attributes = get_option (' gitattributes' )
775+ if system_attributes != ''
776+ libgit_c_args += ' -DETC_GITATTRIBUTES="' + system_attributes + ' "'
777+ else
778+ libgit_c_args += ' -DETC_GITATTRIBUTES="' + get_option (' sysconfdir' ) + ' /gitattributes"'
779+ endif
780+
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
787+
776788editor_opt = get_option (' default_editor' )
777789if editor_opt != '' and editor_opt != ' vi'
778790 libgit_c_args += ' -DDEFAULT_EDITOR="' + editor_opt + ' "'
@@ -1584,10 +1596,19 @@ else
15841596 error (' Unsupported CSPRNG backend: ' + csprng_backend)
15851597endif
15861598
1599+ git_exec_path = ' libexec/git-core'
1600+ libexec = get_option (' libexecdir' )
1601+ if libexec != ' libexec' and libexec != ' .'
1602+ git_exec_path = libexec
1603+ endif
1604+
15871605if get_option (' runtime_prefix' )
15881606 libgit_c_args += ' -DRUNTIME_PREFIX'
15891607 build_options_config.set(' RUNTIME_PREFIX' , ' true' )
1590- git_exec_path = get_option (' libexecdir' ) / ' git-core'
1608+
1609+ if git_exec_path.startswith(' /' )
1610+ error (' runtime_prefix requires a relative libexecdir not:' , libexec)
1611+ endif
15911612
15921613 if compiler.has_header(' mach-o/dyld.h' )
15931614 libgit_c_args += ' -DHAVE_NS_GET_EXECUTABLE_PATH'
@@ -1624,7 +1645,6 @@ if get_option('runtime_prefix')
16241645 endif
16251646else
16261647 build_options_config.set(' RUNTIME_PREFIX' , ' false' )
1627- git_exec_path = get_option (' prefix' ) / get_option (' libexecdir' ) / ' git-core'
16281648endif
16291649libgit_c_args += ' -DGIT_EXEC_PATH="' + git_exec_path + ' "'
16301650
0 commit comments