]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - Configurations/descrip.mms.tmpl
Processing GNU-style "make variables" - separate CPP flags from C flags
[thirdparty/openssl.git] / Configurations / descrip.mms.tmpl
index 924dd9e869ad9661ef57acf554f09a7602f9889b..9995b43b9f6c0343447b2a87f3cf9c3a88b20b0e 100644 (file)
@@ -172,11 +172,20 @@ OPENSSLDIR_C={- $osslprefix -}DATAROOT:[000000]
 ENGINESDIR_C={- $osslprefix -}ENGINES{- $sover_dirname.$target{pointer_size} -}:
 
 CC= {- $target{cc} -}
-CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR_C)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR_C)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
-CFLAGS_Q=$(CFLAGS)
-DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
+DEFINES={- our $defines = join(",",
+                               '__dummy', # To make comma processing easier
+                               @{$target{defines}}, @{$config{defines}}) -}
+CPPFLAGS={- our $cppflags = join('', $target{cppflags}, $config{cppflags}) -}
+CPPFLAGS_Q={- $cppflags =~ s|"|""|g; $defines =~ s|"|""|g;
+              $cppflags."/DEFINE($defines)" -}
+CFLAGS={- $target{cflags} -} {- $config{cflags} -}
 LDFLAGS= {- $target{lflags} -}
 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
+LIB_DEFINES={- join("",
+                    (map { ",$_" }
+                     @{$target{shared_defines}},
+                     'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
+                     'ENGINESDIR="""$(ENGINESDIR_C)"""')) -}
 LIB_CFLAGS={- $target{lib_cflags} // "" -}
 DSO_CFLAGS={- $target{dso_cflags} // "" -}
 BIN_CFLAGS={- $target{bin_cflags} // "" -}
@@ -605,16 +614,26 @@ EOF
       my $srcs =
           join(", ",
                map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
-      my $ecflags;
+      my $cflags = '$(CFLAGS)';
       if ($args{installed}) {
-          $ecflags = { lib => '$(LIB_CFLAGS)',
+          $cflags .= { lib => '$(LIB_CFLAGS)',
                        dso => '$(DSO_CFLAGS)',
                        bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
       } else {
-          $ecflags = { lib => '$(NO_INST_LIB_CFLAGS)',
+          $cflags .= { lib => '$(NO_INST_LIB_CFLAGS)',
                        dso => '$(NO_INST_DSO_CFLAGS)',
                        bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
       }
+      $cflags .= '$(CPPFLAGS)';
+      $cflags .= { lib => '$(LIB_CPPFLAGS)',
+                  dso => '$(DSO_CPPFLAGS)',
+                  bin => '$(BIN_CPPFLAGS)' } -> {$args{intent}};
+      my $defines = '$(DEFINES)';
+      $defines .= { lib => '$(LIB_DEFINES)',
+                   dso => '$(DSO_DEFINES)',
+                   bin => '$(BIN_DEFINES)' } -> {$args{intent}};
+      $cflags .= '/DEFINE=('.$defines.')';
+      
       my $incs_on = "\@ !";
       my $incs_off = "\@ !";
       my $incs = "";
@@ -645,7 +664,7 @@ $obj.OBJ : $deps
         ${before}
         SET DEFAULT $forward
         $incs_on
-        \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
+        \$(CC) ${cflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
         $incs_off
         SET DEFAULT $backward
         ${after}