]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix util/mkinstallvars.pl to treat LIBDIR and libdir correctly
authorRichard Levitte <levitte@openssl.org>
Sat, 3 Jan 2026 12:19:49 +0000 (13:19 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 8 Jan 2026 11:30:24 +0000 (12:30 +0100)
OpenSSL's build file (Makefile) handles library directories via two
variables, 'LIBDIR' and 'libdir', where the former is empty when the
path given through ./Configure's '--libdir' is absolute.

This was forgotten when treating the resulting values in,
util/mkinstallvars.pl, which got libdir in exporters/libcrypto.pc
to not be quite right if .Configure was called with a '--libdir'
with an absolute path.

The fix turns out to be quite easy.

Resolves: https://github.com/openssl/openssl/issues/28779

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29540)

util/mkinstallvars.pl

index 10fd868b18874a7339a8e67a1e5571df76829fb8..0213c6f55f251b861ceb304cb81fa0b12c469d46 100644 (file)
@@ -45,6 +45,17 @@ foreach (@ARGV) {
     push @{$values{$k}}, $v;
 }
 
+# special case for LIBDIR vs libdir.
+# For installations, They both get their value from ./Configure's --libdir or
+# corresponding config target attribute, but LIBDIR only gets a value if the
+# configuration is a relative path, while libdir always gets a value, so if
+# the former doesn't have a value, we give it the latter's value, and rely
+# on mechanisms further down to do the rest of the processing.
+# If they're both empty, it's still fine.
+print STDERR "DEBUG: LIBDIR = $values{LIBDIR}->[0], libdir = $values{libdir}->[0] => ";
+$values{LIBDIR}->[0] = $values{libdir}->[0] unless $values{LIBDIR}->[0];
+print STDERR "LIBDIR = $values{LIBDIR}->[0]\n";
+
 # warn if there are missing values, and also if there are unexpected values
 foreach my $k (sort keys %all) {
     warn "No value given for $k\n" unless $keys{$k};