Rethink the uplink / applink story

Adding uplink and applink to some builds was done by "magic", the
configuration for "mingw" only had a macro definition, the Configure
would react to its presence by adding the uplink source files to
cpuid_asm_src, and crypto/build.info inherited dance to get it
compiled, and Makefile.shared made sure applink.o would be
appropriately linked in.  That was a lot under the hood.

To replace this, we create a few template configurations in
Configurations/00-base-templates.conf, inherit one of them in the
"mingw" configuration, the rest is just about refering to the
$target{apps_aux_src} / $target{apps_obj} in the right places.

Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
Richard Levitte
2016-02-18 18:43:56 +01:00
parent 5be5e56c09
commit 3a55c92bba
8 changed files with 36 additions and 22 deletions

View File

@@ -12,7 +12,7 @@
thread_cflags => "",
thread_defines => [],
apps_extra_src => "",
apps_aux_src => "",
cpuid_asm_src => "mem_clr.c",
bn_asm_src => "bn_asm.c",
ec_asm_src => "",
@@ -34,6 +34,7 @@
unistd => "<unistd.h>",
shared_target => "",
shared_cflag => "",
shared_defines => [],
shared_ldflag => "",
shared_rcflag => "",
shared_extension => "",
@@ -41,6 +42,28 @@
build_file => "Makefile",
},
uplink_common => {
template => 1,
apps_aux_src => add(" ","../ms/applink.c"),
cpuid_asm_src => add(" ","../ms/uplink.c"),
shared_defines => add(undef, "OPENSSL_USE_APPLINK"),
},
x86_uplink => {
inherit_from => [ "uplink_common" ],
template => 1,
cpuid_asm_src => add(" ","uplink-x86.s"),
},
x86_64_uplink => {
inherit_from => [ "uplink_common" ],
template => 1,
cpuid_asm_src => add(" ","uplink-x86_64.s"),
},
ia64_uplink => {
inherit_from => [ "uplink_common" ],
template => 1,
cpuid_asm_src => add(" ","uplink-ia64.s"),
},
x86_asm => {
template => 1,
cpuid_asm_src => "x86cpuid.s",

View File

@@ -1162,7 +1162,8 @@
#### MinGW
"mingw" => {
inherit_from => [ asm("x86_asm") ],
inherit_from => [ asm("x86_asm"),
sub { $config{no_shared} ? () : "x86_uplink" } ],
cc => "gcc",
cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
debug_cflags => "-g -O0",
@@ -1174,7 +1175,7 @@
perlasm_scheme => "coff",
dso_scheme => "win32",
shared_target => "cygwin-shared",
shared_cflag => "-D_WINDLL -DOPENSSL_USE_APPLINK",
shared_cflag => add(" ", "-D_WINDLL"),
shared_ldflag => "-static-libgcc",
shared_rcflag => "--target=pe-i386",
shared_extension => ".dll",
@@ -1200,7 +1201,7 @@
perlasm_scheme => "mingw64",
dso_scheme => "win32",
shared_target => "cygwin-shared",
shared_cflag => "-D_WINDLL",
shared_cflag => add(" ", "-D_WINDLL"),
shared_ldflag => "-static-libgcc",
shared_rcflag => "--target=pe-x86-64",
shared_extension => ".dll",