diff options
author | Richard Levitte <levitte@openssl.org> | 2015-05-18 14:31:49 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-01-22 00:58:56 +0100 |
commit | 88087414def54cd55dfebc172f17f79ed7d3034a (patch) | |
tree | f375deb9a16124f804d8b676abe51da727881c26 /Configurations | |
parent | 9e0724a1805fba20a897f6c7f95336f0da017ccf (diff) |
Refactor config - @MK1MF_Builds out, general build scheme in
Time to get rid of @MK1MF_Builds and introduce a more flexible
'build_scheme' configuration key. Its value may be a string or an
array of strings, meaning we need to teach resolve_config how to
handle ARRAY referenses.
The build scheme is a word that selects a function to create the
appropriate result files for a certain configuration. Currently valid
build schemes aer "mk1mf" and "unixmake", the plan is however to add
at least one other for a more universal build scheme.
Incidently, this also adds the functions 'add' and 'add_before', which
can be used in a configuration, so instead of having to repeatedly
write a sub like this:
key1 => sub { join(" ", @_, "myvalues"); },
key2 => sub { join(" ", "myvalues", @_); },
one could write this:
key1 => add(" ", "myvalues"),
key2 => add_before(" ", "myvalues"),
The good point with 'add' and 'add_before' is that they handle
inheritances where the values are a misture of scalars and ARRAYs. If
there are any ARRAY to be found, the resulting value will be an ARRAY,
otherwise it will be a scalar with all the incoming valued joined
together with the separator given as first argument to add/add_before.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/00-base-templates.conf | 1 | ||||
-rw-r--r-- | Configurations/10-main.conf | 28 | ||||
-rw-r--r-- | Configurations/README | 12 |
3 files changed, 30 insertions, 11 deletions
diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 064648f15a..90633c4abf 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -20,6 +20,7 @@ poly1305_obj => "", unistd => "<unistd.h>", + build_scheme => "unixmake", }, x86_asm => { diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 06911acac1..c5ae5940e2 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -125,13 +125,13 @@ }, "solaris-sparcv8-gcc" => { inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ], - cflags => sub { join(" ","-mcpu=v8",@_); }, + cflags => add_before(" ", "-mcpu=v8"), }, "solaris-sparcv9-gcc" => { # -m32 should be safe to add as long as driver recognizes # -mcpu=ultrasparc inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ], - cflags => sub { join(" ","-m32 -mcpu=ultrasparc",@_); }, + cflags => add_before(" ", "-m32 -mcpu=ultrasparc"), debug_cflags => "-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__", }, "solaris64-sparcv9-gcc" => { @@ -161,15 +161,15 @@ #### "solaris-sparcv8-cc" => { inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ], - cflags => sub { join(" ","-xarch=v8",@_); }, + cflags => add_before(" ", "-xarch=v8"), }, "solaris-sparcv9-cc" => { inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ], - cflags => sub { join(" ","-xarch=v8plus -xtarget=ultra",@_); }, + cflags => add_before(" ", "-xarch=v8plus -xtarget=ultra"), }, "solaris64-sparcv9-cc" => { inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ], - cflags => sub { join(" ","-xarch=v9 -xtarget=ultra",@_); }, + cflags => add_before(" ", "-xarch=v9 -xtarget=ultra"), bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR", shared_ldflag => "-xarch=v9 -G -dy -z text", multilib => "/64", @@ -353,7 +353,7 @@ }, "hpux-parisc1_1-cc" => { inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ], - cflags => sub { join(" ","+DA1.1",@_); }, + cflags => add_before(" ", "+DA1.1"), multilib => "/pa1.1", }, "hpux64-parisc2-cc" => { @@ -799,7 +799,7 @@ }, "android-armv7" => { inherit_from => [ "android-armeabi" ], - cflags => sub { join (" ","-march=armv7-a",@_); }, + cflags => add_before(" ", "-march=armv7-a"), }, "android-mips" => { inherit_from => [ "android", asm("mips32_asm") ], @@ -1119,23 +1119,26 @@ cc => "cl", cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE", dso_scheme => "win32", + build_scheme => "mk1mf", }, "VC-WIN64I" => { inherit_from => [ "VC-common", asm("ia64_asm") ], - cflags => sub { join(" ",@_,"-DUNICODE -D_UNICODE"); }, + cflags => add(" ", "-DUNICODE -D_UNICODE"), sys_id => "WIN64I", bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN", bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; }, rc4_obj => "", perlasm_scheme => "ias", + build_scheme => [ "mk1mf", "VC-W64" ], }, "VC-WIN64A" => { inherit_from => [ "VC-common", asm("x86_64_asm") ], - cflags => sub { join(" ",@_,"-DUNICODE -D_UNICODE"); }, + cflags => add(" ", "-DUNICODE -D_UNICODE"), sys_id => "WIN64A", bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN", bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; }, perlasm_scheme => "auto", + build_scheme => [ "mk1mf", "VC-W64" ], }, "VC-WIN32" => { # x86 Win32 target defaults to ANSI API, if you want UNICODE, @@ -1144,12 +1147,14 @@ sys_id => "WIN32", bn_ops => "BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}", perlasm_scheme => "win32n", + build_scheme => [ "mk1mf", "VC-W32" ], }, "VC-CE" => { cc => "cl", sys_id => "WINCE", bn_ops => "BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}", dso_scheme => "win32", + build_scheme => [ "mk1mf", "VC-WCE" ], }, #### Borland C++ 4.5 @@ -1158,6 +1163,7 @@ sys_id => "WIN32", bn_ops => "BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN", dso_scheme => "win32", + build_scheme => [ "mk1mf", "BC" ], }, #### MinGW @@ -1277,10 +1283,12 @@ "netware-clib" => { cc => "mwccnlm", bn_ops => "${x86_gcc_opts}", + build_scheme => [ "mk1mf", "netware" ], }, "netware-clib-bsdsock" => { cc => "mwccnlm", bn_ops => "${x86_gcc_opts}", + build_scheme => [ "mk1mf", "netware" ], }, "netware-clib-gcc" => { cc => "i586-netware-gcc", @@ -1296,10 +1304,12 @@ "netware-libc" => { cc => "mwccnlm", bn_ops => "BN_LLONG ${x86_gcc_opts}", + build_scheme => [ "mk1mf", "netware" ], }, "netware-libc-bsdsock" => { cc => "mwccnlm", bn_ops => "BN_LLONG ${x86_gcc_opts}", + build_scheme => [ "mk1mf", "netware" ], }, "netware-libc-gcc" => { cc => "i586-netware-gcc", diff --git a/Configurations/README b/Configurations/README index e1327e57f9..df55d71549 100644 --- a/Configurations/README +++ b/Configurations/README @@ -97,8 +97,16 @@ In each table entry, the following keys are significant: shared_target => The shared library building method used. This is a target found in Makefile.shared. build_scheme => The scheme used to build up a Makefile. - (NOTE: this is here for future use, it's - not implemented yet) + In its simplest form, the value is a string + with the name of the build scheme. + The value may also take the form of a list + of strings, if the build_scheme is to have + some options. In this case, the first + string in the list is the name of the build + scheme. + Currently recognised build schemes are + "mk1mf" and "unixmake". Others may appear + in the future. multilib => On systems that support having multiple implementations of a library (typically a |