Unified - Adapt the Unix and VMS templates to support GENERATE

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Richard Levitte 2016-03-07 14:38:54 +01:00
parent ae4c745075
commit 66ddf178b4
2 changed files with 52 additions and 0 deletions

View file

@ -407,6 +407,21 @@ configdata.pm : {- join(" ", sourcefile("Configurations", "descrip.mms.tmpl"), s
{-
use File::Basename;
use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
sub generatesrc {
my %args = @_;
my $generator = join(" ", @{$args{generator}});
if ($args{src} !~ /\.[sS]$/) {
return <<"EOF";
$args{src} : $args{generator}->[0]
\$(PERL) $generator > \$@
EOF
} else {
die "No method to generate assembler source present.\n";
}
}
sub src2obj {
my %args = @_;
my $obj = $args{obj};

View file

@ -816,6 +816,43 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/commo
return map { shlib_simple($_) } @_;
}
sub generatesrc {
my %args = @_;
my $generator = join(" ", @{$args{generator}});
if ($args{src} !~ /\.[sS]$/) {
return <<"EOF";
$args{src}: $args{generator}->[0]
\$(PERL) $generator > \$@
EOF
} else {
if ($args{generator}->[0] =~ /\.[sS]$/) {
return <<"EOF";
$args{src}: $args{generator}->[0]
\$(CC) \$(CFLAGS) -E \$< > \$@
EOF
} elsif ($args{generator}->[0] =~ /\.pl$/) {
return <<"EOF";
$args{src}: $args{generator}->[0]
( trap "rm -f \$@.S" INT; \\
CC="\$(CC)" \$(PERL) $generator \$@.S; \\
if grep '^#' \$@.S >/dev/null; then \\
\$(CC) -E -P \$@.S > \$@ && rm -f \$@.S; \\
else \\
mv \$@.S \$@; \\
fi )
EOF
} elsif ($args{generator}->[0] =~ /\.m4$/) {
return <<"EOF";
$args{src}: $args{generator}->[0]
m4 -B 8192 $generator > \$@
EOF
} else {
die "Generator type for $args{src} unknown: $args{generator}\n";
}
}
}
sub src2obj {
my %args = @_;
my $obj = $args{obj};