1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision: 1.55 $)dnl
4 AC_INIT(include/osip2/osip.h)
6 AC_MSG_NOTICE([osip The GNU Open SIP library.])
7 AC_MSG_NOTICE([Copyright (C) 2001,2002,2003,2004 Aymeric MOIZARD - <jack@atosc.org>])
10 dnl *********************************************************************
11 dnl Source packaging numbers
16 OSIP_VERSION=$OSIP_MAJOR_VERSION.$OSIP_MINOR_VERSION.$OSIP_MICRO_VERSION
18 LIBOSIP_SO_VERSION=`expr $OSIP_MINOR_VERSION + $OSIP_MAJOR_VERSION`:$OSIP_MICRO_VERSION:$OSIP_MINOR_VERSION
20 AC_SUBST(LIBOSIP_SO_VERSION, $LIBOSIP_SO_VERSION)
22 AC_SUBST(OSIP_VERSION)
27 AC_MSG_RESULT([Configuring ${PACKAGE} ${VERSION}])
28 OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
29 AC_MSG_RESULT([Building Package on ${OS}])
33 dnl *********************************************************************
34 dnl Initialize automake stuff
35 AC_CONFIG_AUX_DIR(scripts)
36 AM_CONFIG_HEADER(config.h)
37 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
38 AM_ACLOCAL_INCLUDE(scripts)
42 dnl Checks for programs.
49 dnl Initialize libtool
53 dnl declare --enable-* args and collect ac_help strings
56 [ --enable-debug turn on debugging.],
57 enable_debug=$enableval,enable_debug="yes")
60 [ --enable-trace turn on trace.],
61 enable_trace=$enableval,enable_trace="yes")
63 AC_ARG_ENABLE(mpatrol,
64 [ --enable-mpatrol turn on memory leak detection with patrol.],
65 enable_mpatrol=$enableval,enable_mpatrol="no")
67 dnl build with multithreaded support (need semaphore).
69 [ --enable-mt compile oSIP without multi-thread support.],
70 enable_mt=$enableval,enable_mt="yes")
74 [ --enable-md5 compile oSIP with MD5 support.],
75 enable_md5=$enableval,enable_md5="yes")
77 dnl buffer save mode support.
78 AC_ARG_ENABLE(buffermode,
79 [ --enable-buffermode compile oSIP without buffer save mode support.],
80 enable_buffermode=$enableval,enable_buffermode="yes")
82 dnl support for linux-thread or posix thread (pthread.h)
83 AC_ARG_ENABLE(pthread,
84 [ --enable-pthread enable support for POSIX threads. (default=autodetect)],
85 enable_pthread=$enableval,enable_pthread="no")
87 dnl support for semaphore.h (linux/sun...)
88 AC_ARG_ENABLE(semaphore,
89 [ --enable-semaphore enable support for semaphore (semaphore.h)],
90 enable_semaphore=$enableval,enable_semaphore="no")
92 dnl support for sysV semaphore in sys/sem.h (BSD/linux...)
94 [ --enable-sysv enable support for sysV semaphore (sys/sem.h).],
95 enable_sysv=$enableval,enable_sysv="no")
97 dnl support for gperf.
99 [ --enable-gperf enable support for gperf (improve the parser speed).],
100 enable_gperf=$enableval,enable_gperf="no")
102 AC_ARG_ENABLE(ntimer,
103 [ --enable-ntimer enable new timer facility. (default yes)],
104 enable_ntimer=$enableval,enable_ntimer="yes")
106 dnl compile with mt support
107 if test "x$enable_mt" = "xyes"; then
108 if test "x$enable_pthread" = "xyes"; then
109 SIP_FSM_FLAGS="-DOSIP_MT -DHAVE_PTHREAD"
112 SIP_FSM_FLAGS="-DOSIP_MT"
117 if test "x$enable_ntimer" = "xyes"; then
118 SIP_FSM_FLAGS="$SIP_FSM_FLAGS -DNEW_TIMER"
121 if test "x$enable_gperf" = "xyes"; then
122 SIP_PARSER_FLAGS="$SIP_PARSER_FLAGS -DUSE_GPERF"
125 if test "x$enable_semaphore" = "xyes"; then
126 SIP_FSM_FLAGS="$SIP_FSM_FLAGS -DHAVE_SEMAPHORE_H"
127 AC_CHECK_HEADERS(semaphore.h)
128 elif test "x$enable_sysv" = "xyes"; then
129 SIP_FSM_FLAGS="$SIP_FSM_FLAGS -DHAVE_SYS_SEM_H"
130 AC_CHECK_HEADERS(sys/sem.h)
132 AC_CHECK_HEADERS(semaphore.h)
133 AC_CHECK_HEADERS(sys/sem.h)
138 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -pedantic"
156 if test "x$enable_md5" = "xno"; then
157 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -DNO_MD5_SUPPORT"
160 if test "x$enable_buffermode" = "xyes"; then
161 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -DUSE_TMP_BUFFER"
164 if test "x$enable_debug" = "xyes"; then
165 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -DENABLE_DEBUG -g"
166 CFLAGS=`echo $CFLAGS | sed 's/-O.//'`
169 if test "x$enable_trace" = "xyes"; then
170 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -DENABLE_TRACE"
173 if test "x$enable_mpatrol" = "xyes"; then
174 SIP_EXTRA_FLAGS="$SIP_EXTRA_FLAGS -DENABLE_MPATROL"
175 EXTRA_LIB="$EXTRA_LIB -lmpatrolmt -lelf -lpthread"
178 dnl Checks for libraries. (those one are needed for sun)
179 AC_CHECK_LIB(posix4,sem_open,[FSM_LIB="$FSM_LIB -lposix4 -mt"])
180 AC_CHECK_LIB(nsl,nis_add,[FSM_LIB="$FSM_LIB -lnsl"])
181 AC_CHECK_LIB(socket,sendto,[FSM_LIB="$FSM_LIB -lsocket"])
183 AC_CACHE_CHECK([whether -Wall works], Wall_flag, [
184 saved_CPPFLAGS=$CPPFLAGS
186 AC_TRY_COMPILE(, , Wall_flag=yes, Wall_flag=no)
187 CPPFLAGS=$saved_CPPFLAGS
190 if test "x$Wall_flag" = xyes; then
191 CPPFLAGS="$CPPFLAGS -Wall"
194 AC_CACHE_CHECK([whether -Wcast-align works], Wcast_align_flag, [
195 saved_CPPFLAGS=$CPPFLAGS
196 CPPFLAGS="-Wcast-align"
197 AC_TRY_COMPILE(, , Wcast_align_flag=yes, Wcast_align_flag=no)
198 CPPFLAGS=$saved_CPPFLAGS
201 if test "x$Wcast_align_flag" = xyes; then
202 CPPFLAGS="$CPPFLAGS -Wcast-align"
205 AC_CACHE_CHECK([whether -Wchar-subscripts works], Wchar_subscripts_flag, [
206 saved_CPPFLAGS=$CPPFLAGS
207 CPPFLAGS="-Wchar-subscripts"
208 AC_TRY_COMPILE(, , Wchar_subscripts_flag=yes, Wchar_subscripts_flag=no)
209 CPPFLAGS=$saved_CPPFLAGS
212 if test "x$Wchar_subscripts_flag" = xyes; then
213 CPPFLAGS="$CPPFLAGS -Wchar-subscripts"
216 AC_CACHE_CHECK([whether -Wformat works], Wformat_flag, [
217 saved_CPPFLAGS=$CPPFLAGS
219 AC_TRY_COMPILE(, , Wformat_flag=yes, Wformat_flag=no)
220 CPPFLAGS=$saved_CPPFLAGS
223 if test "x$Wformat_flag" = xyes; then
224 CPPFLAGS="$CPPFLAGS -Wformat"
227 AC_CACHE_CHECK([whether -Winline works], Winline_flag, [
228 saved_CPPFLAGS=$CPPFLAGS
230 AC_TRY_COMPILE(, , Winline_flag=yes, Winline_flag=no)
231 CPPFLAGS=$saved_CPPFLAGS
234 if test "x$Winline_flag" = xyes; then
235 CPPFLAGS="$CPPFLAGS -Winline"
238 AC_CACHE_CHECK([whether -Wmissing-declarations works], Wmissing_declarations_flag, [
239 saved_CPPFLAGS=$CPPFLAGS
240 CPPFLAGS="-Wmissing-declarations"
241 AC_TRY_COMPILE(, , Wmissing_declarations_flag=yes, Wmissing_declarations_flag=no)
242 CPPFLAGS=$saved_CPPFLAGS
245 if test "x$Wmissing_declarations_flag" = xyes; then
246 CPPFLAGS="$CPPFLAGS -Wmissing-declarations"
249 AC_CACHE_CHECK([whether -Wmissing-prototypes works], Wmissing_prototypes_flag, [
250 saved_CPPFLAGS=$CPPFLAGS
251 CPPFLAGS="-Wmissing-prototypes"
252 AC_TRY_COMPILE(, , Wmissing_prototypes_flag=yes, Wmissing_prototypes_flag=no)
253 CPPFLAGS=$saved_CPPFLAGS
256 if test "x$Wmissing_prototypes_flag" = xyes; then
257 CPPFLAGS="$CPPFLAGS -Wmissing-prototypes"
260 AC_CACHE_CHECK([whether -Wnested-externs works], Wnested_externs_flag, [
261 saved_CPPFLAGS=$CPPFLAGS
262 CPPFLAGS="-Wnested-externs"
263 AC_TRY_COMPILE(, , Wnested_externs_flag=yes, Wnested_externs_flag=no)
264 CPPFLAGS=$saved_CPPFLAGS
267 if test "x$Wnested_externs_flag" = xyes; then
268 CPPFLAGS="$CPPFLAGS -Wnested-externs"
271 AC_CACHE_CHECK([whether -Wpointer-arith works], Wpointer_arith_flag, [
272 saved_CPPFLAGS=$CPPFLAGS
273 CPPFLAGS="-Wpointer-arith"
274 AC_TRY_COMPILE(, , Wpointer_arith_flag=yes, Wpointer_arith_flag=no)
275 CPPFLAGS=$saved_CPPFLAGS
278 if test "x$Wpointer_arith_flag" = xyes; then
279 CPPFLAGS="$CPPFLAGS -Wpointer-arith"
282 SIP_CFLAGS="$SIP_CFLAGS $CFLAGS"
286 AC_SUBST(SIP_EXTRA_FLAGS)
287 AC_SUBST(SIP_PARSER_FLAGS)
288 AC_SUBST(SIP_FSM_FLAGS)
294 dnl Checks for header files.
296 dnl This is to be removed for autoconf2.50
298 AC_CHECK_HEADERS(string.h)
299 AC_CHECK_HEADERS(strings.h)
300 AC_CHECK_HEADERS(stdlib.h)
301 AC_CHECK_HEADERS(unistd.h)
302 AC_CHECK_HEADERS(sys/types.h)
303 dnl !This is to be removed for autoconf2.50
305 AC_CHECK_HEADERS(sys/unistd.h)
306 AC_CHECK_HEADERS(syslog.h)
307 AC_CHECK_HEADERS(ctype.h)
308 AC_CHECK_HEADERS(stdio.h)
309 AC_CHECK_HEADERS(stdarg.h)
310 AC_CHECK_HEADERS(varargs.h)
311 AC_CHECK_HEADERS(fcntl.h)
312 AC_CHECK_HEADERS(time.h)
313 AC_CHECK_HEADERS(sys/time.h)
314 AC_CHECK_HEADERS(sys/select.h)
315 AC_CHECK_HEADERS(assert.h)
316 AC_CHECK_HEADERS(signal.h)
317 AC_CHECK_HEADERS(sys/signal.h)
318 AC_CHECK_HEADERS(malloc.h)
324 src/osipparser2/Makefile
327 src/test/res/Makefile
329 include/osip2/Makefile
330 include/osipparser2/Makefile
331 include/osipparser2/headers/Makefile
334 help/doxygen/Makefile
337 platform/rpm/Makefile
338 platform/windows/Makefile
339 platform/vsnet/Makefile)