From 9dfc868025721873952f7765e59ae9fee45a276a Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 10 Sep 2018 02:28:39 +0200 Subject: [PATCH] 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 Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/7159) --- Configurations/common.tmpl | 2 +- Configurations/descrip.mms.tmpl | 19 +++++++++++++------ Configurations/unix-Makefile.tmpl | 3 +++ Configurations/windows-makefile.tmpl | 10 +++++++--- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index 246f18a4c1..94e49319a9 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -133,7 +133,7 @@ # If this is somehow a compiled object, take care of it that way # Otherwise, it might simply be generated if (defined $unified_info{sources}->{$_}) { - doobj($_, $lib, intent => "lib", installed => is_installed($lib)); + doobj($_, $lib, intent => "shlib", installed => is_installed($lib)); } else { dogenerate($_, undef, undef, intent => "lib"); } diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index 0c2695d2d1..f85848f012 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -777,11 +777,13 @@ EOF } my $cppflags = { + shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' } -> {$args{intent}}; - my @incs_cmds = includes({ lib => '$(LIB_INCLUDES)', + my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)', + lib => '$(LIB_INCLUDES)', dso => '$(DSO_INCLUDES)', bin => '$(BIN_INCLUDES)' } -> {$args{intent}}, '$(CNF_INCLUDES)', @@ -844,7 +846,8 @@ EOF my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !"; if ($srcs[0] =~ /\.asm$/) { - my $asflags = { lib => ' $(LIB_ASFLAGS)', + my $asflags = { shlib => ' $(LIB_ASFLAGS)', + lib => ' $(LIB_ASFLAGS)', dso => ' $(DSO_ASFLAGS)', bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}}; return <<"EOF"; @@ -858,19 +861,23 @@ EOF my $cflags; if ($args{installed}) { - $cflags = { lib => '$(LIB_CFLAGS)', + $cflags = { shlib => '$(LIB_CFLAGS)', + lib => '$(LIB_CFLAGS)', dso => '$(DSO_CFLAGS)', bin => '$(BIN_CFLAGS)' } -> {$args{intent}}; } else { - $cflags = { lib => '$(NO_INST_LIB_CFLAGS)', + $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)', + lib => '$(NO_INST_LIB_CFLAGS)', dso => '$(NO_INST_DSO_CFLAGS)', bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}}; } - $cflags .= { lib => '$(LIB_CPPFLAGS)', + $cflags .= { shlib => '$(LIB_CPPFLAGS)', + lib => '$(LIB_CPPFLAGS)', dso => '$(DSO_CPPFLAGS)', 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)', bin => '$(BIN_INCLUDES)' } -> {$args{intent}}, '$(INCLUDES)', diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 16af4d2087..bb6755b425 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -984,6 +984,7 @@ EOF } my $cppflags = { + shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' @@ -1023,6 +1024,7 @@ EOF $cmd = '$(CXX)'; $cmdcompile = ' -c'; $cmdflags = { + shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)', dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)', bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)' @@ -1031,6 +1033,7 @@ EOF $cmd = '$(CC)'; $cmdcompile = ' -c'; $cmdflags = { + shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index f7d8e273c4..c8b0cf1c31 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -531,6 +531,7 @@ EOF my $cppflags = $incs; $cppflags .= { + shlib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)', dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)', bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)' @@ -568,14 +569,17 @@ EOF my $srcs = '"'.join('" "', @srcs).'"'; my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"'; my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}}); - my $cflags = { lib => ' $(LIB_CFLAGS)', + my $cflags = { shlib => ' $(LIB_CFLAGS)', + lib => ' $(LIB_CFLAGS)', dso => ' $(DSO_CFLAGS)', bin => ' $(BIN_CFLAGS)' } -> {$args{intent}}; $cflags .= $incs; - $cflags .= { lib => ' $(LIB_CPPFLAGS)', + $cflags .= { shlib => ' $(LIB_CPPFLAGS)', + lib => ' $(LIB_CPPFLAGS)', dso => ' $(DSO_CPPFLAGS)', bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}}; - my $asflags = { lib => ' $(LIB_ASFLAGS)', + my $asflags = { shlib => ' $(LIB_ASFLAGS)', + lib => ' $(LIB_ASFLAGS)', dso => ' $(DSO_ASFLAGS)', bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}}; my $makedepprog = $config{makedepprog}; -- 2.25.1