Makefile.am: Add PRELOAD_SYSLOGFORMAT and other helpers

Instead of hardcoding the same dlpreopen at many different locations,
add a helper variable to the top-level Makefile.am, and use that
variable in all other places.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
When doing make check in a subdir, use tests from subdirs too

Teach the Mk/subdir.mk snippet to recurse into subdirs of subdirs when
doing make check. This is a bit of a nasty hack, but gets the job done.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/subdir.mk: Support partial installation

When using the wrapper Makefile (Mk/subdir.mk), allow make install to
work from within a subdir. The solution is a bit of a hack, and contains
some hard-coded assumptions, and only works for lib/ and stuff under
modules/, but that's where 99% of the work is done anyway.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/subdir.mk: When running under a subdir of lib/, work on lib

Directories under lib/ (except for ivykis, where this doesn't apply
anyway) are for organisational purposes only, they are used as part of
libsyslog-ng, built from lib/ itself. So when standing in such a subdir,
pretend we're in lib instead.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
configure.in: Remove obsolete macro usage

Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER, and drop the use of
AM_PROG_CC_STDC, because these macros are long obsolete, and were
removed from automake 1.13.

Reported-by: Michael Sterrett <mr_bones_@gentoo.org>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afmongodb: Update the embedded libmongo-client

Update the embedded libmongo-client library to the latest git master, to
pull in a modernised configure.ac and a couple of other fixes.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afmongodb: Update the embedded libmongo-client again

The embedded libmongo-client needs an update, to fix make dist, this
does just that.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
pacctformat: Fix the constructor

Instead of using a pointer to a function as the constructor, use the
function itself, properly casted, like the rest of the similar
constructors.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/lex-rules.am: Touch the output of the lexer rules

In order not to regenerate lib/cfg-lex.h all the time if cfg-lex.l has
its timestamp updated without any content change, touch the target in
the lexer rules, so that their timestamp gets updated, even if the file
is not regenerated.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Mk/lex-rules.am: Make grammar compilation less verbose

When the grammar is unchanged, hide that, there's no need to show that.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
tests: Add a testcase for template_escape()

In order not to break template_escape() functionality, add a test case
for basic functionality testing.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
templates: Respect the template_escape() in template functions

When a template function creates a template itself, make the new
template inherit the escape setting from the parent.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
.travis.yml: Run func-tests too

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
cfg-grammar.y: Allow defaultless block{} arguments again

When parsing block{} arguments, do not ignore ones where the default
value is empty: that is perfectly valid.

Fixes: #230
Reported-by: Anton Koldaev <koldaevav@gmail.com>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>