From cff64af5532d3a1b0e2e9adf88454887efba01b2 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 20 Nov 2019 14:58:20 +0100 Subject: [PATCH] Configure: make it possible to have generated generators This makes it possible to chain GENERATOR statements, which allows constructs like this: GENERATE[something.html]=something.pod GENERATE[something.pod]=something.pod.in Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/6236) --- Configure | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Configure b/Configure index 11c9479416..bad09ed8a3 100755 --- a/Configure +++ b/Configure @@ -2124,10 +2124,18 @@ EOF my $dest = $_; my $ddest = cleanfile($buildd, $_, $blddir); die "more than one generator for $dest: " - ,join(" ", @{$generate{$_}}),"\n" - if scalar @{$generate{$_}} > 1; + ,join(" ", @{$generate{$_}}),"\n" + if scalar @{$generate{$_}} > 1; my @generator = split /\s+/, $generate{$dest}->[0]; - $generator[0] = cleanfile($sourced, $generator[0], $blddir), + my $gen = $generator[0]; + $generator[0] = cleanfile($sourced, $gen, $blddir); + + # If the generator isn't in the source tree, we assume it's + # generated in the build tree + if ($generate{$gen}) { + $generator[0] = cleanfile($buildd, $gen, $blddir); + } + $unified_info{generate}->{$ddest} = [ @generator ]; } -- 2.25.1