1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([mediastreamer],[2.3.1])
4 AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A mediastreaming library for telephony application.])
5 AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
9 dnl Source packaging numbers
10 MEDIASTREAMER_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
11 MEDIASTREAMER_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
12 MEDIASTREAMER_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
13 MEDIASTREAMER_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
15 LIBMEDIASTREAMER_SO_CURRENT=0 dnl increment this number when you add/change/remove an interface
16 LIBMEDIASTREAMER_SO_REVISION=1 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
17 LIBMEDIASTREAMER_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
19 LIBMEDIASTREAMER_SO_VERSION=$LIBMEDIASTREAMER_SO_CURRENT:$LIBMEDIASTREAMER_SO_REVISION:$LIBMEDIASTREAMER_SO_AGE
20 MEDIASTREAMER_VERSION=${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION}
22 if test -n "$MEDIASTREAMER_EXTRA_VERSION" ; then
23 MEDIASTREAMER_VERSION="${MEDIASTREAMER_VERSION}.${MEDIASTREAMER_EXTRA_VERSION}"
26 AC_SUBST(LIBMEDIASTREAMER_SO_VERSION)
27 AC_SUBST(MEDIASTREAMER_VERSION)
31 OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
32 AC_MSG_RESULT([Building Package on ${OS}])
34 AM_INIT_AUTOMAKE([tar-ustar])
35 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
36 AC_CONFIG_HEADERS(mediastreamer-config.h)
37 AC_DEFINE_UNQUOTED(MEDIASTREAMER_MAJOR_VERSION,$MEDIASTREAMER_MAJOR_VERSION, [major version])
38 AC_DEFINE_UNQUOTED(MEDIASTREAMER_MINOR_VERSION,$MEDIASTREAMER_MINOR_VERSION, [minor version])
39 AC_DEFINE_UNQUOTED(MEDIASTREAMER_MICRO_VERSION,$MEDIASTREAMER_MICRO_VERSION, [micro version])
40 AC_DEFINE_UNQUOTED(MEDIASTREAMER_VERSION,"$MEDIASTREAMER_VERSION",[MEDIASTREAMER version number])
46 AC_MSG_CHECKING([warning make an error on compilation])
48 [ --enable-strict Enable error on compilation warning [default=no]],
49 [wall_werror=$enableval],
51 if test "$USER" = "smorlat" ; then
59 CFLAGS="-DORTP_INET6 $CFLAGS "
61 dnl enable ipv6 support
63 [ --enable-ipv6 Turn on ipv6 support],
64 [case "${enableval}" in
67 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
69 if test x$ipv6 = xtrue ; then
70 CFLAGS="$CFLAGS -DINET6"
75 [ --enable-debug=[yes/no] enables the display of traces showing the execution of the library. [default=yes]],
76 [case "${enableval}" in
77 yes) debug_enabled=yes;;
78 no) debug_enabled=no;;
79 *) AC_MSG_ERROR("Bad value for --enable-debug");;
84 dnl Checks for programs.
93 if test "$GCC" != "yes" ; then
96 dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS
97 CFLAGS="$CFLAGS +O2 -g "
101 CFLAGS="$CFLAGS -Wall"
106 if test $debug_enabled = "yes"; then
107 CFLAGS="$CFLAGS -g -DDEBUG"
109 CFLAGS="$CFLAGS -O2 -g "
112 dnl Checks for header files.
115 dnl Checks for typedefs, structures, and compiler characteristics.
120 if test x$ac_cv_c_bigendian = xyes ; then
121 CFLAGS="$CFLAGS -D_BIGENDIAN "
124 if test $GCC = yes && test $wall_werror = yes; then
125 CFLAGS="$CFLAGS -Werror "
135 MSPLUGINS_LIBS="-dynamiclib"
137 LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio"
140 CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC"
141 CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE"
142 dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
149 CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
150 CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
151 dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
152 LIBS="$LIBS -lws2_32 -lwinmm "
156 MSPLUGINS_CFLAGS="-pthread"
157 MSPLUGINS_LIBS="-shared -pthread"
158 CFLAGS="$CFLAGS -pthread -D_REENTRANT"
159 LIBS="$LIBS -pthread -lpthread"
163 AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
165 AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
167 AC_CONFIG_COMMANDS([libtool-hacking],[
168 if test "$mingw_found" = "yes" ; then
169 echo "Hacking libtool to work with mingw..."
170 sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
171 cp -f ./libtool.tmp ./libtool
174 echo "No need to hack libtool."
176 ], [mingw_found=$mingw_found])
179 dnl prefer fixed point computations
180 AC_ARG_ENABLE(fixed_point,
181 [ --enable-fixed-point Turn on fixed point computations (default: guess)],
182 [case "${enableval}" in
183 yes) fixed_point=true;;
184 no) fixed_point=false;;
185 guess) fixed_point=guess;;
186 *) AC_MSG_ERROR(bad value ${enableval} for --enable-fixed-point) ;;
187 esac],[fixed_point=guess])
189 if test "$fixed_point" = "guess" ; then
190 AC_MSG_CHECKING([whether fixed point arithmetic is preferred])
191 case ${target_cpu}${host_cpu} in
202 AC_MSG_RESULT([$fixed_point])
206 if test x$fixed_point = xtrue ; then
207 MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT"
211 dnl initialize pkg-config so that we can use it within if else fi statements.
212 PKG_PROG_PKG_CONFIG()
214 AC_SUBST(MSPLUGINS_CFLAGS)
215 AC_SUBST(MSPLUGINS_LIBS)
217 AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"])
219 dnl *********************************
220 dnl various checks for soundcard apis
221 dnl *********************************
225 if test x$mingw_found = xyes ; then
230 [ --enable-oss Disable oss support],
231 [case "${enableval}" in
234 *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
237 if "$oss" = "true"; then
238 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
239 if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
240 test "${ac_cv_header_soundcard_h}" = "yes" || \
241 test "${ac_cv_header_sys_audio_h}" = "yes" || \
242 test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
249 AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue)
251 dnl conditionnal build of ALSA support
253 [ --enable-alsa Turn on alsa native support compiling],
254 [case "${enableval}" in
257 *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
260 if test "$alsa" = "true"; then
261 AC_CHECK_HEADERS(alsa/asoundlib.h,
262 [ AC_CHECK_LIB(asound,snd_pcm_open,
263 [ ALSA_LIBS="-lasound"
265 AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available])
273 AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue)
277 [ --enable-artsc Turn on artsc (kde<4) sound input/output (no) ],
278 [case "${enableval}" in
281 *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
286 if test "$artsc" = "true" ; then
288 dnl check for arts (kde sound daemon) support
289 PKG_CHECK_MODULES(ARTS, [artsc],[
294 if test x$artsc = xtrue ; then
295 AC_CHECK_HEADERS(kde/artsc/artsc.h,
296 [ AC_CHECK_LIB(artsc,arts_init,
297 [ ARTS_LIBS="-lartsc"
307 if test x$arts_enabled = xtrue; then
309 AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available])
312 AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue)
314 AC_ARG_ENABLE(portaudio,
315 [ --enable-portaudio Turn on portaudio native support compiling],
316 [case "${enableval}" in
317 yes) portaudio=true ;;
318 no) portaudio=false ;;
319 *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
320 esac],[portaudio=false])
322 if test "$portaudio" = "true"; then
323 AC_CHECK_HEADERS(portaudio.h,
324 [ AC_CHECK_LIB(portaudio,Pa_Initialize,
325 [ PORTAUDIO_LIBS="-lportaudio"
327 AC_DEFINE(__PORTAUDIO_ENABLED__,1,[defined if portaudio support is available])
328 portaudio_enabled=true
334 AC_SUBST(PORTAUDIO_LIBS)
335 AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue)
337 AC_ARG_ENABLE(macsnd,
338 [ --enable-macsnd Turn on native macosx sound support (default=no)],
339 [case "${enableval}" in
342 *) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;;
343 esac],[macsnd=false])
345 if test "$macsnd" = "true"; then
346 AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available])
351 AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
353 AC_ARG_ENABLE(macaqsnd,
354 [ --enable-macaqsnd Turn on native macosx Audio Queue sound support (default=yes)],
355 [case "${enableval}" in
356 yes) macaqsnd=true ;;
357 no) macaqsnd=false ;;
358 *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;;
359 esac],[macaqsnd=true])
361 if test "$macosx_found" != "yes" ; then
365 if test "$macaqsnd" = "true"; then
366 AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
370 AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
373 [ --disable-jack Disable jack support],
374 [case "${enableval}" in
377 *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
380 if test x$jack = xtrue; then
382 dnl Check for samplerate libraries
383 dnl Check for jack libraries (sound output plugin)
384 PKG_CHECK_MODULES(JACK,jack >= 0.15.0,
386 dnl we' found jack devel files
387 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13,
388 [AC_DEFINE(__JACK_ENABLED__,1,[Jack support])
391 [echo "libsamplerate not found, jack support disabled."])
392 AC_SUBST(SAMPLERATE_CFLAGS)
393 AC_SUBST(SAMPLERATE_LIBS)
395 [echo "No jack support."] )
397 if test x$jack_found = xno ; then
405 AC_SUBST(JACK_CFLAGS)
410 if test "$found_sound" = "no"; then
411 AC_MSG_WARN([Could not find a support sound driver API])
415 dnl *************************************
416 dnl check for various codecs libraries
417 dnl *************************************
420 [ --disable-speex Disable speex support],
421 [case "${enableval}" in
424 *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;;
427 if test x$speex = xtrue; then
429 dnl check for installed version of speex
430 PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3,
431 [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ],
432 [try_other_speex=yes]
434 PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes)
436 PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3,
437 [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS"
438 AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library])
439 build_resample=yes] ,
440 [AC_MSG_NOTICE([No speexdsp library found.])
443 AC_SUBST(SPEEX_CFLAGS)
448 AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes )
449 AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes )
452 [ --disable-gsm Disable gsm support],
453 [case "${enableval}" in
456 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;;
459 if test x$gsm = xtrue; then
464 [ --with-gsm Sets the installation prefix of gsm codec library [default=/usr] ],
465 [ gsmdir=${withval}],[ gsmdir=/usr ])
467 if test x"$gsmdir" != xno ; then
468 test x"$gmsdir" = xyes && gsmdir=/usr
469 MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include],
470 [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create])
471 if test "$GSM_found" = "yes" ; then
480 AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes )
483 AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
484 AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
485 AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
486 AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
488 dnl *********************************************
489 dnl setup oRTP dependency
490 dnl *********************************************
491 AC_ARG_ENABLE(external-ortp,
492 [ --enable-external-ortp Use external oRTP library],
493 [case "${enableval}" in
494 yes) external_ortp=true ;;
495 no) external_ortp=false ;;
496 *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
497 esac],[external_ortp=false])
499 if test "$external_ortp" = 'false'; then
500 if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then
501 echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h"
502 ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include"
503 ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la"
504 if test x$ac_cv_c_bigendian = xyes ; then
505 ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
511 if test "$external_ortp" = 'true'; then
512 PKG_CHECK_MODULES(ORTP, ortp >= 0.9.0, ,
513 [ AC_MSG_ERROR([Couldn't find ortp library]) ] )
515 AC_SUBST(ORTP_CFLAGS)
519 dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins
520 AC_CHECK_HEADERS(dlfcn.h)
522 AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true])
523 AC_CHECK_FUNC(dlopen,[have_dlopen=true])
524 if test "$have_dlopen" = "true" ; then
525 AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable])
528 dnl check various things
531 if test "x${prefix}" = "xNONE"; then
532 package_prefix=${ac_default_prefix}
534 package_prefix=${prefix}
537 if test x$mingw_found = xyes ; then
541 dnl define path of plugins:
542 AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${package_prefix}/lib/mediastreamer/plugins" ,[path of plugins])
543 PACKAGE_PLUGINS_DIR="${package_prefix}/lib/mediastreamer/plugins"
544 AC_SUBST(PACKAGE_PLUGINS_DIR)
546 PACKAGE_DATA_DIR="$prefix/share"
547 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data])
548 AC_SUBST(PACKAGE_DATA_DIR)
550 dnl check for video4linux headers
551 AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
552 if test "${ac_cv_header_linux_videodev_h}" = "yes" || \
553 test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
559 AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes )
561 PKG_CHECK_MODULES(LIBV4L2, libv4l2,
562 [AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])]
563 ,[echo "No libv4l2 found."]
565 PKG_CHECK_MODULES(LIBV4L1, libv4l1,
566 [AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])]
567 ,[echo "No libv4l1 found."]
570 dnl ##################################################
571 dnl # Check for doxygen
572 dnl ##################################################
574 AC_PATH_PROG(DOXYGEN,doxygen,false)
575 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
578 dnl ##################################################
579 dnl # Check for ESP Packager
580 dnl ##################################################
582 AC_PATH_PROG(EPM,epm,false)
583 AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
584 AC_PATH_PROG(EPMINSTALL,epminstall,false)
585 AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
588 # Preferred packaging system, as per EPM terminology
591 if test -f /etc/debian_version ; then
598 EPM_PKG_EXT=depot.gz;;
602 AC_SUBST(EPM_PKG_EXT)
604 # System software User & Group names
610 *-*-hpux*|*-dec-osf*)
621 *) ARCH=$target_cpu;;
625 # Various other packaging variables, that can be over-ridden ad `make
627 SUMMARY="A mediastreaming library."
638 CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS"
639 CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS"
640 dnl: these ones gets exported in pkgconfig file.
641 AC_SUBST(MS_PUBLIC_CFLAGS)
646 include/mediastreamer2/Makefile
650 build/win32native/Makefile
651 build/win32-novideo/Makefile
653 build/winmob/Makefile