Commit graph

99 commits

Author SHA1 Message Date
Richard Levitte
940a09bad4 Minimize copied config settings
$target{lflags} and $target{plib_flag} were copied to %config for no
good reason.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-02 19:15:42 +01:00
Richard Levitte
2e0956ba6d Unified - have configdata.pm depend on a few more things
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-01 06:39:16 +01:00
Richard Levitte
340da949cc Make generation of dependency files more efficient when possible
When building with GNU C, clang or VMS C, it's more efficient to
generate dependency file and object file in one call rather than two.
Have the dependency output in a temporary file and compare it with the
previous one if available to see if replacement is waranted, thereby
avoiding unnecessary reconstruction of Makefile / descrip.mms.

Github issue #750

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-28 01:16:44 +01:00
Rich Salz
6ab364149d Remove some old files.
I read the PROBLEMS, and they're outdated; nothing I'd put in the
online FAQ, for example.  Test-builds work without using these files.
Had to remove the rehash.time stuff from Makefile.in

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-27 13:39:46 -05:00
Rob Percival
0cea8832df Public API for Certificate Transparency
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-26 14:57:29 -05:00
Richard Levitte
28a55a873d Make it possible to build even if dependency files can't be generated
If the local system doesn't have GNU C or clang, and not even
makedepend, the build will stop because the call of 'makedepend'
fails.  This changes so the build won't stop because of such failure.
The result will be empty .d files, and that's ok.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-25 14:48:52 +01:00
Richard Levitte
84af1bae68 Clean away $config{no_shared} since we have $disabled{shared}
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-22 16:36:58 +01:00
Richard Levitte
f8d9d6e48b Check that any dependency file is newer than Makefile before concatenating
On slower file systems, this makes a huge difference

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-21 16:26:06 +01:00
Richard Levitte
ea80a25e81 Avoid GNU make re-exec when adding dependencies to Makefile
GNU make will re-exec if (it thinks that) the Makefile has changed.
Just having the target Makefile seems to make it think it has, so we
end up in a look where GNU make re-execs for ever.

The fix is easy, just remove the Makefile target and have the depend
target run the recipe on its own instead of depending on Makefile.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-21 00:33:54 +01:00
Ben Laurie
834aae2a99 Remove OBJ_EXT and friends.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20 21:07:29 +00:00
Ben Laurie
58f2b0ae58 Missing extension on dependency, .d file is not always made (e.g. when input
is a .s).

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20 16:56:44 +00:00
Richard Levitte
45502bfe19 Always build library object files with shared library cflags
This takes us away from the idea that we know exactly how our static
libraries are going to get used.  Instead, we make them available to
build shareable things with, be it other shared libraries or DSOs.

On the other hand, we also have greater control of when the shared
library cflags.  They will never be used with object files meant got
binaries, such as apps/openssl or test/test*.

With unified, we take this a bit further and prepare for having to
deal with extra cflags specifically to be used with DSOs (dynamic
engines), libraries and binaries (applications).

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20 16:51:31 +01:00
Richard Levitte
874efa9f81 Unified 'make depend' has to cleanup after itself
It failed to remove lingering Makefile.new

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-19 23:34:25 +01:00
Richard Levitte
ce5ed82f82 Fix Configurations/unix-Makefile.tmpl
It was turning off output again in two place where it should have
turned it on.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-19 22:39:08 +01:00
Richard Levitte
0fb3b62902 Make sure the linked programs have the correct extension
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:16 +01:00
Richard Levitte
f99f91f121 Misc small fixes.
Better libclean that removes the exact files that have been built,
nothing more and nothing less.

Corrected typo

A couple of editorial changes.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
98e5534e65 Try removing installation directories after having uninstalled files
Of course, if there are remaining files in a directory, it won't be removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
5386287cfc Small rename fest in unified, obj2dynlib -> obj2dso
Since we're using the acronym DSO everywhere else and that's a common
name for that kind of object, we might as well do so here as well.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
c8c2b77900 Remake the installation of shared libraries in unix-Makefile.tmpl
Instead of having the installation recipe rely on special knowledge,
feed it with information, including what shared library files belong
together.  For Cygwin and Mingw, that's the .dll and its import
library .dll.a.  For Unixen, it's the shared library file name with SO
version and the one without.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
e048fd5171 Big rename fest in makefile.shared: link_a / link_o -> link_shlib / link_dso
Originally, the Makefile.shared targets described what they used as
input for a shared object, be it a shared library or a DSO.  It turned
out, however, that the link_o targets were used exclusively for
engines and the link_a targets were for libcrypto and libssl.

This rename fest turns and indication on the kind of input the targets
get to the intention with using them.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
f5c174ff93 Centralise the shared library / dso name info in unix-Makefile.tmpl
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
e987f9f271 Let Configure figure out the diverse shared library and DSO extensions
Then it can pass around the information where it belongs.  The
Makefile templates pick it up along with other target data, the
DSO module gets to pick up the information through
crypto/include/internal/dso_conf.h

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
f0c93a8593 Unified - don't install the ossltest engine
This is done with a simple file name comparison.  We could think of
something more elegant in the future.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:12:33 +01:00
Richard Levitte
8be7bdb5c6 Unified - do a better job when uninstalling
Some directories weren't removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:12:33 +01:00
Richard Levitte
27f42b4679 Don't use config.timestamp, we already have configdata.pm
The benefit with using configdata.pm is that Configure writes it for
us.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-19 02:30:51 +01:00
Richard Levitte
c058fcd798 Automatic 'make depend' for the unified build scheme
This isn't the fully featured combination of compiler generated
dependency files and Makefile include directives, but a cheaper
variant of the same.

The dependency files are generated automatically, but then we have the
usual "depend" target.  However, we depend on it in the bigger phony
targets that are the most likely to be used.  That make this feature
automatic enough.

A side effect is that we can't use the build file's timestamp to check
if reconfiguring might be in order.  In its place, we use a flag file
that depends on Configure and the build file template and depend on it
in spots where it makes sense to check for the need to reconfigure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:48:52 +01:00
Richard Levitte
f325fba50c Set EXE_EXT environment variable when testing
When cross compiling, we may end up with someting like apps/openssl.exe
and a number of test/*.exe.  However, util/shlib_wrap.sh doesn't know
what the executable extension should be, if any, so we need to make
sure it has access to that information when testing, since
OpenSSL::Test uses that script to execute all programs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:45:44 +01:00
Richard Levitte
ce192ebed0 Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPEND
All those flags existed because we had all the dependencies versioned
in the repository, and wanted to have it be consistent, no matter what
the local configuration was.  Now that the dependencies are gone from
the versioned Makefile.ins, it makes much more sense to use the exact
same flags as when compiling the object files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:43:09 +01:00
Richard Levitte
88297284ad Don't treat .d (depend) files separately from object files
.d (.MMS in the VMS world) files with just dependencies are built from
exactly the same conditions as the object files.  Therefore, the rules
for them can be built at the same time as the rules for the
corresponding object files.

This removes the requirement for a src2dep function in the build file
templates, and for common.tmpl to call it.  In the end, the existence
of depend files is entirely up to the build file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:42:09 +01:00
Richard Levitte
7d1037661a Fix the makedepend constructor in unix-Makefile.tmpl
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:41:29 +01:00
Richard Levitte
3544091ae0 MANSUFFIX should be left empty
That variable isn't for us, it's for any user, distributor or package
builder that wants one after the section number.  "ssl" seems to be
popular...

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-15 14:16:07 +01:00
Ben Laurie
ecd44a3c1e Address comments.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-15 12:15:45 +00:00
Ben Laurie
18c7e6dda8 Tests depend on everything.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-15 12:09:58 +00:00
Richard Levitte
ba327ade80 Have dofile.pl say where it was run, for real this time
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-14 08:47:47 +01:00
Richard Levitte
4b799ceaa2 Have dofile.pl say where it was run
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-14 08:33:21 +01:00
Richard Levitte
68a5f1a278 Don't build test programs by default, add convenience targets for unified build
Test programs are now only built when running "make test" or "make
build_tests".

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 18:32:01 +01:00
Richard Levitte
dde10ab4d2 Have the same installation directories in unified as in unixmake
unix-Makefile.tmpl was lagging behind on this point.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 18:32:01 +01:00
Richard Levitte
af093bf485 Add SHARED_RCFLAGS in unified Makefile template
Also remove a spurious extra $(LDFLAGS)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 16:03:31 +01:00
Richard Levitte
3af104f3cc The unified build may delete installed manual files
The installation of man files and html files alike didn't properly
check that file names with different casing could be the same on
case-insensitive file systems.  This change fixes that.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 15:12:24 +01:00
Richard Levitte
dac494d2a8 In templates, output_on() must be used the same way as output_off()
Otherwise, there will be an unbalance.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 13:59:10 +01:00
Richard Levitte
03ed5e9906 We need the linked utils after a full build.
We really needs a better util/shlib_wrap.sh, but will have to do for now.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 23:06:41 +01:00
Richard Levitte
50e83cdde6 Unified build - fix make depend
There was a catch 22, where 'make depend' directly after configuring
in an otherwise pristine build tree would fail because buildinf.h
didn't exist yet.

This change has the depend building targets depend on the same other
targets as the object file building targets, so the generation of
buildinf.h and similar files would kick in during 'make depend'.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 23:05:43 +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
Richard Levitte
fb3e2a88ee Generate progs.h from a bunch of files instead of internal knowledge
apps/progs.pl counted on the caller to provide the exact command
files.  The unified build doesn't have that knowledge, and the easier
and more flexible thing to do is to feed it all the apps/*.c files and
let it figure out the command names by looking inside (looking for
/int ([a-z0-9][a-z0-9_]*)_main\(int argc,/).

Also, add it to the generate command, since it's a versioned file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 04:42:22 +01:00
Richard Levitte
6bb2106e24 Add the generate mechanism from unixmake to unix-Makefile.tmpl
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 20:10:44 +01:00
Richard Levitte
cedbb1462a Make shared library targets more consistent
On Windows POSIX layers, two files are produced for a shared library,
there's {shlibname}.dll and there's the import library {libname}.dll.a

On some/most Unix platforms, a {shlibname}.{sover}.so and a symlink
{shlibname}.so are produced.

For each of them, unix-Makefile.tmpl was entirely consistent on which
to have as a target when building a shared library or which to use as
dependency.

This change clears this up and makes it consistent, we use the
simplest form possible, {lib}.dll.a on Windows POSIX layers and
{shlibname}.so on Unix platforms.  No exception.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 17:08:38 +01:00
Richard Levitte
076e596ffb Quote the CFLAG in Unixly Makefiles, for buildinf.h
Because the command line definitions of OPENSSLDIR and ENGINESDIR
contain quotes, we need a variant of CFLAG where backslashes and
quotes are escaped when we produce buildinf.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 19:36:48 +01:00
Richard Levitte
fcf80c469a unified build scheme: add the tweaks to build on Cygwin & Mingw
Cygwin and Mingw name their libraries a bit differently from the rest
of the POSIXly universe, we need to adapt to that.

In Makefile.tmpl, it means that some hunks will only be output
conditionally.

This also means that shared_extension for the Cygwin and Mingw
configurations in Configurations/10-main.conf are changing from .dll.a
to .dll.  Makefile.shared does a fine job without having them
specified, and it's much easier to work with tucking an extra .a at
the end of files in the installation recipes than any amount of name
rewrites, especially with the support of the SHARED_NAME in the top
build.info.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:04 +01:00
Richard Levitte
567a9e6fe0 unified build scheme: add a "unified" template for Unix Makefile
This also adds all the raw sections needed for some files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:04 +01:00