source: mediastreamer2/configure.ac @ 1322:8da3bcb947c5

Last change on this file since 1322:8da3bcb947c5 was 1322:8da3bcb947c5, checked in by Simon Morlat <simon.morlat@…>, 2 years ago

new audio unit based filter for macosx.

File size: 19.6 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([mediastreamer],[2.7.2])
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=1 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[  --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
59CFLAGS="-DORTP_INET6 $CFLAGS "
60
61dnl enable ipv6 support
62AC_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])
69if test x$ipv6 = xtrue ; then
70        CFLAGS="$CFLAGS -DINET6"
71fi
72
73
74AC_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
84dnl Checks for programs.
85AC_PROG_CC
86AC_PROG_CXX
87AC_PROG_OBJC
88AC_LIBTOOL_WIN32_DLL
89AC_PROG_LIBTOOL
90AC_ENABLE_SHARED(yes)
91AC_ENABLE_STATIC(no)
92
93if 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
100else
101        CFLAGS="$CFLAGS -Wall"
102fi
103
104
105
106if test $debug_enabled = "yes"; then
107        CFLAGS="$CFLAGS -g -DDEBUG"
108else
109        CFLAGS="$CFLAGS -O2 -g "
110fi
111
112dnl Checks for header files.
113AC_HEADER_STDC
114
115dnl Checks for typedefs, structures, and compiler characteristics.
116AC_C_CONST
117AC_C_INLINE
118AC_HEADER_TIME
119AC_WORDS_BIGENDIAN
120if test x$ac_cv_c_bigendian = xyes ; then
121        CFLAGS="$CFLAGS -D_BIGENDIAN "
122fi
123
124if test $GCC = yes && test $wall_werror = yes;  then
125        CFLAGS="$CFLAGS -Werror "
126fi
127
128macosx_found=no
129mingw32ce_found=no
130
131dnl add thread flags
132case $target_os in
133        *darwin*)
134                MSPLUGINS_CFLAGS=""
135                MSPLUGINS_LIBS="-dynamiclib"
136                macosx_found=yes
137                LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio -framework Carbon -framework AudioUnit"
138        ;;
139        *mingw32ce)
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"
142dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
143                LIBS="$LIBS -lws2"
144                mingw_found=yes
145                mingw32ce_found=yes
146                build_tests=no
147    ;;
148        *mingw*)
149                CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
150                CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
151dnl 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 "
153                mingw_found=yes
154        ;;
155  *)
156     MSPLUGINS_CFLAGS="-pthread"
157     MSPLUGINS_LIBS="-shared -pthread"
158     CFLAGS="$CFLAGS -pthread -D_REENTRANT"
159     LIBS="$LIBS -pthread -lpthread"
160     ;;
161esac
162
163AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
164
165AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
166
167AC_CONFIG_COMMANDS([libtool-hacking],[
168if 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
172        rm -f ./libtool.tmp
173else
174        echo "No need to hack libtool."
175fi
176], [mingw_found=$mingw_found])
177
178
179dnl prefer fixed point computations
180AC_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])
188
189if test "$fixed_point" = "guess" ; then
190        AC_MSG_CHECKING([whether fixed point arithmetic is preferred])
191        case ${target_cpu}${host_cpu} in
192                *bfin*)
193                        fixed_point=true
194                ;;
195                *arm*)
196                        fixed_point=true
197                ;;
198                *)
199                        fixed_point=false
200                ;;
201        esac
202        AC_MSG_RESULT([$fixed_point])
203fi
204 
205
206if test x$fixed_point = xtrue ; then
207        MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT"
208fi
209
210
211dnl initialize pkg-config so that we can use it within if else fi statements.
212PKG_PROG_PKG_CONFIG()
213
214AC_SUBST(MSPLUGINS_CFLAGS)
215AC_SUBST(MSPLUGINS_LIBS)
216
217AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"])
218
219dnl     *********************************
220dnl     various checks for soundcard apis
221dnl     *********************************
222
223found_sound=no
224
225if test x$mingw_found = xyes ; then
226        found_sound=yes
227fi
228
229AC_ARG_ENABLE(oss,
230      [  --enable-oss    Disable oss support],
231      [case "${enableval}" in
232        yes) oss=true ;;
233        no)  oss=false ;;
234        *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
235      esac],[oss=true])
236
237if "$oss" = "true"; then
238AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
239if 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
243        found_sound=yes
244else
245        oss=false
246fi
247fi
248
249AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue)
250
251dnl conditionnal build of ALSA support
252AC_ARG_ENABLE(alsa,
253      [  --enable-alsa    Turn on alsa native support compiling],
254      [case "${enableval}" in
255        yes) alsa=true ;;
256        no)  alsa=false ;;
257        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
258      esac],[alsa=true])
259
260if test "$alsa" = "true"; then
261        AC_CHECK_HEADERS(alsa/asoundlib.h,
262                [ AC_CHECK_LIB(asound,snd_pcm_open,
263                        [ ALSA_LIBS="-lasound"
264                          found_sound=yes
265                        AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available])
266                        alsa_enabled=true
267                        ])
268                ]
269        )
270fi
271AC_SUBST(ALSA_LIBS)
272
273AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue)
274
275
276AC_ARG_ENABLE(artsc,
277      [  --enable-artsc    Turn on artsc (kde<4) sound input/output (no) ],
278      [case "${enableval}" in
279        yes) artsc=true ;;
280        no)  artsc=false ;;
281        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
282      esac],[artsc=no])
283
284arts_enabled=false
285
286if test "$artsc" = "true" ; then
287
288        dnl check for arts (kde sound daemon) support
289        PKG_CHECK_MODULES(ARTS, [artsc],[
290                dnl New detection
291                arts_enabled=true
292        ],[
293                dnl Old detection
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"
298                                        arts_enabled=true
299                                        ])
300                                ]
301                        )
302                fi
303                AC_SUBST(ARTS_LIBS)
304        ])
305fi
306
307if test x$arts_enabled = xtrue; then
308        found_sound=yes
309        AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available])
310fi
311
312AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue)
313
314AC_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])
321
322if test "$portaudio" = "true"; then
323        AC_CHECK_HEADERS(portaudio.h,
324                [ AC_CHECK_LIB(portaudio,Pa_Initialize,
325                        [ PORTAUDIO_LIBS="-lportaudio"
326                          found_sound=yes
327                        AC_DEFINE(__PORTAUDIO_ENABLED__,1,[defined if portaudio support is available])
328                        portaudio_enabled=true
329                        ])
330                ]
331        )
332fi
333
334AC_SUBST(PORTAUDIO_LIBS)
335AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue)
336
337AC_ARG_ENABLE(macsnd,
338      [  --enable-macsnd    Turn on Audio Units macosx sound support (default=yes)],
339      [case "${enableval}" in
340        yes) macsnd=true ;;
341        no)  macsnd=false ;;
342        *) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;;
343      esac],[macsnd=true])
344
345AC_ARG_ENABLE(macaqsnd,
346      [  --enable-macaqsnd    Turn on native macosx Audio Queue sound support (default=no)],
347      [case "${enableval}" in
348        yes) macaqsnd=true ;;
349        no)  macaqsnd=false ;;
350        *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;;
351      esac],[macaqsnd=true])
352
353
354
355if test "$macosx_found" = "yes" ; then
356        if test "$macsnd" = "true"; then
357                AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available])
358                macsnd_enabled=true
359                found_sound=yes
360        fi
361        if test "$macaqsnd" = "true"; then
362                AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
363                found_sound=yes
364                macaqsnd=true
365        fi
366fi
367
368
369AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
370AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
371
372AC_ARG_ENABLE(iounit,
373      [  --enable-iounit    Turn on native iOS audio unit support (default=no)],
374      [case "${enableval}" in
375        yes) iounit=true ;;
376        no)  iounit=false ;;
377        *) AC_MSG_ERROR(bad value ${enableval} for --enable-iounit) ;;
378      esac],[iounit=false])
379
380if test "$iounit" = "true"; then
381        AC_DEFINE(__MACIOUNIT_ENABLED__,1,[defined if native apple iounit support is available])
382        iounit_enabled=true
383        found_sound=yes
384fi
385
386AM_CONDITIONAL(BUILD_MACIOUNIT, test x$iounit_enabled = xtrue)
387
388AC_ARG_ENABLE(jack,
389      [  --disable-jack    Disable jack support],
390      [case "${enableval}" in
391        yes) jack=true ;;
392        no)  jack=false ;;
393        *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
394      esac],[jack=true])
395
396if test x$jack = xtrue; then
397
398dnl Check for samplerate libraries
399dnl Check for jack libraries (sound output plugin)
400PKG_CHECK_MODULES(JACK,jack >= 0.15.0,
401[
402        dnl we' found jack devel files
403        PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13,
404                [AC_DEFINE(__JACK_ENABLED__,1,[Jack support])
405                found_sound=yes
406                jack_found=yes] ,
407                [echo "libsamplerate not found, jack support disabled."])
408        AC_SUBST(SAMPLERATE_CFLAGS)
409        AC_SUBST(SAMPLERATE_LIBS)
410],
411[echo "No jack support."] )
412
413if test x$jack_found = xno ; then
414        dnl reset flags
415        JACK_CFLAGS=
416        JACK_LIBS=
417        SAMPLERATE_CFLAGS=
418        SAMPLERATE_LIBS=
419fi
420
421AC_SUBST(JACK_CFLAGS)
422AC_SUBST(JACK_LIBS)
423
424fi
425
426AC_ARG_ENABLE(pulseaudio,
427      [  --disable-pulseaudio    Disable pulseaudio support],
428      [case "${enableval}" in
429        yes) pulseaudio=true ;;
430        no)  pulseaudio=false ;;
431        *) AC_MSG_ERROR(bad value ${enableval} for --disable-pulseaudio) ;;
432      esac],[pulseaudio=true])
433
434
435if test x$pulseaudio = xtrue ; then
436        PKG_CHECK_MODULES(LIBPULSE, libpulse >= 0.9.21,
437                [AC_DEFINE(__PULSEAUDIO_ENABLED__,1,[Pulse audio support])],
438                [pulseaudio=false])
439fi
440
441AM_CONDITIONAL(BUILD_PULSEAUDIO,test x$pulseaudio = xtrue)
442
443
444if test "$found_sound" = "no"; then
445        AC_MSG_WARN([Could not find a support sound driver API])
446fi
447
448
449dnl     *************************************
450dnl     check for various codecs libraries
451dnl     *************************************
452
453AC_ARG_ENABLE(speex,
454      [  --disable-speex    Disable speex support],
455      [case "${enableval}" in
456        yes) speex=true ;;
457        no)  speex=false ;;
458        *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;;
459      esac],[speex=true])
460
461if test x$speex = xtrue; then
462
463dnl check for installed version of speex
464PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3,
465        [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ],
466        [try_other_speex=yes]
467)
468PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes)
469build_resample=false
470PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3,
471    [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS"
472    AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library])
473    build_resample=yes] ,
474    [AC_MSG_NOTICE([No speexdsp library found.])
475]
476)
477AC_SUBST(SPEEX_CFLAGS)
478AC_SUBST(SPEEX_LIBS)
479
480fi
481
482AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes )
483AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes )
484
485AC_ARG_ENABLE(gsm,
486      [  --disable-gsm    Disable gsm support],
487      [case "${enableval}" in
488        yes) gsm=true ;;
489        no)  gsm=false ;;
490        *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;;
491      esac],[gsm=auto])
492     
493if test x$gsm != xfalse; then
494
495dnl check for gsm
496build_gsm=no
497AC_ARG_WITH( gsm,
498                  [  --with-gsm         Sets the installation prefix of gsm codec library [default=/usr] ],
499                  [ gsmdir=${withval}],[ gsmdir=/usr ])
500
501if test x"$gsmdir" != xno ; then
502        test x"$gmsdir" = xyes && gsmdir=/usr
503        MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include],
504                [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create])
505        if test "$GSM_found" = "yes" ; then
506                build_gsm=yes
507        elif test "$gsm" = "true"; then
508                AC_MSG_ERROR([Could not locate gsm headers or library.])
509        fi
510else
511        build_gsm=no
512fi
513
514fi
515
516AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes )
517
518MS_CHECK_VIDEO
519AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
520AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
521AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
522AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
523AM_CONDITIONAL(BUILD_FFMPEG, test "$ffmpeg" = "true")
524AM_CONDITIONAL(BUILD_SDL,test "$sdl_found" = "true" )
525AM_CONDITIONAL(BUILD_X11_XV, test "$enable_xv" = "true" )
526
527dnl     *********************************************
528dnl     setup oRTP dependency
529dnl     *********************************************
530AC_ARG_ENABLE(external-ortp,
531      [  --enable-external-ortp    Use external oRTP library],
532      [case "${enableval}" in
533        yes) external_ortp=true ;;
534        no)  external_ortp=false ;;
535        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
536      esac],[external_ortp=false])
537
538if test "$external_ortp" = 'false'; then
539        if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then
540                echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h"
541                ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include"
542                ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la"
543                if test x$ac_cv_c_bigendian = xyes ; then
544                        ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
545                fi
546        else
547                external_ortp=true
548        fi
549fi
550if test "$external_ortp" = 'true'; then
551        PKG_CHECK_MODULES(ORTP, ortp >= 0.9.0, ,
552                [ AC_MSG_ERROR([Couldn't find ortp library]) ] )
553fi
554AC_SUBST(ORTP_CFLAGS)
555AC_SUBST(ORTP_LIBS)
556
557
558dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins
559AC_CHECK_HEADERS(dlfcn.h)
560have_dlopen=false
561AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true])
562AC_CHECK_FUNC(dlopen,[have_dlopen=true])
563if test "$have_dlopen" = "true" ; then
564        AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable])
565fi
566
567dnl check various things
568AC_FUNC_ALLOCA
569
570if test "x${prefix}" = "xNONE"; then
571        package_prefix=${ac_default_prefix}
572else
573        package_prefix=${prefix}
574fi
575
576
577PACKAGE_PLUGINS_DIR="\$(libdir)/mediastreamer/plugins"
578
579if test x$mingw_found = xyes ; then
580        package_prefix="."
581        PACKAGE_PLUGINS_DIR="./lib/mediastreamer/plugins"
582fi
583
584dnl define path of plugins:
585
586AC_SUBST(PACKAGE_PLUGINS_DIR)
587
588PACKAGE_DATA_DIR="$prefix/share"
589AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR,  "${package_prefix}/share" ,[path of data])
590AC_SUBST(PACKAGE_DATA_DIR)
591
592dnl check for video4linux headers
593AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
594if test "${ac_cv_header_linux_videodev_h}" = "yes" || \
595        test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
596        found_v4l=yes
597else
598        found_v4l=no
599fi
600
601AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes )
602
603AC_ARG_ENABLE(libv4l,
604      [  --disable-libv4l    Disable usage of libv4l, really discouraged],
605      [case "${enableval}" in
606        yes) libv4l=yes ;;
607        no)  libv4l=no ;;
608        *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l) ;;
609      esac],[libv4l=yes])
610
611PKG_CHECK_MODULES(LIBV4L2, libv4l2,
612        [AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])
613        have_libv4l2=yes]
614        ,[echo "No libv4l2 found."]
615)
616PKG_CHECK_MODULES(LIBV4L1, libv4l1,
617        [AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])
618        have_libv4l1=yes]
619        ,[echo "No libv4l1 found."]
620)
621
622if test "$found_v4l" = "yes" && test "$have_libv4l2" != "yes" ; then
623        if test "$video" = "true" && test "$libv4l" = "yes" ; then
624                AC_MSG_ERROR(
625[
626Missing libv4l2. It is highly recommended to build with
627libv4l2 headers and library. Many camera will won't work or will crash
628your application if libv4l2 is not installed.
629If you know what you are doing, you can use --disable-libv4l to disable
630this check.
631])
632        fi
633fi
634
635dnl ##################################################
636dnl # Check for doxygen
637dnl ##################################################
638
639AC_PATH_PROG(DOXYGEN,doxygen,false)
640AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
641
642
643dnl ##################################################
644dnl # Check for ESP Packager
645dnl ##################################################
646
647AC_PATH_PROG(EPM,epm,false)
648AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
649AC_PATH_PROG(EPMINSTALL,epminstall,false)
650AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
651
652
653# Preferred packaging system, as per EPM terminology
654case $target in
655*-*-linux*)
656        if test -f /etc/debian_version ; then
657                EPM_PKG_EXT=deb
658        else
659                EPM_PKG_EXT=rpm
660        fi
661        ;;
662*-hp-hpux*)
663        EPM_PKG_EXT=depot.gz;;
664*-dec-osf*)
665        EPM_PKG_EXT=setld;;
666esac
667AC_SUBST(EPM_PKG_EXT)
668
669# System software User & Group names
670case $target in
671*-*-linux*)
672        SYS_USER=root
673        SYS_GROUP=root
674        ;;
675*-*-hpux*|*-dec-osf*)
676        SYS_USER=bin
677        SYS_GROUP=bin
678        ;;
679esac
680AC_SUBST(SYS_USER)
681AC_SUBST(SYS_GROUP)
682
683# CPU Architecture
684case $target_cpu in
685i?86)           ARCH=i386;;
686*)              ARCH=$target_cpu;;
687esac
688AC_SUBST(ARCH)
689
690# Various other packaging variables, that can be over-ridden ad `make
691# package' time
692SUMMARY="A mediastreaming library."
693AC_SUBST(SUMMARY)
694PACKAGER=anonymous
695AC_SUBST(PACKAGER)
696LICENSE=GPL
697AC_SUBST(LICENSE)
698VENDOR=Linphone
699AC_SUBST(VENDOR)
700RELEASE=1
701AC_SUBST(RELEASE)
702
703CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS"
704CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS"
705dnl: these ones gets exported in pkgconfig file.
706AC_SUBST(MS_PUBLIC_CFLAGS)
707
708AC_OUTPUT(
709Makefile
710include/Makefile
711include/mediastreamer2/Makefile
712src/Makefile
713tests/Makefile
714build/Makefile
715build/win32native/Makefile
716build/win32native/mediastream/Makefile
717build/win32-novideo/Makefile
718build/wince/Makefile
719build/winmob/Makefile
720mediastreamer.pc
721mediastreamer2.spec
722help/Makefile
723help/Doxyfile
724help/doxygen.dox
725)
726
Note: See TracBrowser for help on using the repository browser.