File: configure.in

package info (click to toggle)
log4cxx 0.9.7-6.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,620 kB
  • ctags: 2,766
  • sloc: cpp: 18,909; sh: 8,896; xml: 1,146; makefile: 480; ansic: 159
file content (380 lines) | stat: -rwxr-xr-x 8,966 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
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