Do not alter environment CFLAGS, CPPFLAGS etc.

These variables should never be overriden by our makefiles, only the
AM_CFLAGS or libcf_agent_la_CFLAGS variants are to be set.

Also fixed wrong libutils dependencies that were discovered after this
change: libutils currently must link to OpenSSL and PCRE.

This clean-up occurred after an attempt to only link cf-upgrade to
libutils, but noticing that it pulls out everything as dependency.
CFLAGS, CPPFLAGS etc should override auto-detected variables.

CFLAGS, CPPFLAGS, LDFLAGS are the ones that user sets on the command
line by doing:

./configure CFLAGS=-O3

Thus they should stay the last ones, overriding all auto-detected values
and configure-specified values. This patch attempts to make this happen.

Nevertheless we still retain and manually append ENV_CFLAGS at the end
of CFLAGS.  Even though CFLAGS should contain the ./configure command
line CFLAGS as last, some macro seem to mess the order up and insert
its own optimisation flags as well. So we append ENV_CFLAGS at the end
manually, causing a bit of flag duplication.  Thanks @kacfengine for
bringing this up.
Separately include proper CPPFLAGS for every binary

Now that CORE_*FLAGS are not used anymore, I tried to explicitly include
only the needed CPPFLAGS for each binary. Unfortunately, because
cf3.defs.h is inluded almost everywhere, and it includes headers from
libutils, which needs OpenSSL includes, I had to carry the
OPENSSL_CPPFLAGS almost everywhere, and in fewer cases PCRE_CPPFLAGS as
well.

I didn't manage to completely remove those dependencies (OpenSSL, PCRE),
but at least now they are not included from within platform.h, but only
from the respective headers that need them.

To sum up, the dependency mess is less but still exists, but at least it
is visible in each makefile and we can untangle it little by little. And
every new dependency added by mistake will trigger a failure, where
previously it succeeded because CORE_CPPFLAGS included everything plus
the kitchen sink.
Remove hackishly stated dependencies, they are properly detected now.
Include stddef.h always

Fixing the broken Solaris build.
Removed unused struct, and the openssl/rsa.h dependency from cf3.defs.h.
Fix detection of getline() which has been a GNU extension before POSIX.1-2008.
Fix ./configure -C on platforms without proper printf.
Remove poinless type qualifier.

It makes zero difference to the compiler since the returned struct may
freely be assigned to a const or not struct. It also saves a bunch of
warnings when -Wextra is employed.
Merge pull request #1847 from jimis/automake_sanitisation-rebase

Automake sanitisation rebased
Simplify Makefile so that it does not create cf-upgrade-*.o objects.

The side-effect is that autoconf complains that we changed user-defined
variables. That is not true, because CFLAGS, CPPFLAGS, LDFLAGS are
defined by our configure.ac, because we blatantly ignore recommendations
at:

http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

The proper thing would be to empty the AM_CFLAGS etc options. But we
first need to refactor our configure.ac to not replace CFLAGS, and then
adjust the rest of Makefiles,
Ugly code has ugly bug.
Merge pull request #1848 from jimis/master

Windows cf-upgrade self-exec fix.
redmine4094: Infer start-time from elapsed when needed.

Some variants of ps report start-time as a date if before today (no
matter how recently today started) or even report a year for dates
before this year (even if new year's day started mere seconds ago).
These, naturally, give very imprecise information.  When that happens
but we have an elapsed time column (containing a value we can parse),
use this to infer a better start-time.  At the same time, improve
parsing of relevant time strings generally.  Based on a patch from
Tony Lill - many thanks.

Added an acceptance test.  Failed before the fix, passes with it :-)