summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTanzinul Islam <tanzinul.islam@gmail.com>2020-12-09 00:29:14 +0000
committerDmitry Belyavskiy <beldmit@gmail.com>2021-04-19 11:05:54 +0200
commit6afb36342d4bc63a774fd96088ededfc00401e1d (patch)
tree0cef52523b29ff8970ca431a6653d12b1a5d61f3
parent5fee3fe2760d65a141873601c4b7b9fd2fc5c7b1 (diff)
Build resource files
We need to compile with [brcc32.exe][1] and link with [ilink32.exe][2]. The latter expects the `.res` files to be given in the final comma- separated section in the command line (after the `.def` file). [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/BRCC32.EXE,_the_Resource_Compiler [2]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_ILINK32_and_ILINK64_on_the_Command_Line#Command-Line_Elements Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
-rw-r--r--Configurations/00-base-templates.conf2
-rw-r--r--Configurations/10-main.conf3
-rw-r--r--Configurations/50-cppbuilder.conf4
-rw-r--r--Configurations/windows-makefile.tmpl34
-rw-r--r--apps/build.info2
-rw-r--r--build.info2
6 files changed, 32 insertions, 15 deletions
diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf
index 3c569814ae..0e5d38d5a6 100644
--- a/Configurations/00-base-templates.conf
+++ b/Configurations/00-base-templates.conf
@@ -108,8 +108,6 @@ my %targets=(
return ();
},
- RC => "rc",
- rcoutflag => "/fo",
MT => "mt",
MTFLAGS => "-nologo",
mtinflag => "-manifest ",
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index 3d6fbba5e4..4d42c7fae8 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1288,6 +1288,8 @@ my %targets = (
ARFLAGS => "/nologo",
aroutflag => "/out:",
ar_resp_delim => "\n",
+ RC => "rc",
+ rcoutflag => "/fo",
defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
"UNICODE", "_UNICODE",
"_CRT_SECURE_NO_DEPRECATE",
@@ -1301,6 +1303,7 @@ my %targets = (
shared_ldflag => "/dll",
shared_target => "win-shared", # meaningless except it gives Configure a hint
lddefflag => "/def:",
+ ldresflag => " ",
ld_implib_flag => "/implib:",
thread_scheme => "winthreads",
dso_scheme => "win32",
diff --git a/Configurations/50-cppbuilder.conf b/Configurations/50-cppbuilder.conf
index cb293afcb9..40b89b403e 100644
--- a/Configurations/50-cppbuilder.conf
+++ b/Configurations/50-cppbuilder.conf
@@ -38,10 +38,14 @@ my %targets = (
AR => "tlib",
ARFLAGS => "/P256 /N /u",
ar_resp_delim => " &\n",
+ RC => "brcc32",
+ RCFLAGS => '-i"$(BDS)\include\windows\sdk"',
+ rcoutflag => "-fo",
shared_target => "win-shared",
shared_ldflag => "-Tpd c0d32.obj",
dso_lflags => "-Tpd c0d32.obj",
lddefflag => ",",
+ ldresflag => ",",
ld_implib_rule => 'implib $< $**',
dso_scheme => "win32",
}
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 1e3d63f8d1..521f72d7b7 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -848,7 +848,10 @@ EOF
my %args = @_;
my $lib = $args{lib};
my @objs = map { platform->convertext($_) }
- grep { platform->isobj($_) || platform->isres($_) }
+ grep { platform->isobj($_) }
+ @{$args{objs}};
+ my @ress = map { platform->convertext($_) }
+ grep { platform->isres($_) }
@{$args{objs}};
my @defs = map { platform->def($_) }
grep { platform->isdef($_) }
@@ -857,10 +860,11 @@ EOF
die "More than one exported symbols list" if scalar @defs > 1;
my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
my $objs = join($target{ld_resp_delim}, @objs);
- my $deps = join(" ", @objs, @defs, @deps);
+ my $ress = join($target{ld_resp_delim}, @ress);
+ my $deps = join(" ", @objs, @ress, @defs, @deps);
my $import = platform->sharedlib_import($lib);
my $dll = platform->sharedlib($lib);
- my $shared_def = join("", map { " $target{lddefflag}$_" } @defs);
+ my $shared_def = $target{lddefflag} . join("", @defs);
my $implib_rule = $target{ld_implib_rule} || "";
my $implib_flag = $target{ld_implib_flag}
? "$target{ld_implib_flag}$import"
@@ -875,7 +879,7 @@ $dll: $deps
IF EXIST $full.manifest DEL /F /Q $full.manifest
IF EXIST \$@ DEL /F /Q \$@
\$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) @<< $implib_flag || (DEL /Q \$(\@B).* $import; EXIT 1)
-$objs$target{ld_resp_delim}\$(LDOUTFLAG)$dll$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(LIB_EX_LIBS)$shared_def
+$objs$target{ld_resp_delim}\$(LDOUTFLAG)$dll$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(LIB_EX_LIBS)$target{ld_resp_delim}$shared_def$target{ldresflag}$ress
<<
IF EXIST $dll.manifest \\
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dll.manifest \$(MTOUTFLAG)$dll
@@ -892,21 +896,26 @@ EOF
my $dso = platform->dso($args{module});
my $dso_n = platform->dsoname($args{module});
my @objs = map { platform->convertext($_) }
- grep { platform->isobj($_) || platform->isres($_) }
+ grep { platform->isobj($_) }
+ @{$args{objs}};
+ my @ress = map { platform->convertext($_) }
+ grep { platform->isres($_) }
@{$args{objs}};
my @defs = map { platform->def($_) }
grep { platform->isdef($_) }
@{$args{objs}};
my @deps = compute_lib_depends(@{$args{deps}});
+ die "More than one exported symbols list" if scalar @defs > 1;
my $objs = join($target{ld_resp_delim}, @objs);
+ my $ress = join($target{ld_resp_delim}, @ress);
my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
- my $deps = join(" ", @objs, @defs, @deps);
- my $shared_def = join("", map { " $target{lddefflag}$_" } @defs);
+ my $deps = join(" ", @objs, @ress, @defs, @deps);
+ my $shared_def = $target{lddefflag} . join("", @defs);
return <<"EOF";
$dso: $deps
IF EXIST $dso.manifest DEL /F /Q $dso.manifest
\$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) @<< || (DEL /Q \$(\@B).* $dso_n.*; EXIT 1)
-$objs$target{ld_resp_delim}\$(LDOUTFLAG)$dso$target{ldpostoutflag}$target{ld_resp_delim}$linklibs \$(DSO_EX_LIBS)$shared_def
+$objs$target{ld_resp_delim}\$(LDOUTFLAG)$dso$target{ldpostoutflag}$target{ld_resp_delim}$linklibs \$(DSO_EX_LIBS)$target{ld_resp_delim}$shared_def$target{ldresflag}$ress
<<
IF EXIST $dso.manifest \\
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso.manifest \$(MTOUTFLAG)$dso
@@ -929,17 +938,20 @@ EOF
my %args = @_;
my $bin = platform->bin($args{bin});
my @objs = map { platform->convertext($_) }
- grep { platform->isobj($_) || platform->isres($_) }
+ grep { platform->isobj($_) }
+ @{$args{objs}};
+ my @ress = map { platform->convertext($_) }
+ grep { platform->isres($_) }
@{$args{objs}};
my @deps = compute_lib_depends(@{$args{deps}});
my $objs = join($target{ld_resp_delim}, @objs);
my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
- my $deps = join(" ", @objs, @deps);
+ my $deps = join(" ", @objs, @ress, @deps);
return <<"EOF";
$bin: $deps
IF EXIST $bin.manifest DEL /F /Q $bin.manifest
\$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) @<<
-$objs$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(BIN_EX_LIBS)
+$objs$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(BIN_EX_LIBS)$target{ldresflag}$target{ldresflag}$ress
<<
IF EXIST $bin.manifest \\
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin
diff --git a/apps/build.info b/apps/build.info
index 146e9009f5..06759b2f94 100644
--- a/apps/build.info
+++ b/apps/build.info
@@ -71,7 +71,7 @@ IF[{- !$disabled{apps} -}]
# always depend on a changed configuration.
DEPEND[progs.c]=../configdata.pm
- IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}]
+ IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
GENERATE[openssl.rc]=../util/mkrc.pl openssl
SOURCE[openssl]=openssl.rc
ENDIF
diff --git a/build.info b/build.info
index f631d6c780..6c91e22309 100644
--- a/build.info
+++ b/build.info
@@ -79,7 +79,7 @@ IF[{- defined $target{shared_defflag} -}]
GENERATE[libssl.ld]=util/libssl.num libssl
ENDIF
-IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}]
+IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
GENERATE[libcrypto.rc]=util/mkrc.pl libcrypto
GENERATE[libssl.rc]=util/mkrc.pl libssl