From 2f7dc16995f655aa35fbb0dba8098a800911b53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Wed, 18 Jul 2018 02:26:06 +0300 Subject: [PATCH] build: if libdir is not set, set it to EXEC_PREFIX/lib This way the behavior of default libdir stays consistent before and after switching to gnu_dirs from waf itself. --- wscript | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wscript b/wscript index 01d3c020e8..e0dbeab322 100644 --- a/wscript +++ b/wscript @@ -941,6 +941,12 @@ def options(opt): opt.parser.remove_option("--pdfdir") opt.parser.remove_option("--psdir") + libdir = opt.parser.get_option('--libdir') + if libdir: + # Replace any mention of lib64 as we keep the default + # for libdir the same as before the waf update. + libdir.help = libdir.help.replace('lib64', 'lib') + group = opt.get_option_group("Installation directories") for ident, default, desc in _INSTALL_DIRS_LIST: group.add_option('--{0}'.format(ident), @@ -983,6 +989,7 @@ def is_debug_build(ctx): return getattr(ctx.options, 'enable_debug-build') def configure(ctx): + from waflib import Options ctx.resetenv(ctx.options.variant) ctx.check_waf_version(mini='1.8.4') target = os.environ.get('TARGET') @@ -1013,6 +1020,12 @@ def configure(ctx): ctx.load('detections.devices') ctx.load('gnu_dirs') + # if libdir is not set in command line options, + # override the gnu_dirs default in order to + # always have `lib/` as the library directory. + if not getattr(Options.options, 'LIBDIR', None): + ctx.env['LIBDIR'] = Utils.subst_vars(os.path.join('${EXEC_PREFIX}', 'lib'), ctx.env) + for ident, _, _ in _INSTALL_DIRS_LIST: varname = ident.upper() ctx.env[varname] = getattr(ctx.options, ident)