| 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=6:0:0 |
| |
| AC_SUBST(LT_VERSION) |
| |
| AM_CONFIG_HEADER(include/log4cxx/config.h) |
| |
| AM_INIT_AUTOMAKE(log4cxx, 0.9.4) |
| |
| # 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 |
| |
| # Checks header files |
| # ---------------------------------------------------------------------------- |
| AC_CHECK_HEADERS(unistd.h io.h ) |
| |
| # Checks local idioms |
| # ---------------------------------------------------------------------------- |
| |
| # syslog_test |
| |
| # 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" |
| ;; |
| *) |
| 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_FUNC(socket) |
| |
| # 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) |
| |
| #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 |
| |
| #linux atomic functions |
| AC_MSG_CHECKING(for Linux atomic operations support) |
| case "$host" in |
| *linux*) |
| AC_DEFINE(HAVE_LINUX_ATOMIC_OPERATIONS, 1, Linux atomic operations support.) |
| AC_MSG_RESULT(yes) |
| ;; |
| *) |
| AC_MSG_RESULT(no) |
| ;; |
| esac |
| |
| # Create files |
| # ---------------------------------------------------------------------------- |
| |
| AC_CONFIG_FILES([ |
| Makefile |
| docs/Makefile |
| 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 |
| performance/Makefile |
| performance/xml/Makefile |
| msvc/Makefile |
| msvc/dll/Makefile |
| msvc/simplesocketserver/Makefile |
| msvc/static/Makefile |
| msvc/tests/Makefile |
| msvc/performance/Makefile |
| ]) |
| AC_OUTPUT |