]> sjero.net Git - linphone/blob - linphone/mediastreamer2/configure.ac
a3affd4a5cfb1da544122e0747635272162d2b31
[linphone] / linphone / mediastreamer2 / configure.ac
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 mingw32ce_found=no
130
131 dnl add thread flags
132 case $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"
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"
142 dnl 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"
151 dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux
152                 LIBS="$LIBS -lws2_32 -lwinmm "
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      ;;
161 esac
162
163 AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
164
165 AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
166
167 AC_CONFIG_COMMANDS([libtool-hacking],[
168 if test "$mingw_found" = "yes" ; then
169         echo "Hacking libtool to work with mingw..."
170         sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
171         cp -f ./libtool.tmp ./libtool
172         rm -f ./libtool.tmp
173 else
174         echo "No need to hack libtool."
175 fi
176 ], [mingw_found=$mingw_found])
177
178
179 dnl prefer fixed point computations
180 AC_ARG_ENABLE(fixed_point,
181       [  --enable-fixed-point    Turn on fixed point computations (default: guess)],
182       [case "${enableval}" in
183         yes)  fixed_point=true;;
184         no)   fixed_point=false;;
185         guess) fixed_point=guess;;
186         *) AC_MSG_ERROR(bad value ${enableval} for --enable-fixed-point) ;;
187       esac],[fixed_point=guess])
188
189 if 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])
203 fi
204   
205
206 if test x$fixed_point = xtrue ; then
207         MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT"
208 fi
209
210
211 dnl initialize pkg-config so that we can use it within if else fi statements.
212 PKG_PROG_PKG_CONFIG()
213
214 AC_SUBST(MSPLUGINS_CFLAGS)
215 AC_SUBST(MSPLUGINS_LIBS)
216
217 AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"])
218
219 dnl     *********************************
220 dnl     various checks for soundcard apis
221 dnl     *********************************
222
223 found_sound=no
224
225 if test x$mingw_found = xyes ; then
226         found_sound=yes
227 fi
228
229 AC_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
237 if "$oss" = "true"; then
238 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
239 if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
240         test "${ac_cv_header_soundcard_h}" = "yes" || \
241                 test "${ac_cv_header_sys_audio_h}" = "yes" || \
242         test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
243         found_sound=yes
244 else
245         oss=false
246 fi
247 fi
248
249 AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue)
250
251 dnl conditionnal build of ALSA support
252 AC_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
260 if test "$alsa" = "true"; then
261         AC_CHECK_HEADERS(alsa/asoundlib.h,
262                 [ AC_CHECK_LIB(asound,snd_pcm_open,
263                         [ ALSA_LIBS="-lasound"
264                           found_sound=yes
265                         AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available])
266                         alsa_enabled=true 
267                         ])
268                 ]
269         )
270 fi
271 AC_SUBST(ALSA_LIBS)
272
273 AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue)
274
275
276 AC_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
284 arts_enabled=false
285
286 if 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         ])
305 fi
306
307 if test x$arts_enabled = xtrue; then
308         found_sound=yes
309         AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available])
310 fi
311
312 AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue)
313
314 AC_ARG_ENABLE(portaudio,
315       [  --enable-portaudio    Turn on portaudio native support compiling],
316       [case "${enableval}" in
317         yes) portaudio=true ;;
318         no)  portaudio=false ;;
319         *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
320       esac],[portaudio=false])
321
322 if 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         )
332 fi
333
334 AC_SUBST(PORTAUDIO_LIBS)
335 AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue)
336
337 AC_ARG_ENABLE(macsnd,
338       [  --enable-macsnd    Turn on native macosx sound support (default=no)],
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=false])
344
345 if test "$macsnd" = "true"; then
346         AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available])
347         macsnd_enabled=true
348         found_sound=yes
349 fi
350
351 AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
352
353 AC_ARG_ENABLE(macaqsnd,
354       [  --enable-macaqsnd    Turn on native macosx Audio Queue sound support (default=yes)],
355       [case "${enableval}" in
356         yes) macaqsnd=true ;;
357         no)  macaqsnd=false ;;
358         *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;;
359       esac],[macaqsnd=true])
360
361 if test "$macosx_found" != "yes" ; then
362         macaqsnd=false
363 fi
364
365 if test "$macaqsnd" = "true"; then
366         AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
367         found_sound=yes
368 fi
369
370 AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
371
372 AC_ARG_ENABLE(jack,
373       [  --disable-jack    Disable jack support],
374       [case "${enableval}" in
375         yes) jack=true ;;
376         no)  jack=false ;;
377         *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
378       esac],[jack=true])
379
380 if test x$jack = xtrue; then
381
382 dnl Check for samplerate libraries
383 dnl Check for jack libraries (sound output plugin)
384 PKG_CHECK_MODULES(JACK,jack >= 0.15.0, 
385
386         dnl we' found jack devel files
387         PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13,
388                 [AC_DEFINE(__JACK_ENABLED__,1,[Jack support])
389                 found_sound=yes 
390                 jack_found=yes] ,
391                 [echo "libsamplerate not found, jack support disabled."])
392         AC_SUBST(SAMPLERATE_CFLAGS)
393         AC_SUBST(SAMPLERATE_LIBS)
394 ], 
395 [echo "No jack support."] )
396
397 if test x$jack_found = xno ; then
398         dnl reset flags 
399         JACK_CFLAGS=
400         JACK_LIBS=
401         SAMPLERATE_CFLAGS=
402         SAMPLERATE_LIBS=
403 fi
404
405 AC_SUBST(JACK_CFLAGS)
406 AC_SUBST(JACK_LIBS) 
407
408 fi
409
410 if test "$found_sound" = "no"; then
411         AC_MSG_WARN([Could not find a support sound driver API])
412 fi
413
414
415 dnl     *************************************
416 dnl     check for various codecs libraries
417 dnl     *************************************
418
419 AC_ARG_ENABLE(speex,
420       [  --disable-speex    Disable speex support],
421       [case "${enableval}" in
422         yes) speex=true ;;
423         no)  speex=false ;;
424         *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;;
425       esac],[speex=true])
426
427 if test x$speex = xtrue; then
428
429 dnl check for installed version of speex
430 PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3,
431         [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ],
432         [try_other_speex=yes]
433 )
434 PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes)
435 build_resample=false
436 PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3,
437     [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS"
438     AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library])
439     build_resample=yes] ,
440     [AC_MSG_NOTICE([No speexdsp library found.])
441 ]
442 )
443 AC_SUBST(SPEEX_CFLAGS)
444 AC_SUBST(SPEEX_LIBS)
445
446 fi
447
448 AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes )
449 AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes )
450
451 AC_ARG_ENABLE(gsm,
452       [  --disable-gsm    Disable gsm support],
453       [case "${enableval}" in
454         yes) gsm=true ;;
455         no)  gsm=false ;;
456         *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;;
457       esac],[gsm=true])
458
459 if test x$gsm = xtrue; then
460
461 dnl check for gsm
462 build_gsm=no
463 AC_ARG_WITH( gsm,
464                   [  --with-gsm         Sets the installation prefix of gsm codec library [default=/usr] ],
465                   [ gsmdir=${withval}],[ gsmdir=/usr ])
466
467 if test x"$gsmdir" != xno ; then
468         test x"$gmsdir" = xyes && gsmdir=/usr
469         MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include],
470                 [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create])
471         if test "$GSM_found" = "yes" ; then
472                 build_gsm=yes
473         fi
474 else
475         build_gsm=no
476 fi
477
478 fi
479
480 AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes )
481
482 MS_CHECK_VIDEO
483 AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
484 AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
485 AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
486 AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
487
488 dnl     *********************************************
489 dnl     setup oRTP dependency
490 dnl     *********************************************
491 AC_ARG_ENABLE(external-ortp,
492       [  --enable-external-ortp    Use external oRTP library],
493       [case "${enableval}" in
494         yes) external_ortp=true ;;
495         no)  external_ortp=false ;;
496         *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
497       esac],[external_ortp=false])
498
499 if test "$external_ortp" = 'false'; then
500         if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then 
501                 echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h"
502                 ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include"
503                 ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la"
504                 if test x$ac_cv_c_bigendian = xyes ; then
505                         ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
506                 fi
507         else
508                 external_ortp=true
509         fi
510 fi
511 if test "$external_ortp" = 'true'; then
512         PKG_CHECK_MODULES(ORTP, ortp >= 0.9.0, ,
513                 [ AC_MSG_ERROR([Couldn't find ortp library]) ] )
514 fi
515 AC_SUBST(ORTP_CFLAGS)
516 AC_SUBST(ORTP_LIBS)
517
518
519 dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins
520 AC_CHECK_HEADERS(dlfcn.h)
521 have_dlopen=false
522 AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true])
523 AC_CHECK_FUNC(dlopen,[have_dlopen=true])
524 if test "$have_dlopen" = "true" ; then
525         AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable])
526 fi
527
528 dnl check various things
529 AC_FUNC_ALLOCA
530
531 if test "x${prefix}" = "xNONE"; then
532         package_prefix=${ac_default_prefix}
533 else
534         package_prefix=${prefix}
535 fi
536
537 if test x$mingw_found = xyes ; then
538         package_prefix="."
539 fi
540
541 dnl define path of plugins:
542 AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${package_prefix}/lib/mediastreamer/plugins" ,[path of plugins])
543 PACKAGE_PLUGINS_DIR="${package_prefix}/lib/mediastreamer/plugins"
544 AC_SUBST(PACKAGE_PLUGINS_DIR)
545
546 PACKAGE_DATA_DIR="$prefix/share"
547 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR,  "${package_prefix}/share" ,[path of data])
548 AC_SUBST(PACKAGE_DATA_DIR)
549
550 dnl check for video4linux headers
551 AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
552 if test "${ac_cv_header_linux_videodev_h}" = "yes" || \
553         test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
554         found_v4l=yes
555 else
556         found_v4l=no
557 fi
558
559 AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes )
560
561 PKG_CHECK_MODULES(LIBV4L2, libv4l2,
562         [AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])]
563         ,[echo "No libv4l2 found."]
564 )
565 PKG_CHECK_MODULES(LIBV4L1, libv4l1,
566         [AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])]
567         ,[echo "No libv4l1 found."]
568 )
569
570 dnl ##################################################
571 dnl # Check for doxygen
572 dnl ##################################################
573
574 AC_PATH_PROG(DOXYGEN,doxygen,false)
575 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
576
577
578 dnl ##################################################
579 dnl # Check for ESP Packager
580 dnl ##################################################
581
582 AC_PATH_PROG(EPM,epm,false)
583 AC_PATH_PROG(MKEPMLIST,mkepmlist,false)
584 AC_PATH_PROG(EPMINSTALL,epminstall,false)
585 AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false)
586
587
588 # Preferred packaging system, as per EPM terminology
589 case $target in
590 *-*-linux*)
591         if test -f /etc/debian_version ; then
592                 EPM_PKG_EXT=deb
593         else
594                 EPM_PKG_EXT=rpm
595         fi
596         ;;
597 *-hp-hpux*)
598         EPM_PKG_EXT=depot.gz;;
599 *-dec-osf*)
600         EPM_PKG_EXT=setld;;
601 esac
602 AC_SUBST(EPM_PKG_EXT)
603
604 # System software User & Group names
605 case $target in
606 *-*-linux*)
607         SYS_USER=root
608         SYS_GROUP=root
609         ;;
610 *-*-hpux*|*-dec-osf*)
611         SYS_USER=bin
612         SYS_GROUP=bin
613         ;;
614 esac
615 AC_SUBST(SYS_USER)
616 AC_SUBST(SYS_GROUP)
617
618 # CPU Architecture
619 case $target_cpu in
620 i?86)           ARCH=i386;;
621 *)              ARCH=$target_cpu;;
622 esac
623 AC_SUBST(ARCH)
624
625 # Various other packaging variables, that can be over-ridden ad `make
626 # package' time
627 SUMMARY="A mediastreaming library."
628 AC_SUBST(SUMMARY)
629 PACKAGER=anonymous
630 AC_SUBST(PACKAGER)
631 LICENSE=GPL
632 AC_SUBST(LICENSE)
633 VENDOR=Linphone
634 AC_SUBST(VENDOR)
635 RELEASE=1
636 AC_SUBST(RELEASE)
637
638 CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS"
639 CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS"
640 dnl: these ones gets exported in pkgconfig file.
641 AC_SUBST(MS_PUBLIC_CFLAGS)
642
643 AC_OUTPUT(
644 Makefile
645 include/Makefile
646 include/mediastreamer2/Makefile
647 src/Makefile
648 tests/Makefile
649 build/Makefile
650 build/win32native/Makefile
651 build/win32-novideo/Makefile
652 build/wince/Makefile
653 build/winmob/Makefile
654 mediastreamer.pc
655 mediastreamer2.spec
656 help/Makefile
657 help/Doxyfile
658 help/doxygen.dox
659 )