summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-07 14:38:54 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-07 18:25:56 +0100
commit66ddf178b4eaac6d65f8ba56821f69b598556cec (patch)
tree3751e8f7350f251bff93893bed5e08ee4c109e37
parentae4c7450754ea13265edd69e6ff74d87c89401cd (diff)
Unified - Adapt the Unix and VMS templates to support GENERATE
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r--Configurations/descrip.mms.tmpl15
-rw-r--r--Configurations/unix-Makefile.tmpl37
2 files changed, 52 insertions, 0 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index ef59d425e4..157ebb5d32 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -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};
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 50dafd284a..226f5bdfa8 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -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};