From 8c11c69b7994fc6cb877e7b7b244e6fd417ce206 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 26 Apr 2021 15:08:18 +0100
Subject: [PATCH] helpers: Check for $LIB = lib32, lib64 generically

pressure-vessel is currently x86-only, but we want to be portable to
non-x86 if it's easy to do. It's reasonably common for all architectures
to use lib, lib32 or lib64 for $LIB.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 helpers/meson.build | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/helpers/meson.build b/helpers/meson.build
index 10bf79657..f97dca075 100644
--- a/helpers/meson.build
+++ b/helpers/meson.build
@@ -164,13 +164,20 @@ executable(
 
 subdir('lib')
 
+sizeof_pointer = c_compiler.sizeof('void*')
+
+if sizeof_pointer == 4
+  subdir('lib32')
+elif sizeof_pointer == 8
+  subdir('lib64')
+endif
+
 if multiarch == 'i386-linux-gnu'
   subdir('i386')
   subdir('i486')
   subdir('i586')
   subdir('i686')
 
-  subdir('lib32')
   subdir('lib/i386-linux-gnu')
 
   # This is to support Ubuntu 12.04 where $LIB wrongly expanded to just
@@ -181,7 +188,6 @@ elif multiarch == 'x86_64-linux-gnu'
   subdir('x86_64')
   subdir('xeon_phi')
 
-  subdir('lib64')
   subdir('lib/x86_64-linux-gnu')
 
   # To support Ubuntu 12.04, see above
-- 
GitLab