Commit Graph

981 Commits

Author SHA1 Message Date
Rich Salz 8bccbce52a Reformat warn variables for easier editing.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 12:39:24 -05:00
Richard Levitte 63994098d5 Rethink the method to place user cflags last
The previous method had some unfortunate consequences with
--strict-warnings.  To counteract, revert part of the previous change
and move down the block of code that adds the user cflags and defines.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 14:06:40 +01:00
Richard Levitte 3c65577f1a Rename INSTALL_PREFIX to DESTDIR, remove option --install_prefix
INSTALL_PREFIX is a confusing name, as there's also --prefix.
Instead, tag along with the rest of the open source world and adopt
the Makefile variable DESTDIR to designate the desired staging
directory.

The Configure option --install_prefix is removed, the only way to
designate a staging directory is with the Makefile variable (this is
also implemented for VMS' descrip.mms et al).

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 21:54:07 +01:00
Rich Salz 2b91ec7575 Put user flags last for priority.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-12 15:42:33 -05:00
Richard Levitte 04f171c096 Remove last chomps
In the previous commit to change all chomp to a more flexible regexp,
Configure was forgotten.  This completes the change.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-12 13:04:32 +01:00
Rich Salz 22e3dcb780 Remove TLS heartbeat, disable DTLS heartbeat
To enable heartbeats for DTLS, configure with enable-heartbeats.
Heartbeats for TLS have been completely removed.

This addresses RT 3647

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11 12:57:26 -05:00
Rich Salz f3f1cf8444 Move to REF_DEBUG, for consistency.
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11 12:40:32 -05:00
Richard Levitte 64c443e3f0 Add support for shared_rcflag, useful for windres (Cygwin and Mingw)
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:50:01 +01:00
Richard Levitte 68ab559a50 Modernise the mingw cflags and ldflags
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:50:01 +01:00
Richard Levitte e737d7b197 Unified build: Keep track of generated header files
If someone runs a mixed unixmake / unified environment (the unified
build tree would obviously be out of the source tree), the unified
build will pick up on the unixmake crypto/buildinf.h because of
assumptions made around this sort of declaration (found in
crypto/build.info):

    DEPENDS[cversion.o]=buildinf.h

The assumption was that if such a header could be found in the source
tree, that was the one to depend on, otherwise it would assume it
should be in the build tree.

This change makes sure that sort of mix-up won't happen again.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:48:32 +01:00
Richard Levitte d20bb611d9 Remove the "make depend" message
It's not necessary for a pristine source, and a developer that makes
changes usually knows what to do.

Also, there was this mechanism that would do a "make depend"
automatically which hasn't been used for so many years.  Removed as
well.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:47:36 +01:00
Richard Levitte f4a748a17d Produce buildinf.h on Windows the same way as on Unix
Because ENGINESDIR and OPENSSLDIR typically contains backslashes, they
need to be escaped just right.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 19:36:48 +01:00
Richard Levitte 242ffb05a2 unified build scheme: Try to nudge users to try the "unified" build
This commit SHALL be reverted before final release.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:04 +01:00
Richard Levitte 5482dac9f4 Configure et al: move the installation directory logic to Makefiles
The logic to figure out the combinations of --prefix and --openssldir
has stayed in Configure so far, with Unix paths as defaults.

However, since we're making Configure increasingly platform agnostic,
these defaults need to change and adapt to the platform, along with
the logic to combine them.

The easiest to provide for this is to move the logic and the defaults
away from Configure and into the build files.

This also means that the definition of the macros ENGINESDIR and
OPENSSLDIR move away from include/openssl/opensslconf.h and into the
build files.

Makefile.in is adapted accordingly.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:34:06 +01:00
Richard Levitte bcb1977b7f Configure et al: treat C defines separately
With some compilers, C macros are defined differently on the command
line than on Unix.  It could be that the flad to define them isn't -D,
it could also be that they need to be grouped together and not be mixed
in with the other compiler flags (that's how it's done on VMS, for
example).

On Unix family platform configurations, we can continue to have macro
definitions mixed in with the rest of the flags, so the changes in
Configurations/*.conf are kept to an absolute minimum.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:34:06 +01:00
Rich Salz 7984f082d5 Remove store.
Rebased and merged by me, with Ben's approval.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Ben Laurie <ben@openssl.org>
2016-02-10 07:56:26 -05:00
Richard Levitte 2e963849b7 Make the processing of build.info files more aware of absolute dirs
There were cases where some input was absolute, and concatenating it
to the diretory to the source or build top could fail spectacularly.
Let's check the input first to see if it's absolute.

And while we're on the subject of checking if a file or dir spec is
absolute using file_name_is_absolute() has its own quirks on VMS,
where a logical name is considered absolute under most circumstances.
This is perfectly correct from a VMS point of view, but when parsing
the build.info files, we want single word file or directory names to
only be checked syntactically.  A function isabsolute() that does the
right thing is the solution.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 05:09:39 +01:00
Mat 7839b735d8 GH649: Fix: version32.rc was not created on Windows
version32.rc was not created on Windows. The if condition has been corrected.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-09 17:51:22 -05:00
Matt Caswell 498abff0ae Add an OPENSSL_NO_AUTOERRINIT option
This option disables automatic loading of the crypto/ssl error strings in
order to keep statically linked executable file size down

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09 15:11:38 +00:00
Matt Caswell b184e3ef73 Provide framework for auto initialise/deinitialise of the library
This commit provides the basis and core code for an auto initialisation
and deinitialisation framework for libcrypto and libssl. The intention is
to remove the need (in many circumstances) to call explicit initialise and
deinitialise functions. Explicit initialisation will still be an option,
and if non-default initialisation is needed then it will be required.
Similarly for de-initialisation (although this will be a lot easier since
it will bring all de-initialisation into a single function).

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09 15:11:38 +00:00
Richard Levitte ec182ef044 Use rel2abs() on VMS, rather than realpath()
It seems realpath() is quite buggy on VMS, or will at least give quite
surprising results.  On the other hand, realpath() is the better on
Unix to clean out clutter like foo/../bar on Unix.

So we make out own function to get the absolute directory for a given
input, and use rel2abs() or realpath() depending on the platform
Configure runs on.

Issue reported by Steven M. Schweda <sms@antinode.info>

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-09 13:14:33 +01:00
Richard Levitte ddf1847dc8 unified build scheme: add and document the "unified" driving engine
common.tmpl will be used together with the template build file, and is
the engine that connects the information gathered from all the
build.info files with making the build file itself.

This file expects there to be a template section in the build file
template that defines a number perl functions designed to return
strings with appropriate lines for the build system at hand.  The
exact functions, what they can expect as arguments and what output
they're expected to produce is documented in Configurations/README.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-09 01:25:00 +01:00
Richard Levitte dca99383c2 Use File::Path::mkpath rather than File::Path::make_path
File::Path::make_path didn't show up before File::Path 2.06 / perl v5.10.1.
Because we're trying to stay compatible with perl v5.10.0 and up,
it's better to use the legacy interface.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-08 17:03:37 +01:00
Richard Levitte c86ddbe613 Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs.  These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.

Unfortunately, that conclusion wasn't entirely accurate.  Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.

Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.

Also, documentation is changed in Configurations/README.  This was
previously forgotten.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-06 17:57:19 +01:00
Todd Short 52739e40cc Add option to disable async
Add no-async option to Configure that forces ASYNC_NULL.
Related to RT1979
An embedded system or replacement C library (e.g. musl or uClibc)
may not support the *context APIs that are needed for async operation.

Compiles with musl. Ran unit tests, async tests skipped as expected.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-04 12:07:50 -05:00
Richard Levitte b31feae6de If egd is disabled by default, it should be possible to enable
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-04 16:46:37 +01:00
Michael Lee 20a5819f13 [Configure] Make --with-zlib-* work with configdata.pm
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-03 18:23:08 +01:00
Richard Levitte 85152ca4a1 Use a simpler method to build a glob than splitpath and catpath
It turns out that the combination splitpath() could return an empty
string for the directory part.  This doesn't play well with catdir().

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-02 20:07:44 +01:00
Rich Salz f1f07a2367 Better check for gcc/clang
Iteratively improved with Richard and Andy.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-01 09:42:10 -05:00
Richard Levitte 9fe2bb77c4 unified build scheme: a first introduction
The "unified" build scheme revolves around small information files,
build.info, which each describe their own bit of everything that needs
to be built, using a mini-language described in Configurations/README.

The information in build.info file contain references to source files
and final result.  Object files are not mentioned at all, they are
simply from source files.  Because of this, all the *_obj items in
Configurations/*.conf are renamed to *_asm_src and the files listed
in the values are change from object files to their corresponding
source files.  For the sake of the other build schemes, Configure
generates corresponding *_obj entries in %target.

Furthermore, the "unified" build scheme supports having a build
directory tree separate from the source directry tree.

All paths in a build.info file is assumed to be relative to its
location, either within the source tree or within the build tree.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-01 12:46:58 +01:00
Andy Polyakov 46d4d86577 Configure: restore original logic for -DWHIRLPOOL_ASM.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-31 22:43:29 +01:00
Richard Levitte 0e87e05816 Remove the extra checks for Intel's C compiler
When the target is {something}-icc, we're doing some extra checks of
the icc compiler.  However, all such targets were cleaned away in
March 2015, so this Configure section is dead code.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-31 19:51:33 +01:00
Richard Levitte fb36ca1290 Don't go into dotted directories when copying Makefile.in to Makefile
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-31 12:49:36 +01:00
Rich Salz 94af0cd7f3 Move more BN internals to bn_lcl.h
There was an unused macro in ssl_locl.h that used an internal
type, so I removed it.
Move bio_st from bio.h to ossl_type.h

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-30 16:54:35 -05:00
Richard Levitte 421e30ec67 Configure: Clarify the handling of $thread_cflags
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-30 07:53:02 +01:00
Rich Salz 826e9e5446 Missed rc2_int from before.
Also remove $Makefile variable :)

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-29 17:22:38 -05:00
Rich Salz ced2c2c598 Templatize util/domd
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-29 16:56:07 -05:00
Richard Levitte 1740c16265 Configure et al: split up the lflags configuration item into two
The lflags configuration had a weird syntax with a % as separator.  If
it was present, whatever came before ended up as PEX_LIBS in Makefile
(usually, this is LDFLAGS), while whatever came after ended up as
EX_LIBS.

This change splits that item into lflags and ex_libs, making their use
more explicit.

Also, PEX_LIBS in all the Makefiles are renamed to LDFLAGS.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 18:36:57 +01:00
Richard Levitte f8206c8e24 Revert "Don't replace cflags with thread_cflags, only append the latter"
This reverts commit a450326ee0.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 18:00:45 +01:00
Richard Levitte a450326ee0 Don't replace cflags with thread_cflags, only append the latter
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 17:32:31 +01:00
Rich Salz a01dab9462 Remove x86_gcc_des,x86_gcc_opts
This is a followin from !1738, we no longer need those variables.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-29 10:30:57 -05:00
Rich Salz 78d6a74a6c Missed part of b4f35e
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-28 13:40:33 -05:00
Rich Salz b4f35e5e07 Remove EIGHT_BIT and SIXTEEN_BIT
Also cleaned up bn_prime.pl to current coding style.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-27 19:10:13 -05:00
Rich Salz 3e9e810f2e Remove outdated legacy crypto options
Many options for supporting optimizations for legacy crypto on legacy
platforms have been removed.  This simplifies the source code and
does not really penalize anyone.
        DES_PTR (always on)
        DES_RISC1, DES_RISC2 (always off)
        DES_INT (always 'unsigned int')
        DES_UNROLL (always on)
        BF_PTR (always on) BF_PTR2 (removed)
        MD2_CHAR, MD2_LONG (always 'unsigned char')
        IDEA_SHORT, IDEA_LONG (always 'unsigned int')
        RC2_SHORT, RC2_LONG (always 'unsigned int')
        RC4_LONG (only int and char (for assembler) are supported)
        RC4_CHUNK (always long), RC_CHUNK_LL (removed)
        RC4_INDEX (always on)
And also make D_ENCRYPT macro more clear (@appro)

This is done in consultation with Andy.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-27 19:05:50 -05:00
Richard Levitte 8ed40b83ec Fix check of what makedepprog should be
A mistake was made and the setting of this config variable got
reverted to an older behavior.  This restores the latest.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-01-27 19:03:13 +01:00
Richard Levitte 97ad487029 SHARED_LIBS_LINK_EXTS is no longer used, remove it completely
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26 19:48:36 +01:00
Richard Levitte 96d2d7bc71 Use Configure's @disablables and %disabled through configdata.pm
Enhances the routines in OpenSSL::Test::Utils for checking disabled
stuff to get their information directly from Configure instead of
'openssl list -disabled'.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-26 09:53:36 +01:00
Richard Levitte f0bd468675 Small cleanups in Configure
- Small rearrangement of the TABLE and HASH printouts, and adding
  printout of the "build_scheme" item
- Renamed "engines_obj" to "padlock_obj"
- Moved the runs of dofile down...  it didn't quite make sense to have
  that in the middle of a printout

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-25 21:51:22 +01:00
Richard Levitte 9ab6fc5936 Generate warning text
Now that we're using templates, we should warn people not to edit the
resulting file.  We do it through util/dofile.pl, which is enhanced
with an option to tell what file it was called from.  We also change
the calls so the template files are on the command line instead of
being redirected through standard input.  That way, we can display
something like this (example taken from include/openssl/opensslconf.h):

    /* WARNING: do not edit! */
    /* Generated by Configure from include/openssl/opensslconf.h.in */

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-25 21:19:59 +01:00
Richard Levitte 52cdc9970d Misc fixups
The goal is Makefile, not Makefile.new
Remove the second generation of opensslconf.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-25 20:36:43 +01:00