Configure - get rid of the special debug_ and release_ settings

Instead, make the build type ("debug" or "release") available through
$config{build_type} and let the configs themselves figure out what the
usual settings (such as "cflags", "lflags" and so on) should be
accordingly.

The benefit with this is that we can now have debug and release
variants of any setting, not just those Configure supports, and may
also involve other factors (the MSVC flags /MD[d] and /MT[d] involve
both build type and whether threading is enabled or not)

Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
Richard Levitte 2016-03-02 19:13:26 +01:00
parent 940a09bad4
commit 8864f0de7b
4 changed files with 173 additions and 179 deletions

View File

@ -5,10 +5,6 @@
cflags => "", cflags => "",
defines => [], defines => [],
debug_cflags => "",
debug_defines => [],
release_cflags => "",
release_defines => [],
thread_cflags => "", thread_cflags => "",
thread_defines => [], thread_defines => [],

View File

@ -1,14 +1,19 @@
## -*- mode: perl; -*- ## -*- mode: perl; -*-
## Standard openssl configuration targets. ## Standard openssl configuration targets.
sub picker {
my %opts = @_;
return sub { add($opts{default} || (),
$opts{$config{build_type}} || ())->(); }
}
%targets = ( %targets = (
#### Basic configs that should work on any 32-bit box #### Basic configs that should work on any 32-bit box
"gcc" => { "gcc" => {
cc => "gcc", cc => "gcc",
cflags => "", cflags => picker(debug => "-O0 -g",
debug_cflags => "-O0 -g", release => "-O3"),
release_cflags => "-O3",
thread_cflag => "(unknown)", thread_cflag => "(unknown)",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
}, },
@ -22,9 +27,9 @@
"vos-gcc" => { "vos-gcc" => {
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
cc => "gcc", cc => "gcc",
cflags => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN", cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG", debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "(unknown)", thread_cflag => "(unknown)",
sys_id => "VOS", sys_id => "VOS",
lflags => "-Wl,-map", lflags => "-Wl,-map",
@ -51,9 +56,9 @@
# with "Illegal mnemonic" error message. # with "Illegal mnemonic" error message.
inherit_from => [ "solaris-common", asm("x86_elf_asm") ], inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
cc => "gcc", cc => "gcc",
cflags => add_before("-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM"), cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3 -fomit-frame-pointer", release => "-O3 -fomit-frame-pointer")),
thread_cflag => "-pthread", thread_cflag => "-pthread",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
shared_cflag => "-fPIC", shared_cflag => "-fPIC",
@ -70,9 +75,9 @@
# <appro@fy.chalmers.se> # <appro@fy.chalmers.se>
inherit_from => [ "solaris-common", asm("x86_64_asm") ], inherit_from => [ "solaris-common", asm("x86_64_asm") ],
cc => "gcc", cc => "gcc",
cflags => add_before("-m64 -Wall -DL_ENDIAN"), cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3")),
thread_cflag => "-pthread", thread_cflag => "-pthread",
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf", perlasm_scheme => "elf",
@ -85,9 +90,9 @@
"solaris-x86-cc" => { "solaris-x86-cc" => {
inherit_from => [ "solaris-common" ], inherit_from => [ "solaris-common" ],
cc => "cc", cc => "cc",
cflags => add_before("-xarch=generic -xstrconst -Xa -DL_ENDIAN"), cflags => add_before(picker(default => "-xarch=generic -xstrconst -Xa -DL_ENDIAN",
debug_cflags => "-g", debug => "-g",
release_cflags => "-xO5 -xregs=frameptr -xdepend -xbuiltin", release => "-xO5 -xregs=frameptr -xdepend -xbuiltin")),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
lflags => add("-mt"), lflags => add("-mt"),
ex_libs => add("-lpthread"), ex_libs => add("-lpthread"),
@ -98,9 +103,9 @@
"solaris64-x86_64-cc" => { "solaris64-x86_64-cc" => {
inherit_from => [ "solaris-common", asm("x86_64_asm") ], inherit_from => [ "solaris-common", asm("x86_64_asm") ],
cc => "cc", cc => "cc",
cflags => add_before("-xarch=generic64 -xstrconst -Xa -DL_ENDIAN"), cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
debug_cflags => "-g", debug => "-g",
release_cflags => "-xO5 -xdepend -xbuiltin", release => "-xO5 -xdepend -xbuiltin")),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
lflags => add("-mt"), lflags => add("-mt"),
ex_libs => add("-lpthread"), ex_libs => add("-lpthread"),
@ -115,9 +120,9 @@
"solaris-sparcv7-gcc" => { "solaris-sparcv7-gcc" => {
inherit_from => [ "solaris-common" ], inherit_from => [ "solaris-common" ],
cc => "gcc", cc => "gcc",
cflags => add_before("-Wall -DB_ENDIAN -DBN_DIV2W"), cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3")),
thread_cflag => "-pthread", thread_cflag => "-pthread",
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
shared_cflag => "-fPIC", shared_cflag => "-fPIC",
@ -131,8 +136,8 @@
# -m32 should be safe to add as long as driver recognizes # -m32 should be safe to add as long as driver recognizes
# -mcpu=ultrasparc # -mcpu=ultrasparc
inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ], inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
cflags => add_before("-m32 -mcpu=ultrasparc"), cflags => add_before(picker(default => "-m32 -mcpu=ultrasparc",
debug_cflags => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__", debug => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__")),
}, },
"solaris64-sparcv9-gcc" => { "solaris64-sparcv9-gcc" => {
inherit_from => [ "solaris-sparcv9-gcc" ], inherit_from => [ "solaris-sparcv9-gcc" ],
@ -149,9 +154,9 @@
"solaris-sparcv7-cc" => { "solaris-sparcv7-cc" => {
inherit_from => [ "solaris-common" ], inherit_from => [ "solaris-common" ],
cc => "cc", cc => "cc",
cflags => add_before("-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W"), cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
debug_cflags => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG", debug => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
release_cflags => "-xO5 -xdepend", release => "-xO5 -xdepend")),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
lflags => add("-mt"), lflags => add("-mt"),
ex_libs => add("-lpthread"), ex_libs => add("-lpthread"),
@ -181,9 +186,9 @@
"irix-gcc" => { "irix-gcc" => {
inherit_from => [ "BASE_unix", asm("mips32_asm") ], inherit_from => [ "BASE_unix", asm("mips32_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DB_ENDIAN", cflags => picker(default => "-DB_ENDIAN",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "(unknown)", thread_cflag => "(unknown)",
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
perlasm_scheme => "o32", perlasm_scheme => "o32",
@ -194,9 +199,9 @@
"irix-cc" => { "irix-cc" => {
inherit_from => [ "BASE_unix", asm("mips32_asm") ], inherit_from => [ "BASE_unix", asm("mips32_asm") ],
cc => "cc", cc => "cc",
cflags => "-use_readonly_const -DB_ENDIAN", cflags => picker(default => "-use_readonly_const -DB_ENDIAN",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O2", release => "-O2"),
thread_cflag => "(unknown)", thread_cflag => "(unknown)",
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
perlasm_scheme => "o32", perlasm_scheme => "o32",
@ -210,9 +215,9 @@
"irix-mips3-gcc" => { "irix-mips3-gcc" => {
inherit_from => [ "BASE_unix", asm("mips64_asm") ], inherit_from => [ "BASE_unix", asm("mips64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W", cflags => picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-D_SGI_MP_SOURCE -pthread", thread_cflag => "-D_SGI_MP_SOURCE -pthread",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT", bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
perlasm_scheme => "n32", perlasm_scheme => "n32",
@ -225,9 +230,9 @@
"irix-mips3-cc" => { "irix-mips3-cc" => {
inherit_from => [ "BASE_unix", asm("mips64_asm") ], inherit_from => [ "BASE_unix", asm("mips64_asm") ],
cc => "cc", cc => "cc",
cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W", cflags => picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O2", release => "-O2"),
thread_cflag => "-D_SGI_MP_SOURCE", thread_cflag => "-D_SGI_MP_SOURCE",
ex_libs => add("-lpthread"), ex_libs => add("-lpthread"),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT", bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
@ -242,9 +247,9 @@
"irix64-mips4-gcc" => { "irix64-mips4-gcc" => {
inherit_from => [ "BASE_unix", asm("mips64_asm") ], inherit_from => [ "BASE_unix", asm("mips64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W", cflags => picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-D_SGI_MP_SOURCE", thread_cflag => "-D_SGI_MP_SOURCE",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG", bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "64", perlasm_scheme => "64",
@ -257,9 +262,9 @@
"irix64-mips4-cc" => { "irix64-mips4-cc" => {
inherit_from => [ "BASE_unix", asm("mips64_asm") ], inherit_from => [ "BASE_unix", asm("mips64_asm") ],
cc => "cc", cc => "cc",
cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W", cflags => picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O2", release => "-O2"),
thread_cflag => "-D_SGI_MP_SOURCE", thread_cflag => "-D_SGI_MP_SOURCE",
ex_libs => add("-lpthread"), ex_libs => add("-lpthread"),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG", bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
@ -302,9 +307,9 @@
"hpux-parisc-gcc" => { "hpux-parisc-gcc" => {
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
cc => "gcc", cc => "gcc",
cflags => "-DB_ENDIAN -DBN_DIV2W", cflags => picker(default => "-DB_ENDIAN -DBN_DIV2W",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
ex_libs => add("-Wl,+s -ldld"), ex_libs => add("-Wl,+s -ldld"),
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
@ -321,9 +326,9 @@
"hpux64-parisc2-gcc" => { "hpux64-parisc2-gcc" => {
inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ], inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DB_ENDIAN", cflags => picker(default => "-DB_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
ex_libs => add("-ldl"), ex_libs => add("-ldl"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
@ -342,9 +347,9 @@
"hpux-parisc-cc" => { "hpux-parisc-cc" => {
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
cc => "cc", cc => "cc",
cflags => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY", cflags => picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
debug_cflags => "+O0 +d -g", debug => "+O0 +d -g",
release_cflags => "+O3", release => "+O3"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
ex_libs => add("-Wl,+s -ldld -lpthread"), ex_libs => add("-Wl,+s -ldld -lpthread"),
bn_ops => "RC4_CHAR", bn_ops => "RC4_CHAR",
@ -362,9 +367,9 @@
"hpux64-parisc2-cc" => { "hpux64-parisc2-cc" => {
inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ], inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
cc => "cc", cc => "cc",
cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY", cflags => picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
debug_cflags => "+O0 +d -g", debug => "+O0 +d -g",
release_cflags => "+O3", release => "+O3"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
ex_libs => add("-ldl -lpthread"), ex_libs => add("-ldl -lpthread"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
@ -380,9 +385,9 @@
"hpux-ia64-cc" => { "hpux-ia64-cc" => {
inherit_from => [ "BASE_unix", asm("ia64_asm") ], inherit_from => [ "BASE_unix", asm("ia64_asm") ],
cc => "cc", cc => "cc",
cflags => "-Ae +DD32 +Olit=all -z -DB_ENDIAN", cflags => picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
debug_cflags => "+O0 +d -g", debug => "+O0 +d -g",
release_cflags => "+O2", release => "+O2"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
ex_libs => add("-ldl -lpthread"), ex_libs => add("-ldl -lpthread"),
bn_ops => "SIXTY_FOUR_BIT", bn_ops => "SIXTY_FOUR_BIT",
@ -398,9 +403,9 @@
"hpux64-ia64-cc" => { "hpux64-ia64-cc" => {
inherit_from => [ "BASE_unix", asm("ia64_asm") ], inherit_from => [ "BASE_unix", asm("ia64_asm") ],
cc => "cc", cc => "cc",
cflags => "-Ae +DD64 +Olit=all -z -DB_ENDIAN", cflags => picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
debug_cflags => "+O0 +d -g", debug => "+O0 +d -g",
release_cflags => "+O3", release => "+O3"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
ex_libs => add("-ldl -lpthread"), ex_libs => add("-ldl -lpthread"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
@ -415,9 +420,9 @@
"hpux-ia64-gcc" => { "hpux-ia64-gcc" => {
inherit_from => [ "BASE_unix", asm("ia64_asm") ], inherit_from => [ "BASE_unix", asm("ia64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DB_ENDIAN", cflags => picker(default => "-DB_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
ex_libs => add("-ldl"), ex_libs => add("-ldl"),
bn_ops => "SIXTY_FOUR_BIT", bn_ops => "SIXTY_FOUR_BIT",
@ -431,9 +436,9 @@
"hpux64-ia64-gcc" => { "hpux64-ia64-gcc" => {
inherit_from => [ "BASE_unix", asm("ia64_asm") ], inherit_from => [ "BASE_unix", asm("ia64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-mlp64 -DB_ENDIAN", cflags => picker(default => "-mlp64 -DB_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
ex_libs => add("-ldl"), ex_libs => add("-ldl"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
@ -497,9 +502,9 @@
"linux-generic32" => { "linux-generic32" => {
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
cc => "gcc", cc => "gcc",
cflags => "-Wall", cflags => picker(default => "-Wall",
debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG", debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
ex_libs => add("-ldl"), ex_libs => add("-ldl"),
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
@ -519,14 +524,14 @@
}, },
"linux-ppc64" => { "linux-ppc64" => {
inherit_from => [ "linux-generic64", asm("ppc64_asm") ], inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
cflags => "-m64 -Wall -DB_ENDIAN", cflags => add("-m64 -DB_ENDIAN"),
perlasm_scheme => "linux64", perlasm_scheme => "linux64",
shared_ldflag => "-m64", shared_ldflag => "-m64",
multilib => "64", multilib => "64",
}, },
"linux-ppc64le" => { "linux-ppc64le" => {
inherit_from => [ "linux-generic64", asm("ppc64_asm") ], inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
cflags => "-m64 -Wall -DL_ENDIAN", cflags => add("-m64 -DL_ENDIAN"),
perlasm_scheme => "linux64le", perlasm_scheme => "linux64le",
shared_ldflag => "-m64", shared_ldflag => "-m64",
}, },
@ -572,7 +577,7 @@
}, },
"linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
inherit_from => [ "linux-generic32", asm("aarch64_asm") ], inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
cflags => "-mabi=ilp32 -Wall", cflags => add("-mabi=ilp32"),
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
perlasm_scheme => "linux64", perlasm_scheme => "linux64",
shared_ldflag => "-mabi=ilp32", shared_ldflag => "-mabi=ilp32",
@ -582,7 +587,7 @@
# Configure script adds minimally required -march for assembly # Configure script adds minimally required -march for assembly
# support, if no -march was specified at command line. # support, if no -march was specified at command line.
inherit_from => [ "linux-generic32", asm("mips32_asm") ], inherit_from => [ "linux-generic32", asm("mips32_asm") ],
cflags => "-mabi=32 -Wall -DBN_DIV3W", cflags => add("-mabi=32 -DBN_DIV3W"),
perlasm_scheme => "o32", perlasm_scheme => "o32",
shared_ldflag => "-mabi=32", shared_ldflag => "-mabi=32",
}, },
@ -590,7 +595,7 @@
# specifications, MIPS32 and MIPS64, rather than to kernel bitness. # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
"linux-mips64" => { "linux-mips64" => {
inherit_from => [ "linux-generic32", asm("mips64_asm") ], inherit_from => [ "linux-generic32", asm("mips64_asm") ],
cflags => "-mabi=n32 -Wall -DBN_DIV3W", cflags => add("-mabi=n32 -DBN_DIV3W"),
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
perlasm_scheme => "n32", perlasm_scheme => "n32",
shared_ldflag => "-mabi=n32", shared_ldflag => "-mabi=n32",
@ -598,7 +603,7 @@
}, },
"linux64-mips64" => { "linux64-mips64" => {
inherit_from => [ "linux-generic64", asm("mips64_asm") ], inherit_from => [ "linux-generic64", asm("mips64_asm") ],
cflags => "-mabi=64 -O3 -Wall -DBN_DIV3W", cflags => add("-mabi=64 -DBN_DIV3W"),
perlasm_scheme => "64", perlasm_scheme => "64",
shared_ldflag => "-mabi=64", shared_ldflag => "-mabi=64",
multilib => "64", multilib => "64",
@ -607,19 +612,17 @@
#### IA-32 targets... #### IA-32 targets...
"linux-elf" => { "linux-elf" => {
inherit_from => [ "linux-generic32", asm("x86_elf_asm") ], inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
cc => "gcc", cflags => add(picker(default => "-DL_ENDIAN",
cflags => "-DL_ENDIAN -Wall", release => "-fomit-frame-pointer")),
debug_cflags => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG", ex_libs => add(picker(debug => "-lefence")),
release_cflags => "-O3 -fomit-frame-pointer",
debug_ex_libs => "-lefence",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
}, },
"linux-aout" => { "linux-aout" => {
inherit_from => [ "BASE_unix", asm("x86_asm") ], inherit_from => [ "BASE_unix", asm("x86_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DL_ENDIAN -Wall", cflags => add(picker(default => "-DL_ENDIAN -Wall",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3 -fomit-frame-pointer", release => "-O3 -fomit-frame-pointer")),
thread_cflag => "(unknown)", thread_cflag => "(unknown)",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
perlasm_scheme => "a.out", perlasm_scheme => "a.out",
@ -627,7 +630,7 @@
"linux-x86_64" => { "linux-x86_64" => {
inherit_from => [ "linux-generic64", asm("x86_64_asm") ], inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
cflags => "-m64 -DL_ENDIAN -Wall", cflags => add("-m64 -DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf", perlasm_scheme => "elf",
shared_ldflag => "-m64", shared_ldflag => "-m64",
@ -636,11 +639,11 @@
"linux-x86_64-clang" => { "linux-x86_64-clang" => {
inherit_from => [ "linux-x86_64" ], inherit_from => [ "linux-x86_64" ],
cc => "clang", cc => "clang",
cflags => "-m64 -DL_ENDIAN -Wall -Wextra -Qunused-arguments", cflags => add("-Wextra -Qunused-arguments"),
}, },
"linux-x32" => { "linux-x32" => {
inherit_from => [ "linux-generic32", asm("x86_64_asm") ], inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
cflags => "-mx32 -DL_ENDIAN -Wall", cflags => add("-mx32 -DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT", bn_ops => "SIXTY_FOUR_BIT",
perlasm_scheme => "elf", perlasm_scheme => "elf",
shared_ldflag => "-mx32", shared_ldflag => "-mx32",
@ -654,7 +657,7 @@
"linux64-s390x" => { "linux64-s390x" => {
inherit_from => [ "linux-generic64", asm("s390x_asm") ], inherit_from => [ "linux-generic64", asm("s390x_asm") ],
cflags => "-m64 -Wall -DB_ENDIAN", cflags => add("-m64 -DB_ENDIAN"),
perlasm_scheme => "64", perlasm_scheme => "64",
shared_ldflag => "-m64", shared_ldflag => "-m64",
multilib => "64", multilib => "64",
@ -677,7 +680,7 @@
# sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1... # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
# #
inherit_from => [ "linux-generic32", asm("s390x_asm") ], inherit_from => [ "linux-generic32", asm("s390x_asm") ],
cflags => "-m31 -Wall -Wa,-mzarch -DB_ENDIAN", cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; }, bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-s390x/bn_asm/; $r; },
perlasm_scheme => "31", perlasm_scheme => "31",
shared_ldflag => "-m31", shared_ldflag => "-m31",
@ -689,19 +692,19 @@
# patiently assisted with debugging of following two configs. # patiently assisted with debugging of following two configs.
"linux-sparcv8" => { "linux-sparcv8" => {
inherit_from => [ "linux-generic32", asm("sparcv8_asm") ], inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
cflags => "-mcpu=v8 -Wall -DB_ENDIAN -DBN_DIV2W", cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
}, },
"linux-sparcv9" => { "linux-sparcv9" => {
# it's a real mess with -mcpu=ultrasparc option under Linux, # it's a real mess with -mcpu=ultrasparc option under Linux,
# but -Wa,-Av8plus should do the trick no matter what. # but -Wa,-Av8plus should do the trick no matter what.
inherit_from => [ "linux-generic32", asm("sparcv9_asm") ], inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
cflags => "-m32 -mcpu=ultrasparc -Wall -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W", cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
shared_ldflag => "-m32", shared_ldflag => "-m32",
}, },
"linux64-sparcv9" => { "linux64-sparcv9" => {
# GCC 3.1 is a requirement # GCC 3.1 is a requirement
inherit_from => [ "linux-generic64", asm("sparcv9_asm") ], inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
cflags => "-m64 -mcpu=ultrasparc -Wall -DB_ENDIAN", cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
shared_ldflag => "-m64", shared_ldflag => "-m64",
multilib => "64", multilib => "64",
@ -709,7 +712,7 @@
"linux-alpha-gcc" => { "linux-alpha-gcc" => {
inherit_from => [ "linux-generic64", asm("alpha_asm") ], inherit_from => [ "linux-generic64", asm("alpha_asm") ],
cflags => "-DL_ENDIAN", cflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
}, },
"linux-c64xplus" => { "linux-c64xplus" => {
@ -762,14 +765,15 @@
# systems are perfectly capable of executing binaries targeting # systems are perfectly capable of executing binaries targeting
# Froyo. Keep in mind that in the nutshell Android builds are # Froyo. Keep in mind that in the nutshell Android builds are
# about JNI, i.e. shared libraries, not applications. # about JNI, i.e. shared libraries, not applications.
cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall", cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release => "-O3"),
lflags => "-pie", lflags => "-pie",
shared_cflag => "", shared_cflag => "",
}, },
"android-x86" => { "android-x86" => {
inherit_from => [ "android", asm("x86_asm") ], inherit_from => [ "android", asm("x86_asm") ],
release_cflags => "-O3 -fomit-frame-pointer", cflags => add(picker(release => "-fomit-frame-pointer")),
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
perlasm_scheme => "android", perlasm_scheme => "android",
}, },
@ -804,8 +808,9 @@
"android64" => { "android64" => {
inherit_from => [ "linux-generic64" ], inherit_from => [ "linux-generic64" ],
cflags => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall", cflags => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release => "-O3"),
lflags => "-pie", lflags => "-pie",
shared_cflag => "", shared_cflag => "",
}, },
@ -825,9 +830,9 @@
# expands it as -lc_r, which seems to be sufficient? # expands it as -lc_r, which seems to be sufficient?
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
cc => "cc", cc => "cc",
cflags => "-Wall", cflags => picker(default => "-Wall",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT", thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
dso_scheme => "dlfcn", dso_scheme => "dlfcn",
@ -842,8 +847,8 @@
"BSD-x86" => { "BSD-x86" => {
inherit_from => [ "BSD-generic32", asm("x86_asm") ], inherit_from => [ "BSD-generic32", asm("x86_asm") ],
cflags => "-DL_ENDIAN -Wall", cflags => add(picker(default => "-DL_ENDIAN",
release_cflags => "-O3 -fomit-frame-pointer", release => "-fomit-frame-pointer")),
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
shared_target => "bsd-shared", shared_target => "bsd-shared",
perlasm_scheme => "a.out", perlasm_scheme => "a.out",
@ -855,26 +860,26 @@
"BSD-sparcv8" => { "BSD-sparcv8" => {
inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ], inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
cflags => "-mcpu=v8 -Wall -DB_ENDIAN", cflags => add("-mcpu=v8 -DB_ENDIAN"),
}, },
"BSD-sparc64" => { "BSD-sparc64" => {
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
# simply *happens* to work around a compiler bug in gcc 3.3.3, # simply *happens* to work around a compiler bug in gcc 3.3.3,
# triggered by RIPEMD160 code. # triggered by RIPEMD160 code.
inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ], inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
cflags => "-DB_ENDIAN -DMD32_REG_T=int -Wall", cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
}, },
"BSD-ia64" => { "BSD-ia64" => {
inherit_from => [ "BSD-generic64", asm("ia64_asm") ], inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
cflags => "-DL_ENDIAN -Wall", cflags => add_before("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
}, },
"BSD-x86_64" => { "BSD-x86_64" => {
inherit_from => [ "BSD-generic64", asm("x86_64_asm") ], inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
cflags => "-DL_ENDIAN -Wall", cflags => add_before("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf", perlasm_scheme => "elf",
}, },
@ -1019,9 +1024,9 @@
"aix-gcc" => { "aix-gcc" => {
inherit_from => [ "BASE_unix", asm("ppc32_asm") ], inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DB_ENDIAN", cflags => picker(default => "-DB_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O", release => "-O"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
sys_id => "AIX", sys_id => "AIX",
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
@ -1035,9 +1040,9 @@
"aix64-gcc" => { "aix64-gcc" => {
inherit_from => [ "BASE_unix", asm("ppc64_asm") ], inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-maix64 -DB_ENDIAN", cflags => picker(default => "-maix64 -DB_ENDIAN",
debug_cflags => "-O0 -g", debug => "-O0 -g",
release_cflags => "-O", release => "-O"),
thread_cflag => "-pthread", thread_cflag => "-pthread",
sys_id => "AIX", sys_id => "AIX",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
@ -1054,9 +1059,9 @@
"aix-cc" => { "aix-cc" => {
inherit_from => [ "BASE_unix", asm("ppc32_asm") ], inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
cc => "cc", cc => "cc",
cflags => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst", cflags => picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
debug_cflags => "", debug => "-O0 -g",
release_cflags => "-O", release => "-O"),
thread_cflag => "-qthreaded -D_THREAD_SAFE", thread_cflag => "-qthreaded -D_THREAD_SAFE",
sys_id => "AIX", sys_id => "AIX",
bn_ops => "BN_LLONG RC4_CHAR", bn_ops => "BN_LLONG RC4_CHAR",
@ -1070,9 +1075,9 @@
"aix64-cc" => { "aix64-cc" => {
inherit_from => [ "BASE_unix", asm("ppc64_asm") ], inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
cc => "cc", cc => "cc",
cflags => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst", cflags => picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
debug_cflags => "", debug => "-O0 -g",
release_cflags => "-O", release => "-O"),
thread_cflag => "-qthreaded -D_THREAD_SAFE", thread_cflag => "-qthreaded -D_THREAD_SAFE",
sys_id => "AIX", sys_id => "AIX",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
@ -1174,9 +1179,9 @@
inherit_from => [ "BASE_unix", asm("x86_asm"), inherit_from => [ "BASE_unix", asm("x86_asm"),
sub { $disabled{shared} ? () : "x86_uplink" } ], sub { $disabled{shared} ? () : "x86_uplink" } ],
cc => "gcc", cc => "gcc",
cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall", cflags => picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3 -fomit-frame-pointer", release => "-O3 -fomit-frame-pointer"),
thread_cflag => "-D_MT", thread_cflag => "-D_MT",
sys_id => "MINGW32", sys_id => "MINGW32",
ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"), ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
@ -1201,9 +1206,9 @@
# Applink is never engaged and can as well be omitted. # Applink is never engaged and can as well be omitted.
inherit_from => [ "BASE_unix", asm("x86_64_asm") ], inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall", cflags => picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-D_MT", thread_cflag => "-D_MT",
sys_id => "MINGW64", sys_id => "MINGW64",
ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"), ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
@ -1240,9 +1245,9 @@
"Cygwin-x86" => { "Cygwin-x86" => {
inherit_from => [ "BASE_unix", asm("x86_asm") ], inherit_from => [ "BASE_unix", asm("x86_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DTERMIOS -DL_ENDIAN -Wall", cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3 -fomit-frame-pointer", release => "-O3 -fomit-frame-pointer"),
sys_id => "CYGWIN", sys_id => "CYGWIN",
bn_ops => "BN_LLONG", bn_ops => "BN_LLONG",
perlasm_scheme => "coff", perlasm_scheme => "coff",
@ -1255,9 +1260,9 @@
"Cygwin-x86_64" => { "Cygwin-x86_64" => {
inherit_from => [ "BASE_unix", asm("x86_64_asm") ], inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
cc => "gcc", cc => "gcc",
cflags => "-DTERMIOS -DL_ENDIAN -Wall", cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
sys_id => "CYGWIN", sys_id => "CYGWIN",
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "mingw64", perlasm_scheme => "mingw64",
@ -1369,9 +1374,9 @@
inherit_from => [ "BASE_unix" ], inherit_from => [ "BASE_unix" ],
template => 1, template => 1,
cc => "cc", cc => "cc",
cflags => "", cflags => picker(default => "",
debug_cflags => "-g -O0", debug => "-g -O0",
release_cflags => "-O3", release => "-O3"),
thread_cflag => "-D_REENTRANT", thread_cflag => "-D_REENTRANT",
sys_id => "MACOSX", sys_id => "MACOSX",
plib_lflags => "-Wl,-search_paths_first", plib_lflags => "-Wl,-search_paths_first",
@ -1385,28 +1390,28 @@
}, },
"darwin-ppc-cc" => { "darwin-ppc-cc" => {
inherit_from => [ "darwin-common", asm("ppc32_asm") ], inherit_from => [ "darwin-common", asm("ppc32_asm") ],
cflags => "-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL", cflags => add("-arch ppc -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
perlasm_scheme => "osx32", perlasm_scheme => "osx32",
shared_ldflag => "-arch ppc -dynamiclib", shared_ldflag => "-arch ppc -dynamiclib",
}, },
"darwin64-ppc-cc" => { "darwin64-ppc-cc" => {
inherit_from => [ "darwin-common", asm("ppc64_asm") ], inherit_from => [ "darwin-common", asm("ppc64_asm") ],
cflags => "-arch ppc64 -DB_ENDIAN", cflags => add("-arch ppc64 -DB_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "osx64", perlasm_scheme => "osx64",
shared_ldflag => "-arch ppc64 -dynamiclib", shared_ldflag => "-arch ppc64 -dynamiclib",
}, },
"darwin-i386-cc" => { "darwin-i386-cc" => {
inherit_from => [ "darwin-common", asm("x86_asm") ], inherit_from => [ "darwin-common", asm("x86_asm") ],
cflags => "-arch i386 -DL_ENDIAN", cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
release_cflags => "-O3 -fomit-frame-pointer", release => "-fomit-frame-pointer")),
bn_ops => "BN_LLONG RC4_INT", bn_ops => "BN_LLONG RC4_INT",
perlasm_scheme => "macosx", perlasm_scheme => "macosx",
shared_ldflag => "-arch i386 -dynamiclib", shared_ldflag => "-arch i386 -dynamiclib",
}, },
"darwin64-x86_64-cc" => { "darwin64-x86_64-cc" => {
inherit_from => [ "darwin-common", asm("x86_64_asm") ], inherit_from => [ "darwin-common", asm("x86_64_asm") ],
cflags => "-arch x86_64 -DL_ENDIAN -Wall", cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
bn_ops => "SIXTY_FOUR_BIT_LONG", bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "macosx", perlasm_scheme => "macosx",
shared_ldflag => "-arch x86_64 -dynamiclib", shared_ldflag => "-arch x86_64 -dynamiclib",
@ -1429,7 +1434,7 @@
# #
"iphoneos-cross" => { "iphoneos-cross" => {
inherit_from => [ "darwin-common" ], inherit_from => [ "darwin-common" ],
cflags => "-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common", cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
sys_id => "iOS", sys_id => "iOS",
}, },
"ios-cross" => { "ios-cross" => {
@ -1437,13 +1442,13 @@
# It should be possible to go below iOS 6 and even add -arch armv6, # It should be possible to go below iOS 6 and even add -arch armv6,
# thus targeting iPhone pre-3GS, but it's assumed to be irrelevant # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
# at this point. # at this point.
cflags => "-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common", cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
sys_id => "iOS", sys_id => "iOS",
perlasm_scheme => "ios32", perlasm_scheme => "ios32",
}, },
"ios64-cross" => { "ios64-cross" => {
inherit_from => [ "darwin-common", asm("aarch64_asm") ], inherit_from => [ "darwin-common", asm("aarch64_asm") ],
cflags => "-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common", cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
sys_id => "iOS", sys_id => "iOS",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64", perlasm_scheme => "ios64",
@ -1568,12 +1573,12 @@
inherit_from => [ "BASE_VMS" ], inherit_from => [ "BASE_VMS" ],
template => 1, template => 1,
cc => "CC/DECC", cc => "CC/DECC",
cflags => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)", cflags => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL/NAMES=(AS_IS,SHORTENED)",
debug_cflags => "/NOOPTIMIZE/DEBUG", debug => "/NOOPTIMIZE/DEBUG",
release_cflags => "/OPTIMIZE/NODEBUG", release => "/OPTIMIZE/NODEBUG"),
lflags => "/MAP", lflags => picker(default => "/MAP",
debug_lflags => "/DEBUG/TRACEBACK", debug => "/DEBUG/TRACEBACK",
release_lflags => "/NODEBUG/NOTRACEBACK", release => "/NODEBUG/NOTRACEBACK"),
shared_target => "vms-shared", shared_target => "vms-shared",
apps_aux_src => "vms_decc_init.c", apps_aux_src => "vms_decc_init.c",

View File

@ -1,18 +1,26 @@
## -*- mode: perl; -*- ## -*- mode: perl; -*-
## Personal configuration targets ## Personal configuration targets
sub picker {
my %opts = @_;
return sub { add($opts{default} || (),
$opts{$config{build_type}} || ())->(); }
}
%targets = ( %targets = (
"levitte-linux-elf" => { "levitte-linux-elf" => {
inherit_from => [ "linux-elf" ], inherit_from => [ "linux-elf" ],
debug_cflags => add("-ggdb -g3"), cflags => add(picker(debug => "-ggdb -g3")),
debug_defines => add("LEVITTE_DEBUG", { separator => undef }), defines => add(picker(debug => "LEVITTE_DEBUG"),
{ separator => undef }),
build_scheme => [ "unified", "unix" ], build_scheme => [ "unified", "unix" ],
build_file => "Makefile", build_file => "Makefile",
}, },
"levitte-linux-x86_64" => { "levitte-linux-x86_64" => {
inherit_from => [ "linux-x86_64" ], inherit_from => [ "linux-x86_64" ],
debug_cflags => add("-ggdb -g3"), cflags => add(picker(debug => "-ggdb -g3")),
debug_defines => add("LEVITTE_DEBUG", { separator => undef }), defines => add(picker(debug => "LEVITTE_DEBUG"),
{ separator => undef }),
build_scheme => [ "unified", "unix" ], build_scheme => [ "unified", "unix" ],
build_file => "Makefile", build_file => "Makefile",
}, },

View File

@ -438,7 +438,7 @@ $config{openssl_other_defines}=[];
my $libs=""; my $libs="";
my $target=""; my $target="";
$config{options}=""; $config{options}="";
my $build_prefix = "release_"; $config{build_type} = "release";
my @argvcopy=@ARGV; my @argvcopy=@ARGV;
@ -591,11 +591,11 @@ foreach (@argvcopy)
} }
elsif (/^--debug$/) elsif (/^--debug$/)
{ {
$build_prefix = "debug_"; $config{build_type} = "debug";
} }
elsif (/^--release$/) elsif (/^--release$/)
{ {
$build_prefix = "release_"; $config{build_type} = "release";
} }
elsif (/^386$/) elsif (/^386$/)
{ $config{processor}=386; } { $config{processor}=386; }
@ -826,7 +826,7 @@ print "Configuring for $target\n";
# Support for legacy targets having a name starting with 'debug-' # Support for legacy targets having a name starting with 'debug-'
my ($d, $t) = $target =~ m/^(debug-)?(.*)$/; my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
if ($d) { if ($d) {
$build_prefix = "debug_"; $config{build_type} = "debug";
# If we do not find debug-foo in the table, the target is set to foo. # If we do not find debug-foo in the table, the target is set to foo.
if (!$table{$target}) { if (!$table{$target}) {
@ -866,14 +866,9 @@ $target{nm} = $ENV{'NM'} || $target{nm} || "nm";
# For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_ # For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
# or release_ attributes. # or release_ attributes.
# Do it in such a way that no spurious space is appended (hence the grep). # Do it in such a way that no spurious space is appended (hence the grep).
$config{defines} = [ @{$target{defines}}, $config{defines} = $target{defines} || [];
@{$target{$build_prefix."defines"}} ]; $config{cflags} = $target{cflags} || "";
$config{cflags} = join(" ", $config{ex_libs} = $target{ex_libs} || "";
grep { $_ ne "" } ($target{cflags},
$target{$build_prefix."cflags"}));
$config{ex_libs} = join(" ",
grep { $_ ne "" } ($target{ex_libs},
$target{$build_prefix."ex_libs"}));
# Make sure build_scheme is consistent. # Make sure build_scheme is consistent.
$target{build_scheme} = [ $target{build_scheme} ] $target{build_scheme} = [ $target{build_scheme} ]
@ -2172,22 +2167,12 @@ sub print_table_entry
"cc", "cc",
"cflags", "cflags",
"defines", "defines",
"debug_cflags",
"debug_defines",
"release_cflags",
"release_defines",
"thread_cflag", "thread_cflag",
"unistd", "unistd",
"ld", "ld",
"lflags", "lflags",
"plib_lflags", "plib_lflags",
"ex_libs", "ex_libs",
"debug_lflags",
"debug_plib_lflags",
"debug_ex_libs",
"release_lflags",
"release_plib_lflags",
"release_ex_libs",
"bn_ops", "bn_ops",
"cpuid_obj", "cpuid_obj",
"bn_obj", "bn_obj",