summaryrefslogtreecommitdiff
path: root/Configurations/unix-Makefile.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-04-26 09:17:05 +0200
committerRichard Levitte <levitte@openssl.org>2021-04-28 21:35:26 +0200
commit2e535eb50aa9c6b73c796f668e1aef8bc17f14c4 (patch)
tree0142e28aa342ecc6cdb3fbdf01446544222f9609 /Configurations/unix-Makefile.tmpl
parent0bd138b8c36c7e8e504beb2c12a2771929c24cfb (diff)
downloadopenssl-new-2e535eb50aa9c6b73c796f668e1aef8bc17f14c4.tar.gz
Configuration: rework how dependency making is handled
Previously, we had dependency making pretty much hard coded in the build file templates, with a bit of an exception for Unix family platforms, where we had different cases depending on what dependency making program was found. With the Embarcadero C++ builder, a separate scheme appeared, with a different logic. This change merges the two, and introduces two config target attributes: makedepcmd The program to use, where this is relevant. This replaces the earlier configuration attribute 'makedepprog'. makedep_scheme This is a keyword that can be used by build files templates to produce different sorts of commands, but most importantly, to pass as argument to util/add-depend.pl, which uses this keyword as a "producer" for the dependency lines. If the config target doesn't define the 'makedep_scheme' attribute, Configure tries to figure it out by looking for GCC compatible compilers or for the 'makedepend' command. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/15006)
Diffstat (limited to 'Configurations/unix-Makefile.tmpl')
-rw-r--r--Configurations/unix-Makefile.tmpl14
1 files changed, 6 insertions, 8 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index be6036c227..e2df304061 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -3,7 +3,8 @@
##
## {- join("\n## ", @autowarntext) -}
{-
- our $makedepprog = platform->makedepprog();
+ our $makedep_scheme = $config{makedep_scheme};
+ our $makedepcmd = platform->makedepcmd();
sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
@@ -315,7 +316,7 @@ CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
-MAKEDEPEND={- $config{makedepprog} -}
+MAKEDEPEND={- $config{makedepcmd} -}
PERL={- $config{PERL} -}
@@ -570,9 +571,7 @@ distclean: clean
# concatenate only if that is true.
depend:
@: {- output_off() if $disabled{makedepend}; "" -}
- @$(PERL) $(SRCDIR)/util/add-depends.pl {-
- defined $makedepprog && $makedepprog =~ /\/makedepend/
- ? 'makedepend' : 'gcc' -}
+ @$(PERL) $(SRCDIR)/util/add-depends.pl "{- $makedep_scheme -}"
@: {- output_on() if $disabled{makedepend}; "" -}
# Install helper targets #############################################
@@ -1516,8 +1515,7 @@ EOF
$obj: $deps
$cmd $incs $defs $cmdflags -c -o \$\@ $srcs
EOF
- } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
- && !grep /\.rc$/, @srcs) {
+ } elsif ($makedep_scheme eq 'gcc' && !grep /\.rc$/, @srcs) {
$recipe .= <<"EOF";
$obj: $deps
$cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
@@ -1533,7 +1531,7 @@ EOF
$obj: $deps
$cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
EOF
- if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
+ if ($makedep_scheme eq 'makedepend') {
$recipe .= <<"EOF";
\$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
> $dep