blob: c021ccdc7b3cad5a33a1dfadadb830f501deff09 [file] [log] [blame]
AC_INIT(src/logger.cpp)
# autoconf 2.50 or higher to rebuild aclocal.m4, because the
# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
AC_PREREQ(2.50)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
#
# +1 : ? : +1 == new interface that does not break old one
# +1 : ? : 0 == new interface that breaks old one
# ? : ? : 0 == no new interfaces, but breaks apps
# ? :+1 : ? == just some internal changes, nothing breaks but might work
# better
# CURRENT : REVISION : AGE
LT_VERSION=9:0:0
AC_SUBST(LT_VERSION)
AM_CONFIG_HEADER(include/log4cxx/config_auto.h)
AH_VERBATIM([HAVE_NO_EXPLICIT_EXPORTS],
[/* no explicit exports */
#define LOG4CXX_EXPORT])
AM_INIT_AUTOMAKE(log4cxx, 0.9.7)
# Checks for programs
# ----------------------------------------------------------------------------
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CXX([g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC])
AC_PROG_CXXCPP
AC_LANG(C++)
# CXX fine tuning
case "$host" in
*-dec-osf*)
CXXFLAGS="$CXXFLAGS -std strict_ansi_errors"
;;
*)
;;
esac
# Doxygen
AC_ARG_ENABLE(doxygen,
AC_HELP_STRING(--enable-doxygen,
[enable documentation generation with doxygen (auto)]))
AC_ARG_ENABLE(dot,
AC_HELP_STRING(--enable-dot,
[use 'dot' to generate graphs in doxygen (auto)]))
AC_ARG_ENABLE(html-docs,
AC_HELP_STRING(--enable-html-docs,
[enable HTML generation with doxygen (yes)]),
[],
[enable_html_docs=yes])
AC_ARG_ENABLE(latex-docs,
AC_HELP_STRING(--enable-latex-docs,
[enable LaTeX documentation generation with doxygen (no)]),
[],
[enable_latex_docs=no])
if test "x$enable_doxygen" = xno; then
enable_doc=no
else
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
if test "x$DOXYGEN" = x; then
if test "x$enable_doxygen" = xyes; then
AC_MSG_ERROR([could not find doxygen])
fi
enable_doc=no
else
enable_doc=yes
AC_PATH_PROG(DOT, dot, , $PATH)
fi
fi
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
AM_CONDITIONAL(LATEX_DOC, test x$enable_latex_docs = xyes)
if test x$DOT = x; then
if test "x$enable_dot" = xyes; then
AC_MSG_ERROR([could not find dot])
fi
enable_dot=no
else
enable_dot=yes
fi
AC_SUBST(enable_dot)
AC_SUBST(enable_html_docs)
AC_SUBST(enable_latex_docs)
# CppUnit
AC_ARG_ENABLE(cppunit,
AC_HELP_STRING(--enable-cppunit,
[enable test excution with cppunit (auto)]))
enable_tests=yes
if test "x$enable_cppunit" = xno; then
enable_tests=no
else
AC_CHECK_PROG(CPPUNIT_CONFIG, cppunit-config, yes, no)
if test "x$CPPUNIT_CONFIG" = "xyes"
then
LIBS_CPPUNIT="`cppunit-config --libs`"
CPPFLAGS_CPPUNIT="`cppunit-config --cflags`"
AC_SUBST(LIBS_CPPUNIT)
AC_SUBST(CPPFLAGS_CPPUNIT)
else
AC_MSG_WARN(cppunit not found !)
fi
AC_CHECK_HEADER([cppunit/TestFixture.h],,
enable_tests=no)
fi
AC_HAVE_LIBRARY([boost_regex],,
enable_tests=no)
AC_CHECK_HEADERS([boost/regex.hpp],,
enable_tests=no)
AM_CONDITIONAL(TESTS, test x$enable_tests = xyes)
# Checks header files
# ----------------------------------------------------------------------------
AC_CHECK_HEADERS(unistd.h io.h alloca.h)
# Checks local idioms
# ----------------------------------------------------------------------------
# for SysLogAppender
AC_CHECK_FUNCS(syslog)
# Checks for libraries
# ----------------------------------------------------------------------------
AC_PROG_RANLIB
# for threads
AC_MSG_CHECKING(for thread support)
AC_ARG_WITH(thread,
AC_HELP_STRING(--with-thread, [thread support. Accepted arguments :
pthread, Microsoft, no (default=pthread)]),
[ac_with_thread=$withval],
[ac_with_thread=pthread])
case "$ac_with_thread" in
Microsoft)
AC_DEFINE(HAVE_MS_THREAD, 1, thread support through Microsoft threads.)
AC_DEFINE(HAVE_THREAD, 1, thread support)
AC_MSG_RESULT(Microsoft)
;;
pthread)
AC_MSG_RESULT(pthread)
AC_CHECK_HEADER(pthread.h,, AC_MSG_ERROR(pthread library not found !))
AC_DEFINE(HAVE_PTHREAD, 1, thread support through pthread library.)
AC_DEFINE(HAVE_THREAD, 1, thread support)
case "$host" in
*freebsd*)
CPPFLAGS="$CPPLAGS -D_THREAD_SAFE"
LIBS="-pthread $LIBS"
;;
*solaris*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
LIBS="-lpthread -lrt $LIBS"
;;
*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
LIBS="-lpthread $LIBS"
;;
esac
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(???)
AC_MSG_ERROR(Unknown option : $ac_with_thread)
;;
esac
# for SocketAppender
AC_CHECK_FUNCS(gethostbyname,,
[AC_CHECK_LIB(nsl,gethostbyname,,
[AC_CHECK_LIB(socket,gethostbyname)])])
AC_CHECK_FUNCS(setsockopt,,[AC_CHECK_LIB(socket,setsockopt)])
# for DOMConfigurator
AC_MSG_CHECKING(for XML support)
AC_ARG_WITH(XML,
AC_HELP_STRING(--with-XML, [XML support. Accepted arguments :
libxml2, Microsoft, no (default=libxml2)]),
[ac_with_xml=$withval],
[ac_with_xml=libxml2]
)
case "$ac_with_xml" in
Microsoft)
AC_DEFINE(HAVE_MS_XML, 1, ODBC support through Microsoft XML.)
AC_DEFINE(HAVE_XML, 1, XML support)
AC_MSG_RESULT(Microsoft)
;;
libxml2)
AC_MSG_RESULT(libxml2)
AC_CHECK_PROG(XML2_CONFIG, xml2-config, yes, no)
if test "x$XML2_CONFIG" = "xyes"
then
AC_DEFINE(HAVE_LIBXML2, 1, XML support through libxml2.)
AC_DEFINE(HAVE_XML, 1, XML support)
LIBS_XML="`xml2-config --libs`"
CPPFLAGS_XML="`xml2-config --cflags`"
else
AC_MSG_WARN(libxml2 not found !)
fi
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(???)
AC_MSG_ERROR(Unknown option : $ac_with_xml)
;;
esac
AC_SUBST(LIBS_XML)
AC_SUBST(CPPFLAGS_XML)
#for UNICODE
AC_MSG_CHECKING(for UTF-16 Unicode support)
AC_ARG_ENABLE(unicode,
AC_HELP_STRING(--enable-unicode, [UTF-16 Unicode support (default=no)]),
AC_DEFINE(UNICODE, 1, UTF-16 Unicode support.)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#for ODBCAppender
AC_MSG_CHECKING(for ODBC support)
AC_ARG_WITH(ODBC,
AC_HELP_STRING(--with-ODBC, [ODBC support. Accepted arguments :
unixODBC, iODBC, Microsoft, no (default=no)]),
[ac_with_odbc=$withval],
[ac_with_odbc=no])
case "$ac_with_odbc" in
Microsoft)
AC_DEFINE(HAVE_MS_ODBC, 1, ODBC support through Microsoft ODBC.)
AC_DEFINE(HAVE_ODBC, 1, ODBC support)
AC_MSG_RESULT(Microsoft)
LIBS_ODBC="-lodbc32"
;;
unixODBC)
AC_MSG_RESULT(unixODBC)
AC_CHECK_HEADER(sqlext.h,, AC_MSG_ERROR(unixODBC not found !))
AC_DEFINE(HAVE_UNIX_ODBC, 1, ODBC support through unixODBC.)
AC_DEFINE(HAVE_ODBC, 1, ODBC support)
LIBS_ODBC="-lodbc"
;;
iODBC)
AC_MSG_RESULT(iODBC)
AC_CHECK_PROG(IODBC_CONFIG, iodbc-config, yes, no)
if test "x$IODBC_CONFIG" = "xyes"
then
AC_DEFINE(HAVE_I_ODBC, 1, ODBC support through iODBC.)
AC_DEFINE(HAVE_ODBC, 1, ODBC support)
LIBS_ODBC="`iodbc-config --libs`"
CPPFLAGS_ODBC="`iodbc-config --cflags`"
else
AC_MSG_ERROR(iODBC not found !)
fi
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(???)
AC_MSG_ERROR(Unknown option : $ac_with_odbc)
;;
esac
AC_SUBST(LIBS_ODBC)
AC_SUBST(CPPFLAGS_ODBC)
#for System
AC_CHECK_FUNCS(gettimeofday ftime setenv)
#for SMTPAppender
AC_MSG_CHECKING(for SMTP support)
AC_ARG_WITH(SMTP,
AC_HELP_STRING(--with-SMTP, [SMTP support. Accepted arguments :
libsmtp, CDO, no (default=no)]),
[ac_with_smtp=$withval],
[ac_with_smtp=no])
case "$ac_with_smtp" in
CDO)
AC_MSG_RESULT(CDO)
AC_DEFINE(HAVE_CDO_SMTP, 1, SMTP support through Microsoft CDO.)
AC_DEFINE(HAVE_SMTP, 1, SMTP support)
;;
libsmtp)
AC_MSG_RESULT(libsmtp)
AC_CHECK_LIB([smtp_mime], [libsmtp_session_initialize],,
AC_MSG_ERROR(libsmtp library not found !),
`glib-config --libs` -lsmtp)
AC_DEFINE(HAVE_LIBSMTP, 1, SMTP support through libsmtp library.)
AC_DEFINE(HAVE_SMTP, 1, SMTP support)
LIBS="`glib-config --libs` -lsmtp $LIBS"
CPPFLAGS="`glib-config --cflags` $CPPFLAGS"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(???)
AC_MSG_ERROR(Unknown option : $ac_with_smtp)
;;
esac
#for _T
case "$host" in
*apple-darwin*)
AC_DEFINE(MUST_UNDEF_T, 1, Defined to 1 if macro _T has to be undefined)
;;
esac
# Create files
# ----------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
docs/Makefile
docs/Doxyfile
src/Makefile
include/Makefile
include/log4cxx/Makefile
include/log4cxx/helpers/Makefile
include/log4cxx/net/Makefile
include/log4cxx/nt/Makefile
include/log4cxx/spi/Makefile
include/log4cxx/varia/Makefile
include/log4cxx/xml/Makefile
include/log4cxx/config/Makefile
include/log4cxx/db/Makefile
tests/Makefile
tests/input/Makefile
tests/input/xml/Makefile
tests/src/Makefile
tests/src/customlogger/Makefile
tests/src/defaultinit/Makefile
tests/src/helpers/Makefile
tests/src/net/Makefile
tests/src/pattern/Makefile
tests/src/util/Makefile
tests/src/xml/Makefile
tests/src/varia/Makefile
tests/witness/Makefile
performance/Makefile
performance/xml/Makefile
examples/Makefile
msvc/Makefile
msvc/dll/Makefile
msvc/examples/Makefile
msvc/simplesocketserver/Makefile
msvc/static/Makefile
msvc/tests/Makefile
msvc/performance/Makefile
])
AC_OUTPUT