@@ -743,7 +743,7 @@ build_options_config.set('GIT_TEST_OPTS', '')
743
743
build_options_config.set(' GIT_TEST_PERL_FATAL_WARNINGS' , '' )
744
744
build_options_config.set_quoted(' GIT_TEST_UTF8_LOCALE' , get_option (' test_utf8_locale' ))
745
745
build_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' ))
747
747
748
748
if get_option (' sane_tool_path' ).length() != 0
749
749
sane_tool_path = (host_machine .system() == ' windows' ? ' ;' : ' :' ).join(get_option (' sane_tool_path' ))
@@ -761,8 +761,6 @@ endif
761
761
libgit_c_args = [
762
762
' -DBINDIR="' + get_option (' bindir' ) + ' "' ,
763
763
' -DDEFAULT_GIT_TEMPLATE_DIR="' + get_option (' datadir' ) / ' git-core/templates' + ' "' ,
764
- ' -DETC_GITATTRIBUTES="' + get_option (' gitattributes' ) + ' "' ,
765
- ' -DETC_GITCONFIG="' + get_option (' gitconfig' ) + ' "' ,
766
764
' -DFALLBACK_RUNTIME_PREFIX="' + get_option (' prefix' ) + ' "' ,
767
765
' -DGIT_HOST_CPU="' + host_machine .cpu_family() + ' "' ,
768
766
' -DGIT_HTML_PATH="' + get_option (' datadir' ) / ' doc/git-doc"' ,
@@ -773,6 +771,20 @@ libgit_c_args = [
773
771
' -DSHELL_PATH="' + fs.as_posix(target_shell.full_path()) + ' "' ,
774
772
]
775
773
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
+
776
788
editor_opt = get_option (' default_editor' )
777
789
if editor_opt != '' and editor_opt != ' vi'
778
790
libgit_c_args += ' -DDEFAULT_EDITOR="' + editor_opt + ' "'
@@ -1584,10 +1596,19 @@ else
1584
1596
error (' Unsupported CSPRNG backend: ' + csprng_backend)
1585
1597
endif
1586
1598
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
+
1587
1605
if get_option (' runtime_prefix' )
1588
1606
libgit_c_args += ' -DRUNTIME_PREFIX'
1589
1607
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
1591
1612
1592
1613
if compiler.has_header(' mach-o/dyld.h' )
1593
1614
libgit_c_args += ' -DHAVE_NS_GET_EXECUTABLE_PATH'
@@ -1624,7 +1645,6 @@ if get_option('runtime_prefix')
1624
1645
endif
1625
1646
else
1626
1647
build_options_config.set(' RUNTIME_PREFIX' , ' false' )
1627
- git_exec_path = get_option (' prefix' ) / get_option (' libexecdir' ) / ' git-core'
1628
1648
endif
1629
1649
libgit_c_args += ' -DGIT_EXEC_PATH="' + git_exec_path + ' "'
1630
1650
0 commit comments