1 AC_INIT(src/main/cpp/logger.cpp)
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # autoconf 2.50 or higher to rebuild aclocal.m4, because the
19 # AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
26 # +1 : ? : +1 == new interface that does not break old one
27 # +1 : ? : 0 == new interface that breaks old one
28 # ? : ? : 0 == no new interfaces, but breaks apps
29 # ? :+1 : ? == just some internal changes, nothing breaks but might work
31 # CURRENT : REVISION : AGE
36 AH_VERBATIM([HAVE_NO_EXPLICIT_EXPORTS],
37 [/* no explicit exports */
38 #define LOG4CXX_EXPORT])
40 AM_INIT_AUTOMAKE(log4cxx, 0.10.0)
43 # ----------------------------------------------------------------------------
49 AC_PROG_CXX([g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC])
57 CXXFLAGS="$CXXFLAGS -std strict_ansi_errors"
65 AC_ARG_ENABLE(doxygen,
66 AC_HELP_STRING(--enable-doxygen,
67 [enable documentation generation with doxygen (auto)]))
70 AC_HELP_STRING(--enable-dot,
71 [use 'dot' to generate graphs in doxygen (auto)]))
73 AC_ARG_ENABLE(html-docs,
74 AC_HELP_STRING(--enable-html-docs,
75 [enable HTML generation with doxygen (yes)]),
77 [enable_html_docs=yes])
79 AC_ARG_ENABLE(latex-docs,
80 AC_HELP_STRING(--enable-latex-docs,
81 [enable LaTeX documentation generation with doxygen (no)]),
83 [enable_latex_docs=no])
85 if test "x$enable_doxygen" = xno; then
88 AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
89 if test "x$DOXYGEN" = x; then
90 if test "x$enable_doxygen" = xyes; then
91 AC_MSG_ERROR([could not find doxygen])
96 AC_PATH_PROG(DOT, dot, , $PATH)
99 AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
100 AM_CONDITIONAL(LATEX_DOC, test x$enable_latex_docs = xyes)
102 if test x$DOT = x; then
103 if test "x$enable_dot" = xyes; then
104 AC_MSG_ERROR([could not find dot])
112 base_dir=`(cd $srcdir && pwd)`
115 AC_SUBST(enable_html_docs)
116 AC_SUBST(enable_latex_docs)
117 AC_SUBST(manual_dest)
123 # Checks header files
124 # ----------------------------------------------------------------------------
125 APR_FIND_APR( , , 1, 1)
126 if test "$apr_found" = "no"; then
127 AC_MSG_ERROR(APR could not be located. Please use the --with-apr option.)
130 CPPFLAGS="$CPPFLAGS `$apr_config --cppflags` `$apr_config --includes`"
131 APR_LIBS="`$apr_config --link-ld --libs`"
133 LDFLAGS="$LDFLAGS $APR_LIBS"
135 APR_FIND_APU( , , 1, 1)
136 if test "$apu_found" = "no"; then
137 AC_MSG_ERROR(APR-util could not be located. Please use the --with-apr-util option.)
140 CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
141 APU_LIBS="`$apu_config --link-ld --libs`"
143 LDFLAGS="$LDFLAGS $APU_LIBS"
145 # Checks local idioms
146 # ----------------------------------------------------------------------------
148 # for local syslog() function for SyslogAppender
149 AC_CHECK_FUNCS(mbsrtowcs, [have_mbsrtowcs=yes], [have_mbsrtowcs=no])
150 if test "$have_mbsrtowcs" = "yes"
152 AC_SUBST(HAS_MBSRTOWCS, 1)
154 AC_SUBST(HAS_MBSRTOWCS, 0)
157 AC_CHECK_FUNCS(wcstombs, [have_wcstombs=yes], [have_wcstombs=no])
158 if test "$have_wcstombs" = "yes"
160 AC_SUBST(HAS_WCSTOMBS, 1)
162 AC_SUBST(HAS_WCSTOMBS, 0)
165 # for local syslog() function for SyslogAppender
166 AC_CHECK_FUNCS(syslog, [have_syslog=yes], [have_syslog=no])
167 if test "$have_syslog" = "yes"
169 AC_SUBST(HAS_SYSLOG, 1)
171 AC_SUBST(HAS_SYSLOG, 0)
174 AC_CHECK_HEADER([locale],have_locale=yes,have_locale=no)
175 if test "$have_locale" = "yes"
177 AC_SUBST(HAS_STD_LOCALE, 1)
179 AC_SUBST(HAS_STD_LOCALE, 0)
182 AC_MSG_CHECKING([for wchar_t])
183 AC_COMPILE_IFELSE(AC_LANG_SOURCE([[
185 std::wstring w;]]), [have_wchar_t=yes], [have_wchar_t=no])
186 AC_MSG_RESULT($have_wchar_t)
187 if test "$have_wchar_t" = "yes"
189 AC_SUBST(HAS_WCHAR_T, 1)
191 AC_SUBST(HAS_WCHAR_T, 0)
194 AC_CHECK_FUNCS(fwide, [have_fwide=yes], [have_fwide=no])
195 if test "$have_fwide" = "yes"
197 AC_SUBST(HAS_FWIDE, 1)
199 AC_SUBST(HAS_FWIDE, 0)
203 # Checks for libraries
204 # ----------------------------------------------------------------------------
210 AC_MSG_CHECKING(for ODBC support)
212 AC_HELP_STRING(--with-ODBC, [ODBC support. Accepted arguments :
213 unixODBC, iODBC, Microsoft, no (default=no)]),
214 [ac_with_odbc=$withval],
216 case "$ac_with_odbc" in
218 AC_SUBST(HAS_ODBC, 1, ODBC support)
219 AC_MSG_RESULT(Microsoft)
223 AC_MSG_RESULT(unixODBC)
224 AC_CHECK_HEADER(sqlext.h,, AC_MSG_ERROR(unixODBC not found !))
225 AC_SUBST(HAS_ODBC, 1, ODBC support)
230 AC_CHECK_PROG(IODBC_CONFIG, iodbc-config, yes, no)
231 if test "x$IODBC_CONFIG" = "xyes"
233 AC_SUBST(HAS_ODBC, 1, ODBC support)
234 LIBS_ODBC="`iodbc-config --libs`"
235 CPPFLAGS_ODBC="`iodbc-config --cflags`"
237 AC_MSG_ERROR(iODBC not found !)
241 AC_SUBST(HAS_ODBC, 0, No ODBC support)
246 AC_MSG_ERROR(Unknown option : $ac_with_odbc)
250 AC_SUBST(CPPFLAGS_ODBC)
254 AC_MSG_CHECKING(for SMTP support)
256 AC_HELP_STRING(--with-SMTP, [SMTP support. Accepted arguments :
257 libesmtp, no (default=no)]),
258 [ac_with_smtp=$withval],
260 case "$ac_with_smtp" in
262 AC_MSG_RESULT(libesmtp)
263 AC_CHECK_LIB([esmtp], [smtp_create_session],,
264 AC_MSG_ERROR(libesmtp library not found !),
266 AC_SUBST(HAS_LIBESMTP, 1, SMTP support through libesmtp library.)
271 AC_SUBST(HAS_LIBESMTP, 0, SMTP support through libesmtp library.)
275 AC_MSG_ERROR(Unknown option : $ac_with_smtp)
281 AC_HELP_STRING(--enable-char,
282 [enable char API (yes)]))
283 if test "x$enable_char" = xno; then
289 if test "$have_char_api" = "yes"
291 AC_SUBST(CHAR_API, 1)
293 AC_SUBST(CHAR_API, 0)
297 AC_ARG_ENABLE(wchar_t,
298 AC_HELP_STRING(--enable-wchar_t,
299 [enable wchar_t API (yes if wchar_t available)]))
300 if test "x$enable_wchar_t" = xno; then
303 if test "$have_wchar_t" = "yes"
311 if test "$have_wchar_t_api" = "yes"
313 AC_SUBST(WCHAR_T_API, 1)
315 AC_SUBST(WCHAR_T_API, 0)
319 AC_ARG_ENABLE(unichar,
320 AC_HELP_STRING(--enable-unichar,
321 [enable unichar API (no)]))
322 if test "x$enable_unichar" = "yes"
324 AC_SUBST(UNICHAR_API, 1)
326 AC_SUBST(UNICHAR_API, 0)
330 AC_ARG_ENABLE(cfstring,
331 AC_HELP_STRING(--enable-cfstring,
332 [enable cfstring API (no)]))
333 if test "x$enable_cfstring" = xyes; then
334 AC_MSG_CHECKING([for cfstring])
335 CPPFLAGS="$CPPFLAGS -framework CoreFoundation"
336 AC_COMPILE_IFELSE(AC_LANG_SOURCE([[
337 #include <CoreFoundation/CFString.h>
338 CFStringRef x = CFSTR("Hello");]]), [have_cfstring_api=yes], [have_cfstring_api=no])
339 AC_MSG_RESULT($have_cfstring_api)
344 if test "$have_cfstring_api" = "yes"
346 AC_SUBST(CFSTRING_API, 1)
348 AC_SUBST(CFSTRING_API, 0)
351 #determine charset type
352 AC_MSG_CHECKING([charset type])
354 AC_HELP_STRING(--with-charset=TYPE, [locale charset.
355 Accepted TYPE variants: auto, utf-8, iso-8859-1, usascii, ebcdic (default=auto)]),
356 [ac_with_charset=$withval],
357 [ac_with_charset=auto])
359 case "$ac_with_charset" in
362 AC_SUBST(CHARSET_UTF8, 1)
363 AC_SUBST(CHARSET_ISO88591, 0)
364 AC_SUBST(CHARSET_USASCII, 0)
365 AC_SUBST(CHARSET_EBCDIC, 0)
369 AC_MSG_RESULT(iso-8859-1)
370 AC_SUBST(CHARSET_UTF8, 0)
371 AC_SUBST(CHARSET_ISO88591, 1)
372 AC_SUBST(CHARSET_USASCII, 0)
373 AC_SUBST(CHARSET_EBCDIC, 0)
377 AC_MSG_RESULT(usascii)
378 AC_SUBST(CHARSET_UTF8, 0)
379 AC_SUBST(CHARSET_ISO88591, 0)
380 AC_SUBST(CHARSET_USASCII, 1)
381 AC_SUBST(CHARSET_EBCDIC, 0)
385 AC_MSG_RESULT(usascii)
386 AC_SUBST(CHARSET_UTF8, 0)
387 AC_SUBST(CHARSET_ISO88591, 0)
388 AC_SUBST(CHARSET_USASCII, 0)
389 AC_SUBST(CHARSET_EBCDIC, 1)
394 AC_SUBST(CHARSET_UTF8, 0)
395 AC_SUBST(CHARSET_ISO88591, 0)
396 AC_SUBST(CHARSET_USASCII, 0)
397 AC_SUBST(CHARSET_EBCDIC, 0)
402 AC_MSG_ERROR(Invalid charset type: $ac_with_charset)
408 #determine logchar type
409 AC_MSG_CHECKING([logchar type])
411 AC_HELP_STRING(--with-logchar=TYPE, [type for logchar.
412 Accepted TYPE variants: utf-8, wchar_t, unichar (default=utf-8)]),
413 [ac_with_logchar=$withval],
414 [ac_with_logchar=utf-8])
416 case "$ac_with_logchar" in
419 AC_SUBST(LOGCHAR_IS_UTF8, 1)
420 AC_SUBST(LOGCHAR_IS_WCHAR, 0)
421 AC_SUBST(LOGCHAR_IS_UNICHAR, 0)
425 AC_MSG_RESULT(wchar_t)
426 AC_SUBST(LOGCHAR_IS_UTF8, 0)
427 AC_SUBST(LOGCHAR_IS_WCHAR, 1)
428 AC_SUBST(LOGCHAR_IS_UNICHAR, 0)
432 AC_MSG_RESULT(unichar)
433 AC_SUBST(LOGCHAR_IS_UTF8, 0)
434 AC_SUBST(LOGCHAR_IS_WCHAR, 0)
435 AC_SUBST(LOGCHAR_IS_UNICHAR, 1)
440 AC_MSG_ERROR(Invalid logchar type: $ac_with_logchar)
447 # ----------------------------------------------------------------------------
454 src/main/cpp/Makefile
455 src/main/include/Makefile
456 src/main/include/log4cxx/log4cxx.h
457 src/main/include/log4cxx/private/log4cxx_private.h
458 src/main/include/log4cxx/private/Makefile
459 src/main/include/log4cxx/Makefile
460 src/main/include/log4cxx/helpers/Makefile
461 src/main/include/log4cxx/net/Makefile
462 src/main/include/log4cxx/nt/Makefile
463 src/main/include/log4cxx/spi/Makefile
464 src/main/include/log4cxx/spi/location/Makefile
465 src/main/include/log4cxx/varia/Makefile
466 src/main/include/log4cxx/xml/Makefile
467 src/main/include/log4cxx/config/Makefile
468 src/main/include/log4cxx/db/Makefile
469 src/main/include/log4cxx/rolling/Makefile
470 src/main/include/log4cxx/pattern/Makefile
471 src/main/include/log4cxx/filter/Makefile
473 src/site/doxy/Makefile
474 src/site/doxy/Doxyfile
476 src/test/resources/Makefile
477 src/test/resources/input/Makefile
478 src/test/resources/input/ndc/Makefile
479 src/test/resources/input/rolling/Makefile
480 src/test/resources/input/xml/Makefile
481 src/test/cpp/Makefile
482 src/test/resources/witness/Makefile
483 src/test/resources/witness/encoding/Makefile
484 src/test/resources/witness/ndc/Makefile
485 src/test/resources/witness/rolling/Makefile
486 src/examples/Makefile
487 src/examples/cpp/Makefile