aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build30
1 files changed, 25 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index a1476e5b32..d938bc8822 100644
--- a/meson.build
+++ b/meson.build
@@ -743,7 +743,7 @@ build_options_config.set('GIT_TEST_OPTS', '')
build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')
build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))
build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
-build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
+build_options_config.set_quoted('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
if get_option('sane_tool_path').length() != 0
sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))
@@ -761,8 +761,6 @@ endif
libgit_c_args = [
'-DBINDIR="' + get_option('bindir') + '"',
'-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"',
- '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"',
- '-DETC_GITCONFIG="' + get_option('gitconfig') + '"',
'-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"',
'-DGIT_HOST_CPU="' + host_machine.cpu_family() + '"',
'-DGIT_HTML_PATH="' + get_option('datadir') / 'doc/git-doc"',
@@ -773,6 +771,20 @@ libgit_c_args = [
'-DSHELL_PATH="' + fs.as_posix(target_shell.full_path()) + '"',
]
+system_attributes = get_option('gitattributes')
+if system_attributes != ''
+ libgit_c_args += '-DETC_GITATTRIBUTES="' + system_attributes + '"'
+else
+ libgit_c_args += '-DETC_GITATTRIBUTES="' + get_option('sysconfdir') / 'gitattributes"'
+endif
+
+system_config = get_option('gitconfig')
+if system_config != ''
+ libgit_c_args += '-DETC_GITCONFIG="' + system_config + '"'
+else
+ libgit_c_args += '-DETC_GITCONFIG="' + get_option('sysconfdir') / 'gitconfig"'
+endif
+
editor_opt = get_option('default_editor')
if editor_opt != '' and editor_opt != 'vi'
libgit_c_args += '-DDEFAULT_EDITOR="' + editor_opt + '"'
@@ -1584,10 +1596,19 @@ else
error('Unsupported CSPRNG backend: ' + csprng_backend)
endif
+git_exec_path = 'libexec/git-core'
+libexec = get_option('libexecdir')
+if libexec != 'libexec' and libexec != '.'
+ git_exec_path = libexec
+endif
+
if get_option('runtime_prefix')
libgit_c_args += '-DRUNTIME_PREFIX'
build_options_config.set('RUNTIME_PREFIX', 'true')
- git_exec_path = get_option('libexecdir') / 'git-core'
+
+ if git_exec_path.startswith('/')
+ error('runtime_prefix requires a relative libexecdir not:', libexec)
+ endif
if compiler.has_header('mach-o/dyld.h')
libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'
@@ -1624,7 +1645,6 @@ if get_option('runtime_prefix')
endif
else
build_options_config.set('RUNTIME_PREFIX', 'false')
- git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core'
endif
libgit_c_args += '-DGIT_EXEC_PATH="' + git_exec_path + '"'