From: Gerald Pfeifer Subject: [PATCH] makedep: Handle amd64 as x86-64. Message-Id: <20210917054120.3581833E82@hamza.pair.com> Date: Fri, 17 Sep 2021 07:41:15 +0200 (CEST) For historic reasons FreeBSD call x86-64 by the name of amd64. And when building ports it uses a variable named ARCH to hold that value (or i386 for x86). Wine uses a variable by that name, too, which gets overriden by the one coming from the system, leading to Wine not finding some of its files (since "x86-64" is hardcoded elsewhere). I was thinking to rename Wine's variable from ARCH to WINEARCH, alas that name is already taken for a different purpose. So best have makedep accept amd64 as a synonym for x86-64 and convert the former to the latter. Signed-off-by: Gerald Pfeifer --- tools/makedep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/makedep.c b/tools/makedep.c index 59857762edd..ed7a58ed1f9 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -4446,6 +4446,13 @@ int main( int argc, char *argv[] ) if (!man_ext) man_ext = "3w"; if (arch) { + /* For historic reasons FreeBSD calls x86-64 by the name of amd64 + * and features a variable ARCH with that value in the environment + * when building ports. This breaks Wine in interesting ways, so + * revert to the industry standard name when we enouncter amd64. + */ + if ( !strcmp(arch,"amd64") ) + arch = "x86-64"; so_dir = strmake( "$(dlldir)/%s-unix", arch ); pe_dir = strmake( "$(dlldir)/%s-windows", arch ); } -- 2.31.1