grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
@{$unified_info{programs}}))
-}
+INSTALL_EXPORTERS_PKGCONFIG={-
+ join(" \\\n" . ' ' x 28,
+ fill_lines(" ", $COLUMNS - 28,
+ grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'pkg-config'}
+ sort keys %{$unified_info{generate}}))
+-}
BIN_SCRIPTS={-
join(" \\\n" . ' ' x 12,
fill_lines(" ", $COLUMNS - 12,
bindir={- file_name_is_absolute($bindir)
? $bindir : '$(INSTALLTOP)/$(BINDIR)' -}
+PKGCONFIGDIR=$(libdir)/pkgconfig
+
MANDIR=$(INSTALLTOP)/share/man
DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
HTMLDIR=$(DOCDIR)/html
build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) ## Create HTML documentation
build_generated: $(GENERATED_MANDATORY)
-build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
+build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
build_modules_nodep: $(MODULES)
build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
$(RM) tags TAGS doc-nits md-nits
$(RM) -r test/test-runs
$(RM) providers/fips*.new
- $(RM) openssl.pc libcrypto.pc libssl.pc
-find . -type l \! -name '.*' -exec $(RM) {} \;
distclean: clean ## Clean and remove the configuration
: {- output_off() if sharedaix(); output_on(); "" -}; \
done
@ : {- output_on() if $disabled{shared}; "" -}
- @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)/pkgconfig"
- @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
- @cp libcrypto.pc "$(DESTDIR)$(libdir)/pkgconfig"
- @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
- @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
- @cp libssl.pc "$(DESTDIR)$(libdir)/pkgconfig"
- @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
- @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
- @cp openssl.pc "$(DESTDIR)$(libdir)/pkgconfig"
- @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(PKGCONFIGDIR)"
+ @for e in $(INSTALL_EXPORTERS_PKGCONFIG); do \
+ fn=`basename $$e`; \
+ $(ECHO) "install $$e -> $(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
+ cp $$e "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
+ chmod 644 "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
+ done
uninstall_dev: uninstall_runtime_libs
@$(ECHO) "*** Uninstalling development files"
: {- output_on() unless windowsdll(); "" -}; \
done
@ : {- output_on() if $disabled{shared}; "" -}
- $(RM) "$(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
- $(RM) "$(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
- $(RM) "$(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
- -$(RMDIR) "$(DESTDIR)$(libdir)/pkgconfig"
+ @for e in $(INSTALL_EXPORTERS_PKGCONFIG); do \
+ fn=`basename "$$e"`; \
+ $(RM) "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
+ done
+ -$(RMDIR) "$(DESTDIR)$(PKGCONFIGDIR)"
-$(RMDIR) "$(DESTDIR)$(libdir)"
_install_modules_deps: install_runtime_libs build_modules
# Building targets ###################################################
-libcrypto.pc libssl.pc openssl.pc: Makefile $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
-
-libcrypto.pc:
- @ ( echo 'prefix=$(INSTALLTOP)'; \
- echo 'exec_prefix=$${prefix}'; \
- if [ -n "$(LIBDIR)" ]; then \
- echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
- else \
- echo 'libdir=$(libdir)'; \
- fi; \
- echo 'includedir=$${prefix}/include'; \
- echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
- echo 'modulesdir=$${libdir}/ossl-modules'; \
- echo ''; \
- echo 'Name: OpenSSL-libcrypto'; \
- echo 'Description: OpenSSL cryptography library'; \
- echo 'Version: '$(VERSION); \
- echo 'Libs: -L$${libdir} -lcrypto'; \
- echo 'Libs.private: $(LIB_EX_LIBS)'; \
- echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
-
-libssl.pc:
- @ ( echo 'prefix=$(INSTALLTOP)'; \
- echo 'exec_prefix=$${prefix}'; \
- if [ -n "$(LIBDIR)" ]; then \
- echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
- else \
- echo 'libdir=$(libdir)'; \
- fi; \
- echo 'includedir=$${prefix}/include'; \
- echo ''; \
- echo 'Name: OpenSSL-libssl'; \
- echo 'Description: Secure Sockets Layer and cryptography libraries'; \
- echo 'Version: '$(VERSION); \
- echo 'Requires.private: libcrypto'; \
- echo 'Libs: -L$${libdir} -lssl'; \
- echo 'Cflags: -I$${includedir}' ) > libssl.pc
-
-openssl.pc:
- @ ( echo 'prefix=$(INSTALLTOP)'; \
- echo 'exec_prefix=$${prefix}'; \
- if [ -n "$(LIBDIR)" ]; then \
- echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
- else \
- echo 'libdir=$(libdir)'; \
- fi; \
- echo 'includedir=$${prefix}/include'; \
- echo ''; \
- echo 'Name: OpenSSL'; \
- echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
- echo 'Version: '$(VERSION); \
- echo 'Requires: libssl libcrypto' ) > openssl.pc
-
Makefile: configdata.pm \
{- join(" \\\n" . ' ' x 10,
fill_lines(" ", $COLUMNS - 10,
--- /dev/null
+#! /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;
+_____