Build files: Separate 'lib' intent from 'shlib' intent

This is in preparation for having separate CFLAGS variables for static
and for shared library builds.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7159)
This commit is contained in:
Richard Levitte 2018-09-10 02:28:39 +02:00
parent bec2db1809
commit 9dfc868025
4 changed files with 24 additions and 10 deletions

View file

@ -133,7 +133,7 @@
# If this is somehow a compiled object, take care of it that way # If this is somehow a compiled object, take care of it that way
# Otherwise, it might simply be generated # Otherwise, it might simply be generated
if (defined $unified_info{sources}->{$_}) { if (defined $unified_info{sources}->{$_}) {
doobj($_, $lib, intent => "lib", installed => is_installed($lib)); doobj($_, $lib, intent => "shlib", installed => is_installed($lib));
} else { } else {
dogenerate($_, undef, undef, intent => "lib"); dogenerate($_, undef, undef, intent => "lib");
} }

View file

@ -777,11 +777,13 @@ EOF
} }
my $cppflags = { my $cppflags = {
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
} -> {$args{intent}}; } -> {$args{intent}};
my @incs_cmds = includes({ lib => '$(LIB_INCLUDES)', my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
lib => '$(LIB_INCLUDES)',
dso => '$(DSO_INCLUDES)', dso => '$(DSO_INCLUDES)',
bin => '$(BIN_INCLUDES)' } -> {$args{intent}}, bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
'$(CNF_INCLUDES)', '$(CNF_INCLUDES)',
@ -844,7 +846,8 @@ EOF
my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !"; my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
if ($srcs[0] =~ /\.asm$/) { if ($srcs[0] =~ /\.asm$/) {
my $asflags = { lib => ' $(LIB_ASFLAGS)', my $asflags = { shlib => ' $(LIB_ASFLAGS)',
lib => ' $(LIB_ASFLAGS)',
dso => ' $(DSO_ASFLAGS)', dso => ' $(DSO_ASFLAGS)',
bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}}; bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
return <<"EOF"; return <<"EOF";
@ -858,19 +861,23 @@ EOF
my $cflags; my $cflags;
if ($args{installed}) { if ($args{installed}) {
$cflags = { lib => '$(LIB_CFLAGS)', $cflags = { shlib => '$(LIB_CFLAGS)',
lib => '$(LIB_CFLAGS)',
dso => '$(DSO_CFLAGS)', dso => '$(DSO_CFLAGS)',
bin => '$(BIN_CFLAGS)' } -> {$args{intent}}; bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
} else { } else {
$cflags = { lib => '$(NO_INST_LIB_CFLAGS)', $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)',
lib => '$(NO_INST_LIB_CFLAGS)',
dso => '$(NO_INST_DSO_CFLAGS)', dso => '$(NO_INST_DSO_CFLAGS)',
bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}}; bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
} }
$cflags .= { lib => '$(LIB_CPPFLAGS)', $cflags .= { shlib => '$(LIB_CPPFLAGS)',
lib => '$(LIB_CPPFLAGS)',
dso => '$(DSO_CPPFLAGS)', dso => '$(DSO_CPPFLAGS)',
bin => '$(BIN_CPPFLAGS)' } -> {$args{intent}}; bin => '$(BIN_CPPFLAGS)' } -> {$args{intent}};
my @incs_cmds = includes({ lib => '$(LIB_INCLUDES)', my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
lib => '$(LIB_INCLUDES)',
dso => '$(DSO_INCLUDES)', dso => '$(DSO_INCLUDES)',
bin => '$(BIN_INCLUDES)' } -> {$args{intent}}, bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
'$(INCLUDES)', '$(INCLUDES)',

View file

@ -984,6 +984,7 @@ EOF
} }
my $cppflags = { my $cppflags = {
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
@ -1023,6 +1024,7 @@ EOF
$cmd = '$(CXX)'; $cmd = '$(CXX)';
$cmdcompile = ' -c'; $cmdcompile = ' -c';
$cmdflags = { $cmdflags = {
shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)', dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)' bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
@ -1031,6 +1033,7 @@ EOF
$cmd = '$(CC)'; $cmd = '$(CC)';
$cmdcompile = ' -c'; $cmdcompile = ' -c';
$cmdflags = { $cmdflags = {
shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'

View file

@ -531,6 +531,7 @@ EOF
my $cppflags = $incs; my $cppflags = $incs;
$cppflags .= { $cppflags .= {
shlib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)', dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)',
bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)' bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)'
@ -568,14 +569,17 @@ EOF
my $srcs = '"'.join('" "', @srcs).'"'; my $srcs = '"'.join('" "', @srcs).'"';
my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"'; my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}}); my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
my $cflags = { lib => ' $(LIB_CFLAGS)', my $cflags = { shlib => ' $(LIB_CFLAGS)',
lib => ' $(LIB_CFLAGS)',
dso => ' $(DSO_CFLAGS)', dso => ' $(DSO_CFLAGS)',
bin => ' $(BIN_CFLAGS)' } -> {$args{intent}}; bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
$cflags .= $incs; $cflags .= $incs;
$cflags .= { lib => ' $(LIB_CPPFLAGS)', $cflags .= { shlib => ' $(LIB_CPPFLAGS)',
lib => ' $(LIB_CPPFLAGS)',
dso => ' $(DSO_CPPFLAGS)', dso => ' $(DSO_CPPFLAGS)',
bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}}; bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
my $asflags = { lib => ' $(LIB_ASFLAGS)', my $asflags = { shlib => ' $(LIB_ASFLAGS)',
lib => ' $(LIB_ASFLAGS)',
dso => ' $(DSO_ASFLAGS)', dso => ' $(DSO_ASFLAGS)',
bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}}; bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
my $makedepprog = $config{makedepprog}; my $makedepprog = $config{makedepprog};