1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([ortp],[0.16.1])
5 dnl Source packaging numbers
6 ORTP_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
7 ORTP_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
8 ORTP_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
9 ORTP_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
11 LIBORTP_SO_CURRENT=8 dnl increment this number when you add/change/remove an interface
12 LIBORTP_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
13 LIBORTP_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
15 LIBORTP_SO_VERSION=$LIBORTP_SO_CURRENT:$LIBORTP_SO_REVISION:$LIBORTP_SO_AGE
16 ORTP_VERSION=${ORTP_MAJOR_VERSION}.${ORTP_MINOR_VERSION}.${ORTP_MICRO_VERSION}
18 if test -n "$ORTP_EXTRA_VERSION" ; then
19 ORTP_VERSION="${ORTP_VERSION}.${ORTP_EXTRA_VERSION}"
22 ORTP_PKGCONFIG_VERSION=${ORTP_VERSION}
24 AC_SUBST(LIBORTP_SO_VERSION)
25 AC_SUBST(ORTP_VERSION)
26 AC_SUBST(ORTP_PKGCONFIG_VERSION)
31 AM_INIT_AUTOMAKE([tar-ustar])
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
33 AC_CONFIG_HEADERS(ortp-config.h)
34 AC_DEFINE_UNQUOTED(ORTP_MAJOR_VERSION,$ORTP_MAJOR_VERSION, [major version])
35 AC_DEFINE_UNQUOTED(ORTP_MINOR_VERSION,$ORTP_MINOR_VERSION, [minor version])
36 AC_DEFINE_UNQUOTED(ORTP_MICRO_VERSION,$ORTP_MICRO_VERSION, [micro version])
37 AC_DEFINE_UNQUOTED(ORTP_VERSION,"$ORTP_VERSION",[ortp version number])
41 AC_MSG_CHECKING([warning make an error on compilation])
43 [ --enable-strict Enable error on compilation warning [default=yes]],
44 [wall_werror=$enableval],
49 [ --enable-perf Disable costly features to reduce cpu consumtion [default=no]],
56 dnl enable ipv6 support
58 [ --enable-ipv6 Turn on ipv6 support],
59 [case "${enableval}" in
62 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
64 if test x$ipv6 = xtrue ; then
65 ORTP_DEFS="$ORTP_DEFS -DORTP_INET6"
68 AC_ARG_ENABLE(mode64bit,
69 [ --enable-mode64bit=[yes/no] produce a 64-bit library. [default=no]],
70 [case "${enableval}" in
71 yes) mode64bit_enabled=yes;;
72 no) mode64bit_enabled=no;;
73 *) AC_MSG_ERROR("Bad value for --enable-mode64bit");;
75 [mode64bit_enabled=no])
78 [ --enable-debug=[yes/no] enables the display of traces showing the execution of the library. [default=yes]],
79 [case "${enableval}" in
80 yes) debug_enabled=yes;;
81 no) debug_enabled=no;;
82 *) AC_MSG_ERROR("Bad value for --enable-debug");;
88 posixtimer_interval=10000
94 AC_DEFINE(NOCONNECT,1,[Defined if we should not use connect() on udp sockets])
95 CFLAGS="$CFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L"
99 AC_DEFINE(NOCONNECT,1,[Defined if we should not use connect() on udp sockets])
100 PTHREAD_LDFLAGS="-pthread"
103 CFLAGS="$CFLAGS -D_WIN32_WCE -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
104 LIBS="$LIBS -lws2 -liphlpapi"
109 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
110 LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm"
115 AC_CONFIG_COMMANDS([libtool-hacking],[
116 if test "$mingw_found" = "yes" ; then
117 echo "Hacking libtool to work with mingw..."
118 sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
119 cp -f ./libtool.tmp ./libtool
122 ],[mingw_found=$mingw_found])
124 dnl Checks for programs.
128 AC_ENABLE_SHARED(yes)
131 if test "$GCC" != "yes" ; then
132 if test "$hpux_host" = "yes" ; then
133 dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS
134 CFLAGS="$CFLAGS +O2 -g "
135 if test x$mode64bit_enabled = xyes ; then
136 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
140 CFLAGS="$CFLAGS -Wall"
145 dnl Check if we have seteuid system call
146 AC_CHECK_FUNCS(seteuid)
149 dnl check if we can use the pthread_library
150 AC_CHECK_LIB(pthread, pthread_mutex_init, [pthread_enabled=yes], [pthread_enabled=no])
151 if test $pthread_enabled = "no" ; then
154 PTHREAD_LIBS="-lpthread"
155 PTHREAD_CFLAGS="-D_REENTRANT"
156 AC_SUBST(PTHREAD_CFLAGS)
157 AC_SUBST(PTHREAD_LIBS)
158 AC_SUBST(PTHREAD_LDFLAGS)
160 AC_ARG_WITH(thread-stack-size,
161 AC_HELP_STRING([--with-thread-stack-size=SIZE-IN-BYTES],[Set thread stack size [[default=os-default]]]),
162 [thread_stack_size=$withval], [thread_stack_size=0])
163 AC_DEFINE_UNQUOTED(ORTP_DEFAULT_THREAD_STACK_SIZE, $thread_stack_size, [Default thread stack size (0 = let operating system decide)])
166 dnl check for libsrtp support (secure rtp)
168 [ --with-srtp Set prefix where libsrtp can be found (ex:/usr or /usr/local)[default=/usr] ],
169 [ srtp_prefix=${withval}],[ srtp_prefix=/usr ])
172 if test "${srtp_prefix}" != "/usr" ; then
173 SRTP_CFLAGS="-I${srtp_prefix}/include"
174 SRTP_LIBS="-L${srtp_prefix}/lib"
176 SRTP_LIBS="$SRTP_LIBS -lsrtp"
178 dnl check srtp headers
180 CPPFLAGS_save=$CPPFLAGS
181 CPPFLAGS=$SRTP_CFLAGS
182 AC_CHECK_HEADER([srtp/srtp.h],have_srtp_headers=yes)
183 CPPFLAGS=$CPPFLAGS_save
185 dnl check for srtp lib
186 LDFLAGS_save=$LDFLAGS
189 AC_CHECK_LIB(srtp,srtp_init,have_srtp_lib=yes)
190 LDFLAGS=$LDFLAGS_save
193 if test "$have_srtp_headers$have_srtp_lib" = "yesyes" ; then
195 AC_DEFINE(HAVE_SRTP, 1, [Defined when srtp support is compiled])
197 AC_MSG_NOTICE([Could not find libsrtp headers or lib, cryto transport disabled.])
202 AC_SUBST(SRTP_CFLAGS)
205 if test $debug_enabled = "yes"; then
206 ORTP_DEFS="$ORTP_DEFS -DORTP_DEBUG_MODE -g"
207 CFLAGS=`echo $CFLAGS | sed 's/-O.//'`
210 AC_ARG_ENABLE(memcheck,
211 [ --enable-memcheck=[yes/no] enables memory leak detection (HPUX only).],
212 [case "${enableval}" in
213 yes) memcheck_enabled=yes;;
214 no) memcheck_enabled=no;;
215 *) AC_MSG_ERROR("Bad value for --enable-memcheck");;
217 [memcheck_enabled=no])
219 if test "$memcheck_enabled" = "yes" ; then
220 if test "$hpux_host" = "yes" ; then
221 AC_DEFINE(ENABLE_MEMCHECK,1,[Defined when memory leak checking if enabled])
223 echo "WARNING ************ : the memory check option is only available for HPUX."
227 AC_ARG_ENABLE(so-reuseaddr,
228 [ --enable-so-reuseaddr=[yes/no] enables SO_REUSEADDR socket option in the rtp_session_set_local_addr() function.],
229 [case "${enableval}" in
230 yes) so_reuseaddr_enabled=yes;;
231 no) so_reuseaddr_enabled=no;;
232 *) AC_MSG_ERROR("Bad value for --enable-so-reuseaddr");;
234 [so_reuseaddr_enabled=yes])
236 if test "$so_reuseaddr_enabled" = "yes" ; then
237 AC_DEFINE(SO_REUSE_ADDR,1,[Defined when SO_REUSEADDR socket option in the rtp_session_set_local_addr() function is enabled])
241 dnl Checks for header files.
243 AC_CHECK_HEADERS(poll.h sys/poll.h sys/uio.h fcntl.h sys/time.h unistd.h sys/audio.h linux/soundcard.h)
245 dnl Checks for typedefs, structures, and compiler characteristics.
250 if test x$ac_cv_c_bigendian = xyes ; then
251 ORTP_DEFS="$ORTP_DEFS -DORTP_BIGENDIAN"
254 dnl Checks for library functions.
255 AC_CHECK_FUNCS(select socket strerror)
257 if test $hpux_host = "yes" ; then
258 dnl it seems 10 ms is too fast on hpux and it causes trouble
259 posixtimer_interval=20000
262 AC_DEFINE_UNQUOTED(POSIXTIMER_INTERVAL,$posixtimer_interval,[Defines the periodicity of the rtp scheduler in microseconds])
264 if test "$perf" = "yes" ; then
265 CFLAGS="$CFLAGS -DPERF"
268 if test $GCC = yes && test $wall_werror = yes; then
269 CFLAGS="$CFLAGS -Werror "
272 AC_ARG_ENABLE(ssl-hmac,
273 [ --enable-ssl-hmac=[yes/no] enables use of ssl/hmac for stun],
274 [case "${enableval}" in
275 yes) ssl_hmac_enabled=yes;;
276 no) ssl_hmac_enabled=no;;
277 *) AC_MSG_ERROR("Bad value for --enable-ssl-hmac");;
279 [ssl_hmac_enabled=yes])
281 if test "$ssl_hmac_enabled" = "yes" ; then
282 AC_CHECK_HEADERS(openssl/hmac.h openssl/md5.h)
283 AC_CHECK_LIB(ssl,SSL_CTX_new,[SSL_LIBS="-lssl"])
284 AC_CHECK_LIB(crypto,MD5,[SSL_LIBS="$SSL_LIBS -lcrypto"])
293 ORTPDEPS_LIBS="$ORTPDEPS_LIBS $PTHREAD_LIBS $PTHREAD_LDFLAGS $SRTP_LIBS $SSL_LIBS"
294 ORTPDEPS_CFLAGS="$ORTPDEPS_CFLAGS $PTHREAD_CFLAGS $ORTP_DEFS $SRTP_CFLAGS"
295 CFLAGS="$CFLAGS $ORTP_DEFS"
296 echo "$ORTPDEPS_CFLAGS" > ortp.defs
299 dnl ##################################################
300 dnl # Check for doxygen
301 dnl ##################################################
303 AC_PATH_PROG(DOXYGEN,doxygen,false)
304 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
307 dnl ##################################################
308 dnl # Check for ESP Packager
309 dnl ##################################################
311 AC_PATH_PROG(EPM,epm,false)
312 AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
313 AC_PATH_PROG(EPMINSTALL,epminstall,false)
314 AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
315 AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
317 # Preferred packaging system, as per EPM terminology
320 if test -f /etc/debian_version ; then
327 EPM_PKG_EXT=depot.gz;;
331 AC_SUBST(EPM_PKG_EXT)
333 # System software User & Group names
339 *-*-hpux*|*-dec-osf*)
350 *) ARCH=$target_cpu;;
354 # Various other packaging variables, that can be over-ridden ad `make
356 SUMMARY="An LGPL implementation of RTP - RFC3550"
367 AC_SUBST(ORTPDEPS_CFLAGS)
368 AC_SUBST(ORTPDEPS_LIBS)
369 AC_SUBST(ORTPDEPS_LDFLAGS)
374 include/ortp/Makefile
377 src/tests/win_receiver/Makefile
378 src/tests/win_sender/Makefile
380 build/win32native/Makefile
382 build/winmob/Makefile
388 AC_MSG_WARN([ortp-0.15.0 breaks compatibility with older releases, because value returned by rtp_session_recvm_with_ts() has
389 changed. See the API documentation in doc/ for further readings.])