From 6afb36342d4bc63a774fd96088ededfc00401e1d Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Wed, 9 Dec 2020 00:29:14 +0000 Subject: 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 Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/13540) --- Configurations/00-base-templates.conf | 2 -- Configurations/10-main.conf | 3 +++ Configurations/50-cppbuilder.conf | 4 ++++ Configurations/windows-makefile.tmpl | 34 +++++++++++++++++++++++----------- 4 files changed, 30 insertions(+), 13 deletions(-) (limited to 'Configurations') 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 -- cgit v1.2.3