aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-12-27 23:43:35 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-12-30 00:51:19 +0200
commitda5da5977ab975480570b06b72df98318f2efd23 (patch)
tree25bd67ae292b092df226dd354a7d54f4da2c880e /mesonbuild
parentab3aeeffe92bc874d5f5a04af0ae9dc568a09ce7 (diff)
downloadmeson-da5da5977ab975480570b06b72df98318f2efd23.zip
meson-da5da5977ab975480570b06b72df98318f2efd23.tar.gz
meson-da5da5977ab975480570b06b72df98318f2efd23.tar.bz2
Default libdir is "lib" when cross compiling. Closes #2535.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/coredata.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index d70c230..4e2f3e0 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -299,6 +299,7 @@ class CoreData:
# Only to print a warning if it changes between Meson invocations.
self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '')
self.config_files = self.__load_config_files(options.native_file)
+ self.libdir_cross_fixup()
@staticmethod
def __load_config_files(filenames):
@@ -348,6 +349,13 @@ class CoreData:
raise MesonException('Cannot find specified cross file: ' + filename)
+ def libdir_cross_fixup(self):
+ # By default set libdir to "lib" when cross compiling since
+ # getting the "system default" is always wrong on multiarch
+ # platforms as it gets a value like lib/x86_64-linux-gnu.
+ if self.cross_file is not None:
+ self.builtins['libdir'].value = 'lib'
+
def sanitize_prefix(self, prefix):
if not os.path.isabs(prefix):
raise MesonException('prefix value {!r} must be an absolute path'