-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up exporters, specifically those we have for pkg-config
The pkg-config exporters were a special hack, all in Configurations/unix-Makefile.tmpl, and this was well and good as long as that was the only main package interface configuration system that we cared about. Things have changed, though, so we move the pkg-config production to be templatable in a more flexible manner. Additional templates for other interface configuration systems can then be added fairly easily. Two variants of the .pc files are produced: - Those in 'exporters/' are installed in the location that 'pkg-config' itself prefers for installed packages. - Those in the top directory are to be used when it's desirable to build directly against an OpenSSL build tree. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #20878)
- Loading branch information
Showing
8 changed files
with
150 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# For installation: libcrypto.pc, libssl.pc, and openssl.pc | ||
GENERATE[libcrypto.pc]{exporter=pkg-config}=pkg-config/libcrypto.pc.in | ||
DEPEND[libcrypto.pc]=../installdata.pm | ||
GENERATE[libssl.pc]{exporter=pkg-config}=pkg-config/libssl.pc.in | ||
DEPEND[libssl.pc]=../installdata.pm | ||
GENERATE[openssl.pc]{exporter=pkg-config}=pkg-config/openssl.pc.in | ||
DEPEND[openssl.pc]=../installdata.pm | ||
DEPEND[openssl.pc]=libcrypto.pc libssl.pc | ||
|
||
DEPEND[""]=openssl.pc | ||
|
||
GENERATE[../installdata.pm]=../util/mkinstallvars.pl \ | ||
"PREFIX=$(INSTALLTOP)" BINDIR=bin "LIBDIR=$(LIBDIR)" \ | ||
INCLUDEDIR=include APPLINKDIR=include/openssl \ | ||
"ENGINESDIR=$(ENGINESDIR)" "MODULESDIR=$(MODULESDIR)" \ | ||
"VERSION=$(VERSION)" "LDLIBS=$(LIB_EX_LIBS)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
libdir={- $OpenSSL::safe::installdata::LIBDIR -} | ||
includedir={- $OpenSSL::safe::installdata::INCLUDEDIR -} | ||
enginesdir={- $OpenSSL::safe::installdata::ENGINESDIR -} | ||
modulesdir={- $OpenSSL::safe::installdata::MODULESDIR -} | ||
|
||
Name: OpenSSL-libcrypto | ||
Description: OpenSSL cryptography library | ||
Version: {- $OpenSSL::safe::installdata::VERSION -} | ||
Libs: -L${libdir} -lcrypto | ||
Libs.private: {- join(' ', @OpenSSL::safe::installdata::LDLIBS) -} | ||
Cflags: -I${includedir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
libdir={- $OpenSSL::safe::installdata::LIBDIR -} | ||
includedir={- $OpenSSL::safe::installdata::INCLUDEDIR -} | ||
|
||
Name: OpenSSL-libssl | ||
Description: Secure Sockets Layer and cryptography libraries | ||
Version: {- $OpenSSL::safe::installdata::VERSION -} | ||
Requires.private: libcrypto | ||
Libs: -L${libdir} -lssl | ||
Cflags: -I${includedir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
libdir={- $OpenSSL::safe::installdata::LIBDIR -} | ||
includedir={- $OpenSSL::safe::installdata::INCLUDEDIR -} | ||
|
||
Name: OpenSSL | ||
Description: Secure Sockets Layer and cryptography libraries and tools | ||
Version: {- $OpenSSL::safe::installdata::VERSION -} | ||
Requires: libssl libcrypto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#! /usr/bin/env perl | ||
# Copyright 2021 The OpenSSL Project Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License 2.0 (the "License"). You may not use | ||
# this file except in compliance with the License. You can obtain a copy | ||
# in the file LICENSE in the source distribution or at | ||
# https://www.openssl.org/source/license.html | ||
|
||
# All variables are supposed to come from Makefile, in environment variable | ||
# form, or passed as variable assignments on the command line. | ||
# The result is a Perl module creating the package OpenSSL::safe::installdata. | ||
|
||
use File::Spec; | ||
|
||
# These are expected to be set up as absolute directories | ||
my @absolutes = qw(PREFIX); | ||
# These may be absolute directories, and if not, they are expected to be set up | ||
# as subdirectories to PREFIX | ||
my @subdirs = qw(BINDIR LIBDIR INCLUDEDIR ENGINESDIR MODULESDIR APPLINKDIR); | ||
|
||
my %keys = (); | ||
foreach (@ARGV) { | ||
(my $k, my $v) = m|^([^=]*)=(.*)$|; | ||
$keys{$k} = 1; | ||
$ENV{$k} = $v; | ||
} | ||
foreach my $k (sort keys %keys) { | ||
my $v = $ENV{$k}; | ||
$v = File::Spec->rel2abs($v) if $v && grep { $k eq $_ } @absolutes; | ||
$ENV{$k} = $v; | ||
} | ||
foreach my $k (sort keys %keys) { | ||
my $v = $ENV{$k} || '.'; | ||
$v = File::Spec->rel2abs($v, $ENV{PREFIX}) | ||
if ($v && !File::Spec->file_name_is_absolute($v) | ||
&& grep { $k eq $_ } @subdirs); | ||
$ENV{$k} = $v; | ||
} | ||
|
||
print <<_____; | ||
package OpenSSL::safe::installdata; | ||
use strict; | ||
use warnings; | ||
use Exporter; | ||
our \@ISA = qw(Exporter); | ||
our \@EXPORT = qw(\$PREFIX \$BINDIR \$LIBDIR \$INCLUDEDIR \$APPLINKDIR | ||
\$ENGINESDIR \$MODULESDIR \$VERSION \$LDLIBS); | ||
our \$PREFIX = '$ENV{PREFIX}'; | ||
our \$BINDIR = '$ENV{BINDIR}'; | ||
our \$LIBDIR = '$ENV{LIBDIR}'; | ||
our \$INCLUDEDIR = '$ENV{INCLUDEDIR}'; | ||
our \$ENGINESDIR = '$ENV{ENGINESDIR}'; | ||
our \$MODULESDIR = '$ENV{MODULESDIR}'; | ||
our \$APPLINKDIR = '$ENV{APPLINKDIR}'; | ||
our \$VERSION = '$ENV{VERSION}'; | ||
our \@LDLIBS = | ||
# Unix and Windows use space separation, VMS uses comma separation | ||
split(/ +| *, */, '$ENV{LDLIBS}'); | ||
1; | ||
_____ |