Commit graph

421 commits

Author SHA1 Message Date
Richard Levitte
b2de11c58b Versioning engines default location: the Unix case
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1.  We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.

For Unix, the default installation directory is changed from
$PREFIX/lib/engines to $PREFIX/lib/engines-${major}_${minor} (mingw)
or $PREFIX/lib/engines-${major}.${minor} (all but mingw)

($PREFIX is the directory given for the configuration option --prefix,
and ${major} and ${minor} are the major and minor shared library
version numbers)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-07 15:07:32 +02:00
Richard Levitte
ee0a61cfb8 Versioning engines default location: the Windows case
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1.  We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.

For windows, the default installation directory is changed from
$PREFIX/lib/engines to $PREFIX/lib/engines-${major}_${minor}

($PREFIX is the directory given for the configuration option --prefix,
and ${major} and ${minor} are the major and minor shared library
version numbers)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-07 15:07:32 +02:00
Richard Levitte
8478a70333 Make 'build_libs' build shared libraries as well
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-06 14:38:13 +02:00
Richard Levitte
e45c78fc98 VMS: make sure there's a file extension when creating files
When creating the library $lib.olb, make sure the extension is there.
Otherwise, a logical name with the same name as the file in question
will redirect the creation elsewhere.

Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-07-06 02:08:53 +02:00
Richard Levitte
3426de2262 VMS: Add installation verification procedure
On VMS, it's customary to have a procedure to check that the software
was installed correctly and can run as advertised.

The procedure added here is fairly simple, it checks that all
libraries are in place, that the header crypto.h is in place, and that
the command 'openssl version -a' runs without trouble.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:50:44 +02:00
Richard Levitte
d17d3293d1 Fix some VMS inconsistencies
- The install top is versioned by default.  However, only the major
  version should be used.
- the default areas for certs, private keys an config files have
  changed, now all prefixed with 'OSSL$'.  This gets reflected in
  cryptlib.h.
- [.VMS]openssl_startup.com.in had some faults regarding creating
  rooted concealed logical names.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:49:45 +02:00
Richard Levitte
dbb3aba17e Install the openssl app with version number on VMS
This makes it possible for script writers to lock on to a specific
version if they need to.  Note that only the major version number is
used.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:49:45 +02:00
Richard Levitte
8842005e75 Have the VMS shared library file names contain the shared version
Also, have the static library file names contain the pointer size when
applicable.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:49:45 +02:00
Richard Levitte
34d5490a1d Pass down correct information to the VMS startup script templates
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:49:45 +02:00
Richard Levitte
7878e536d0 Add the missing pointer_size information on VMS configs
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-02 15:49:45 +02:00
Ben Laurie
27c40a9317 Ensure that global dependencies are built first, even for parallell builds
Also, make sure that per-file deps are included in the build, even if previous
builds have failed.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-02 13:57:07 +01:00
Richard Levitte
15a1f19e62 Deal with pod2html issues, in this case the lack of .html suffix in links
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-01 19:06:37 +02:00
Richard Levitte
0685b15a68 Windows: Recreate the $prefix variable
$prefix was removed as part of the DESTDIR work.  However, it was
still used to create the ENGINESDIR_dev and ENGINESDIR_dir variables,
so a restoration is needed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-30 19:07:15 +02:00
Richard Levitte
b8bbd8b1bd Windows: Make DESTDIR work
DESTDIR can't be used on Windows the same way as on Unix, the device
part of the installation paths get in the way.

To remedy this, have INSTALLTOP, OPENSSLDIR and ENGINESDIR get
different values depending on if $(DESTDIR) is empty or not, and use
$(INSTALLTOP), $(OPENSSLDIR) and $(ENGINESDIR) alone.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-28 15:42:52 +02:00
Richard Levitte
850000aa41 Build files: don't generate empty action lines in generatedir()
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-28 14:02:44 +02:00
Roumen Petrov
57ade5711b Use include paths to our source before any other cflags
This is just in case someone passed an inclusion path with the
configuration, and there are OpenSSL headers from another version
in there.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-27 23:52:40 +02:00
Andy Polyakov
dbbb6a87a7 unix-Makefile.tmpl: omit lib<rary>.a updates from directory targets.
Since corresponding rule was removed from windows-makefile.tmpl out
of necessity, question popped if it's appropriate to harmonize even
unix-Makefile.tmpl. Note that as long as you work on single directory
'make lib<rary>.a' is effectively equivalent to 'make <dir/ectory>'
prior this modification.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-27 23:28:07 +02:00
Andy Polyakov
cfef7e9e68 windows-makefile.tmpl: don't use $? in library targets.
Problem with Microsoft lib.exe is that it doesn't *update* modules
in .lib archive, but creates new one upon every invocation. As result
if a source file was updated and nmake was executed, a useless archive
with only one module was created. In other words one has to always
pass all .obj modules on command line, not only recently recompiled.

[This also creates dilemma for directory targets, e.g. crypto\aes,
that were added to simplify every-day life for developer. Since
whole idea behind those targets is to minimize the re-compile time
upon single file modification, the only sensible thing to do is to
omit intended library update.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-27 23:26:12 +02:00
Andy Polyakov
0b919cc5d5 Configurations/10-main.conf: fix PA-RISC commentary.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-27 10:12:23 +02:00
Richard Levitte
4813ad2d24 Harmonise the different build files
- User targets are now the same and generally do the same things
- configdata.pm depends on exactly the same files on all platforms
- VMS production of shared libraries is simplified
- VMS automatic dependency files get the extension .D rather than .MMS

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-17 16:06:31 +02:00
Richard Levitte
b867c7077a VMS: use BLDDIR rather than BUILDDIR in descrip.mms.tmpl
Just like in the other build file templates

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:11:38 +02:00
Richard Levitte
932eaf0085 Add a developer target 'build_generated' to rebuild mandatory headers
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:11:38 +02:00
Richard Levitte
7cae38642e Build file templates: make sure to depend on generated header files
As well as properly generating those that are made from .in files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:11:38 +02:00
Richard Levitte
4f858293a9 Configure: Make it possible to generate mandatory header files
'DEPEND[]=file.h' becomes a special way to say that 'file.h' must be
generated before anything else is built.  It's likely that a number
of source files depend on these header files, this provides a simple
way to make sure they are always generated even it the dependency data
hasn't been added to the build file yet.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:11:38 +02:00
Ben Laurie
a1bce642c9 Omit corpora from tarball.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-10 13:00:31 +01:00
Richard Levitte
ec772a817a Fix the directory target generation
The directories for the final products were never registered, it was
plain luck that intermediary files were in the same place and
registered the directory anyway.

Also, scripts are generated directly from source (binaries go through
intermadiary object files), so we need to explicitely make sure to
avoid registering the source directory unless it's an in source
build.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-06 15:14:36 +02:00
Richard Levitte
0ad1d94df4 Add developer targets for each subdirectory we have something to build in
Previous build scheme allowed building just the stuff in one
subdirectory, like this:

    make -C crypto/aes

Because the unified only has a top-level Makefile, this is not
possible with it.  This change adds a replacement where each directory
we have something to build in becomes a target in its own right,
allowing building something like this:

    make crypto/aes

The exception is the directory test, because we already have such a
target.

Reviewed-by: Stephen Henson <steve@openssl.org>
2016-06-04 20:33:46 +02:00
Richard Levitte
67152812f4 Windows build: Remove .manifest files in test/ as well
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-04 09:43:26 +02:00
Rich Salz
b8a9af6881 Remove/rename some old files.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-01 11:29:57 -04:00
Richard Levitte
cb66390857 Windows makefile: handle the case with space in source directory
This applies when building out-of-source.

RT#4486

NOTE: we can't do the same for Unix, as Unix make doesn't handle this
type of issue.  Also, directory specs are much less likely to have
spaces on Unix...

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-27 17:41:32 +02:00
Richard Levitte
cbece22079 Allow space in PERL spec (unix only)
Someone wants to configure like this:

    PERL="/usr/bin/env perl" ./config

The end goal is to get that in the #! line of CA.pl and a few other
scripts.  That works well already, but in the Makefile, there were a
few lines looking like this:

    PERL=$(PERL) $(PERL) whatever.pl ...

Those need some quoting.

RT#4311

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-27 17:38:31 +02:00
Richard Levitte
b202bf675b Complete the list of files to clean up on Windows
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-25 00:46:00 +02:00
Richard Levitte
05a7aee0e2 Communicate Configure generated header files to build files
Add Configure generated header files to $unified_info{generate}.  This
makes sure the build files will pick them up with the rest for the
GENERATED macro, and thereby make sure they get cleaned away by 'make
clean'

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-25 00:46:00 +02:00
Richard Levitte
7285ac0956 VMS: show the ossl_dataroot logical as well when doing "mms debug_logicals"
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-23 21:48:42 +02:00
Richard Levitte
2ff4d2933e Install the scripts the same way on Windows and VMS as on Unix
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-23 21:48:42 +02:00
Richard Levitte
5f94746fa4 Make sure tsget.pl and c_rehash.pl get installed on VMS and Windows.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-23 21:48:42 +02:00
Richard Levitte
f3fcd4d5e7 VMS: remove last VAX vestiges
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-23 19:36:55 +02:00
Richard Levitte
7d52e55457 Windows: shut DEL up
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-23 09:36:02 +02:00
Richard Levitte
beadb44157 HTML docs on Unix: Add a HTML title
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-23 00:45:44 +02:00
Richard Levitte
e990ec5234 Use the process_docs script to install docs on Windows and VMS
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-19 23:51:44 +02:00
Andy Polyakov
6c4be50a5d Move Haiku configuration to separate config file to denote
the fact that it's community-supported target.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-19 22:39:52 +02:00
Andy Polyakov
6133b4edbd ARMv8 assembly pack: add OPENSSL_cleanse.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16 22:21:17 +02:00
Richard Levitte
8f41ff2d53 Add support for RC / WINDRES env variables
RT#2558

Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-05-16 18:03:40 +02:00
Cristian Stoica
1b4d0e3c1e do not remove links found in .git directory
Some setups use links inside .git directory and make clean should not
remove them to avoid breaking git meta-information.

Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>

CLA: none; trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1078)
2016-05-16 17:58:52 +02:00
Richard Levitte
592b6fb489 Small MSVC build fixes.
- "/Ox /O2 /Ob2" get's reduced to "/O2", the reason being:

    /Ox = /Ob2 /Og /Oi /Ot /Oy /Gs
    /O2 = /Ob2 /Og /Oi /Ot /Oy /Gs /GF /Gy

- apps/openssl.cnf gets installed.

- always delete files quietly, as they might not be there.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1075)
2016-05-16 11:15:57 +02:00
Richard Levitte
e073fd15b7 openssl_{startup,shutdown}.com.in are in the source directory
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-14 14:09:47 +02:00
Richard Levitte
3ec8a1cfd8 Windows: When installing libraries and executables, install .pdb files as well
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-12 22:20:30 +02:00
Richard Levitte
ae69c7d353 Move the DJGPP target to its own config.
DJGPP is a 3rd party configuration, we rely entirely on the OpenSSL to
help us fine tune and test.  Therefore, it's moved to its own config.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-05-12 22:10:55 +02:00
Andy Polyakov
5d8b70a45d Configurations: engage MIPS64 Poly1305 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-10 20:28:37 +02:00
Andy Polyakov
c3ad47f501 windows-makefile.tmpl: minor adjustments.
- some Perl versions are allergic to missing ';';
- don't stop if del fails;
- omit unused environment variable;

Reviewed-by: Stephen Henson <steve@openssl.org>
2016-05-10 20:20:40 +02:00
Richard Levitte
06aa885d0c Have [.VMS]openssl_{startup,shutdown}.com depend on respective *.in
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-05-10 11:28:00 +02:00
Richard Levitte
ee7fb55e88 Fix VMS/openssl_{startup,shutddown}.com.in
They were using the wrong variables.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-05-10 11:28:00 +02:00
Andy Polyakov
c21c7830ac IRIX fixes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-10 08:44:51 +02:00
Richard Levitte
e817315702 VMS: support VERBOSE and V in descrip.mms
With Unixly Makefiles as well as with nmake, make variables are
transferred to the shell running the commands as envinronment
variables.  This principle doesn't apply with MMS, so we must
explicitely define VERBOSE as commands when it's needed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-09 16:11:36 +02:00
Andy Polyakov
9921b7b6a2 Configurations/windows-makefile.tmpl: expand environments early.
If environment variables are not explanded early enough, expanded
strings are passed with single backslash to C compiler, e.g.
C:\Program Files, which effectively results in OpenSSL looking for
engines and certificates in C:Program Files.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-09 10:40:56 +02:00
Andy Polyakov
c6cb8e3ca4 Alpha assembly pack: make it work on Linux.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-04 08:51:08 +02:00
Andy Polyakov
39199fb3b0 Configurations/unix-Makefile.tmpl: don't count on -E -P.
Some non-Gnu compilers interpret -E -P combination differently.
some prioritize -E over -P, others -P over -E (in which case .i
file is generated and sometimes truncated because of redirection).

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-03 20:57:00 +02:00
Andy Polyakov
b4de72bf64 Tru64 fixes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-03 20:14:26 +02:00
Richard Levitte
85e2fe8113 Remove personal configs from version control
As per a team decision back in 2014.

Reviewed-by: Stephen Henson <steve@openssl.org>
2016-05-02 20:19:41 +02:00
Andy Polyakov
cba792a1e9 Android build fixes.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-02 12:49:57 +02:00
Richard Levitte
b7650c6797 Add the adjusted perl scripts to the set of "update" scripts
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-01 15:09:20 +02:00
Richard Levitte
e590afdcf4 VMS: only explicitely translate names in library C files.
When compiling all other C files, rely on the compiler to
automatically pick up the name translation information from the header
files __DECC_INCLUDE_{PRO,EPI}LOGUE.H.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-29 15:20:48 +02:00
Kirill Marinushkin
e6f2bb6604 Fixed scripts order for generate_crypto_objects target
Script obj_dat.pl depends on file obj_mac.h generated by script objects.pl

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-29 09:17:09 -04:00
Richard Levitte
2036fd5046 Document the enhancements for DEPEND and INCLUDE and use a better example
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-25 18:06:06 +02:00
Richard Levitte
8d34daf0ce Build system: add include directories and dependencies for generators
In the case of generating a file like this:

    GENERATE[foo.S]=mkfoo.pl arg1 arg2

the 'mkfoo.pl' generator itself might need to include other files,
such as perl modules within our source tree.  We can reuse already
existing syntax for it, like this:

    INCLUDE[mkfoo.pl]=module/path

or:

    DEPEND[mkfoo.pl]=modules/mymodule.pm

This change implements the support for such constructs, and for the
DEPEND statement, for any value that indicates a perl module (.pm
file), it will automatically infer an INCLUDE statement for its
directory, just like it does for C header files, so you won't have do
write this:

    DEPEND[mkfoo.pl]=modules/mymodule.pm
    INCLUDE[mkfoo.pl]=modules

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-25 18:06:06 +02:00
Richard Levitte
e38bd9489a Update the Configurations READMEs
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-04-22 00:18:01 +02:00
Richard Levitte
45c6e23c97 Remove --classic build entirely
The Unix build was the last to retain the classic build scheme.  The
new unified scheme has matured enough, even though some details may
need polishing.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-20 16:04:56 +02:00
Andy Polyakov
3acfc40a7e Configurations: fix typo in 50-masm.conf.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20 10:55:17 +02:00
Andy Polyakov
6944565bd5 evp/aes_aes.c: engage Fujitsu SPARC64 X AES support.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20 09:57:43 +02:00
Andy Polyakov
38c5674dda Configuration: add unsupported masm target.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20 09:51:37 +02:00
Richard Levitte
f0d484fcd4 Typo, asoutflag -> perlasm_scheme
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-04-19 23:22:55 +02:00
Richard Levitte
43800958f1 Only allow Microsoft assembler with no-asm on Windows
This also restores the possibility to have ml used with VC-WIN32 with
no-asm, which was lost during the mk1mf -> unified transition.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-19 20:57:08 +02:00
Richard Levitte
1b741653ce Build: Make 'test' depend on 'tests'
Because we have a directory 'test', the target 'test' may be confusing
to make.  However, if we make it depend on 'tests', which doesn't
exist, make should never fail to run the actions.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-19 20:56:35 +02:00
Jérôme Duval
2ca1e22b2a Haiku x86-64 doesn't need RC4_CHAR.
* add a comment about Haiku being built with no-asm.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-18 07:40:11 -04:00
Richard Levitte
34da11b39d Don't use a default for --with-zlib-lib on Windows with option 'zlib'
To begin with, the default should have been the import library, not
the DLL itself.  However, we don't know what directory it's installed
in either way, so we may as well demand the full path from the user

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-15 09:17:13 +02:00
Richard Levitte
ef5b8296a1 ex_libs settings have to be added to, not overriden, on Windows too
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-15 07:53:17 +02:00
Jérôme Duval
6e08e9e7cc Add Haiku support.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-14 13:49:42 -04:00
Richard Levitte
f2ead992c9 Fix installation on VMS for no-stdio and no-autoalginit
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-14 16:41:03 +01:00
Richard Levitte
df6533795b Fix installation for no-stdio and no-autoalginit
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-14 16:41:03 +01:00
Matt Caswell
d90a6beb0e Fix no-stdio and no-autoalginit
no-stdio does not work with the apps. Since the tests also need the apps
it doesn't support that either. Therefore we disable building of both.

no-autoalginit is not compatible with the apps because it requires explicit
loading of the algorithms, and the apps don't do that. Therefore we disable
building the apps for this option. Similarly the tests depend on the apps
so we also disable the tests. Finally the whole point about no-autoalginit
is to avoid excessive executable sizes when doing static linking. Therefore
we disable "shared" if this option is selected.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-14 16:41:03 +01:00
Richard Levitte
da430a5555 Fix the handling of --with-zlib-include
The handling was Unix centric, already in Configure.  Change that to
just collect the value and let the build file templates figure out
what to do with it.

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-13 11:36:46 +02:00
Richard Levitte
5a5c0b953f Remake the way dynamic zlib is loaded
Instead of absolute hard coding of the libz library name, have it use
the macro LIBZ, which is set to defaults we know in case it's
undefined.

This allows our configuration to set something that's sane on current
or older platforms, and allows the user to override it by defining
LIBZ themselves.

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-13 11:36:46 +02:00
Richard Levitte
0c9b153426 Configuration: Simplify the way vms information is retrieved
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-13 11:36:46 +02:00
Richard Levitte
62890f4728 Fix zlib configuration options.
The macros ZLIB and ZLIB_SHARED weren't appropriately defined,
deviating wrongly from how they worked in earlier OpenSSL versions.
So, restore it so that ZLIB is defined if configured "enable-zlib" and
so that ZLIB and ZLIB_SHARED are defined if configured
"enable-zlib-dynamic".

Additionally, correct the interpretation of the --with-zlib-lib value
on Windows and VMS, where it's used to indicate the actual zlib
zlib library file / logical name, as that can differ depending on zlib
version and packaging on those platforms.

Finally for Windows and VMS, we also define the macro LIBZ with that
file name / logical name when configured "zlib-dynamic", so the
compression unit can pick it up and use it.

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-13 11:36:46 +02:00
Andy Polyakov
463a7b8cb0 Clean-up *_DEBUG options.
Since NDEBUG is defined unconditionally on command line for release
builds, we can omit *_DEBUG options in favour of effective "all-on"
in debug builds exercised though CI.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-07 21:18:00 +02:00
Andy Polyakov
c32cbe9787 Configurations/10-main.conf: omit now redundant -D_WINDLL.
... and refine /MT vs. /MD flag handling.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07 21:13:02 +02:00
Andy Polyakov
d237d69914 windows-makefile.tmpl: clean up after DLL link failure.
Without proper cleanup after DLL link failure second attempt to
run nmake would actually proceed and failure will be "shifted" to
run time. This is because libcrypto.lib import library is generated
even if DLL link fails.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07 21:12:10 +02:00
Emilia Kasper
53ff6ac159 Remove redundant symlink
We used to symlink generate_ssl_tests.pl to the build directory.
Now that the build scripts look for sources in both directories, this
is no longer necessary (see commit
fbd361eaf8).

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07 14:17:24 +02:00
Richard Levitte
f246f90e6a Perl: foreach (@list) { code } is better
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-06 17:30:01 +02:00
Richard Levitte
2110febb11 Perl cleanup: don't create lists unnecessarily
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-06 15:21:27 +02:00
Richard Levitte
1c9f511793 VMS: Fix special case for [.test]ssltest_old.c
[.test]ssltest.c was renamed to [.test]ssltest_old.c, reflect that in
descrip.mms.tmpl.

Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-04-06 13:56:49 +02:00
Emilia Kasper
453dfd8d5e New SSL test framework
Currently, SSL tests are configured via command-line switches to
ssltest.c. This results in a lot of duplication between ssltest.c and
apps, and a complex setup. ssltest.c is also simply old and needs
maintenance.

Instead, we already have a way to configure SSL servers and clients, so
we leverage that. SSL tests can now be configured from a configuration
file. Test servers and clients are configured using the standard
ssl_conf module. Additional test settings are configured via a test
configuration.

Moreover, since the CONF language involves unnecessary boilerplate, the
test conf itself is generated from a shorter Perl syntax.

The generated testcase files are checked in to the repo to make
it easier to verify that the intended test cases are in fact run; and to
simplify debugging failures.

To demonstrate the approach, min/max protocol tests are converted to the
new format. This change also fixes MinProtocol and MaxProtocol
handling. It was previously requested that an SSL_CTX have both the
server and client flags set for these commands; this clearly can never work.

Guide to this PR:
 - test/ssl_test.c - test framework
 - test/ssl_test_ctx.* - test configuration structure
 - test/handshake_helper.* - new SSL test handshaking code
 - test/ssl-tests/ - test configurations
 - test/generate_ssl_tests.pl - script for generating CONF-style test
   configurations from perl inputs

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-05 13:44:46 +02:00
Richard Levitte
68cd4e3f99 Makefile et al template: only modify static library with new object files
Previously, we updated the static libraries (libcrypto.a on Unix,
libcrypto.lib on Windows) with all the object files, regardless of if
they were rebuilt or not.  With this change, we only update them with
the object files were rebuilt.

NOTE: this does not apply on VMS, as the expansion of $? may be too
large for a command line.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-04 00:24:58 +02:00
Richard Levitte
e3d8185880 make depend: Check that find returned a non-empty string rather than an empty
The logic to find out of there are any .d files newer than Makefile is
sound.  Checking the result was less so.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-02 20:10:03 +02:00
Coty Sutherland
2d5a1cfab8 Correcting typo that causes make install fail
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-02 17:20:55 +02:00
Richard Levitte
368058d0a7 Force argv to be an array of long pointers on VMS
Reverts commit 087ca80ad8

Instead of battling the odd format of argv given to main() in default
P64 mode, tell the compiler to make it an array of 64-bit pointers
when compiling in P64 mode.

A note is added in NOTES.VMS regarding minimum DEC C version.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-01 16:23:35 +02:00
Richard Levitte
5902821d81 Make the use of perl more consistent
- In Configure, register the perl interpreter used to run Configure,
  so that's the one being used throughout instead of something else
  that Configure happens to find.  This is helpful for using a perl
  version that's not necessarely first in $PATH:

    /opt/perl/5.22.1/bin/perl ./Configure

- Make apps/tsget a generated file, just like apps/CA.pl, so the
  perl interpreter registered by Configure becomes the hashbang path
  instead of a hardcoded /usr/bin/perl

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-01 07:24:04 +02:00
Richard Levitte
2a08d1a05d Make it possible to specify source files that will only be used for shared libs
There are rare cases when an object file will only be used when
building a shared library.  To enable this, we introduce
SHARED_SOURCE:

    SHARED_SOURCE[libfoo]=dllmain.c

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-30 11:22:15 +02:00
Richard Levitte
47a11172f1 'make test' depends of having util/shlib-wrap.sh symlinked in build dir
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-30 04:33:48 +02:00
Richard Levitte
0a2629b38e Config: The cflags in vms-alpha and vms-ia64 have to be added
"vms-generic" already has some values, which were discarded.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-29 22:06:07 +02:00
Richard Levitte
5fe5bc3094 VMS: Disable the warning MAYLOSEDATA3
The warning MAYLOSEDATA3 is one you will always get when compiling
source that calculates the difference between two pointers with
/POINTER_SIZE=64.

The reason is quite simple, ptrdiff_t is always a 32-bit integer
regardless of pointer size, so the result of 'ptr1 - ptr2' can
potentially be larger than a 32-bit integer.  The compiler simply
warns you of that possibility.

However, we only use pointer difference within objects and strings,
all of them well within 2^32 bytes in size, so that operation is
harmless with our source, and we can therefore safely turn off that
warning.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-29 20:27:22 +02:00
Richard Levitte
40ea24b081 VMS: Display the correct path to openssl_startup.com and openssl-utils.com
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-29 20:26:43 +02:00
Andy Polyakov
fdf6f73e5e Windows build system: fix 32-bit appveyor build.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-29 09:51:40 +02:00
Andy Polyakov
6ddb62a575 Build system: VC-WIN64I fixups.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-29 09:48:25 +02:00
Richard Levitte
a5bb160c8c VMS: $? might be huge enough to break line length limit, so don't print it
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-24 00:36:03 +01:00
Richard Levitte
b6fe86cdea VMS: install openssl.conf in OPENSSLDIR, not INSTALLTOP
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-24 00:36:03 +01:00
Richard Levitte
b3514b4772 VMS: have mms ignore creation of already existing dirs
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-24 00:36:03 +01:00
Richard Levitte
6bd1ef90b2 VMS: Rethink the staging directory
On Windows and Unix, the staging directory $(DESTDIR) can simply be
prepended to the installation directory.  An attempt was made to do
something similar on VMS, but that ended up being a half measure
solution.  Instead of that, simply use the staging directory as a
prefix under which [.OPENSSL-INSTALL] and [.OPENSSL-COMMON] will hold
the two directory trees that should end up in the directories
indicated by --prefix and --openssldir, and finish the installation
with appropriate instructions on what to do next.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-24 00:36:03 +01:00
Richard Levitte
667c6bfe18 Adjust some default installation directories
- on VMS, SYS$COMMON:[SSL] is already used as installation directory
  by HP SSL, so we make our default for --openssldir
  SYS$COMMON:[OPENSSL-COMMON] instead.
- Updated notes on default installation dirs fir Unix and Windows

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-24 00:36:03 +01:00
Richard Levitte
b54e35f6cd VMS: compensate for command line length limits with a logical name
Sometimes, you might end up with a rather long compile line due to
excessively long /INCLUDE directories.  Compensate for it by making
a temporary logical name with them and using said logical name as
/INCLUDE argument.

A note was added to NOTES.VMS regarding these limitations.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-23 19:58:12 +01:00
Richard Levitte
ac722c9af0 Small fixups in DSO
- VMS configs had no dso_scheme
- Incorrect return of NULL method.

Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-23 08:40:56 +01:00
Richard Levitte
52d86d9b8d Downcase VMS config names
On VMS, we downcase option names, which means that config names are
downcased as well, so they need to be downcased in the target table to
be found.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-21 20:20:15 +01:00
Richard Levitte
2b364f615b In for loop values, introduce a dummy to protect against empty list
In constructions such as 'for x in $(MAKEVAR); do ...', there's the
possibility that $(MAKEVAR) is en empty value.  Some shells don't like
that, so introduce a dummy value that gets discarded:

    for x in dummy $(MAKEVAR); do
        if [ "$$x" = "dummy" ]; then continue; fi

Closes RT#4459

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-21 16:11:12 +01:00
Andy Polyakov
b75ac3c2a3 Build system: VC-WIN64I fixups.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21 11:44:27 +01:00
Andy Polyakov
bb6b950e1c Configurations/windows-makefile.tmpl: respect no-makedepend.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21 11:30:14 +01:00
Andy Polyakov
acf1525966 Windows build system: get uplink right.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21 11:27:57 +01:00
Andy Polyakov
c75065e1ea Configurations/10-main.conf: freeze -std option in darwin*-ppc-cc.
RT#4422

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21 11:11:19 +01:00
Richard Levitte
3e67b33346 Remove mk1mf documentation
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-21 11:02:00 +01:00
Richard Levitte
0ef1ce49ee Remove generation of ms/version32.rc from Configure, use util/mkrc.pl
utils/mkrc.pl was added a while ago as a better generator for the
Windows DLL resource file.  Finalize the change by removing the
ms/version32.rc generator from Configure and adding resource file
support using mkrc.pl in Configurations/windows-makefile.pl

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-21 11:00:21 +01:00
Richard Levitte
f3e5948af6 Have makedepend output to stdout and redirect it
This gives us better control of what files are produced.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-20 23:03:10 +01:00
Richard Levitte
674d5858df If the asm file to be compiled isn't generated, leave the ext alone
Closes RT#4447

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-19 22:21:14 +01:00
Richard Levitte
9a9f8ee788 Don't let 'generate' target depend on generated files, act directly instead
One of the 'generate' targets depended on $(SRCDIR)/apps/progs.h,
which depended on...  nothing.  This meant it never got regenerated
once it existed, regardless of need.  Of course, we could have it
depend on all the files checked to generate it, but they also depend
on progs.h, so we'd end up getting cricular dependencies, which makes
make unhappy.

Furthermore, and this applies for the other generated files, having
them as targets means that they may be regenerated on the fly in some
cases, and since they get written to the source tree, this isn't such
a good idea if that tree is read-only (which is a possible situation
in an out-of-tree build).

So, we move all the actions to the 'generate' targets themselves, thus
making sure they get regenerated in a controlled manner and regardless
of dependencies.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-19 22:19:12 +01:00
Viktor Dukhovni
ffc8d605e8 Revert "Generate apps/progs.h on the fly"
This reverts commit 04e2a52737.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 13:29:35 -04:00
Richard Levitte
50bf25d223 Add a few more quotes for Windows (install_ssldirs)
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 11:25:10 +01:00
Richard Levitte
5287761bfc Replace sed command with perl
Some implementations of sed require a newline before an ending '}'.
The easier method is to replace that sed command with the
corresponding perl command.

Closes RT#4448

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 11:18:56 +01:00
Richard Levitte
243a98d4a0 Clear the exit code from 'find' in 'make depend'
Depending on what has been built so far, all .d files may not be
present and 'find' will exit with non-zero exit code.  This isn't a
bother for us but may break make, so clear the exit code with an added
'exit 0'.

Closes RT#4444

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 11:17:42 +01:00
Richard Levitte
ac89799c3e Shut find up about files not found
Some of the files in $(DEPS) might not exist.  We don't need to know.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 02:40:02 +01:00
Richard Levitte
769777b0a2 Use the dependencies received in generatesrc()
generatesrc() did already receive dependency information, but never
used it, and never really needed to...  until now.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 01:49:31 +01:00
Richard Levitte
04e2a52737 Generate apps/progs.h on the fly
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-19 01:49:31 +01:00
Richard Levitte
a6adf099cb Better 'make depend' mechanism
Instead of relying on the '-nt' test operator, which doesn't exist
everywhere, use find's '-newer' to find out if any of the known .d
files is newer than Makefile.

Closes RT#4444

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-18 20:55:10 +01:00
Richard Levitte
1f2e1cd5e8 Make picker, thread and combine standard config helper functions
Document them as well

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-17 22:46:14 +01:00
Rich Salz
1fbab1dc6f Remove Netware and OS/2
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-17 17:06:57 -04:00
Richard Levitte
dc8941f031 windows-makefile.tmpl: Stop keeping temporary files
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-17 21:06:14 +01:00
Richard Levitte
8c16829ebd Add install targets for Windows
On Windows, we set INSTALLTOP to default as follows:

  VC-WIN32:

    PREFIX:     %ProgramFiles(x86)%\OpenSSL
    OPENSSLDIR: %CommonProgramFiles(x86)%\SSL

  VC-WIN64*:

    PREFIX:     %ProgramW6432%\OpenSSL
    OPENSSLDIR: %CommonProgramW6432%\SSL

Should those environment variables be missing, the following is used
as fallback:

    PREFIX:     %ProgramFiles%\OpenSSL
    OPENSSLDIR: %CommonProgramFiles%\SSL

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-17 21:06:14 +01:00
Rich Salz
23d38992fc Remove ultrix/mips support.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-17 15:29:15 -04:00
Richard Levitte
8e56a4227b Remove support for Borland C++
Borland C++ 4.5 is very old and our "support" for it is already
non-existent, we might as well remove it.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-17 20:16:38 +01:00
Richard Levitte
a4a7174890 Start documenting Configure internals
This is a living document, everyone is encouraged to add to it.
Implementation details as well as broader implementation philosophy
has a place here.

I'm starting with documentation of the how conditions in build.info
files are treated.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-17 19:08:49 +01:00
Richard Levitte
a717738b45 Don't define OPENSSL_ENGINES in test recipes, do it in Makefiles instead
In most builds, we can assume that engines live in the build tree
subdirectory "engines".  This was hard coded into the tests that use
the engine ossltest.

However, that hard coding is tedious, it would need to be done in
every test recipe, and it's an incorrect assumption in some cases.

This change has us play it safe and let the build files tell the
testing framework where the engines are.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-17 10:10:59 +01:00
Richard Levitte
757c416c4d unix-Makefile template: use $(PERL) everywhere
There was one spot that had hard-coded 'perl'

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-16 23:59:20 +01:00
Richard Levitte
685b6f293b When building DLLs, hack the library name in the .def file
util/mkdef.pl assumes it knows what the resulting library name will
be.  Really, it shouldn't, but changing it will break classic native
Windows builds, so we leave it for now and change the LIBRARY line
externally when needed instead.

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-16 18:11:13 +01:00
Richard Levitte
8975fb6212 DLL object files should not be built with /Zl"
When building the DLLs, we depend on the correct default C RTL info.

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-16 18:11:01 +01:00
Matt Caswell
c1ea997aa8 We should use $SRCDIR in Makefiles
Normally we always refer to source files relative to $SRCDIR in Makefiles.
However the reference to unix-Makefile.tmpl was using a fully expanded
absolute path. This can cause problems for Mingw.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-16 13:35:18 +01:00
Andy Polyakov
2460c7f133 poly1305/asm/poly1305-x86_64.pl: make it work with linux-x32.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-15 23:58:31 +01:00
Richard Levitte
4def90c5de Make the perl dependency post-processor into just one line
Make doesn't always treat multiline quoted strings as nicely as one
would wish.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-15 23:49:22 +01:00
Richard Levitte
29b28eee3e Not all shells understand !
In unix-Makefile.tmpl, this construction has been used a few times

	if ! something; then ...

It seems, though, that some shells do not understand !, so these need
to be changed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-15 22:28:16 +01:00
Richard Levitte
e58d91027a Cygwin configs were missing thread_scheme settings, add them
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-15 15:38:11 +01:00
Andy Polyakov
8d51db86f7 s390x assembly pack: 32-bit fixups.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-14 13:52:34 +01:00
Richard Levitte
01d9997659 Fix a few Configure errors
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-14 11:21:35 +01:00
Richard Levitte
4c1cf7e440 Collect the names of generated files and clean them away at target clean:
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-13 00:03:48 +01:00
Richard Levitte
8a0a3d293c Use single quotes rather than double quotes when needed
When passing down values to Makefile.shared, do so with single quotes
as much as possible to avoid having the shell create a mess of quotes.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-13 00:02:55 +01:00