aboutsummaryrefslogtreecommitdiffstats
path: root/Configure
Commit message (Collapse)AuthorAgeFilesLines
* Refactor file writing - introduce template driven file writingRichard Levitte2016-01-221-207/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apps/CA.pl and tools/c_rehash are built from template files. So far, this was done by Configure, which created its own problems as it forced everyone to reconfigure just because one of the template files had changed. Instead, have those files created as part of the normal build in apps/ and in tools/. Furthermore, this prepares for a future where Configure may produce entirely other build files than Makefile, and the latter can't be guaranteed to be the holder of all information for other scripts. Instead, configdata.pm (described below) becomes the center of configuration information. This introduces a few new things: %config a hash table to hold all kinds of configuration data that can be used by any other script. configdata.pm a perl module that Configure writes. It currently holds the hash tables %config and %target. util/dofile.pl a script that takes a template on STDIN and outputs the result after applying configuration data on it. It's supposed to be called like this: perl -I$(TOP) -Mconfigdata < template > result or perl -I$(TOP) -Mconfigdata templ1 templ2 ... > result Note: util/dofile.pl requires Text::Template. As part of this changed, remove a number of variables that are really just copies of entries in %target, and use %target directly. The exceptions are $target{cflags} and $target{lflags}, they do get copied to $cflags and $lflags. The reason for this is that those variable potentially go through a lot of changes and would rather deserve a place in %config. That, however, is for another commit. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Refactor config - consolidate and refresh print_table_entryRichard Levitte2016-01-221-120/+84
| | | | | | | | | | | It's time for print_table_entry to get a bit of refreshment. The way it was put together, we needed to maintain the list of known configuration keys of interest twice, in different shapes. This is error prone, so move the list of strings to a common list for all printing cases, and use simple formatting of lines to do the actual printout based on that list. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refactor config - @MK1MF_Builds out, general build scheme inRichard Levitte2016-01-221-45/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Refactor config - move templates and template docs to ConfigurationsRichard Levitte2016-01-221-390/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the documentation of the target configuration form to Configurations/README. Move initial assembler object templates to Configurations/00-BASE-templates.conf. Furthermore, remove all variables containing the names of the non-assembler object files and make a BASE template of them instead. The values from this templates are used as defaults as is. The remaining manipulation of data when assembler modules are used is done only when $no_asm is false. While doing this, clean out some other related variables that aren't used anywhere. Also, we had to move the resolution of the chosen target a bit, or the function 'asm' would never catch a true $no_asm... this hasn't mattered before we've moved it all to the BASE template, but now it does. At the same time, add the default for the 'unistd' key to the BASE template. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refresh the thinking of --prefix and --openssldirRichard Levitte2016-01-221-11/+13
| | | | | | | | | | | | | | | --prefix is now exclusively used for software and manual installation. --openssldir is not exclusively used as a default location for certs, keys and the default openssl.cnf. This change is made to bring clarity, to have the two less intertwined, and to be more compatible with the usual ways of software installation. Please change your habits and scripts to use --prefix rather than --openssldir for installation location now. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Refactor config - throw away the last remains of '--test-sanity'Richard Levitte2016-01-211-4/+1
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Refactor config - consolidate handling of disabled stuffRichard Levitte2016-01-211-120/+81
| | | | | | | | | | | | | | | | | | | It's time to refactor the handling of %disabled so that all information of value is in the same place. We have so far had a few cascading disable rules in form of code, far away from %disabled. Instead, bring that information to the array @disable_cascade, which is a list of pairs of the form 'test => descendents'. The test part can be a string, and it's simply checked if that string is a key in %disabled, or it can be a CODEref to do a more complex test. If the test comes true, then all descendents are disabled. This check is performed until there are no more things that need to be disabled. Also, $default_depflags is constructed from the information in %disabled instead of being a separate string. While a string of its own is visually appealing, it's much too easy to forget to update it when something is changed in %disabled. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Refactor config - rewrite handling of "reconf"Richard Levitte2016-01-211-203/+194
| | | | | | | | | | | | | The way the "reconf"/"reconfigure" argument is handled is overly complicated. Just grep for it first, and if it is there in the current arguments, get the old command line arguments from Makefile. While we're at it, make the Makefile variable CONFIGURE_ARGS hold the value as a perl list of strings. This makes things much safer in case one of the arguments would contain a space. Since CONFIGURE_ARGS is used for nothing else, there's no harm in this. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Refactor config - split read_config into read_config and resolve_configRichard Levitte2016-01-201-416/+244
| | | | | | | | | | | | | | | | | | Split the read_config function into read_config that ONLY reads the configuration files but doesn't try to resolve any of the inheritances, and resolve_config which resolves the inheritance chain of a given target. Move them to the bottom of Configure, with the rest of the helpers. Have a new small hash table, %target, which will hold the values for the target the user requested. This also means that all access to the current target data can be reduced from '$table{$target}->{key}' to a mere '$target{key}'. While we're at it, the old string formatted configurations are getting obsolete, so they may as well get deprecated entirely. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refactor config - throw away '--test-sanity'Richard Levitte2016-01-201-43/+0
| | | | | | | | Get rid of the --test-sanity option. Since we no longer have string based configurations, we don't have the problem with miscounting colons any more. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Refactor config - a small cosmetic touchup of ConfigureRichard Levitte2016-01-201-12/+7
| | | | | | | | | | Start simple, removed some unused variables and change all '<<EOF' to '<<"EOF"'. The latter is because some code colorizers (notably, in emacs) cannot recognise the here document end marker unless it's quoted and therefore assume the rest of the file is part of the here document. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove the GOST engineMatt Caswell2016-01-191-1/+0
| | | | | | | | | | The GOST engine is now out of date and is removed by this commit. An up to date GOST engine is now being maintained in an external repository. See: https://wiki.openssl.org/index.php/Binaries Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix BSD -rpath parameterRichard Levitte2016-01-191-1/+1
| | | | | | | | | For BSD systems, Configure adds a shared_ldflags including a reference to the Makefile variable LIBRPATH, but since it must be passed down to Makefile.shared, care must be taken so the value of LIBRPATH doesn't get expanded too early, or it ends up giving an empty string. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Support disabling any or all TLS or DTLS versionsViktor Dukhovni2016-01-191-13/+107
| | | | | | | | | | | | | | | Some users want to disable SSL 3.0/TLS 1.0/TLS 1.1, and enable just TLS 1.2. In the future they might want to disable TLS 1.2 and enable just TLS 1.3, ... This commit makes it possible to disable any or all of the TLS or DTLS protocols. It also considerably simplifies the SSL/TLS tests, by auto-generating the min/max version tests based on the set of supported protocols (425 explicitly written out tests got replaced by two loops that generate all 425 tests if all protocols are enabled, fewer otherwise). Reviewed-by: Richard Levitte <levitte@openssl.org>
* Small fixup, an extra line slipped inRichard Levitte2016-01-141-1/+0
| | | | | | | The previous 'Relax the requirements for a debug build' commit had an extra line of code that shouldn't have been there. This fixes it. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Add a no-egd option to disable EGD-related codeBenjamin Kaduk2016-01-141-1/+3
| | | | | | | | The entropy-gathering daemon is used only on a small number of machines. Provide a configure knob so that EGD support can be disabled by default but re-enabled on those systems that do need it. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Relax the requirements for a debug buildRichard Levitte2016-01-141-8/+3
| | | | | | | | | | | | | We required that a target be named 'debug-something' or to have at least one of the configuration items debug_cflags and debug_lflags for --debug to be accepted. However, there are targets with no such markings but that will still have debugging capabilities. This is particularly true for mk1mf builds, where the extra flags for debugging are figured out later on by util/mk1mf.pl. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix DES_LONG breakageViktor Dukhovni2016-01-131-2/+2
| | | | | | | | | | | | | | | For some strange reason opensslconf.h was only defining DES_LONG when included via des.h, but that's exceedingly fragile (as a result of include guards the include via des.h might not actually process the content again). Ripped out the nesting constraint, now always define OSSL_DES_LONG if not already defined. Note, this could just be DES_LONG, but trying to avoid exposing DES_LONG in places where it has never been seen before, so it is up to des.h to actually define DES_LONG as OSSL_DES_LONG. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix typo in error messageRich Salz2016-01-121-1/+1
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Move Makefiles to Makefile.inRich Salz2016-01-121-5/+26
| | | | | | | | | | Create Makefile's from Makefile.in Rename Makefile.org to Makefile.in Rename Makefiles to Makefile.in Address review feedback from Viktor and Richard Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Adjust $default_depflags to changes in ConfigureRichard Levitte2016-01-111-1/+1
| | | | | | | We use $default_depflags to check if a 'make depend' is needed after configuring, so it needs to be kept up to date. Reviewed-by: Matt Caswell <matt@openssl.org>
* Enable/disable crypto-mdebug just like other featuresViktor Dukhovni2016-01-111-3/+4
| | | | | | Also always abort() on leak failure. Reviewed-by: Stephen Henson <steve@openssl.org>
* Adds crypto-mdebug as a valid optionMat2016-01-091-0/+1
| | | | | | | Adds crypto-mdebug as a valid option. Fixes https://github.com/openssl/openssl/issues/537 Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix build failure on WindowsMat2016-01-091-1/+1
| | | | | | | Fixes https://github.com/openssl/openssl/issues/530 Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni2016-01-071-8/+41
| | | | | | | | | Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* mem functions cleanupRich Salz2016-01-071-1/+1
| | | | | | | | | | | | | | | | | Only two macros CRYPTO_MDEBUG and CRYPTO_MDEBUG_ABORT to control this. If CRYPTO_MDEBUG is not set, #ifdef out the whole debug machinery. (Thanks to Jakob Bohm for the suggestion!) Make the "change wrapper functions" be the only paradigm. Wrote documentation! Format the 'set func' functions so their paramlists are legible. Format some multi-line comments. Remove ability to get/set the "memory debug" functions at runtme. Remove MemCheck_* and CRYPTO_malloc_debug_init macros. Add CRYPTO_mem_debug(int flag) function. Add test/memleaktest. Rename CRYPTO_malloc_init to OPENSSL_malloc_init; remove needless calls. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Configure: refine 'reconf' logic.Andy Polyakov2015-12-221-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix typo.Rich Salz2015-12-161-1/+0
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Provide better "make depend" warning.Rich Salz2015-12-161-13/+17
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix no-dgram.Ben Laurie2015-12-161-0/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove GMP engine.Rich Salz2015-12-151-4/+1
| | | | Reviewed-by: Ben Laurie <ben@openssl.org>
* Configure: add framework for ChaCha and Poly1305 assembly.Andy Polyakov2015-12-131-1/+20
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Configure: 'reconf' to respect CROSS_COMPILE and CC.Andy Polyakov2015-12-131-2/+11
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use OPENSSL_NO_DTLS instead of OPENSSL_NO_DTLS1Kurt Roeckx2015-12-121-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Configure: make no-chacha and no-poly1305 work.Andy Polyakov2015-12-101-0/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Link library for backtrace() on BSD...Ben Laurie2015-12-091-1/+5
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix ./Configure reconfRichard Levitte2015-12-021-1/+2
| | | | | | | './Configure reconf' hasn't been working for a while, because a perl lable needs to be immediately followed by a block. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Move the backtrace memleak options to a separate variableRichard Levitte2015-12-021-1/+13
| | | | | | | | The contents of this variable ($memleak_devteam_backtrace) is added to $cflags unless we build for a platform we know doesn't support gcc's -rdynamic och backtrace() and friends. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add backtrace to memory leak outputRichard Levitte2015-12-021-1/+1
| | | | | | This is an option for builds with gcc and --strict-warnings. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Drop the old perl start magic and replace it with a normal shebangRichard Levitte2015-11-241-3/+2
| | | | | | perlrun(1) leads the way. Reviewed-by: Matt Caswell <matt@openssl.org>
* Add perl modeline to Configure scriptsJacob Bandes-Storch2015-11-241-0/+1
| | | | | | | Encourages GitHub to perform proper syntax highlighting. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make the match for previous cflags a bit more strictRichard Levitte2015-11-091-2/+2
| | | | | | | | ./Configure [target] --strict-warnings -Wno-pedantic-ms-format would not add '-pedantic' because it matches '-Wno-pedantic-ms-format', which was added first. Reviewed-by: Matt Caswell <matt@openssl.org>
* Make Configure die when unsupported options are givenRichard Levitte2015-10-221-1/+8
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add an explicit list of options that can be disabled, enabled, ...Richard Levitte2015-10-221-0/+89
| | | | | | | | | | | | | | Configure has, so far, had no control at all of which 'no-' options it can be given. This means that, for example, someone could configure with something absurd like 'no-stack' and then watch the build crumble to dust... or file a bug report. This introduces some sanity into the possible choices. The added list comes from looking for the explicit ones used in Configure, and from grepping after OPENSSL_NO_ in all source files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* make depend: prefer clang over makedependEmilia Kasper2015-10-141-3/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH429: Add clang to travisAlessandro Ghedini2015-10-131-1/+1
| | | | | Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Andy Polyakov <appro@openssl.org>
* Fix no-stdio buildDavid Woodhouse2015-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Update year in Windows builds.Andy Polyakov2015-09-281-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Enable -Wmissing-variable-declarations andBen Laurie2015-09-111-3/+2
| | | | | | | -Wincompatible-pointer-types-discards-qualifiers (the latter did not require any code changes). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Adapt mk1mf.pl and helpers to the new testing framework.Richard Levitte2015-09-071-8/+10
| | | | | | | | | | | | With the new testing framework, building a test target with mk1mf.pl becomes a very simple thing. And especially, no more need to do the amount of hackery in unix.pl we did. Also, some tests need a working apps/CA.pl as well as rehashed certs in certs/demo. So, move the code creating those files so it gets done regardless, not just in non-mk1mf environments. Reviewed-by: Rich Salz <rsalz@openssl.org>