source: mediastreamer2/configure.ac

tip
Last change on this file was 3620:a058f4f688e2, checked in by laurent <laurent@…>, 7 months ago

merge linphone master

File size: 23.6 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([mediastreamer],[2.8.99])
3
4AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION           A mediastreaming library for telephony application.])
5AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
6
7AC_CANONICAL_SYSTEM
8
9dnl Source packaging numbers
10MEDIASTREAMER_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
11MEDIASTREAMER_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
12MEDIASTREAMER_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
13MEDIASTREAMER_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
14
15LIBMEDIASTREAMER_SO_CURRENT=2 dnl increment this number when you add/change/remove an interface
16LIBMEDIASTREAMER_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
17LIBMEDIASTREAMER_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
18
19LIBMEDIASTREAMER_SO_VERSION=$LIBMEDIASTREAMER_SO_CURRENT:$LIBMEDIASTREAMER_SO_REVISION:$LIBMEDIASTREAMER_SO_AGE
20MEDIASTREAMER_VERSION=${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION}
21
22if test -n "$MEDIASTREAMER_EXTRA_VERSION" ; then
23        MEDIASTREAMER_VERSION="${MEDIASTREAMER_VERSION}.${MEDIASTREAMER_EXTRA_VERSION}"
24fi
25
26AC_SUBST(LIBMEDIASTREAMER_SO_VERSION)
27AC_SUBST(MEDIASTREAMER_VERSION)
28
29PACKAGE=mediastreamer
30
31OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
32AC_MSG_RESULT([Building Package on ${OS}])
33
34AM_INIT_AUTOMAKE([tar-ustar])
35m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
36AC_CONFIG_HEADERS(mediastreamer-config.h)
37AC_DEFINE_UNQUOTED(MEDIASTREAMER_MAJOR_VERSION,$MEDIASTREAMER_MAJOR_VERSION, [major version])
38AC_DEFINE_UNQUOTED(MEDIASTREAMER_MINOR_VERSION,$MEDIASTREAMER_MINOR_VERSION, [minor version])
39AC_DEFINE_UNQUOTED(MEDIASTREAMER_MICRO_VERSION,$MEDIASTREAMER_MICRO_VERSION, [micro version])
40AC_DEFINE_UNQUOTED(MEDIASTREAMER_VERSION,"$MEDIASTREAMER_VERSION",[MEDIASTREAMER version number])
41
42MS_PUBLIC_CFLAGS=
43
44AC_SUBST([mkdir_p])
45
46AC_MSG_CHECKING([warning make an error on compilation])
47AC_ARG_ENABLE(strict,
48[AS_HELP_STRING([--enable-strict], [Enable error on compilation warning (default=no)])],
49[wall_werror=$enableval],
50[wall_werror=yes]
51)
52
53CFLAGS="-DORTP_INET6 $CFLAGS "
54
55dnl enable ipv6 support
56AC_ARG_ENABLE(ipv6,
57      [AS_HELP_STRING([--enable-ipv6], [Turn on IPv6 support (default=yes)])],
58      [case "${enableval}" in
59        yes)  ipv6=true;;
60        no)   ipv6=false;;
61        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
62      esac],[ipv6=true])
63if test x$ipv6 = xtrue ; then
64        CFLAGS="$CFLAGS -DINET6"
65fi
66
67dnl enable timestamp support
68AC_ARG_ENABLE(ntp-timestamp,
69      [AS_HELP_STRING([--enable-ntp-timestamp], [Turn on NTP timestamping on received packet (default=no)])],
70      [case "${enableval}" in
71        yes)  ntptimestamp=true;;
72        no)   ntptimestamp=false;;
73        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ntp-timestamp) ;;
74      esac],[ntptimestamp=false])
75
76dnl Checks for programs.
77AC_PROG_CXX
78AC_PROG_CC
79AC_PROG_OBJC
80
81AC_CONFIG_MACRO_DIR([m4])
82LT_INIT([win32-dll shared disable-static])
83
84
85AC_SUBST([LIBTOOL_DEPS])
86
87if test "$GCC" != "yes" ; then
88        case $target_os in
89                *hpux*)
90                        dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS
91                        CFLAGS="$CFLAGS +O2 -g "
92                        ;;
93        esac
94else
95        CFLAGS="$CFLAGS -Wall -fdiagnostics-show-option"
96fi
97
98AC_ARG_ENABLE([debug],
99                        AS_HELP_STRING([--enable-debug=@<:@yes/no@:>@],[enables the display of traces showing the execution of the library. @<:@default=yes@:>@]),
100                        [],                                                                                     dnl [action-if-given]
101                        [enable_debug=no])                                                      dnl [action-if-not-given]
102
103
104AS_CASE([$enable_debug],
105                [yes],[
106                        CFLAGS="$CFLAGS -g -DDEBUG"
107                        CXXFLAGS="$CXXFLAGS -g -DDEBUG"
108                ],
109                [no],
110                [
111                        case "$CFLAGS" in
112                                *-O*)
113                                ;;
114                                *)
115                                CFLAGS="$CFLAGS -O2 -g"
116                                CXXFLAGS="$CXXFLAGS -O2 -g"
117                                ;;
118                        esac
119                ],
120                [AC_MSG_ERROR([Bad value ($enable_debug) for --enable-debug. Valid values are yes or no.])])
121
122dnl Checks for header files.
123AC_HEADER_STDC
124
125dnl Checks for typedefs, structures, and compiler characteristics.
126AC_C_CONST
127AC_C_INLINE
128AC_HEADER_TIME
129AC_WORDS_BIGENDIAN
130if test x$ac_cv_c_bigendian = xyes ; then
131        CFLAGS="$CFLAGS -D_BIGENDIAN "
132fi
133
134if test $GCC = yes && test $wall_werror = yes;  then
135        CFLAGS="$CFLAGS -Werror -Wno-error=deprecated-declarations"
136fi
137
138macosx_found=no
139ios_found=false
140mingw32ce_found=no
141ios_found=no
142
143dnl add thread flags
144case $host in
145        i386-apple*|armv6-apple*|armv7-apple*|armv7s-apple*)
146                ios_found=yes
147        ;;
148        x86_64-apple*)
149                macosx_found=yes
150        ;;
151        *mingw32ce)
152                CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501  -D_WIN32_WCE  -DORTP_STATIC"
153                CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC  -D_WIN32_WCE"
154dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
155                LIBS="$LIBS -lws2"
156                mingw_found=yes
157                mingw32ce_found=yes
158    ;;
159        *mingw*)
160                CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
161                CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
162dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
163                LIBS="$LIBS -lws2_32 -lwinmm "
164                mingw_found=yes
165        ;;
166  *)
167     MSPLUGINS_CFLAGS="-pthread"
168     MSPLUGINS_LIBS="-shared -pthread"
169     CFLAGS="$CFLAGS -pthread -D_REENTRANT"
170     LIBS="$LIBS -pthread -lpthread"
171     ;;
172esac
173
174if test "$macosx_found" == "yes" ; then
175        LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio -framework AppKit"
176fi
177if test "$ios_found" == "yes" ; then
178        LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio "
179fi
180dnl localization tools
181IT_PROG_INTLTOOL([0.40], [no-xml])
182
183
184GETTEXT_PACKAGE="mediastreamer"
185AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,["mediastreamer"],[name of the gettext domain. Used in the call to 'bindtextdomain()'])
186AC_SUBST([GETTEXT_PACKAGE])
187if test "$mingw_found" != "yes" ; then
188        dnl gettext macro does not work properly under mingw. And we want to use the one provided by GTK.
189        AM_GNU_GETTEXT([external])
190        AM_GNU_GETTEXT_VERSION([0.18])
191        LIBS="$LIBS $LIBINTL"
192else
193        AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
194        AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
195        LIBS="$LIBS -lintl"
196fi
197
198AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
199AM_CONDITIONAL(BUILD_IOS, test x$ios_found = xyes)
200
201AC_CONFIG_COMMANDS([libtool-hacking],[
202if test "$mingw_found" = "yes" ; then
203        echo "Hacking libtool to work with mingw..."
204        sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
205        cp -f ./libtool.tmp ./libtool
206        rm -f ./libtool.tmp
207else
208        echo "No need to hack libtool."
209fi
210], [mingw_found=$mingw_found])
211
212
213dnl prefer fixed point computations
214AC_ARG_ENABLE(fixed_point,
215      [AS_HELP_STRING([--enable-fixed-point=@<:@yes/no/guess@:>@], [Turn on fixed point computations (default=guess)])],
216      [case "${enableval}" in
217        yes)  fixed_point=true;;
218        no)   fixed_point=false;;
219        guess) fixed_point=guess;;
220        *) AC_MSG_ERROR(bad value ${enableval} for --enable-fixed-point) ;;
221      esac],[fixed_point=guess])
222
223if test "$fixed_point" = "guess" ; then
224        AC_MSG_CHECKING([whether fixed point arithmetic is preferred])
225        case ${target_cpu}${host_cpu} in
226                *bfin*)
227                        fixed_point=true
228                ;;
229                *arm*)
230                        fixed_point=true
231                ;;
232                *)
233                        fixed_point=false
234                ;;
235        esac
236        AC_MSG_RESULT([$fixed_point])
237fi
238
239
240if test x$fixed_point = xtrue ; then
241        MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT"
242fi
243
244
245dnl initialize pkg-config so that we can use it within if else fi statements.
246PKG_PROG_PKG_CONFIG()
247
248AC_SUBST(MSPLUGINS_CFLAGS)
249AC_SUBST(MSPLUGINS_LIBS)
250
251dnl     *********************************
252dnl     various checks for soundcard apis
253dnl     *********************************
254
255found_sound=no
256
257if test x$mingw_found = xyes ; then
258        found_sound=yes
259fi
260
261AC_ARG_ENABLE(sound,
262      [AS_HELP_STRING([--disable-sound], [Turn off all possible sound backend (default=no)])],
263      [case "${enableval}" in
264        yes) use_sound=true ;;
265        no)  use_sound=false ;;
266        *) AC_MSG_ERROR(bad value ${enableval} for --disable-sound) ;;
267      esac],[use_sound=true])
268
269AC_ARG_ENABLE(oss,
270      [AS_HELP_STRING([--enable-oss], [Enable oss support])],
271      [case "${enableval}" in
272        yes) oss=true ;;
273        no)  oss=false ;;
274        *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
275      esac],[oss=$use_sound])
276
277if "$oss" = "true"; then
278AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
279if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
280        test "${ac_cv_header_soundcard_h}" = "yes" || \
281                test "${ac_cv_header_sys_audio_h}" = "yes" || \
282        test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
283        found_sound=yes
284else
285        oss=false
286fi
287fi
288
289AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue)
290
291dnl conditionnal build of ALSA support
292AC_ARG_ENABLE(alsa,
293      [AS_HELP_STRING([--enable-alsa], [Turn on alsa native support compiling])],
294      [case "${enableval}" in
295        yes) alsa=true ;;
296        no)  alsa=false ;;
297        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
298      esac],[alsa=$use_sound])
299
300if test "$alsa" = "true"; then
301        AC_CHECK_HEADERS(alsa/asoundlib.h,
302                [ AC_CHECK_LIB(asound,snd_pcm_open,
303                        [ ALSA_LIBS="-lasound"
304                          found_sound=yes
305                        AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available])
306                        alsa_enabled=true
307                        ])
308                ]
309        )
310fi
311AC_SUBST(ALSA_LIBS)
312
313AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue)
314
315
316AC_ARG_ENABLE(artsc,
317      [AS_HELP_STRING([--enable-artsc], [Turn on artsc (KDE<4) sound input/output (default=no)])],
318      [case "${enableval}" in
319        yes) artsc=true ;;
320        no)  artsc=false ;;
321        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
322      esac],[artsc=false])
323
324arts_enabled=false
325
326if test "$artsc" = "true" ; then
327
328        dnl check for arts (kde sound daemon) support
329        PKG_CHECK_MODULES(ARTS, [artsc],[
330                dnl New detection
331                arts_enabled=true
332        ],[
333                dnl Old detection
334                if test x$artsc = xtrue ; then
335                        AC_CHECK_HEADERS(kde/artsc/artsc.h,
336                                [ AC_CHECK_LIB(artsc,arts_init,
337                                        [ ARTS_LIBS="-lartsc"
338                                        arts_enabled=true
339                                        ])
340                                ]
341                        )
342                fi
343                AC_SUBST(ARTS_LIBS)
344        ])
345fi
346
347if test x$arts_enabled = xtrue; then
348        found_sound=yes
349        AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available])
350fi
351
352AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue)
353
354AC_ARG_ENABLE(portaudio,
355      [AS_HELP_STRING([--enable-portaudio], [Turn on portaudio native support compiling (default=no)])],
356      [case "${enableval}" in
357        yes) portaudio=true ;;
358        no)  portaudio=false ;;
359        *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
360      esac],[portaudio=false])
361
362if test "$portaudio" = "true"; then
363        AC_CHECK_HEADERS(portaudio.h,
364                [ AC_CHECK_LIB(portaudio,Pa_Initialize,
365                        [ PORTAUDIO_LIBS="-lportaudio"
366                          found_sound=yes
367                        AC_DEFINE(__PORTAUDIO_ENABLED__,1,[defined if portaudio support is available])
368                        portaudio_enabled=true
369                        ])
370                ]
371        )
372fi
373
374AC_SUBST(PORTAUDIO_LIBS)
375AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue)
376
377AC_ARG_ENABLE(macsnd,
378      [AS_HELP_STRING([--enable-macsnd], [Turn on MAC OS X Audio Units sound support])],
379      [case "${enableval}" in
380        yes) macsnd=true ;;
381        no)  macsnd=false ;;
382        *) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;;
383      esac],[macsnd=$use_sound])
384
385macaqsnd_default=no
386if test "$ios_found" = "yes" ; then
387        macaqsnd_default=true;
388fi
389
390AC_ARG_ENABLE(macaqsnd,
391      [AS_HELP_STRING([--enable-macaqsnd], [Turn on native MAC OS X Audio Queue sound support (default=no)])],
392      [case "${enableval}" in
393        yes) macaqsnd=true ;;
394        no)  macaqsnd=false ;;
395        *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;;
396      esac],[macaqsnd=$macaqsnd_default])
397
398
399
400if test "$macosx_found" = "yes" ; then
401        if test "$macsnd" = "true"; then
402                AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available])
403                macsnd_enabled=true
404                LIBS="$LIBS -framework Carbon -framework AudioUnit"
405                found_sound=yes
406        fi
407fi
408
409if test "$macaqsnd" = "true"; then
410        AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
411        found_sound=yes
412        macaqsnd=true
413fi
414
415AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
416AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
417AM_CONDITIONAL(BUILD_IOSIOUNIT, test x$ios_found = xyes)
418
419AC_ARG_ENABLE(pulseaudio,
420      [AS_HELP_STRING([--disable-pulseaudio], [Disable pulseaudio support])],
421      [case "${enableval}" in
422        yes) pulseaudio=true ;;
423        no)  pulseaudio=false ;;
424        *) AC_MSG_ERROR(bad value ${enableval} for --disable-pulseaudio) ;;
425      esac],[pulseaudio=$use_sound])
426
427
428if test x$pulseaudio = xtrue ; then
429        PKG_CHECK_MODULES(LIBPULSE, libpulse >= 0.9.21,
430                [
431                AC_DEFINE(__PULSEAUDIO_ENABLED__,1,[Pulse audio support])
432                found_sound=yes
433                ],
434                [pulseaudio=false])
435fi
436
437AM_CONDITIONAL(BUILD_PULSEAUDIO,test x$pulseaudio = xtrue)
438
439
440if test "${found_sound}${use_sound}" = "noyes"; then
441        AC_MSG_ERROR([Could not find a support sound driver API. Use --disable-sound if you don't care about having sound.])
442fi
443
444
445dnl     *************************************
446dnl     check for various codecs libraries
447dnl     *************************************
448
449AC_ARG_ENABLE(speex,
450      [AS_HELP_STRING([--disable-speex], [Disable speex support])],
451      [case "${enableval}" in
452        yes) speex=true ;;
453        no)  speex=false ;;
454        *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;;
455      esac],[speex=true])
456
457if test x$speex = xtrue; then
458
459dnl check for installed version of speex
460PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3,
461        [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ],
462        [try_other_speex=yes]
463)
464PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes)
465build_resample=false
466PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3,
467    [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS"
468    AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library])
469    build_resample=yes] ,
470    [AC_MSG_ERROR([No libspeexdsp library found.])
471]
472)
473AC_SUBST(SPEEX_CFLAGS)
474AC_SUBST(SPEEX_LIBS)
475
476fi
477
478AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes )
479AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes )
480
481AC_ARG_ENABLE(gsm,
482      [AS_HELP_STRING([--disable-gsm], [Disable gsm support])],
483      [case "${enableval}" in
484        yes) gsm=true ;;
485        no)  gsm=false ;;
486        *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;;
487      esac],[gsm=auto])
488
489if test x$gsm != xfalse; then
490
491dnl check for gsm
492build_gsm=no
493AC_ARG_WITH( gsm,
494                  [  --with-gsm         Sets the installation prefix of gsm codec library [default=/usr] ],
495                  [ gsmdir=${withval}],[ gsmdir=/usr ])
496
497if test x"$gsmdir" != xno ; then
498        test x"$gmsdir" = xyes && gsmdir=/usr
499        MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include],
500                [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create])
501        if test "$GSM_found" = "yes" ; then
502                build_gsm=yes
503        elif test "$gsm" = "true"; then
504                AC_MSG_ERROR([Could not locate gsm headers or library.])
505        fi
506else
507        build_gsm=no
508fi
509
510fi
511
512dnl check for spandsp support to bring up g726 codec
513AC_ARG_ENABLE(spandsp,
514      [AS_HELP_STRING([--disable-spandsp], [Disable spandsp support])],
515      [case "${enableval}" in
516        yes) spandsp=true ;;
517        no)  spandsp=false ;;
518        *) AC_MSG_ERROR(bad value ${enableval} for --disable-spandsp) ;;
519      esac],[spandsp=true])
520
521if test x$spandsp = xtrue; then
522
523dnl check for installed version of speex
524PKG_CHECK_MODULES(SPANDSP, spandsp >= 0.0.6,
525        [ AC_DEFINE(HAVE_SPANDSP,1,[tells whether spandsp can be used])
526        have_spandsp=true ],
527        [have_spandsp=false]
528)
529AC_SUBST(SPANDSP_CFLAGS)
530AC_SUBST(SPANDSP_LIBS)
531
532fi
533
534
535AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes )
536AM_CONDITIONAL(BUILD_G726, test "$have_spandsp" = "true" )
537
538MS_CHECK_VIDEO
539AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
540AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
541AM_CONDITIONAL(BUILD_VP8, test "$have_vp8" = "yes")
542AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
543AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
544AM_CONDITIONAL(BUILD_FFMPEG, test "$ffmpeg" = "true")
545AM_CONDITIONAL(BUILD_SDL,test "$sdl_found" = "true" )
546AM_CONDITIONAL(BUILD_X11_XV, test "$enable_xv" = "true" )
547AM_CONDITIONAL(BUILD_X11_GL, test "$enable_gl" = "true" )
548
549
550dnl     *********************************************
551dnl     Enable/disable oRTP dependency
552dnl     *********************************************
553AC_ARG_ENABLE(ortp,
554        [AS_HELP_STRING([--disable-ortp], [Disable usage of the oRTP library (default=no)])],
555        [case "${enableval}" in
556                yes)    ortp_enabled=true ;;
557                no)     ortp_enabled=false ;;
558                *)      AC_MSG_ERROR(bad value ${enableval} for --disable-ortp) ;;
559        esac],
560        [ortp_enabled=true])
561AM_CONDITIONAL(ORTP_ENABLED, test x$ortp_enabled = xtrue)
562
563
564dnl     *********************************************
565dnl     setup oRTP dependency
566dnl     *********************************************
567AC_ARG_ENABLE(external-ortp,
568      [AS_HELP_STRING([--enable-external-ortp], [Use external oRTP library (default=no)])],
569      [case "${enableval}" in
570        yes) external_ortp=true ;;
571        no)  external_ortp=false ;;
572        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
573      esac],[external_ortp=false])
574
575if test "$ortp_enabled" = 'true'; then
576        if test "$external_ortp" = 'false'; then
577                if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then
578                        echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h"
579                        ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include"
580                        ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la"
581                        if test x$ac_cv_c_bigendian = xyes ; then
582                                ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
583                        fi
584                        if test x$ntptimestamp = xtrue ; then
585                                ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_TIMESTAMP"
586                        fi
587                else
588                        external_ortp=true
589                fi
590        fi
591        if test "$external_ortp" = 'true'; then
592                PKG_CHECK_MODULES(ORTP, ortp >= 0.17.0, ,
593                        [ AC_MSG_ERROR([Couldn't find ortp library]) ] )
594        fi
595else
596        AC_CHECK_HEADERS(sys/shm.h)
597        ORTP_CFLAGS="-Iortp-deps"
598fi
599AC_SUBST(ORTP_CFLAGS)
600AC_SUBST(ORTP_LIBS)
601
602
603dnl     *********************************************
604dnl     Enable/disable mediastreamer2 filters
605dnl     *********************************************
606AC_ARG_ENABLE(filters,
607        [AS_HELP_STRING([--disable-filters], [Disable compilation of filters (default=no)])],
608        [case "${enableval}" in
609                yes)    filters=true ;;
610                no)     filters=false ;;
611                *)      AC_MSG_ERROR(bad value ${enableval} for --disable-filters) ;;
612        esac],
613        [filters=true])
614AM_CONDITIONAL(MS2_FILTERS, test x$filters = xtrue)
615
616AM_CONDITIONAL(BUILD_VOIP_LIBRARY, test x$ortp_enabled = xtrue)
617
618
619dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins
620AC_CHECK_HEADERS(dlfcn.h)
621have_dlopen=false
622AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true])
623AC_CHECK_FUNC(dlopen,[have_dlopen=true])
624if test "$have_dlopen" = "true" ; then
625        AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable])
626fi
627
628dnl check various things
629AC_FUNC_ALLOCA
630AC_ARG_ENABLE(relativeprefix,
631      [AS_HELP_STRING([--enable-relativeprefix], [Build a linphone that finds its resources relatively to the directory where it is installed])],
632      [case "${enableval}" in
633        yes) relativeprefix=yes ;;
634        no)  relativeprefix=no ;;
635        *) AC_MSG_ERROR(bad value ${enableval} for --enable-relativeprefix) ;;
636      esac],[relativeprefix=guess])
637
638if test "x${prefix}" = "xNONE"; then
639        package_prefix=${ac_default_prefix}
640else
641        package_prefix=${prefix}
642fi
643
644
645
646if test x$mingw_found = xyes || test x$relativeprefix = xyes ; then
647        package_prefix="."
648        PACKAGE_PLUGINS_DIR="./lib/mediastreamer/plugins"
649else
650PACKAGE_PLUGINS_DIR="\$(libdir)/mediastreamer/plugins"
651fi
652
653dnl define path of plugins:
654
655AC_SUBST(PACKAGE_PLUGINS_DIR)
656
657PACKAGE_DATA_DIR="$prefix/share"
658AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR,  "${package_prefix}/share" ,[path of data])
659AC_SUBST(PACKAGE_DATA_DIR)
660
661dnl check for video4linux headers
662AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
663if test "${ac_cv_header_linux_videodev_h}" = "yes" ; then
664        found_v4l1=yes
665else
666        found_v4l1=no
667fi
668if test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
669        found_v4l2=yes
670else
671        found_v4l2=no
672fi
673
674AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
675AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
676
677AC_ARG_ENABLE(libv4l1,
678      [AS_HELP_STRING([--disable-libv4l1], [Disable usage of libv4l1, really discouraged])],
679      [case "${enableval}" in
680        yes) libv4l1=yes ;;
681        no)  libv4l1=no ;;
682        *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l1) ;;
683      esac],[libv4l1=yes])
684
685AC_ARG_ENABLE(libv4l2,
686      [AS_HELP_STRING([--disable-libv4l2], [Disable usage of libv4l2, really discouraged])],
687      [case "${enableval}" in
688        yes) libv4l2=yes ;;
689        no)  libv4l2=no ;;
690        *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l2) ;;
691      esac],[libv4l2=yes])
692
693PKG_CHECK_MODULES(LIBV4L2, libv4l2,
694        [AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])
695        have_libv4l2=yes]
696        ,[echo "No libv4l2 found."]
697)
698PKG_CHECK_MODULES(LIBV4L1, libv4l1,
699        [AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])
700        have_libv4l1=yes]
701        ,[echo "No libv4l1 found."]
702)
703
704if test "$found_v4l2" = "yes" && test "$have_libv4l2" != "yes" ; then
705        if test "$video" = "true" && test "$libv4l2" = "yes" ; then
706                AC_MSG_ERROR(
707[
708Missing libv4l2. It is highly recommended to build with
709libv4l2 headers and library. Many camera will won't work or will crash
710your application if libv4l2 is not installed.
711If you know what you are doing, you can use --disable-libv4l2 to disable
712this check.
713])
714        fi
715fi
716
717
718AC_ARG_ENABLE(tests,
719      [AS_HELP_STRING([--enable-tests], [Enable compilation of tests (default=yes)])],
720      [case "${enableval}" in
721        yes) tests=yes ;;
722        no)  tests=no  ;;
723        *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
724      esac],[tests=yes])
725AM_CONDITIONAL(ENABLE_TESTS, test x$tests = xyes)
726
727
728dnl ##################################################
729dnl # Check for doxygen
730dnl ##################################################
731
732AC_PATH_PROG(DOXYGEN,doxygen,false)
733AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
734
735
736dnl ##################################################
737dnl # Check for ESP Packager
738dnl ##################################################
739
740AC_PATH_PROG(EPM,epm,false)
741AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
742AC_PATH_PROG(EPMINSTALL,epminstall,false)
743AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
744
745
746# Preferred packaging system, as per EPM terminology
747case $target in
748*-*-linux*)
749        if test -f /etc/debian_version ; then
750                EPM_PKG_EXT=deb
751        else
752                EPM_PKG_EXT=rpm
753        fi
754        ;;
755*-hp-hpux*)
756        EPM_PKG_EXT=depot.gz;;
757*-dec-osf*)
758        EPM_PKG_EXT=setld;;
759esac
760AC_SUBST(EPM_PKG_EXT)
761
762# System software User & Group names
763case $target in
764*-*-linux*)
765        SYS_USER=root
766        SYS_GROUP=root
767        ;;
768*-*-hpux*|*-dec-osf*)
769        SYS_USER=bin
770        SYS_GROUP=bin
771        ;;
772esac
773AC_SUBST(SYS_USER)
774AC_SUBST(SYS_GROUP)
775
776# CPU Architecture
777case $target_cpu in
778i?86)           ARCH=i386;;
779*)              ARCH=$target_cpu;;
780esac
781AC_SUBST(ARCH)
782
783# Various other packaging variables, that can be over-ridden ad `make
784# package' time
785SUMMARY="A mediastreaming library."
786AC_SUBST(SUMMARY)
787PACKAGER=anonymous
788AC_SUBST(PACKAGER)
789LICENSE=GPL
790AC_SUBST(LICENSE)
791VENDOR=Linphone
792AC_SUBST(VENDOR)
793RELEASE=1
794AC_SUBST(RELEASE)
795
796CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS"
797CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS "
798dnl: these ones gets exported in pkgconfig file.
799AC_SUBST(MS_PUBLIC_CFLAGS)
800
801AC_CONFIG_FILES(
802Makefile
803po/Makefile.in
804include/Makefile
805include/mediastreamer2/Makefile
806src/Makefile
807tests/Makefile
808build/Makefile
809build/win32native/Makefile
810build/win32native/mediastream/Makefile
811build/win32-novideo/Makefile
812build/wince/Makefile
813build/winmob/Makefile
814mediastreamer.pc
815mediastreamer2.spec
816help/Makefile
817help/Doxyfile
818)
819
820AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.