File: configure.in

package info (click to toggle)
log4c 1.2.4-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 2,808 kB
  • sloc: sh: 11,246; ansic: 8,645; makefile: 680; lex: 134; cpp: 6
file content (255 lines) | stat: -rw-r--r-- 6,992 bytes parent folder | download | duplicates (3)
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
# -*- mode:Shell-script -*-

AC_PREREQ(2.57)

AC_INIT
AC_CONFIG_SRCDIR([configure.in])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([config])
AM_CONFIG_HEADER(src/config.h)

LOG4C_MAJOR_VERSION=1
LOG4C_MINOR_VERSION=2
LOG4C_MICRO_VERSION=4
VERSION=$LOG4C_MAJOR_VERSION.$LOG4C_MINOR_VERSION.$LOG4C_MICRO_VERSION${SNAPSHOT:+.$SNAPSHOT}

# +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:1:3

AC_SUBST(LOG4C_MAJOR_VERSION)
AC_SUBST(LOG4C_MINOR_VERSION)
AC_SUBST(LOG4C_MICRO_VERSION)
AC_SUBST(LT_VERSION)

AM_INIT_AUTOMAKE("log4c", $VERSION)

AC_CANONICAL_HOST

# Need this to get pthread etc.
AC_DEFINE(_GNU_SOURCE,1,"POSIXandGNU extensions")

#####################
# Checks for programs
#.
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AM_PROG_LEX
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL

# platform idioms
case "$host" in
    *-hp-hpux*)
	CFLAGS="-g"
	;;
    *-mingw*)
	dnl required to create shared libraries
	LDFLAGS_NOUNDEFINED="-no-undefined"
	l4c_have_win=yes
	;;
    *)
	;;
esac
AC_SUBST([LDFLAGS_NOUNDEFINED])
AM_CONDITIONAL([WIN32], test "x$l4c_have_win" = "xyes")

if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi

##########################
# Enable debug if required
# 
AC_ARG_ENABLE(debug,
      AC_HELP_STRING([--enable-debug], [LOG4C: turn on debugging (default=no)]))
if test x$enable_debug = xyes; then
    CFLAGS="$CFLAGS -D__SD_DEBUG__ -D__LOG4C_DEBUG__"
fi

########################
# Enable reread if flagged
#
AC_ARG_ENABLE(reread,
	AC_HELP_STRING([--enable-reread], 
		[LOG4C: turn on re-read of log4crc file(default=no)]i),
	if test x$enable_reread = xyes; then
		AC_MSG_NOTICE([Enabled automatic reread of log4crc file])
		AC_DEFINE([__ENABLE_REREAD__], [], 
			[Enable automatic reread of log4crc file])
	fi
)

####################################################################
# Test for pthread and enable rollingfile code which depends on that
# if we find it
#
AC_CHECK_HEADER(pthread.h,[
        AC_CHECK_LIB(pthread,pthread_mutex_init,[
                LIBS="$LIBS -lpthread"
                AC_DEFINE([WITH_ROLLINGFILE], [], [Define if we found pthread.h libpthread])
                AC_MSG_NOTICE([Compile with rollingfile code])
                with_rollingfile=true],[AC_MSG_NOTICE([No pthread--not compiling rollingfile code])]
                )
])
AM_CONDITIONAL(WITH_ROLLINGFILE, test "x$with_rollingfile" = "xtrue")

#####################################
# Enable test compilation if required
#
AC_ARG_ENABLE(test,
       AC_HELP_STRING([--enable-test], [LOG4C: compile test programs (default=no)]))
AM_CONDITIONAL(TEST, test x$enable_test = xyes)

#####################################
# Checks for libraries.
#

#####################################
# Checks for header files.
#
AC_HEADER_STDC
AC_CHECK_HEADERS([alloc.h fcntl.h inttypes.h langinfo.h limits.h malloc.h stddef.h stdint.h \
stdlib.h string.h sys/time.h syslog.h unistd.h stdarg.h varargs.h getopt.h \
pthread.h])
dnl These tests don't work properly, on MinGW the functions are not detected
dnl even they are available. But replacement functions are good enough. :-)
AC_CHECK_FUNCS([sleep gmtime_r localtime_r])
AC_CHECK_DECLS([sleep], [], [], [[#include <unistd.h>]])
AC_CHECK_DECLS([gmtime_r, localtime_r], [], [], [[#include <time.h>]])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

# Checks for library functions.
AC_FUNC_ALLOCA
dnl nonportable or buggy (we want cross-compilation)
dnl AC_FUNC_MALLOC
AC_FUNC_MMAP
dnl nonportable or buggy (we want cross-compilation)
dnl AC_FUNC_REALLOC
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memset munmap nl_langinfo strdup strerror strncasecmp strrchr strstr utime sbrk])
LOG4C_FUNC_GETHOSTNAME
LOG4C_VA_COPY
# enable mmap appender only when mmap() function found
AM_CONDITIONAL(WITH_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")

###############
# Documentation 
#
AC_ARG_ENABLE(doc, 
      AC_HELP_STRING([--enable-doc], 
      	[LOG4C: create documentation with doxygen--html/man/pdf (default=no)]))
	
# Checks for doxygen
AC_PATH_PROG(DOXYGEN, doxygen, )
if test x$DOXYGEN = x; then
	enable_doc=no
fi
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)

#
# Checks for the graphviz tool 'dot' used to generate graphs
# of the class dependencies.  Probably not useful
# for c programs.  If we don't  find dot in the path
# then set HAVE_DOT to NO in Doxyfile.in
#
HAVE_DOT=YES
AC_PATH_PROG(DOT, dot, )
if test x$DOT = x; then
	HAVE_DOT=NO
fi
AC_SUBST(HAVE_DOT)

# Similar for latex
HAVE_LATEX=YES
AC_PATH_PROG(LATEX, latex, )
if test x$LATEX = x; then
	HAVE_LATEX=NO
fi
# This variable is used to turn LATEX on and off in the Doxyfile
AC_SUBST(HAVE_LATEX)
# This variable is used in doc/Makefile.am to set the target to make
# the doc with latex or not
AM_CONDITIONAL(HAVE_LATEX, test x$HAVE_LATEX = xYES)
#
# Documentation
###############

AC_ARG_ENABLE(constructors, AC_HELP_STRING([--enable-constructors], 
	[LOG4C: build with initialization constructors [default=no]]))
if test "x$enable_constructors" = "xyes"; then 
    AC_DEFINE([WITH_CONSTRUCTORS],  1,
	[build log4c with initialization constructors])
    AC_MSG_NOTICE([using constructors to initialize log4c])
fi

# 
###################
###################
# Test for libexpat
#

AC_ARG_WITH(expat,
    AC_HELP_STRING([--without-expat],
              	    [LOG4C: build without expat (default=no).
                    Set this option to yes if you do not want Log4C to use expat
                    for parsing the configuration file.  If without-expat is
                    set to yes then none of the other options related to expat
                    have any effect and Log4C uses some bundled yacc/lex code
                    for parsing it's configuration file.
                    ]),
                    with_expat=no,
                    with_expat=yes)
if test x$with_expat = xyes ; then
 use_expat=yes
 AM_PATH_EXPAT(1.95.1)
fi
dnl AC_MSG_NOTICE([value of with_expat = $with_expat no_expat =  $no_expat use_expat= $use_expat])
AM_CONDITIONAL(USE_EXPAT, test  "x$use_expat" = "xyes" )
# 
###################

AC_CONFIG_FILES([
    Makefile
    log4c-config
    log4c.pc
    log4crc.sample
    log4c.spec
    config/Makefile
    doc/Makefile
    doc/Doxyfile
    doc/main.doc
    src/Makefile
    src/log4c/Makefile
    src/log4c/version.h
    src/sd/Makefile
    tests/Makefile
    tests/log4c/Makefile
    examples/Makefile
    examples/log4crc
    examples/helloworld/Makefile
    examples/helloworld1/Makefile
])
AC_CONFIG_COMMANDS([default],[[
    chmod +x log4c-config
]],[[]])
AC_OUTPUT