From: Viktor Szakats Date: Fri, 27 Aug 2021 12:22:15 +0000 (+0000) Subject: Configure: do not check for an absolute prefix in cross-builds X-Git-Tag: openssl-3.3.0-alpha1~610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ea752997df83c2a694fdb157aab07908303fc90;p=thirdparty%2Fopenssl.git Configure: do not check for an absolute prefix in cross-builds The check is always made according to the host platform's rules, which may not be true for true when the target platform is different, e.g. when cross-building for Windows on a Linux machine. So skip this check when used together with the `--cross-compile-prefix=` option. Fixes https://github.com/openssl/openssl/issues/9520 Reviewed-by: Paul Dale Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22723) --- diff --git a/Configure b/Configure index d7f5ef8ce33..cbba1749b5a 100755 --- a/Configure +++ b/Configure @@ -980,8 +980,6 @@ while (@argvcopy) if (/^--prefix=(.*)$/) { $config{prefix}=$1; - die "Directory given with --prefix MUST be absolute\n" - unless file_name_is_absolute($config{prefix}); } elsif (/^--api=(.*)$/) { @@ -1440,6 +1438,11 @@ foreach (keys %useradd) { # At this point, we can forget everything about %user and %useradd, # because it's now all been merged into the corresponding $config entry +if ($config{prefix} && !$config{CROSS_COMPILE}) { + die "Directory given with --prefix MUST be absolute\n" + unless file_name_is_absolute($config{prefix}); +} + if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) { disable('static', 'pic', 'threads'); }