summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-02-24 14:52:49 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-02-24 14:52:49 +0100
commit924ceb305dc1dced54beaa6ffe4b72b9f2609c6a (patch)
tree1dd9c29e5bda8d7b6f4952827ffe9218bc060df4
parent46d7840b2500fd4cd3044ad06481f27ce97ee2ad (diff)
parent24a36fd14226ccf5f139c07252f05f3db124604e (diff)
downloadrsyslog-924ceb305dc1dced54beaa6ffe4b72b9f2609c6a.tar.gz
rsyslog-924ceb305dc1dced54beaa6ffe4b72b9f2609c6a.tar.xz
rsyslog-924ceb305dc1dced54beaa6ffe4b72b9f2609c6a.zip
Merge branch 'beta'
Conflicts: ChangeLog Makefile.am configure.ac doc/manual.html
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac146
-rw-r--r--m4/.gitignore1
-rw-r--r--m4/atomic_operations.m453
-rw-r--r--plugins/im3195/Makefile.am2
-rw-r--r--plugins/imdiag/Makefile.am2
-rw-r--r--plugins/imfile/Makefile.am2
-rw-r--r--plugins/imgssapi/Makefile.am4
-rw-r--r--plugins/imklog/Makefile.am2
-rw-r--r--plugins/immark/Makefile.am2
-rw-r--r--plugins/imrelp/Makefile.am2
-rw-r--r--plugins/imtcp/Makefile.am2
-rw-r--r--plugins/imtemplate/Makefile.am2
-rw-r--r--plugins/imudp/Makefile.am2
-rw-r--r--plugins/imuxsock/Makefile.am2
-rw-r--r--plugins/omgssapi/Makefile.am4
-rw-r--r--plugins/omlibdbi/Makefile.am4
-rw-r--r--plugins/ommail/Makefile.am2
-rw-r--r--plugins/ommysql/Makefile.am4
-rw-r--r--plugins/ommysql/ommysql.c3
-rw-r--r--plugins/ompgsql/Makefile.am4
-rw-r--r--plugins/omrelp/Makefile.am2
-rw-r--r--plugins/omsnmp/Makefile.am4
-rw-r--r--plugins/omtesting/Makefile.am2
-rw-r--r--runtime/Makefile.am18
-rw-r--r--tests/Makefile.am8
-rw-r--r--tools/Makefile.am4
28 files changed, 144 insertions, 153 deletions
diff --git a/ChangeLog b/ChangeLog
index 02ef2eb7..ba2a6c13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,7 +90,10 @@ version before switching to this one.
- bugfix: memory leak in ompgsql
Thanks to Ken for providing the patch
---------------------------------------------------------------------------
-Version 3.21.10 [BETA] (rgerhards), 2008-12-??
+Version 3.21.11 [BETA] (rgerhards), 2009-0?-??
+- build system improvements contributed by Michael Biebl - thx!
+---------------------------------------------------------------------------
+Version 3.21.10 [BETA] (rgerhards), 2009-02-02
- bugfix: inconsistent use of mutex/atomic operations could cause segfault
details are too many, for full analysis see blog post at:
http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
diff --git a/Makefile.am b/Makefile.am
index 96c9f7d7..aaca570d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,7 @@ lmtcpsrv_la_SOURCES = \
tcps_sess.h \
tcpsrv.c \
tcpsrv.h
-lmtcpsrv_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmtcpsrv_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmtcpsrv_la_LDFLAGS = -module -avoid-version
lmtcpsrv_la_LIBADD =
@@ -23,7 +23,7 @@ lmtcpsrv_la_LIBADD =
lmtcpclt_la_SOURCES = \
tcpclt.c \
tcpclt.h
-lmtcpclt_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmtcpclt_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmtcpclt_la_LDFLAGS = -module -avoid-version
lmtcpclt_la_LIBADD =
@@ -35,9 +35,9 @@ endif # if ENABLE_INET
if ENABLE_GSSAPI
pkglib_LTLIBRARIES += lmgssutil.la
lmgssutil_la_SOURCES = gss-misc.c gss-misc.h
-lmgssutil_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmgssutil_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmgssutil_la_LDFLAGS = -module -avoid-version
-lmgssutil_la_LIBADD = $(gss_libs)
+lmgssutil_la_LIBADD = $(GSS_LIBS)
endif
EXTRA_DIST = \
@@ -115,3 +115,4 @@ SUBDIRS += tests
# in a make distcheck is so that we detect code that accidently was not updated
# when some global update happened.
DISTCHECK_CONFIGURE_FLAGS=--enable-gssapi_krb5 --enable-imfile --enable-snmp --enable-pgsql --enable-libdbi --enable-mysql --enable-imtemplate --enable-relp --enable-rsyslogd --enable-mail --enable-klog --enable-diagtools --enable-gnutls
+ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 1bf460ad..0c924754 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ AC_PREREQ(2.61)
AC_INIT([rsyslog],[4.1.4],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([ChangeLog])
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_GNU_SOURCE
@@ -19,6 +20,8 @@ AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_CANONICAL_HOST
+PKG_PROG_PKG_CONFIG
+
case "${host}" in
*-*-linux*)
os_type="linux"
@@ -40,14 +43,14 @@ AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via
save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(clock_gettime, rt)
-rt_libs=$LIBS
+RT_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(dlopen, dl)
-dl_libs=$LIBS
+DL_LIBS=$LIBS
LIBS=$save_LIBS
-AC_SUBST(rt_libs)
-AC_SUBST(dl_libs)
+AC_SUBST(RT_LIBS)
+AC_SUBST(DL_LIBS)
# Checks for header files.
AC_HEADER_RESOLV
@@ -108,52 +111,7 @@ AC_TRY_COMPILE([
)
# check for availability of atomic operations
-# rgerhards, 2008-09-18, added based on
-# http://svn.apache.org/repos/asf/apr/apr/trunk/configure.in
-
-AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
-[AC_TRY_RUN([
-int main()
-{
- unsigned long val = 1010, tmp, *mem = &val;
-
- if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020)
- return 1;
-
- tmp = val;
-
- if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010)
- return 1;
-
- if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0)
- return 1;
-
- tmp = 3030;
-
- if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp)
- return 1;
-
- if (__sync_lock_test_and_set(&val, 4040) != 3030)
- return 1;
-
- mem = &tmp;
-
- if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp)
- return 1;
-
- __sync_synchronize();
-
- if (mem != &val)
- return 1;
-
- return 0;
-}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])])
-
-if test "$ap_cv_atomic_builtins" = "yes"; then
- AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
-fi
-
-
+RS_ATOMIC_OPERATIONS
# Additional module directories
@@ -223,8 +181,8 @@ if test "$enable_zlib" = "yes"; then
if test "$zlib_header" = "yes"; then
AC_CHECK_LIB(z, deflate,
[AC_DEFINE(USE_NETZIP, 1, [Define if you want to enable zlib support])
- zlib_libs="-lz"
- AC_SUBST(zlib_libs)], enable_zlib="false")
+ ZLIB_LIBS="-lz"
+ AC_SUBST(ZLIB_LIBS)], enable_zlib="false")
fi
fi
@@ -243,8 +201,8 @@ if test $want_gssapi_krb5 = yes; then
AC_CHECK_HEADER(gssapi/gssapi.h, [
AC_DEFINE(USE_GSSAPI,,
Define if you want to use GSSAPI)
- gss_libs="-lgssapi_krb5"
- AC_SUBST(gss_libs)
+ GSS_LIBS="-lgssapi_krb5"
+ AC_SUBST(GSS_LIBS)
])
])
fi
@@ -274,10 +232,10 @@ if test "x$enable_pthreads" != "xno"; then
[pthread_create],
[
AC_DEFINE([USE_PTHREADS], [1], [Multithreading support enabled.])
- pthreads_libs="-lpthread"
- pthreads_cflags="-pthread"
- AC_SUBST(pthreads_libs)
- AC_SUBST(pthreads_cflags)
+ PTHREADS_LIBS="-lpthread"
+ PTHREADS_CFLAGS="-pthread"
+ AC_SUBST(PTHREADS_LIBS)
+ AC_SUBST(PTHREADS_CFLAGS)
],
[AC_MSG_FAILURE([pthread is missing])],
[-lpthread]
@@ -428,10 +386,6 @@ AC_ARG_ENABLE(mysql,
[enable_mysql=no]
)
if test "x$enable_mysql" = "xyes"; then
- AC_CHECK_HEADERS(
- [mysql/mysql.h],,
- [AC_MSG_FAILURE([MySQL is missing])]
- )
AC_CHECK_PROG(
[HAVE_MYSQL_CONFIG],
[mysql_config],
@@ -443,16 +397,16 @@ if test "x$enable_mysql" = "xyes"; then
AC_CHECK_LIB(
[mysqlclient],
[mysql_init],
- [mysql_cflags=`mysql_config --cflags`
- mysql_libs=`mysql_config --libs`
+ [MYSQL_CFLAGS=`mysql_config --cflags`
+ MYSQL_LIBS=`mysql_config --libs`
],
[AC_MSG_FAILURE([MySQL library is missing])],
[`mysql_config --libs`]
)
fi
AM_CONDITIONAL(ENABLE_MYSQL, test x$enable_mysql = xyes)
-AC_SUBST(mysql_cflags)
-AC_SUBST(mysql_libs)
+AC_SUBST(MYSQL_CFLAGS)
+AC_SUBST(MYSQL_LIBS)
# PostgreSQL support
@@ -477,16 +431,16 @@ if test "x$enable_pgsql" = "xyes"; then
AC_CHECK_LIB(
[pq],
[PQconnectdb],
- [pgsql_cflags="-I`pg_config --includedir`"
- pgsql_libs="-L`pg_config --libdir` -lpq"
+ [PGSQL_CFLAGS="-I`pg_config --includedir`"
+ PGSQL_LIBS="-L`pg_config --libdir` -lpq"
],
[AC_MSG_FAILURE([PgSQL library is missing])],
[-L`pg_config --libdir`]
)
fi
AM_CONDITIONAL(ENABLE_PGSQL, test x$enable_pgsql = xyes)
-AC_SUBST(pgsql_cflags)
-AC_SUBST(pgsql_libs)
+AC_SUBST(PGSQL_CFLAGS)
+AC_SUBST(PGSQL_LIBS)
# libdbi support
@@ -507,8 +461,8 @@ if test "x$enable_libdbi" = "xyes"; then
AC_CHECK_LIB(
[dbi],
[dbi_initialize],
- [libdbi_cflags=""
- libdbi_libs="-ldbi"
+ [LIBDBI_CFLAGS=""
+ LIBDBI_LIBS="-ldbi"
],
[AC_MSG_FAILURE([libdbi library is missing])]
)
@@ -519,8 +473,8 @@ if test "x$enable_libdbi" = "xyes"; then
)
fi
AM_CONDITIONAL(ENABLE_OMLIBDBI, test x$enable_libdbi = xyes)
-AC_SUBST(libdbi_cflags)
-AC_SUBST(libdbi_libs)
+AC_SUBST(LIBDBI_CFLAGS)
+AC_SUBST(LIBDBI_LIBS)
# SNMP support
@@ -541,18 +495,18 @@ if test "x$enable_snmp" = "xyes"; then
AC_CHECK_LIB(
[netsnmp],
[snmp_timeout],
- [snmp_cflags=""
- snmp_libs="-lnetsnmp"
+ [SNMP_CFLAGS=""
+ SNMP_LIBS="-lnetsnmp"
],
[AC_MSG_FAILURE([Net-SNMP library is missing])]
)
fi
AM_CONDITIONAL(ENABLE_SNMP, test x$enable_snmp = xyes)
-AC_SUBST(snmp_cflags)
-AC_SUBST(snmp_libs)
+AC_SUBST(SNMP_CFLAGS)
+AC_SUBST(SNMP_LIBS)
-# GNUtls support
+# GnuTLS support
AC_ARG_ENABLE(gnutls,
[AS_HELP_STRING([--enable-gnutls],[Enable GNU TLS support @<:@default=no@:>@])],
[case "${enableval}" in
@@ -563,31 +517,11 @@ AC_ARG_ENABLE(gnutls,
[enable_gnutls=no]
)
if test "x$enable_gnutls" = "xyes"; then
- AC_CHECK_HEADERS(
- [gnutls/gnutls.h],,
- [AC_MSG_FAILURE([GNUTls is missing])]
- )
- AC_CHECK_PROG(
- [HAVE_GNUTLS_CONFIG],
- [libgnutls-config],
- [yes],,,
- )
- if test "x${HAVE_GNUTLS_CONFIG}" != "xyes"; then
- AC_MSG_FAILURE([libgnutls-config not found in PATH])
- fi
- AC_CHECK_LIB(
- [gnutls],
- [gnutls_check_version],
- [gnutls_cflags=`libgnutls-config --cflags`
- gnutls_libs=`libgnutls-config --libs`
- ],
- [AC_MSG_FAILURE([GNU TLS library is missing])],
- [`libgnutls-config --libs`]
- )
+ PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.0)
fi
AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes)
-AC_SUBST(gnutls_cflags)
-AC_SUBST(gnutls_libs)
+AC_SUBST(GNUTLS_CFLAGS)
+AC_SUBST(GNUTLS_LIBS)
# support for building the rsyslogd runtime
@@ -601,12 +535,12 @@ AC_ARG_ENABLE(rsyslogrt,
[enable_rsyslogrt=yes]
)
if test "x$enable_rsyslogrt" = "xyes"; then
- rsrt_cflags="-I\$(top_srcdir)/runtime -I\$(top_srcdir)"
- rsrt_libs="\$(top_builddir)/runtime/librsyslog.la"
+ RSRT_CFLAGS="-I\$(top_srcdir)/runtime -I\$(top_srcdir)"
+ RSRT_LIBS="\$(top_builddir)/runtime/librsyslog.la"
fi
AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
-AC_SUBST(rsrt_cflags)
-AC_SUBST(rsrt_libs)
+AC_SUBST(RSRT_CFLAGS)
+AC_SUBST(RSRT_LIBS)
# support for NOT building rsyslogd (useful for source-based packaging systems)
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 00000000..0f4126cd
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1 @@
+*.m4
diff --git a/m4/atomic_operations.m4 b/m4/atomic_operations.m4
new file mode 100644
index 00000000..ad0ee606
--- /dev/null
+++ b/m4/atomic_operations.m4
@@ -0,0 +1,53 @@
+# rsyslog
+#
+# atomic_operations.m4 - autoconf macro to check if compiler supports atomic
+# operations
+#
+# rgerhards, 2008-09-18, added based on
+# http://svn.apache.org/repos/asf/apr/apr/trunk/configure.in
+#
+#
+AC_DEFUN([RS_ATOMIC_OPERATIONS],
+[AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
+[AC_TRY_RUN([
+int main()
+{
+ unsigned long val = 1010, tmp, *mem = &val;
+
+ if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020)
+ return 1;
+
+ tmp = val;
+
+ if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010)
+ return 1;
+
+ if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0)
+ return 1;
+
+ tmp = 3030;
+
+ if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp)
+ return 1;
+
+ if (__sync_lock_test_and_set(&val, 4040) != 3030)
+ return 1;
+
+ mem = &tmp;
+
+ if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp)
+ return 1;
+
+ __sync_synchronize();
+
+ if (mem != &val)
+ return 1;
+
+ return 0;
+}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])])
+
+if test "$ap_cv_atomic_builtins" = "yes"; then
+ AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
+fi
+
+])
diff --git a/plugins/im3195/Makefile.am b/plugins/im3195/Makefile.am
index bfceb71e..5af0b6f5 100644
--- a/plugins/im3195/Makefile.am
+++ b/plugins/im3195/Makefile.am
@@ -1,7 +1,7 @@
pkglib_LTLIBRARIES = im3195.la
im3195_la_SOURCES = im3195.c
-im3195_la_CPPFLAGS = $(rsrt_cflags) $(pthreads_cflags) $(LIBLOGGING_CFLAGS)
+im3195_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBLOGGING_CFLAGS)
im3195_la_LDFLAGS = -module -avoid-version
im3195_la_LIBADD = $(LIBLOGGING_LIBS)
diff --git a/plugins/imdiag/Makefile.am b/plugins/imdiag/Makefile.am
index da5a3ddc..33e86e93 100644
--- a/plugins/imdiag/Makefile.am
+++ b/plugins/imdiag/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imdiag.la
imdiag_la_SOURCES = imdiag.c
-imdiag_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imdiag_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imdiag_la_LDFLAGS = -module -avoid-version
imdiag_la_LIBADD =
diff --git a/plugins/imfile/Makefile.am b/plugins/imfile/Makefile.am
index a4011d12..551639ba 100644
--- a/plugins/imfile/Makefile.am
+++ b/plugins/imfile/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imfile.la
imfile_la_SOURCES = imfile.c
-imfile_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imfile_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imfile_la_LDFLAGS = -module -avoid-version
imfile_la_LIBADD =
diff --git a/plugins/imgssapi/Makefile.am b/plugins/imgssapi/Makefile.am
index a5cce320..ea016353 100644
--- a/plugins/imgssapi/Makefile.am
+++ b/plugins/imgssapi/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imgssapi.la
imgssapi_la_SOURCES = imgssapi.c
-imgssapi_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imgssapi_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imgssapi_la_LDFLAGS = -module -avoid-version
-imgssapi_la_LIBADD = $(gss_libs)
+imgssapi_la_LIBADD = $(GSS_LIBS)
diff --git a/plugins/imklog/Makefile.am b/plugins/imklog/Makefile.am
index 8f50cfb2..5d4d0465 100644
--- a/plugins/imklog/Makefile.am
+++ b/plugins/imklog/Makefile.am
@@ -11,6 +11,6 @@ if ENABLE_IMKLOG_LINUX
imklog_la_SOURCES += linux.c module.h ksym.c ksyms.h ksym_mod.c
endif
-imklog_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imklog_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imklog_la_LDFLAGS = -module -avoid-version
imklog_la_LIBADD =
diff --git a/plugins/immark/Makefile.am b/plugins/immark/Makefile.am
index 9c0f8f64..6d8ed24a 100644
--- a/plugins/immark/Makefile.am
+++ b/plugins/immark/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = immark.la
immark_la_SOURCES = immark.c immark.h
-immark_la_CPPFLAGS = $(rsrt_cflags) -I$(top_srcdir) $(pthreads_cflags)
+immark_la_CPPFLAGS = $(RSRT_CFLAGS) -I$(top_srcdir) $(PTHREADS_CFLAGS)
immark_la_LDFLAGS = -module -avoid-version
immark_la_LIBADD =
diff --git a/plugins/imrelp/Makefile.am b/plugins/imrelp/Makefile.am
index a96e2b42..8c6faff1 100644
--- a/plugins/imrelp/Makefile.am
+++ b/plugins/imrelp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imrelp.la
imrelp_la_SOURCES = imrelp.c
-imrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) $(rsrt_cflags)
+imrelp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RELP_CFLAGS) $(RSRT_CFLAGS)
imrelp_la_LDFLAGS = -module -avoid-version
imrelp_la_LIBADD = $(RELP_LIBS)
diff --git a/plugins/imtcp/Makefile.am b/plugins/imtcp/Makefile.am
index de746a95..26653536 100644
--- a/plugins/imtcp/Makefile.am
+++ b/plugins/imtcp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imtcp.la
imtcp_la_SOURCES = imtcp.c
-imtcp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imtcp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imtcp_la_LDFLAGS = -module -avoid-version
imtcp_la_LIBADD =
diff --git a/plugins/imtemplate/Makefile.am b/plugins/imtemplate/Makefile.am
index 0ea4355e..1825b5bc 100644
--- a/plugins/imtemplate/Makefile.am
+++ b/plugins/imtemplate/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imtemplate.la
imtemplate_la_SOURCES = imtemplate.c
-imtemplate_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imtemplate_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imtemplate_la_LDFLAGS = -module -avoid-version
imtemplate_la_LIBADD =
diff --git a/plugins/imudp/Makefile.am b/plugins/imudp/Makefile.am
index 28ee9853..517b1287 100644
--- a/plugins/imudp/Makefile.am
+++ b/plugins/imudp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imudp.la
imudp_la_SOURCES = imudp.c
-imudp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imudp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imudp_la_LDFLAGS = -module -avoid-version
imudp_la_LIBADD =
diff --git a/plugins/imuxsock/Makefile.am b/plugins/imuxsock/Makefile.am
index 11a0ba3a..a2fe0baa 100644
--- a/plugins/imuxsock/Makefile.am
+++ b/plugins/imuxsock/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = imuxsock.la
imuxsock_la_SOURCES = imuxsock.c
-imuxsock_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+imuxsock_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
imuxsock_la_LDFLAGS = -module -avoid-version
imuxsock_la_LIBADD =
diff --git a/plugins/omgssapi/Makefile.am b/plugins/omgssapi/Makefile.am
index c2cbe387..a57a64b3 100644
--- a/plugins/omgssapi/Makefile.am
+++ b/plugins/omgssapi/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omgssapi.la
omgssapi_la_SOURCES = omgssapi.c
-omgssapi_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+omgssapi_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
omgssapi_la_LDFLAGS = -module -avoid-version
-omgssapi_la_LIBADD = $(gss_libs)
+omgssapi_la_LIBADD = $(GSS_LIBS)
diff --git a/plugins/omlibdbi/Makefile.am b/plugins/omlibdbi/Makefile.am
index d224f9e4..6a26f807 100644
--- a/plugins/omlibdbi/Makefile.am
+++ b/plugins/omlibdbi/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omlibdbi.la
omlibdbi_la_SOURCES = omlibdbi.c
-omlibdbi_la_CPPFLAGS = -I$(top_srcdir) $(libdbi_cflags) $(pthreads_cflags) $(rsrt_cflags)
+omlibdbi_la_CPPFLAGS = -I$(top_srcdir) $(LIBDBI_CFLAGS) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
omlibdbi_la_LDFLAGS = -module -avoid-version
-omlibdbi_la_LIBADD = $(libdbi_libs)
+omlibdbi_la_LIBADD = $(LIBDBI_LIBS)
diff --git a/plugins/ommail/Makefile.am b/plugins/ommail/Makefile.am
index fa470a43..97c9296a 100644
--- a/plugins/ommail/Makefile.am
+++ b/plugins/ommail/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = ommail.la
ommail_la_SOURCES = ommail.c
-ommail_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+ommail_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
ommail_la_LDFLAGS = -module -avoid-version
ommail_la_LIBADD =
diff --git a/plugins/ommysql/Makefile.am b/plugins/ommysql/Makefile.am
index d5433a40..e253b9da 100644
--- a/plugins/ommysql/Makefile.am
+++ b/plugins/ommysql/Makefile.am
@@ -1,8 +1,8 @@
pkglib_LTLIBRARIES = ommysql.la
ommysql_la_SOURCES = ommysql.c ommysql.h
-ommysql_la_CPPFLAGS = $(rsrt_cflags) $(mysql_cflags) $(pthreads_cflags)
+ommysql_la_CPPFLAGS = $(RSRT_CFLAGS) $(MYSQL_CFLAGS) $(PTHREADS_CFLAGS)
ommysql_la_LDFLAGS = -module -avoid-version
-ommysql_la_LIBADD = $(mysql_libs)
+ommysql_la_LIBADD = $(MYSQL_LIBS)
EXTRA_DIST = createDB.sql contrib/delete_mysql
diff --git a/plugins/ommysql/ommysql.c b/plugins/ommysql/ommysql.c
index 22abb1d2..ecf738a9 100644
--- a/plugins/ommysql/ommysql.c
+++ b/plugins/ommysql/ommysql.c
@@ -35,8 +35,7 @@
#include <signal.h>
#include <errno.h>
#include <time.h>
-#include <mysql/mysql.h>
-#include <mysql/errmsg.h>
+#include <mysql.h>
#include "dirty.h"
#include "syslogd-types.h"
#include "srUtils.h"
diff --git a/plugins/ompgsql/Makefile.am b/plugins/ompgsql/Makefile.am
index cc1c5f49..607239cd 100644
--- a/plugins/ompgsql/Makefile.am
+++ b/plugins/ompgsql/Makefile.am
@@ -1,8 +1,8 @@
pkglib_LTLIBRARIES = ompgsql.la
ompgsql_la_SOURCES = ompgsql.c ompgsql.h
-ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(pgsql_cflags) $(rsrt_cflags)
+ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(PGSQL_CFLAGS) $(RSRT_CFLAGS)
ompgsql_la_LDFLAGS = -module -avoid-version
-ompgsql_la_LIBADD = $(pgsql_libs)
+ompgsql_la_LIBADD = $(PGSQL_LIBS)
EXTRA_DIST = createDB.sql
diff --git a/plugins/omrelp/Makefile.am b/plugins/omrelp/Makefile.am
index f8384f42..906aab43 100644
--- a/plugins/omrelp/Makefile.am
+++ b/plugins/omrelp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omrelp.la
omrelp_la_SOURCES = omrelp.c
-omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) $(rsrt_cflags)
+omrelp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RELP_CFLAGS) $(RSRT_CFLAGS)
omrelp_la_LDFLAGS = -module -avoid-version
omrelp_la_LIBADD = $(RELP_LIBS)
diff --git a/plugins/omsnmp/Makefile.am b/plugins/omsnmp/Makefile.am
index d784faca..f75fb091 100644
--- a/plugins/omsnmp/Makefile.am
+++ b/plugins/omsnmp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omsnmp.la
omsnmp_la_SOURCES = omsnmp.c omsnmp.h
-omsnmp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+omsnmp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
omsnmp_la_LDFLAGS = -module -avoid-version
-omsnmp_la_LIBADD = $(snmp_libs)
+omsnmp_la_LIBADD = $(SNMP_LIBS)
diff --git a/plugins/omtesting/Makefile.am b/plugins/omtesting/Makefile.am
index 8e98ca63..4700e1eb 100644
--- a/plugins/omtesting/Makefile.am
+++ b/plugins/omtesting/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omtesting.la
omtesting_la_SOURCES = omtesting.c
-omtesting_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
+omtesting_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
omtesting_la_LDFLAGS = -module -avoid-version
omtesting_la_LIBADD =
diff --git a/runtime/Makefile.am b/runtime/Makefile.am
index 5e5d08ea..2f0a1aa0 100644
--- a/runtime/Makefile.am
+++ b/runtime/Makefile.am
@@ -86,12 +86,12 @@ librsyslog_la_SOURCES = \
# runtime or will no longer be needed. -- rgerhards, 2008-06-13
if WITH_MODDIRS
-librsyslog_la_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(pthreads_cflags)
+librsyslog_la_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(PTHREADS_CFLAGS)
else
-librsyslog_la_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(pthreads_cflags)
+librsyslog_la_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(PTHREADS_CFLAGS)
endif
#librsyslog_la_LDFLAGS = -module -avoid-version
-librsyslog_la_LIBADD = $(dl_libs) $(rt_libs)
+librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS)
#
# regular expression support
@@ -99,7 +99,7 @@ librsyslog_la_LIBADD = $(dl_libs) $(rt_libs)
if ENABLE_REGEXP
pkglib_LTLIBRARIES += lmregexp.la
lmregexp_la_SOURCES = regexp.c regexp.h
-lmregexp_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmregexp_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmregexp_la_LDFLAGS = -module -avoid-version
lmregexp_la_LIBADD =
endif
@@ -110,13 +110,13 @@ pkglib_LTLIBRARIES += lmnet.la lmnetstrms.la
# network support
#
lmnet_la_SOURCES = net.c net.h
-lmnet_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmnet_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmnet_la_LDFLAGS = -module -avoid-version
lmnet_la_LIBADD =
# network stream master class and stream factory
lmnetstrms_la_SOURCES = netstrms.c netstrms.h netstrm.c netstrm.h nssel.c nssel.h
-lmnetstrms_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmnetstrms_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmnetstrms_la_LDFLAGS = -module -avoid-version
lmnetstrms_la_LIBADD =
@@ -125,7 +125,7 @@ lmnetstrms_la_LIBADD =
# plain tcp driver - main driver
pkglib_LTLIBRARIES += lmnsd_ptcp.la
lmnsd_ptcp_la_SOURCES = nsd_ptcp.c nsd_ptcp.h nsdsel_ptcp.c nsdsel_ptcp.h
-lmnsd_ptcp_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmnsd_ptcp_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
lmnsd_ptcp_la_LDFLAGS = -module -avoid-version
lmnsd_ptcp_la_LIBADD =
endif # if ENABLE_INET
@@ -136,8 +136,8 @@ endif # if ENABLE_INET
if ENABLE_GNUTLS
pkglib_LTLIBRARIES += lmnsd_gtls.la
lmnsd_gtls_la_SOURCES = nsd_gtls.c nsd_gtls.h nsdsel_gtls.c nsdsel_gtls.h
-lmnsd_gtls_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags) $(gnutls_cflags)
+lmnsd_gtls_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(GNUTLS_CFLAGS)
lmnsd_gtls_la_LDFLAGS = -module -avoid-version
-lmnsd_gtls_la_LIBADD = $(gnutls_libs)
+lmnsd_gtls_la_LIBADD = $(GNUTLS_LIBS)
endif
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2cfd5bfb..14e7c195 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,11 +19,11 @@ EXTRA_DIST=1.rstest 2.rstest err1.rstest \
NoExistFile.cfgtest
rt_init_SOURCES = rt-init.c $(test_files)
-rt_init_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
-rt_init_LDADD = $(rsrt_libs) $(zlib_libs) $(pthreads_libs)
+rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
+rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS)
rt_init_LDFLAGS = -export-dynamic
rscript_SOURCES = rscript.c $(test_files)
-rscript_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(rsrt_cflags)
-rscript_LDADD = $(rsrt_libs) $(zlib_libs) $(pthreads_libs)
+rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
+rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS)
rscript_LDFLAGS = -export-dynamic
diff --git a/tools/Makefile.am b/tools/Makefile.am
index b66b8e0c..776279a5 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -21,8 +21,8 @@ rsyslogd_SOURCES = \
pidfile.h \
\
../dirty.h
-rsyslogd_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
-rsyslogd_LDADD = $(zlib_libs) $(pthreads_libs) $(rsrt_libs)
+rsyslogd_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
+rsyslogd_LDADD = $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS)
rsyslogd_LDFLAGS = -export-dynamic
if ENABLE_DIAGTOOLS