| 1 | dnl Process this file with autoconf to produce a configure script. |
|---|
| 2 | AC_INIT([mediastreamer],[2.3.1]) |
|---|
| 3 | |
|---|
| 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)]) |
|---|
| 6 | |
|---|
| 7 | AC_CANONICAL_SYSTEM |
|---|
| 8 | |
|---|
| 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) |
|---|
| 14 | |
|---|
| 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 |
|---|
| 18 | |
|---|
| 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} |
|---|
| 21 | |
|---|
| 22 | if test -n "$MEDIASTREAMER_EXTRA_VERSION" ; then |
|---|
| 23 | MEDIASTREAMER_VERSION="${MEDIASTREAMER_VERSION}.${MEDIASTREAMER_EXTRA_VERSION}" |
|---|
| 24 | fi |
|---|
| 25 | |
|---|
| 26 | AC_SUBST(LIBMEDIASTREAMER_SO_VERSION) |
|---|
| 27 | AC_SUBST(MEDIASTREAMER_VERSION) |
|---|
| 28 | |
|---|
| 29 | PACKAGE=mediastreamer |
|---|
| 30 | |
|---|
| 31 | OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
|---|
| 32 | AC_MSG_RESULT([Building Package on ${OS}]) |
|---|
| 33 | |
|---|
| 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]) |
|---|
| 41 | |
|---|
| 42 | MS_PUBLIC_CFLAGS= |
|---|
| 43 | |
|---|
| 44 | AC_SUBST([mkdir_p]) |
|---|
| 45 | |
|---|
| 46 | AC_MSG_CHECKING([warning make an error on compilation]) |
|---|
| 47 | AC_ARG_ENABLE(strict, |
|---|
| 48 | [ --enable-strict Enable error on compilation warning [default=no]], |
|---|
| 49 | [wall_werror=$enableval], |
|---|
| 50 | [ |
|---|
| 51 | if test "$USER" = "smorlat" ; then |
|---|
| 52 | wall_werror=yes |
|---|
| 53 | else |
|---|
| 54 | wall_werror=no |
|---|
| 55 | fi |
|---|
| 56 | ] |
|---|
| 57 | ) |
|---|
| 58 | |
|---|
| 59 | CFLAGS="-DORTP_INET6 $CFLAGS " |
|---|
| 60 | |
|---|
| 61 | dnl enable ipv6 support |
|---|
| 62 | AC_ARG_ENABLE(ipv6, |
|---|
| 63 | [ --enable-ipv6 Turn on ipv6 support], |
|---|
| 64 | [case "${enableval}" in |
|---|
| 65 | yes) ipv6=true;; |
|---|
| 66 | no) ipv6=false;; |
|---|
| 67 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;; |
|---|
| 68 | esac],[ipv6=true]) |
|---|
| 69 | if test x$ipv6 = xtrue ; then |
|---|
| 70 | CFLAGS="$CFLAGS -DINET6" |
|---|
| 71 | fi |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | AC_ARG_ENABLE(debug, |
|---|
| 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");; |
|---|
| 80 | esac], |
|---|
| 81 | [debug_enabled=no] ) |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | dnl Checks for programs. |
|---|
| 85 | AC_PROG_CC |
|---|
| 86 | AC_PROG_CXX |
|---|
| 87 | AC_PROG_OBJC |
|---|
| 88 | AC_LIBTOOL_WIN32_DLL |
|---|
| 89 | AC_PROG_LIBTOOL |
|---|
| 90 | AC_ENABLE_SHARED(yes) |
|---|
| 91 | AC_ENABLE_STATIC(no) |
|---|
| 92 | |
|---|
| 93 | if test "$GCC" != "yes" ; then |
|---|
| 94 | case $target_os in |
|---|
| 95 | *hpux*) |
|---|
| 96 | dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS |
|---|
| 97 | CFLAGS="$CFLAGS +O2 -g " |
|---|
| 98 | ;; |
|---|
| 99 | esac |
|---|
| 100 | else |
|---|
| 101 | CFLAGS="$CFLAGS -Wall" |
|---|
| 102 | fi |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | if test $debug_enabled = "yes"; then |
|---|
| 107 | CFLAGS="$CFLAGS -g -DDEBUG" |
|---|
| 108 | else |
|---|
| 109 | CFLAGS="$CFLAGS -O2 -g " |
|---|
| 110 | fi |
|---|
| 111 | |
|---|
| 112 | dnl Checks for header files. |
|---|
| 113 | AC_HEADER_STDC |
|---|
| 114 | |
|---|
| 115 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 116 | AC_C_CONST |
|---|
| 117 | AC_C_INLINE |
|---|
| 118 | AC_HEADER_TIME |
|---|
| 119 | AC_WORDS_BIGENDIAN |
|---|
| 120 | if test x$ac_cv_c_bigendian = xyes ; then |
|---|
| 121 | CFLAGS="$CFLAGS -D_BIGENDIAN " |
|---|
| 122 | fi |
|---|
| 123 | |
|---|
| 124 | if test $GCC = yes && test $wall_werror = yes; then |
|---|
| 125 | CFLAGS="$CFLAGS -Werror " |
|---|
| 126 | fi |
|---|
| 127 | |
|---|
| 128 | macosx_found=no |
|---|
| 129 | |
|---|
| 130 | dnl add thread flags |
|---|
| 131 | case $target_os in |
|---|
| 132 | *darwin*) |
|---|
| 133 | MSPLUGINS_CFLAGS="" |
|---|
| 134 | MSPLUGINS_LIBS="-dynamiclib" |
|---|
| 135 | macosx_found=yes |
|---|
| 136 | LIBS="$LIBS -framework CoreFoundation -framework Cocoa" |
|---|
| 137 | ;; |
|---|
| 138 | *mingw*) |
|---|
| 139 | CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" |
|---|
| 140 | CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" |
|---|
| 141 | dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux |
|---|
| 142 | LIBS="$LIBS -lws2_32 -lwinmm " |
|---|
| 143 | mingw_found=yes |
|---|
| 144 | ;; |
|---|
| 145 | *) |
|---|
| 146 | MSPLUGINS_CFLAGS="-pthread" |
|---|
| 147 | MSPLUGINS_LIBS="-shared -pthread" |
|---|
| 148 | CFLAGS="$CFLAGS -pthread -D_REENTRANT" |
|---|
| 149 | LIBS="$LIBS -pthread -lpthread" |
|---|
| 150 | ;; |
|---|
| 151 | esac |
|---|
| 152 | |
|---|
| 153 | AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes) |
|---|
| 154 | |
|---|
| 155 | AC_CONFIG_COMMANDS([libtool-hacking],[ |
|---|
| 156 | if test "$mingw_found" = "yes" ; then |
|---|
| 157 | echo "Hacking libtool to work with mingw..." |
|---|
| 158 | sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp |
|---|
| 159 | cp -f ./libtool.tmp ./libtool |
|---|
| 160 | rm -f ./libtool.tmp |
|---|
| 161 | else |
|---|
| 162 | echo "No need to hack libtool." |
|---|
| 163 | fi |
|---|
| 164 | ], [mingw_found=$mingw_found]) |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | dnl prefer fixed point computations |
|---|
| 168 | AC_ARG_ENABLE(fixed_point, |
|---|
| 169 | [ --enable-fixed-point Turn on fixed point computations (default: guess)], |
|---|
| 170 | [case "${enableval}" in |
|---|
| 171 | yes) fixed_point=true;; |
|---|
| 172 | no) fixed_point=false;; |
|---|
| 173 | guess) fixed_point=guess;; |
|---|
| 174 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-fixed-point) ;; |
|---|
| 175 | esac],[fixed_point=guess]) |
|---|
| 176 | |
|---|
| 177 | if test "$fixed_point" = "guess" ; then |
|---|
| 178 | AC_MSG_CHECKING([whether fixed point arithmetic is preferred]) |
|---|
| 179 | case ${target_cpu}${host_cpu} in |
|---|
| 180 | *bfin*) |
|---|
| 181 | fixed_point=true |
|---|
| 182 | ;; |
|---|
| 183 | *arm*) |
|---|
| 184 | fixed_point=true |
|---|
| 185 | ;; |
|---|
| 186 | *) |
|---|
| 187 | fixed_point=false |
|---|
| 188 | ;; |
|---|
| 189 | esac |
|---|
| 190 | AC_MSG_RESULT([$fixed_point]) |
|---|
| 191 | fi |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | if test x$fixed_point = xtrue ; then |
|---|
| 195 | MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT" |
|---|
| 196 | fi |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | dnl initialize pkg-config so that we can use it within if else fi statements. |
|---|
| 200 | PKG_PROG_PKG_CONFIG() |
|---|
| 201 | |
|---|
| 202 | AC_SUBST(MSPLUGINS_CFLAGS) |
|---|
| 203 | AC_SUBST(MSPLUGINS_LIBS) |
|---|
| 204 | |
|---|
| 205 | AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"]) |
|---|
| 206 | |
|---|
| 207 | dnl ********************************* |
|---|
| 208 | dnl various checks for soundcard apis |
|---|
| 209 | dnl ********************************* |
|---|
| 210 | |
|---|
| 211 | found_sound=no |
|---|
| 212 | |
|---|
| 213 | if test x$mingw_found = xyes ; then |
|---|
| 214 | found_sound=yes |
|---|
| 215 | fi |
|---|
| 216 | |
|---|
| 217 | AC_ARG_ENABLE(oss, |
|---|
| 218 | [ --enable-oss Disable oss support], |
|---|
| 219 | [case "${enableval}" in |
|---|
| 220 | yes) oss=true ;; |
|---|
| 221 | no) oss=false ;; |
|---|
| 222 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;; |
|---|
| 223 | esac],[oss=true]) |
|---|
| 224 | |
|---|
| 225 | if "$oss" = "true"; then |
|---|
| 226 | AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h) |
|---|
| 227 | if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \ |
|---|
| 228 | test "${ac_cv_header_soundcard_h}" = "yes" || \ |
|---|
| 229 | test "${ac_cv_header_sys_audio_h}" = "yes" || \ |
|---|
| 230 | test "${ac_cv_header_machine_soundcard_h}" = "yes"; then |
|---|
| 231 | found_sound=yes |
|---|
| 232 | else |
|---|
| 233 | oss=false |
|---|
| 234 | fi |
|---|
| 235 | fi |
|---|
| 236 | |
|---|
| 237 | AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue) |
|---|
| 238 | |
|---|
| 239 | dnl conditionnal build of ALSA support |
|---|
| 240 | AC_ARG_ENABLE(alsa, |
|---|
| 241 | [ --enable-alsa Turn on alsa native support compiling], |
|---|
| 242 | [case "${enableval}" in |
|---|
| 243 | yes) alsa=true ;; |
|---|
| 244 | no) alsa=false ;; |
|---|
| 245 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;; |
|---|
| 246 | esac],[alsa=true]) |
|---|
| 247 | |
|---|
| 248 | if test "$alsa" = "true"; then |
|---|
| 249 | AC_CHECK_HEADERS(alsa/asoundlib.h, |
|---|
| 250 | [ AC_CHECK_LIB(asound,snd_pcm_open, |
|---|
| 251 | [ ALSA_LIBS="-lasound" |
|---|
| 252 | found_sound=yes |
|---|
| 253 | AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available]) |
|---|
| 254 | alsa_enabled=true |
|---|
| 255 | ]) |
|---|
| 256 | ] |
|---|
| 257 | ) |
|---|
| 258 | fi |
|---|
| 259 | AC_SUBST(ALSA_LIBS) |
|---|
| 260 | |
|---|
| 261 | AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue) |
|---|
| 262 | |
|---|
| 263 | |
|---|
| 264 | AC_ARG_ENABLE(artsc, |
|---|
| 265 | [ --enable-artsc Turn on artsc (kde<4) sound input/output (no) ], |
|---|
| 266 | [case "${enableval}" in |
|---|
| 267 | yes) artsc=true ;; |
|---|
| 268 | no) artsc=false ;; |
|---|
| 269 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;; |
|---|
| 270 | esac],[artsc=no]) |
|---|
| 271 | |
|---|
| 272 | arts_enabled=false |
|---|
| 273 | |
|---|
| 274 | if test "$artsc" = "true" ; then |
|---|
| 275 | |
|---|
| 276 | dnl check for arts (kde sound daemon) support |
|---|
| 277 | PKG_CHECK_MODULES(ARTS, [artsc],[ |
|---|
| 278 | dnl New detection |
|---|
| 279 | arts_enabled=true |
|---|
| 280 | ],[ |
|---|
| 281 | dnl Old detection |
|---|
| 282 | if test x$artsc = xtrue ; then |
|---|
| 283 | AC_CHECK_HEADERS(kde/artsc/artsc.h, |
|---|
| 284 | [ AC_CHECK_LIB(artsc,arts_init, |
|---|
| 285 | [ ARTS_LIBS="-lartsc" |
|---|
| 286 | arts_enabled=true |
|---|
| 287 | ]) |
|---|
| 288 | ] |
|---|
| 289 | ) |
|---|
| 290 | fi |
|---|
| 291 | AC_SUBST(ARTS_LIBS) |
|---|
| 292 | ]) |
|---|
| 293 | fi |
|---|
| 294 | |
|---|
| 295 | if test x$arts_enabled = xtrue; then |
|---|
| 296 | found_sound=yes |
|---|
| 297 | AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available]) |
|---|
| 298 | fi |
|---|
| 299 | |
|---|
| 300 | AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue) |
|---|
| 301 | |
|---|
| 302 | AC_ARG_ENABLE(portaudio, |
|---|
| 303 | [ --enable-portaudio Turn on portaudio native support compiling], |
|---|
| 304 | [case "${enableval}" in |
|---|
| 305 | yes) portaudio=true ;; |
|---|
| 306 | no) portaudio=false ;; |
|---|
| 307 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;; |
|---|
| 308 | esac],[portaudio=false]) |
|---|
| 309 | |
|---|
| 310 | if test "$portaudio" = "true"; then |
|---|
| 311 | AC_CHECK_HEADERS(portaudio.h, |
|---|
| 312 | [ AC_CHECK_LIB(portaudio,Pa_Initialize, |
|---|
| 313 | [ PORTAUDIO_LIBS="-lportaudio" |
|---|
| 314 | found_sound=yes |
|---|
| 315 | AC_DEFINE(__PORTAUDIO_ENABLED__,1,[defined if portaudio support is available]) |
|---|
| 316 | portaudio_enabled=true |
|---|
| 317 | ]) |
|---|
| 318 | ] |
|---|
| 319 | ) |
|---|
| 320 | fi |
|---|
| 321 | |
|---|
| 322 | AC_SUBST(PORTAUDIO_LIBS) |
|---|
| 323 | AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue) |
|---|
| 324 | |
|---|
| 325 | AC_ARG_ENABLE(macsnd, |
|---|
| 326 | [ --enable-macsnd Turn on native macosx sound support (default=no)], |
|---|
| 327 | [case "${enableval}" in |
|---|
| 328 | yes) macsnd=true ;; |
|---|
| 329 | no) macsnd=false ;; |
|---|
| 330 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;; |
|---|
| 331 | esac],[macsnd=false]) |
|---|
| 332 | |
|---|
| 333 | if test "$macsnd" = "true"; then |
|---|
| 334 | AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available]) |
|---|
| 335 | macsnd_enabled=true |
|---|
| 336 | found_sound=yes |
|---|
| 337 | fi |
|---|
| 338 | |
|---|
| 339 | AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue) |
|---|
| 340 | |
|---|
| 341 | AC_ARG_ENABLE(macaqsnd, |
|---|
| 342 | [ --enable-macaqsnd Turn on native macosx Audio Queue sound support (default=yes)], |
|---|
| 343 | [case "${enableval}" in |
|---|
| 344 | yes) macaqsnd=true ;; |
|---|
| 345 | no) macaqsnd=false ;; |
|---|
| 346 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;; |
|---|
| 347 | esac],[macaqsnd=true]) |
|---|
| 348 | |
|---|
| 349 | if test "$macosx_found" != "yes" ; then |
|---|
| 350 | macaqsnd=false |
|---|
| 351 | fi |
|---|
| 352 | |
|---|
| 353 | if test "$macaqsnd" = "true"; then |
|---|
| 354 | AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available]) |
|---|
| 355 | found_sound=yes |
|---|
| 356 | fi |
|---|
| 357 | |
|---|
| 358 | AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue) |
|---|
| 359 | |
|---|
| 360 | AC_ARG_ENABLE(jack, |
|---|
| 361 | [ --disable-jack Disable jack support], |
|---|
| 362 | [case "${enableval}" in |
|---|
| 363 | yes) jack=true ;; |
|---|
| 364 | no) jack=false ;; |
|---|
| 365 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;; |
|---|
| 366 | esac],[jack=true]) |
|---|
| 367 | |
|---|
| 368 | if test x$jack = xtrue; then |
|---|
| 369 | |
|---|
| 370 | dnl Check for samplerate libraries |
|---|
| 371 | dnl Check for jack libraries (sound output plugin) |
|---|
| 372 | PKG_CHECK_MODULES(JACK,jack >= 0.15.0, |
|---|
| 373 | [ |
|---|
| 374 | dnl we' found jack devel files |
|---|
| 375 | PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13, |
|---|
| 376 | [AC_DEFINE(__JACK_ENABLED__,1,[Jack support]) |
|---|
| 377 | found_sound=yes |
|---|
| 378 | jack_found=yes] , |
|---|
| 379 | [echo "libsamplerate not found, jack support disabled."]) |
|---|
| 380 | AC_SUBST(SAMPLERATE_CFLAGS) |
|---|
| 381 | AC_SUBST(SAMPLERATE_LIBS) |
|---|
| 382 | ], |
|---|
| 383 | [echo "No jack support."] ) |
|---|
| 384 | |
|---|
| 385 | if test x$jack_found = xno ; then |
|---|
| 386 | dnl reset flags |
|---|
| 387 | JACK_CFLAGS= |
|---|
| 388 | JACK_LIBS= |
|---|
| 389 | SAMPLERATE_CFLAGS= |
|---|
| 390 | SAMPLERATE_LIBS= |
|---|
| 391 | fi |
|---|
| 392 | |
|---|
| 393 | AC_SUBST(JACK_CFLAGS) |
|---|
| 394 | AC_SUBST(JACK_LIBS) |
|---|
| 395 | |
|---|
| 396 | fi |
|---|
| 397 | |
|---|
| 398 | if test "$found_sound" = "no"; then |
|---|
| 399 | AC_MSG_ERROR([Could not find a support sound driver API]) |
|---|
| 400 | fi |
|---|
| 401 | |
|---|
| 402 | |
|---|
| 403 | dnl ************************************* |
|---|
| 404 | dnl check for various codecs libraries |
|---|
| 405 | dnl ************************************* |
|---|
| 406 | |
|---|
| 407 | AC_ARG_ENABLE(speex, |
|---|
| 408 | [ --disable-speex Disable speex support], |
|---|
| 409 | [case "${enableval}" in |
|---|
| 410 | yes) speex=true ;; |
|---|
| 411 | no) speex=false ;; |
|---|
| 412 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;; |
|---|
| 413 | esac],[speex=true]) |
|---|
| 414 | |
|---|
| 415 | if test x$speex = xtrue; then |
|---|
| 416 | |
|---|
| 417 | dnl check for installed version of speex |
|---|
| 418 | PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, |
|---|
| 419 | [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ], |
|---|
| 420 | [try_other_speex=yes] |
|---|
| 421 | ) |
|---|
| 422 | PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes) |
|---|
| 423 | build_resample=false |
|---|
| 424 | PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3, |
|---|
| 425 | [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS" |
|---|
| 426 | AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library]) |
|---|
| 427 | build_resample=yes] , |
|---|
| 428 | [AC_MSG_NOTICE([No speexdsp library found.]) |
|---|
| 429 | ] |
|---|
| 430 | ) |
|---|
| 431 | AC_SUBST(SPEEX_CFLAGS) |
|---|
| 432 | AC_SUBST(SPEEX_LIBS) |
|---|
| 433 | |
|---|
| 434 | fi |
|---|
| 435 | |
|---|
| 436 | AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes ) |
|---|
| 437 | AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes ) |
|---|
| 438 | |
|---|
| 439 | AC_ARG_ENABLE(gsm, |
|---|
| 440 | [ --disable-gsm Disable gsm support], |
|---|
| 441 | [case "${enableval}" in |
|---|
| 442 | yes) gsm=true ;; |
|---|
| 443 | no) gsm=false ;; |
|---|
| 444 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;; |
|---|
| 445 | esac],[gsm=true]) |
|---|
| 446 | |
|---|
| 447 | if test x$gsm = xtrue; then |
|---|
| 448 | |
|---|
| 449 | dnl check for gsm |
|---|
| 450 | build_gsm=no |
|---|
| 451 | AC_ARG_WITH( gsm, |
|---|
| 452 | [ --with-gsm Sets the installation prefix of gsm codec library [default=/usr] ], |
|---|
| 453 | [ gsmdir=${withval}],[ gsmdir=/usr ]) |
|---|
| 454 | |
|---|
| 455 | if test x"$gsmdir" != xno ; then |
|---|
| 456 | test x"$gmsdir" = xyes && gsmdir=/usr |
|---|
| 457 | MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include], |
|---|
| 458 | [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create]) |
|---|
| 459 | if test "$GSM_found" = "yes" ; then |
|---|
| 460 | build_gsm=yes |
|---|
| 461 | fi |
|---|
| 462 | else |
|---|
| 463 | build_gsm=no |
|---|
| 464 | fi |
|---|
| 465 | |
|---|
| 466 | fi |
|---|
| 467 | |
|---|
| 468 | AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes ) |
|---|
| 469 | |
|---|
| 470 | MS_CHECK_VIDEO |
|---|
| 471 | AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true") |
|---|
| 472 | AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes") |
|---|
| 473 | AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes") |
|---|
| 474 | |
|---|
| 475 | dnl ********************************************* |
|---|
| 476 | dnl setup oRTP dependency |
|---|
| 477 | dnl ********************************************* |
|---|
| 478 | AC_ARG_ENABLE(external-ortp, |
|---|
| 479 | [ --enable-external-ortp Use external oRTP library], |
|---|
| 480 | [case "${enableval}" in |
|---|
| 481 | yes) external_ortp=true ;; |
|---|
| 482 | no) external_ortp=false ;; |
|---|
| 483 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;; |
|---|
| 484 | esac],[external_ortp=false]) |
|---|
| 485 | |
|---|
| 486 | if test "$external_ortp" = 'false'; then |
|---|
| 487 | if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then |
|---|
| 488 | echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h" |
|---|
| 489 | ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include" |
|---|
| 490 | ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la" |
|---|
| 491 | if test x$ac_cv_c_bigendian = xyes ; then |
|---|
| 492 | ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN" |
|---|
| 493 | fi |
|---|
| 494 | else |
|---|
| 495 | external_ortp=true |
|---|
| 496 | fi |
|---|
| 497 | fi |
|---|
| 498 | if test "$external_ortp" = 'true'; then |
|---|
| 499 | PKG_CHECK_MODULES(ORTP, ortp >= 0.9.0, , |
|---|
| 500 | [ AC_MSG_ERROR([Couldn't find ortp library]) ] ) |
|---|
| 501 | fi |
|---|
| 502 | AC_SUBST(ORTP_CFLAGS) |
|---|
| 503 | AC_SUBST(ORTP_LIBS) |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins |
|---|
| 507 | AC_CHECK_HEADERS(dlfcn.h) |
|---|
| 508 | have_dlopen=false |
|---|
| 509 | AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true]) |
|---|
| 510 | AC_CHECK_FUNC(dlopen,[have_dlopen=true]) |
|---|
| 511 | if test "$have_dlopen" = "true" ; then |
|---|
| 512 | AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable]) |
|---|
| 513 | fi |
|---|
| 514 | |
|---|
| 515 | dnl check various things |
|---|
| 516 | AC_FUNC_ALLOCA |
|---|
| 517 | |
|---|
| 518 | if test "x${prefix}" = "xNONE"; then |
|---|
| 519 | package_prefix=${ac_default_prefix} |
|---|
| 520 | else |
|---|
| 521 | package_prefix=${prefix} |
|---|
| 522 | fi |
|---|
| 523 | |
|---|
| 524 | if test x$mingw_found = xyes ; then |
|---|
| 525 | package_prefix="." |
|---|
| 526 | fi |
|---|
| 527 | |
|---|
| 528 | dnl define path of plugins: |
|---|
| 529 | AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${package_prefix}/lib/mediastreamer/plugins" ,[path of plugins]) |
|---|
| 530 | PACKAGE_PLUGINS_DIR="${package_prefix}/lib/mediastreamer/plugins" |
|---|
| 531 | AC_SUBST(PACKAGE_PLUGINS_DIR) |
|---|
| 532 | |
|---|
| 533 | PACKAGE_DATA_DIR="$prefix/share" |
|---|
| 534 | AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data]) |
|---|
| 535 | AC_SUBST(PACKAGE_DATA_DIR) |
|---|
| 536 | |
|---|
| 537 | dnl check for video4linux headers |
|---|
| 538 | AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h) |
|---|
| 539 | if test "${ac_cv_header_linux_videodev_h}" = "yes" || \ |
|---|
| 540 | test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then |
|---|
| 541 | found_v4l=yes |
|---|
| 542 | else |
|---|
| 543 | found_v4l=no |
|---|
| 544 | fi |
|---|
| 545 | |
|---|
| 546 | AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes ) |
|---|
| 547 | |
|---|
| 548 | PKG_CHECK_MODULES(LIBV4L2, libv4l2,[echo "libv4l2 found"],[echo "libv4l2 not found]) |
|---|
| 549 | PKG_CHECK_MODULES(LIBV4L1, libv4l1,[echo "libv4l1 found"],[echo "libv4l1 not found]) |
|---|
| 550 | |
|---|
| 551 | dnl ################################################## |
|---|
| 552 | dnl # Check for doxygen |
|---|
| 553 | dnl ################################################## |
|---|
| 554 | |
|---|
| 555 | AC_PATH_PROG(DOXYGEN,doxygen,false) |
|---|
| 556 | AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) |
|---|
| 557 | |
|---|
| 558 | |
|---|
| 559 | dnl ################################################## |
|---|
| 560 | dnl # Check for ESP Packager |
|---|
| 561 | dnl ################################################## |
|---|
| 562 | |
|---|
| 563 | AC_PATH_PROG(EPM,epm,false) |
|---|
| 564 | AC_PATH_PROG(MKEPMLIST,mkepmlist,false) |
|---|
| 565 | AC_PATH_PROG(EPMINSTALL,epminstall,false) |
|---|
| 566 | AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false) |
|---|
| 567 | |
|---|
| 568 | |
|---|
| 569 | # Preferred packaging system, as per EPM terminology |
|---|
| 570 | case $target in |
|---|
| 571 | *-*-linux*) |
|---|
| 572 | if test -f /etc/debian_version ; then |
|---|
| 573 | EPM_PKG_EXT=deb |
|---|
| 574 | else |
|---|
| 575 | EPM_PKG_EXT=rpm |
|---|
| 576 | fi |
|---|
| 577 | ;; |
|---|
| 578 | *-hp-hpux*) |
|---|
| 579 | EPM_PKG_EXT=depot.gz;; |
|---|
| 580 | *-dec-osf*) |
|---|
| 581 | EPM_PKG_EXT=setld;; |
|---|
| 582 | esac |
|---|
| 583 | AC_SUBST(EPM_PKG_EXT) |
|---|
| 584 | |
|---|
| 585 | # System software User & Group names |
|---|
| 586 | case $target in |
|---|
| 587 | *-*-linux*) |
|---|
| 588 | SYS_USER=root |
|---|
| 589 | SYS_GROUP=root |
|---|
| 590 | ;; |
|---|
| 591 | *-*-hpux*|*-dec-osf*) |
|---|
| 592 | SYS_USER=bin |
|---|
| 593 | SYS_GROUP=bin |
|---|
| 594 | ;; |
|---|
| 595 | esac |
|---|
| 596 | AC_SUBST(SYS_USER) |
|---|
| 597 | AC_SUBST(SYS_GROUP) |
|---|
| 598 | |
|---|
| 599 | # CPU Architecture |
|---|
| 600 | case $target_cpu in |
|---|
| 601 | i?86) ARCH=i386;; |
|---|
| 602 | *) ARCH=$target_cpu;; |
|---|
| 603 | esac |
|---|
| 604 | AC_SUBST(ARCH) |
|---|
| 605 | |
|---|
| 606 | # Various other packaging variables, that can be over-ridden ad `make |
|---|
| 607 | # package' time |
|---|
| 608 | SUMMARY="A mediastreaming library." |
|---|
| 609 | AC_SUBST(SUMMARY) |
|---|
| 610 | PACKAGER=anonymous |
|---|
| 611 | AC_SUBST(PACKAGER) |
|---|
| 612 | LICENSE=GPL |
|---|
| 613 | AC_SUBST(LICENSE) |
|---|
| 614 | VENDOR=Linphone |
|---|
| 615 | AC_SUBST(VENDOR) |
|---|
| 616 | RELEASE=1 |
|---|
| 617 | AC_SUBST(RELEASE) |
|---|
| 618 | |
|---|
| 619 | CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS" |
|---|
| 620 | CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS" |
|---|
| 621 | dnl: these ones gets exported in pkgconfig file. |
|---|
| 622 | AC_SUBST(MS_PUBLIC_CFLAGS) |
|---|
| 623 | |
|---|
| 624 | AC_OUTPUT( |
|---|
| 625 | Makefile |
|---|
| 626 | include/Makefile |
|---|
| 627 | include/mediastreamer2/Makefile |
|---|
| 628 | src/Makefile |
|---|
| 629 | tests/Makefile |
|---|
| 630 | build/Makefile |
|---|
| 631 | build/win32native/Makefile |
|---|
| 632 | build/win32-novideo/Makefile |
|---|
| 633 | build/wince/Makefile |
|---|
| 634 | mediastreamer.pc |
|---|
| 635 | mediastreamer2.spec |
|---|
| 636 | help/Makefile |
|---|
| 637 | help/Doxyfile |
|---|
| 638 | help/doxygen.dox |
|---|
| 639 | ) |
|---|