Display the library building flags
authorRichard Levitte <levitte@openssl.org>
Fri, 9 Mar 2018 11:39:01 +0000 (12:39 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 9 Mar 2018 13:07:59 +0000 (14:07 +0100)
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5560)

Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
Configurations/windows-makefile.tmpl
crypto/build.info

index e8780e4..1972314 100644 (file)
@@ -221,23 +221,28 @@ CNF_EX_LIBS={- join('', map{ ",$_" } @{$target{ex_libs}},
 LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
                          @{$config{lib_asflags}},
                          '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
-LIB_DEFINES={- join('', (map { ",$_" } @{$target{lib_defines}},
+LIB_DEFINES={- our $lib_defines =
+               join('', (map { ",$_" } @{$target{lib_defines}},
                                        @{$target{shared_defines}},
                                        @{$config{lib_defines}},
-                                       @{$config{shared_defines}},
-                                       'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
+                                       @{$config{shared_defines}});
+               join('', $lib_defines,
+                        (map { ",$_" } 'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
                                        'ENGINESDIR="""$(ENGINESDIR_C)"""'),
                         '$(CNF_DEFINES)', '$(DEFINES)') -}
-LIB_INCLUDES={- join(',', @{$target{lib_includes}},
+LIB_INCLUDES={- our $lib_includes =
+                join(',', @{$target{lib_includes}},
                           @{$target{shared_includes}},
                           @{$config{lib_includes}},
                           @{$config{shared_includes}}) -}
-LIB_CPPFLAGS={- join('', "'qual_includes'",
-                         '/DEFINE=(__dummy$(LIB_DEFINES))',
-                         $target{lib_cppflags} || (),
+LIB_CPPFLAGS={- our $lib_cppflags =
+                join('', $target{lib_cppflags} || (),
                          $target{shared_cppflags} || (),
                          @{$config{lib_cppflags}},
-                         @{$config{shared_cppflag}},
+                         @{$config{shared_cppflag}});
+                join('', "'qual_includes'",
+                         '/DEFINE=(__dummy$(LIB_DEFINES))'
+                         $lib_cppflags,
                          '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
 LIB_CFLAGS={- join('', $target{lib_cflags} || (),
                        $target{shared_cflag} || (),
@@ -325,9 +330,10 @@ NO_INST_BIN_CFLAGS={- join('', $target{no_inst_bin_cflags}
 PERLASM_SCHEME={- $target{perlasm_scheme} -}
 
 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
-CPPFLAGS_Q={- (my $c = $cppflags1.$cppflags2) =~ s|"|""|g;
-              (my $d = $defines1.$defines2) =~ s|"|""|g;
-              my $i = join(',', $includes1 || (), $includes2 || ());
+CPPFLAGS_Q={- (my $c = $lib_cppflags.$cppflags2.$cppflags1) =~ s|"|""|g;
+              (my $d = $lib_defines.$defines2.$defines1) =~ s|"|""|g;
+              my $i = join(',', $lib_includes || (), $includes2 || (),
+                                $includes1 || ());
               my $x = $c;
               $x .= "/INCLUDE=($i)" if $i;
               $x .= "/DEFINE=($d)" if $d;
index fc483f0..8230676 100644 (file)
@@ -254,15 +254,18 @@ CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
 # Variables starting with BIN_ are used to build programs and their object
 # files.
 
-LIB_CPPFLAGS={- join(' ', $target{lib_cppflags} || (),
+LIB_CPPFLAGS={- our $lib_cppflags =
+                join(' ', $target{lib_cppflags} || (),
                           $target{shared_cppflag} || (),
                           (map { '-D'.$_ }
                                @{$config{lib_defines}},
-                               @{$config{shared_defines}},
+                               @{$config{shared_defines}}),
+                          @{$config{lib_cppflags}},
+                          @{$config{shared_cppflag}});
+                join(' ', $lib_cppflags,
+                          (map { '-D'.$_ }
                                'OPENSSLDIR="\"$(OPENSSLDIR)\""',
                                'ENGINESDIR="\"$(ENGINESDIR)\""'),
-                          @{$config{lib_cppflags}},
-                          @{$config{shared_cppflag}},
                           '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
                         $target{shared_cflag} || (),
@@ -316,7 +319,9 @@ BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
               $cppflags2 =~ s|([\\"])|\\$1|g;
-              join(' ', $cppflags1 || (), $cppflags2 || ()) -}
+              $lib_cppflags =~ s|([\\"])|\\$1|g;
+              join(' ', $lib_cppflags || (), $cppflags2 || (),
+                        $cppflags1 || ()) -}
 
 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
 
index 83f893d..214619a 100644 (file)
@@ -230,22 +230,25 @@ CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
 LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
                          @{$config{lib_asflags}},
                          '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
-LIB_CPPFLAGS={- join(' ', $target{lib_cppflags} || (),
+LIB_CPPFLAGS={- our $lib_cppflags =
+                join(' ', $target{lib_cppflags} || (),
                           $target{shared_cppflag} || (),
                           (map { quotify_l("-D".$_) }
                                @{$target{lib_defines}},
                                @{$target{shared_defines}},
                                @{$config{lib_defines}},
-                               @{$config{shared_defines}},
-                               "OPENSSLDIR=\"$openssldir\"",
-                               "ENGINESDIR=\"$enginesdir\""),
+                               @{$config{shared_defines}}),
                           (map { quotify_l("-I".$_) }
                                @{$target{lib_includes}},
                                @{$target{shared_includes}},
                                @{$config{lib_includes}},
                                @{$config{shared_includes}}),
                           @{$config{lib_cppflags}},
-                          @{$config{shared_cppflag}},
+                          @{$config{shared_cppflag}});
+                join(' ', $lib_cppflags,
+                          (map { quotify_l("-D".$_) }
+                               "OPENSSLDIR=\"$openssldir\"",
+                               "ENGINESDIR=\"$enginesdir\""),
                           '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
                         $target{shared_cflag} || (),
@@ -294,7 +297,8 @@ BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
               $cppflags2 =~ s|([\\"])|\\$1|g;
-              join(' ', $cppflags1 || (), $cppflags2 || ()) -}
+              join(' ', $lib_cppflags || (), $cppflags2 || (),
+                        $cppflags1 || ()) -}
 
 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
 
index c406a11..368671a 100644 (file)
@@ -11,7 +11,7 @@ EXTRA=  ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
         ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl
 
 DEPEND[cversion.o]=buildinf.h
-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CNF_CFLAGS) $(CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
 DEPEND[buildinf.h]=../configdata.pm
 
 GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)