summaryrefslogtreecommitdiffstats
path: root/configure.ac
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 /configure.ac
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac146
1 files changed, 40 insertions, 106 deletions
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)