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