From 11f63105d003e222576a4e23ab106af2fc5a7741 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 17 Mar 2016 10:18:21 +0530 Subject: [PATCH] New builtin option: libexecdir for installation of helper executables --- mesonbuild/coredata.py | 2 ++ mesonbuild/environment.py | 3 +++ mesonbuild/mconf.py | 1 + mesonbuild/mesonlib.py | 4 ++++ mesonbuild/mesonmain.py | 2 ++ 5 files changed, 12 insertions(+) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 2a735771e..9e927e377 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -28,6 +28,7 @@ builtin_options = {'buildtype': True, 'unity': True, 'prefix': True, 'libdir' : True, + 'libexecdir' : True, 'bindir' : True, 'includedir' : True, 'datadir' : True, @@ -159,6 +160,7 @@ class CoreData(): def init_builtins(self, options): self.builtin_options['prefix'] = UserStringOption('prefix', 'Installation prefix', options.prefix) self.builtin_options['libdir'] = UserStringOption('libdir', 'Library dir', options.libdir) + self.builtin_options['libexecdir'] = UserStringOption('libexecdir', 'Library executables dir', options.libexecdir) self.builtin_options['bindir'] = UserStringOption('bindir', 'Executable dir', options.bindir) self.builtin_options['includedir'] = UserStringOption('includedir', 'Include dir', options.includedir) self.builtin_options['datadir'] = UserStringOption('datadir', 'Data directory', options.datadir) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 1586248e5..61954afec 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -590,6 +590,9 @@ class Environment(): def get_libdir(self): return self.coredata.get_builtin_option('libdir') + def get_libexecdir(self): + return self.coredata.get_builtin_option('libexecdir') + def get_bindir(self): return self.coredata.get_builtin_option('bindir') diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index 03cbe55d6..72b3fbe5f 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -154,6 +154,7 @@ class Conf: parr = [] parr.append(['prefix', 'Install prefix', self.coredata.get_builtin_option('prefix'), '']) parr.append(['libdir', 'Library directory', self.coredata.get_builtin_option('libdir'), '']) + parr.append(['libexecdir', 'Library executables directory', self.coredata.get_builtin_option('libexecdir'), '']) parr.append(['bindir', 'Binary directory', self.coredata.get_builtin_option('bindir'), '']) parr.append(['includedir', 'Header directory', self.coredata.get_builtin_option('includedir'), '']) parr.append(['datadir', 'Data directory', self.coredata.get_builtin_option('datadir'), '']) diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index ac605bf36..2087eee68 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -173,6 +173,10 @@ def default_libdir(): return 'lib64' return 'lib' +def default_libexecdir(): + # There is no way to auto-detect this, so it must be set at build time + return 'libexec' + def get_library_dirs(): if is_windows(): return ['C:/mingw/lib'] # Fixme diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 95e6731c6..0186006c3 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -39,6 +39,8 @@ parser.add_argument('--prefix', default=def_prefix, dest='prefix', help='the installation prefix (default: %(default)s)') parser.add_argument('--libdir', default=mesonlib.default_libdir(), dest='libdir', help='the installation subdir of libraries (default: %(default)s)') +parser.add_argument('--libexecdir', default=mesonlib.default_libexecdir(), dest='libexecdir', + help='the installation subdir of library executables (default: %(default)s)') parser.add_argument('--bindir', default='bin', dest='bindir', help='the installation subdir of executables (default: %(default)s)') parser.add_argument('--includedir', default='include', dest='includedir',