1AC_INIT(log4cpp, 1.1)
2
3# autoconf 2.50 or higher to rebuild aclocal.m4, because the
4# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
5AC_PREREQ(2.50)
6
7#
8# +1 : ? : +1  == new interface that does not break old one
9# +1 : ? : 0   == new interface that breaks old one
10#  ? : ? : 0   == no new interfaces, but breaks apps
11#  ? :+1 : ?   == just some internal changes, nothing breaks but might work
12#                 better
13# CURRENT : REVISION : AGE
14LT_VERSION=5:6:0
15
16AC_SUBST(LT_VERSION)
17
18#AC_CONFIG_SRCDIR(configure.in)
19AC_CONFIG_AUX_DIR(config)
20AM_CONFIG_HEADER(include/config.h)
21
22AM_INIT_AUTOMAKE
23
24# General "with" options
25# ----------------------------------------------------------------------------
26AC_ARG_WITH(idsa, [  --with-idsa             include idsa support])
27
28# Checks for programs
29# ----------------------------------------------------------------------------
30AC_CANONICAL_HOST
31
32AC_ARG_ENABLE(debug,
33    AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)]),
34                   enable_debug=$enableval, enable_debug=no)
35
36if test "$enable_debug" = "yes" ; then
37    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
38    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
39else
40    GCC_CFLAGS="$CFLAGS"
41    GCC_CXXFLAGS="$CXXFLAGS"
42fi
43
44AM_PROG_LIBTOOL
45AC_PROG_INSTALL
46AC_PROG_MAKE_SET
47
48AC_PROG_CXX([g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC])
49
50if test "$GCC" = "yes" ; then
51    CFLAGS="$GCC_CFLAGS"
52    CXXFLAGS="$GCC_CXXFLAGS"
53fi
54
55AC_PROG_CXXCPP
56AC_LANG(C)
57
58# Checks header files
59# ----------------------------------------------------------------------------
60AC_CHECK_HEADERS([unistd.h])
61AC_CHECK_HEADERS([io.h])
62
63# Checks local idioms
64# ----------------------------------------------------------------------------
65AC_C_INT64_T
66AC_FUNC_SNPRINTF
67
68# syslog_test
69AC_CHECK_FUNCS([syslog])
70AC_CHECK_FUNCS([gettimeofday])
71AC_CHECK_FUNCS([ftime])
72AC_CHECK_FUNCS([localtime_r])
73
74# Checks for libraries
75# ----------------------------------------------------------------------------
76
77# checks for pthreads
78ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
79if test $enable_threads != "pthread"; then
80    AC_MSG_ERROR([unable to find pthreads, currently this is required])
81else
82    AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
83    AC_DEFINE(HAVE_THREADING,1,[define if threading is enabled])
84    AC_DEFINE(USE_PTHREADS,1,[define if pthread library is available])
85    LIBS="$PTHREAD_LIBS $LIBS"
86    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
87    CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
88fi
89
90AC_LANG(C++)
91AC_CXX_HAVE_SSTREAM
92
93# idsa_test
94if test "x$with_idsa" = xyes; then
95    AC_CHECK_LIB([idsa], [idsa_open])
96    if test "$ac_cv_lib_idsa_idsa_open" = no; then
97        AC_MSG_ERROR([could not locate idsa library])
98    fi
99fi
100
101# check for doxygen
102# ----------------------------------------------------------------------------
103BB_ENABLE_DOXYGEN
104
105# check for omnithreads
106#BB_CHECK_OMNITHREADS
107#BB_CHECK_PTHREADS
108
109LOG4CPP_CFLAGS="$CXXFLAGS"
110LOG4CPP_LIBS="-llog4cpp"
111LOG4CPP_LIBDEPS="$LIBS"
112LOG4CPP_VERSION="$VERSION"
113
114# CXX fine tuning
115case "$host" in
116    *-dec-osf*)
117	CXXFLAGS="$CXXFLAGS -std strict_ansi_errors"
118	;;
119    *)
120	;;
121esac
122
123PETI_PEDANTIC_GCC
124BB_ENABLE_REMOTE_SYSLOG
125BB_ENABLE_SMTP
126
127# Create files
128# ----------------------------------------------------------------------------
129
130AC_CONFIG_LIBCONFIG_IN([log4cpp])
131AC_CONFIG_PKGCONFIG_IN([log4cpp], [C++ library for flexible logging, modeled after Log4j])
132
133AC_CONFIG_FILES([
134Makefile
135log4cpp.spec
136log4cpp.pc
137log4cpp-config
138config/Makefile
139doc/Makefile
140doc/Doxyfile
141doc/html/Makefile
142src/Makefile
143include/Makefile
144include/log4cpp/Makefile
145include/log4cpp/threading/Makefile
146tests/Makefile
147msvc6/Makefile
148msvc6/log4cpp/Makefile
149msvc6/log4cppDLL/Makefile
150msvc6/testCategory/Makefile
151msvc6/testDLL/Makefile
152msvc6/testMain/Makefile
153msvc6/testNDC/Makefile
154msvc6/testNTEventLog/Makefile
155msvc6/testPattern/Makefile
156bcb5/Makefile
157bcb5/log4cpp/Makefile
158bcb5/testCategory/Makefile
159bcb5/testConfig/Makefile
160bcb5/testFixedContextCategory/Makefile
161bcb5/testmain/Makefile
162bcb5/testNDC/Makefile
163bcb5/testPattern/Makefile
164openvms/Makefile
165])
166AC_OUTPUT
167
168AC_CREATE_PREFIX_CONFIG_H([include/log4cpp/config.h],
169        $PACKAGE_TARNAME, [include/config.h])
170