Skip to content

Commit

Permalink
Use $config{build_file} instead of $target{build_file}
Browse files Browse the repository at this point in the history
If the user specifies an alternative build file than the default, this
alternative is recorded in $config{build_file}, not $target{build_file}.
Therefore, the former should be used, leaving the latter as a mere default.

This is a bug.  While fixing it, document it better too.

Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#20173)

(cherry picked from commit aa2d7e0)
  • Loading branch information
levitte authored and t8m committed Feb 1, 2023
1 parent 0f67990 commit 28b78f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ $target{build_scheme} = [ $target{build_scheme} ]
my ($builder, $builder_platform, @builder_opts) =
@{$target{build_scheme}};

foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm",
foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm",
$builder_platform."-checker.pm")) {
my $checker_path = catfile($srcdir, "Configurations", $checker);
if (-f $checker_path) {
Expand Down Expand Up @@ -1867,8 +1867,8 @@ if ($builder eq "unified") {
# Store the name of the template file we will build the build file from
# in %config. This may be useful for the build file itself.
my @build_file_template_names =
( $builder_platform."-".$target{build_file}.".tmpl",
$target{build_file}.".tmpl" );
( $builder_platform."-".$config{build_file}.".tmpl",
$config{build_file}.".tmpl" );
my @build_file_templates = ();

# First, look in the user provided directory, if given
Expand Down Expand Up @@ -2885,7 +2885,7 @@ exit(0);
#
sub death_handler {
die @_ if $^S; # To prevent the added message in eval blocks
my $build_file = $target{build_file} // "build file";
my $build_file = $config{build_file} // "build file";
my @message = ( <<"_____", @_ );
Failure! $build_file wasn't produced.
Expand Down
8 changes: 8 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,14 @@ and `descrip.mms` on OpenVMS) from a suitable template in `Configurations/`,
and defines various macros in `include/openssl/configuration.h` (generated
from `include/openssl/configuration.h.in`.

If none of the generated build files suit your purpose, it's possible to
write your own build file template and give its name through the environment
variable `BUILDFILE`. For example, Ninja build files could be supported by
writing `Configurations/build.ninja.tmpl` and then configure with `BUILDFILE`
set like this (Unix syntax shown, you'll have to adapt for other platforms):

$ BUILDFILE=build.ninja perl Configure [options...]

### Out of Tree Builds

OpenSSL can be configured to build in a build directory separate from the
Expand Down
2 changes: 1 addition & 1 deletion configdata.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ unless (caller) {
# We do that in two steps, where the first step emits perl
# snipets.

my $buildfile = $target{build_file};
my $buildfile = $config{build_file};
my $buildfile_template = "$buildfile.in";
my @autowarntext = (
'WARNING: do not edit!',
Expand Down

0 comments on commit 28b78f3

Please sign in to comment.