1
AC_PREREQ(2.52)
2
3
dnl initialize autoconf
4
dnl when going to/from release please set the nano (fourth number) right !
5
dnl releases only do Wall, cvs and prerelease does Werror too
6
AC_INIT(GStreamer Bad Plug-ins, 0.10.14.1,
7
    http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
8
    gst-plugins-bad)
9
10
AG_GST_INIT
11
12
dnl initialize automake
13
AM_INIT_AUTOMAKE([-Wno-portability])
14
15
dnl define PACKAGE_VERSION_* variables
16
AS_VERSION
17
18
dnl check if this is a release version
19
AS_NANO(GST_CVS="no", GST_CVS="yes")
20
21
dnl can autoconf find the source ?
22
AC_CONFIG_SRCDIR([docs/plugins/gst-plugins-bad-plugins-docs.sgml])
23
24
dnl define the output header for config
25
AM_CONFIG_HEADER([config.h])
26
27
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28
AM_MAINTAINER_MODE
29
30
dnl sets host_* variables
31
AC_CANONICAL_HOST
32
33
dnl our libraries and install dirs use major.minor as a version
34
GST_MAJORMINOR=$GST_PLUGINS_BAD_VERSION_MAJOR.$GST_PLUGINS_BAD_VERSION_MINOR
35
dnl we override it here if we need to for the release candidate of new series
36
GST_MAJORMINOR=0.10
37
AC_SUBST(GST_MAJORMINOR)
38
39
dnl FIXME: this macro doesn't actually work;
40
dnl the generated libtool script has no support for the listed tags.
41
dnl So this needs to be fixed first if we want to use this
42
dnl AS_LIBTOOL_TAGS([CXX])
43
44
AC_LIBTOOL_WIN32_DLL
45
AM_PROG_LIBTOOL
46
47
dnl *** required versions of GStreamer stuff ***
48
GST_REQ=0.10.24
49
GSTPB_REQ=0.10.24
50
51
dnl *** autotools stuff ****
52
53
dnl allow for different autotools
54
AS_AUTOTOOLS_ALTERNATE
55
56
dnl Add parameters for aclocal
57
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
58
59
dnl set up gettext
60
dnl the version check needs to stay here because autopoint greps for it
61
AM_GNU_GETTEXT_VERSION([0.17])
62
AM_GNU_GETTEXT([external])
63
AG_GST_GETTEXT([gst-plugins-bad-$GST_MAJORMINOR])
64
65
dnl *** check for arguments to configure ***
66
67
AG_GST_ARG_DEBUG
68
AG_GST_ARG_PROFILING
69
AG_GST_ARG_VALGRIND
70
AG_GST_ARG_GCOV
71
72
AG_GST_ARG_EXAMPLES
73
74
AG_GST_ARG_WITH_PKG_CONFIG_PATH
75
AG_GST_ARG_WITH_PACKAGE_NAME
76
AG_GST_ARG_WITH_PACKAGE_ORIGIN
77
78
AG_GST_ARG_WITH_PLUGINS
79
80
AG_GST_ARG_ENABLE_EXTERNAL
81
82
AG_GST_ARG_ENABLE_EXPERIMENTAL
83
84
dnl *** checks for platform ***
85
86
dnl * hardware/architecture *
87
88
dnl common/m4/gst-arch.m4
89
dnl check CPU type
90
AG_GST_ARCH
91
92
dnl Determine endianness
93
AC_C_BIGENDIAN
94
95
dnl *** checks for programs ***
96
97
dnl find a compiler
98
AC_PROG_CC
99
100
dnl determine c++ compiler
101
AC_PROG_CXX
102
dnl determine if c++ is available on this system
103
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
104
105
AS_PROG_OBJC
106
107
dnl check if the compiler supports '-c' and '-o' options
108
AM_PROG_CC_C_O
109
110
dnl check if the compiler supports do while(0) macros
111
AG_GST_CHECK_DOWHILE_MACROS
112
113
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
114
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
115
116
dnl check for documentation tools
117
GTK_DOC_CHECK([1.3])
118
AS_PATH_PYTHON([2.1])
119
AG_GST_PLUGIN_DOCS([1.3],[2.1])
120
121
dnl *** checks for libraries ***
122
123
dnl check for libm, for sin() etc.
124
AC_CHECK_LIBM
125
AC_SUBST(LIBM)
126
127
AC_FUNC_MMAP
128
129
dnl *** checks for header files ***
130
131
AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
132
AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
133
134
if test "x$HAVE_UNISTD_H" != "xyes"; then
135
  GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
136
fi
137
138
dnl used by camerabin
139
AC_CHECK_HEADERS([sys/time.h])
140
141
dnl used by ext/dts
142
AX_CREATE_STDINT_H
143
144
AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
145
AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")
146
147
if test "x$HAVE_PTHREAD_H" != "xyes"; then
148
  GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/dccp//`
149
fi
150
151
dnl *** checks for types/defines ***
152
153
dnl Check for FIONREAD ioctl declaration
154
dnl used in gst/dccp
155
GST_CHECK_FIONREAD
156
157
dnl *** checks for structures ***
158
159
dnl *** checks for compiler characteristics ***
160
161
dnl *** checks for library functions ***
162
AC_CHECK_FUNCS([gmtime_r])
163
164
dnl *** checks for headers ***
165
AC_CHECK_HEADERS([sys/utsname.h])
166
167
dnl *** checks for dependency libraries ***
168
169
dnl *** checks for socket and nsl libraries ***
170
AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
171
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
172
173
dnl GLib is required
174
AG_GST_GLIB_CHECK([2.16])
175
176
dnl liboil is required
177
PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.8, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
178
if test "x$HAVE_LIBOIL" != "xyes"; then
179
  AC_ERROR([liboil-0.3.8 or later is required])
180
fi
181
182
dnl checks for gstreamer
183
dnl uninstalled is selected preferentially -- see pkg-config(1)
184
AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
185
AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
186
AG_GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ], yes)
187
AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
188
AG_GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ], yes)
189
AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes)
190
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
191
192
GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
193
AC_SUBST(GSTPB_PLUGINS_DIR)
194
AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
195
196
dnl Check for documentation xrefs
197
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
198
GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`"
199
GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`"
200
AC_SUBST(GLIB_PREFIX)
201
AC_SUBST(GST_PREFIX)
202
AC_SUBST(GSTPB_PREFIX)
203
204
dnl GTK is optional and used in examples
205
HAVE_GTK=NO
206
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0, HAVE_GTK=yes, HAVE_GTK=no)
207
AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
208
209
dnl libglade is optional and only used in examples
210
HAVE_GLADE=NO
211
PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.6.0, HAVE_GLADE=yes, HAVE_GLADE=no)
212
AC_SUBST(GLADE_LIBS)
213
AC_SUBST(GLADE_CFLAGS)
214
AC_SUBST(HAVE_GLADE)
215
AM_CONDITIONAL(HAVE_GLADE, test "x$HAVE_GLADE" = "xyes")
216
217
dnl x11 is optional for librfb
218
HAVE_X11=NO
219
PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
220
AC_SUBST(X11_LIBS)
221
AC_SUBST(X11_CFLAGS)
222
AC_SUBST(HAVE_X11)
223
AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes")
224
if test "x$HAVE_X11" = "xyes"; then
225
  AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library])
226
fi
227
228
dnl set license and copyright notice
229
GST_LICENSE="LGPL"
230
AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
231
AC_SUBST(GST_LICENSE)
232
233
dnl define LIBDIR so we can inform people where we live
234
AS_AC_EXPAND(LIBDIR, $libdir)
235
AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
236
237
dnl set location of plugin directory
238
AG_GST_SET_PLUGINDIR
239
240
dnl define an ERROR_CFLAGS Makefile variable
241
AG_GST_SET_ERROR_CFLAGS($GST_CVS)
242
243
dnl define an ERROR_CXXFLAGS Makefile variable
244
AG_GST_SET_ERROR_CXXFLAGS($GST_CVS)
245
246
dnl define correct level for debugging messages
247
AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
248
249
dnl *** plug-ins to include ***
250
251
dnl these are all the gst plug-ins, compilable without additional libs
252
AG_GST_CHECK_PLUGIN(aacparse)
253
AG_GST_CHECK_PLUGIN(adpcmdec)
254
AG_GST_CHECK_PLUGIN(aiffparse)
255
AG_GST_CHECK_PLUGIN(amrparse)
256
AG_GST_CHECK_PLUGIN(asfmux)
257
AG_GST_CHECK_PLUGIN(autoconvert)
258
AG_GST_CHECK_PLUGIN(camerabin)
259
AG_GST_CHECK_PLUGIN(legacyresample)
260
AG_GST_CHECK_PLUGIN(bayer)
261
AG_GST_CHECK_PLUGIN(cdxaparse)
262
AG_GST_CHECK_PLUGIN(dccp)
263
AG_GST_CHECK_PLUGIN(debugutils)
264
AG_GST_CHECK_PLUGIN(dtmf)
265
AG_GST_CHECK_PLUGIN(dvdspu)
266
AG_GST_CHECK_PLUGIN(festival)
267
AG_GST_CHECK_PLUGIN(freeze)
268
AG_GST_CHECK_PLUGIN(frei0r)
269
AG_GST_CHECK_PLUGIN(h264parse)
270
AG_GST_CHECK_PLUGIN(hdvparse)
271
AG_GST_CHECK_PLUGIN(id3tag)
272
AG_GST_CHECK_PLUGIN(librfb)
273
AG_GST_CHECK_PLUGIN(liveadder)
274
AG_GST_CHECK_PLUGIN(mpegdemux)
275
AG_GST_CHECK_PLUGIN(mpegtsmux)
276
AG_GST_CHECK_PLUGIN(mpegpsmux)
277
AG_GST_CHECK_PLUGIN(mpeg4videoparse)
278
AG_GST_CHECK_PLUGIN(mpegvideoparse)
279
AG_GST_CHECK_PLUGIN(mve)
280
AG_GST_CHECK_PLUGIN(mxf)
281
AG_GST_CHECK_PLUGIN(nsf)
282
AG_GST_CHECK_PLUGIN(nuvdemux)
283
AG_GST_CHECK_PLUGIN(pcapparse)
284
AG_GST_CHECK_PLUGIN(pnm)
285
AG_GST_CHECK_PLUGIN(qtmux)
286
AG_GST_CHECK_PLUGIN(rawparse)
287
AG_GST_CHECK_PLUGIN(real)
288
AG_GST_CHECK_PLUGIN(rtpmux)
289
AG_GST_CHECK_PLUGIN(scaletempo)
290
AG_GST_CHECK_PLUGIN(sdp)
291
AG_GST_CHECK_PLUGIN(selector)
292
AG_GST_CHECK_PLUGIN(shapewipe)
293
AG_GST_CHECK_PLUGIN(siren)
294
AG_GST_CHECK_PLUGIN(speed)
295
AG_GST_CHECK_PLUGIN(subenc)
296
AG_GST_CHECK_PLUGIN(stereo)
297
AG_GST_CHECK_PLUGIN(tta)
298
AG_GST_CHECK_PLUGIN(valve)
299
AG_GST_CHECK_PLUGIN(videomeasure)
300
AG_GST_CHECK_PLUGIN(videosignal)
301
AG_GST_CHECK_PLUGIN(vmnc)
302
303
dnl *** plug-ins to exclude ***
304
305
dnl real plugin only works on i386 and x86_64 for the time being.
306
if test "x$HAVE_CPU_I386" != "xyes" && test "x$HAVE_CPU_X86_64" != "xyes"; then
307
  AC_MSG_WARN([Not building real plugin, only works on 32bit and 64bit x86 platforms])
308
  AG_GST_DISABLE_PLUGIN(real)
309
fi
310
311
dnl disable experimental plug-ins
312
dnl if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
313
dnl fi
314
315
# This will always succeed because we depend on GLib >= 2.16
316
PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.16, HAVE_GIO=yes, HAVE_GIO=no)
317
AC_SUBST(GIO_CFLAGS)
318
AC_SUBST(GIO_LIBS)
319
320
dnl disable gst plugins we might not be able to build on this
321
dnl platform: librfb (ugly but minimally invasive)
322
dnl FIXME: maybe move to sys, or make work with winsock2
323
AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
324
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
325
326
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
327
  WIN32_LIBS="-lws2_32"
328
  AC_SUBST(WIN32_LIBS)
329
fi
330
331
dnl needed for festival
332
AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")
333
334
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
335
  DCCP_LIBS="$DCCP_LIBS -lws2_32"
336
  XDG_LIBS="$XDG_LIBS -lws2_32"
337
  AC_SUBST(DCCP_LIBS)
338
  AC_SUBST(XDG_LIBS)
339
fi
340
341
if test "x$HAVE_SYS_SOCKET_H" != "xyes"; then
342
  AG_GST_DISABLE_PLUGIN(librfb)
343
fi
344
345
if test "x$HAVE_PTHREAD_H" = "xyes"; then
346
  DCCP_LIBS="$DCCP_LIBS -lpthread"
347
  AC_SUBST(DCCP_LIBS)
348
fi
349
350
if test "x$HAVE_PTHREAD_H" != "xyes"; then
351
  AG_GST_DISABLE_PLUGIN(dccp)
352
fi
353
354
dnl *** sys plug-ins ***
355
356
dnl DirectSound
357
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
358
AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
359
  HAVE_DIRECTSOUND="no"
360
  save_CFLAGS="$CFLAGS"
361
  save_LDFLAGS="$LDFLAGS"
362
  save_LIBS="$LIBS"
363
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
364
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
365
  LIBS="$LIBS -ldsound -ldxerr9 -luser32"
366
  AC_MSG_CHECKING(for DirectSound LDFLAGS)
367
  AC_LINK_IFELSE([
368
#include <windows.h>
369
#include <dxerr9.h>
370
#include <dsound.h>
371
372
int main ()
373
{
374
  DXGetErrorString9 (0);
375
  DirectSoundCreate(NULL, NULL, NULL);
376
377
  return 0;
378
}
379
],
380
    [HAVE_DIRECTSOUND="yes"],
381
    [HAVE_DIRECTSOUND="no"])
382
  AC_MSG_RESULT($HAVE_DIRECTSOUND)
383
  CFLAGS=$save_CFLAGS
384
  LDFLAGS=$save_LDFLAGS
385
  LIBS=$save_LIBS
386
387
  if test "x$HAVE_DIRECTSOUND" = "xyes";  then
388
    dnl this is much more than we want
389
    DIRECTSOUND_LIBS="-ldsound -ldxerr9 -luser32"
390
    AC_SUBST(DIRECTX_CFLAGS)
391
    AC_SUBST(DIRECTX_LDFLAGS)
392
    AC_SUBST(DIRECTSOUND_LIBS)
393
  fi
394
  AC_SUBST(HAVE_DIRECTSOUND)
395
])
396
397
dnl DirectDraw
398
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTDRAW, true)
399
AG_GST_CHECK_FEATURE(DIRECTDRAW, [DirectDraw plug-in], directdrawsink, [
400
  HAVE_DIRECTDRAW="no"
401
  save_CFLAGS="$CFLAGS"
402
  save_LDFLAGS="$LDFLAGS"
403
  save_LIBS="$LIBS"
404
  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
405
  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
406
  LIBS="$LIBS -lddraw -lgdi32"
407
  AC_MSG_CHECKING(for DirectDraw LDFLAGS)
408
  AC_LINK_IFELSE([
409
#include <windows.h>
410
#include <ddraw.h>
411
412
int main ()
413
{
414
  GetStockObject(0);
415
  DirectDrawCreate(NULL, NULL, NULL);
416
417
  return 0;
418
}
419
],
420
    [HAVE_DIRECTDRAW="yes"],
421
    [HAVE_DIRECTDRAW="no"])
422
  AC_MSG_RESULT($HAVE_DIRECTDRAW)
423
  CFLAGS=$save_CFLAGS
424
  LDFLAGS=$save_LDFLAGS
425
  LIBS=$save_LIBS
426
427
  if test "x$HAVE_DIRECTDRAW" = "xyes";  then
428
    dnl this is much more than we want
429
    DIRECTDRAW_LIBS="-lddraw -ldxguid -lgdi32"
430
    AC_SUBST(DIRECTX_CFLAGS)
431
    AC_SUBST(DIRECTX_LDFLAGS)
432
    AC_SUBST(DIRECTDRAW_LIBS)
433
  fi
434
  AC_SUBST(HAVE_DIRECTDRAW)
435
])
436
437
dnl *** OS X videosrc ***
438
translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_VIDEO, true)
439
HAVE_OSX_VIDEO="no"
440
AG_GST_CHECK_FEATURE(OSX_VIDEO, [OSX video], osxvideosrc, [
441
  AC_CHECK_HEADER(Quicktime/Quicktime.h, HAVE_OSX_VIDEO="yes", HAVE_OSX_VIDEO="no")
442
])
443
dnl in case header Quicktime/Quicktime.h is found on other platforms
444
case "$host" in
445
  *-*darwin*)
446
    dnl do nothing
447
    ;;
448
  *)
449
    HAVE_OSX_VIDEO="no"
450
    ;;
451
esac
452
453
dnl check for QuickTime
454
translit(dnm, m, l) AM_CONDITIONAL(USE_QUICKTIME, true)
455
AG_GST_CHECK_FEATURE(QUICKTIME, [QuickTime wrapper], qtwrapper, [
456
  AC_CHECK_HEADER(QuickTime/Movies.h, HAVE_QUICKTIME="yes", HAVE_QUICKTIME="no")
457
])
458
459
dnl check for Video CD
460
translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
461
AG_GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
462
  AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
463
])
464
465
dnl *** ext plug-ins ***
466
dnl keep this list sorted alphabetically !
467
468
if test "x$BUILD_EXTERNAL" = "xyes"; then
469
470
dnl *** alsa ***
471
translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
472
AG_GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
473
  PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
474
    HAVE_ALSA="yes"
475
    AC_SUBST(ALSA_CFLAGS)
476
    AC_SUBST(ALSA_LIBS)
477
  ], [
478
    AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
479
  ])
480
])
481
482
dnl *** assrender ***
483
translit(dnm, m, l) AM_CONDITIONAL(USE_ASSRENDER, true)
484
AG_GST_CHECK_FEATURE(ASSRENDER, [ASS/SSA renderer], assrender, [
485
  PKG_CHECK_MODULES(ASSRENDER, libass >= 0.9.4, [
486
    HAVE_ASSRENDER="yes" ], [
487
    HAVE_ASSRENDER="no"
488
    AC_MSG_RESULT(no)
489
  ])
490
])
491
AC_SUBST(ASSRENDER_CFLAGS)
492
AC_SUBST(ASSRENDER_LIBS)
493
494
dnl *** amrwb ***
495
translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
496
AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbenc, [
497
  AG_GST_CHECK_LIBHEADER(AMRWB, amrwb,
498
                        GP3E_IF_encode, ,
499
                        amrwb/enc.h,
500
                        AMRWB_LIBS="-lamrwb"
501
                        AC_SUBST(AMRWB_LIBS))
502
])
503
504
dnl *** apexsink ***
505
translit(dnm, m, l) AM_CONDITIONAL(USE_APEXSINK, true)
506
AG_GST_CHECK_FEATURE(APEXSINK, [AirPort Express Wireless sink], apexsink, [
507
508
  HAVE_APEXSINK="yes"
509
  # The big search for OpenSSL
510
  # copied from openssh's configure.ac
511
  AC_ARG_WITH(ssl-dir,
512
          [  --with-ssl-dir=PATH     Specify path to OpenSSL installation ],
513
          [
514
                  if test "x$withval" != "xno" ; then
515
                          tryssldir=$withval
516
                  fi
517
          ]
518
  )
519
520
  AC_SEARCH_LIBS(socket, [socket])
521
  AC_SEARCH_LIBS(gethostbyname, [nsl])
522
523
  saved_LIBS="$LIBS"
524
  saved_LDFLAGS="$LDFLAGS"
525
  saved_CPPFLAGS="$CPPFLAGS"
526
  if test "x$prefix" != "xNONE" ; then
527
          tryssldir="$tryssldir $prefix"
528
  fi
529
  AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
530
          for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do
531
                  CPPFLAGS="$saved_CPPFLAGS"
532
                  LDFLAGS="$saved_LDFLAGS"
533
                  LIBS="$saved_LIBS -lssl -lcrypto"
534
535
                  # Skip directories if they don't exist
536
                  if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
537
                          continue;
538
                  fi
539
                  if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
540
                          # Try to use $ssldir/lib if it exists, otherwise
541
                          # $ssldir
542
                          if test -d "$ssldir/lib" ; then
543
                                  LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
544
                                  if test ! -z "$need_dash_r" ; then
545
                                          LDFLAGS="-R$ssldir/lib $LDFLAGS"
546
                                  fi
547
                          else
548
                                  LDFLAGS="-L$ssldir $saved_LDFLAGS"
549
                                  if test ! -z "$need_dash_r" ; then
550
                                          LDFLAGS="-R$ssldir $LDFLAGS"
551
                                  fi
552
                          fi
553
                          # Try to use $ssldir/include if it exists, otherwise
554
                          # $ssldir
555
                          if test -d "$ssldir/include" ; then
556
                                  CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
557
                          else
558
                                  CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
559
                          fi
560
                  fi
561
562
                  # Basic test to check for compatible version and correct linking
563
                  # *does not* test for RSA - that comes later.
564
                  AC_TRY_COMPILE(
565
                          [
566
#include <string.h>
567
#include <openssl/rand.h>
568
],[
569
int main(void)
570
{
571
        char a[2048];
572
        memset(a, 0, sizeof(a));
573
        RAND_add(a, sizeof(a), sizeof(a));
574
        return(RAND_status() <= 0);
575
}
576
                          ],
577
                          [
578
                                  found_crypto=1
579
                                  break;
580
                          ], []
581
                  )
582
583
                  if test ! -z "$found_crypto" ; then
584
                          break;
585
                  fi
586
          done
587
588
          if test -z "$found_crypto" ; then
589
                  HAVE_APEXSINK="no"
590
          fi
591
          if test -z "$ssldir" ; then
592
                  ssldir="(system)"
593
          fi
594
595
          ac_cv_openssldir=$ssldir
596
  ])
597
  if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ;
598
   then
599
          dnl Need to recover ssldir - test above runs in subshell
600
          ssldir=$ac_cv_openssldir
601
          if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
602
                  # Try to use $ssldir/lib if it exists, otherwise
603
                  # $ssldir
604
                  if test -d "$ssldir/lib" ; then
605
                          APEXSINK_LIBS="-L$ssldir/lib $LDFLAGS"
606
                          if test ! -z "$need_dash_r" ; then
607
                                  APEXSINK_LIBS="-R$ssldir/lib $LDFLAGS"
608
                          fi
609
                  else
610
                          APEXSINK_LDFLAGS="-L$ssldir $LDFLAGS"
611
                          if test ! -z "$need_dash_r" ; then
612
                                  APEXSINK_LIBS="-R$ssldir $LDFLAGS"
613
                          fi
614
                  fi
615
                  # Try to use $ssldir/include if it exists, otherwise
616
                  # $ssldir
617
                  if test -d "$ssldir/include" ; then
618
                          APEXSINK_CFLAGS="-I$ssldir/include $CPPFLAGS"
619
                  else
620
                          APEXSINK_CFLAGS="-I$ssldir $CPPFLAGS"
621
                  fi
622
          fi
623
  fi
624
  APEXSINK_LIBS="$APEXSINK_LIBS $LIBS"
625
  AC_SUBST(APEXSINK_LIBS)
626
  AC_SUBST(APEXSINK_CFLAGS)
627
  CPPFLAGS="$saved_CPPFLAGS"
628
  LDFLAGS="$saved_LDFLAGS"
629
  LIBS="$saved_LIBS"
630
])
631
632
dnl *** BZ2 ***
633
translit(dnm, m, l) AM_CONDITIONAL(USE_BZ2, true)
634
AG_GST_CHECK_FEATURE(BZ2, [bz2 library], bz2, [
635
  AG_GST_CHECK_LIBHEADER(BZ2, bz2, BZ2_bzCompress, ,bzlib.h, BZ2_LIBS="-lbz2")
636
  AC_SUBST(BZ2_LIBS)
637
])
638
639
#dnl *** cairo ***
640
#translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
641
#AG_GST_CHECK_FEATURE(CAIRO, [cairo plug-in], cairo, [
642
#  PKG_CHECK_MODULES(CAIRO, cairo >= 1.0 glitz-glx, HAVE_CAIRO=yes, [
643
#    HAVE_CAIRO=no
644
#    AC_MSG_RESULT(no)
645
#  ])
646
#  AC_SUBST(CAIRO_CFLAGS)
647
#  AC_SUBST(CAIRO_LIBS)
648
#])
649
650
dnl *** cdaudio ***
651
translit(dnm, m, l) AM_CONDITIONAL(USE_CDAUDIO, true)
652
AG_GST_CHECK_FEATURE(CDAUDIO, [cdaudio], cdaudio, [
653
  AG_GST_CHECK_CONFIGPROG(CDAUDIO, libcdaudio-config)
654
  AC_SUBST(CDAUDIO_CFLAGS)
655
  AC_SUBST(CDAUDIO_LIBS)
656
])
657
658
dnl *** celt ***
659
translit(dnm, m, l) AM_CONDITIONAL(USE_CELT, true)
660
AG_GST_CHECK_FEATURE(CELT, [celt], celt, [
661
  PKG_CHECK_MODULES(CELT, celt >= 0.5.0, [
662
      HAVE_CELT="yes"], [
663
      PKG_CHECK_MODULES(CELT, celt >= 0.4.0, [
664
          HAVE_CELT="yes"
665
          AC_DEFINE([HAVE_CELT_0_4], 1, [Define if libcelt 0.4 is installed])
666
          ],[
667
          HAVE_CELT="no"
668
          AC_MSG_RESULT(no)
669
      ])
670
  ])
671
  AC_SUBST(CELT_CFLAGS)
672
  AC_SUBST(CELT_LIBS)
673
])
674
675
dnl *** Cog ***
676
translit(dnm, m, l) AM_CONDITIONAL(USE_COG, true)
677
AG_GST_CHECK_FEATURE(COG, [Cog plugin], cog, [
678
  PKG_CHECK_MODULES(COG, libpng12 orc-0.4 >= 0.4.2.1, HAVE_COG="yes", [
679
    HAVE_COG="no"
680
    AC_MSG_RESULT(no)
681
  ])
682
  AC_SUBST(COG_CFLAGS)
683
  AC_SUBST(COG_LIBS)
684
  ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
685
  if test "x$ORCC" = x ; then
686
    ORCC=orcc
687
  fi
688
  AC_SUBST(ORCC)
689
])
690
691
dnl *** dc1394  ***
692
translit(dnm, m, l) AM_CONDITIONAL(USE_DC1394, true)
693
AG_GST_CHECK_FEATURE(DC1394, [libdc1394], dc1394, [
694
   PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.0, [
695
   	if test -z "`pkg-config --modversion libdc1394-2 | grep 2.0.0-rc`"; then
696
		HAVE_DC1394="yes"
697
	else
698
		HAVE_DC1394="no"
699
		AC_MSG_RESULT(no)
700
	fi
701
   ], [
702
        HAVE_DC1394="no"
703
	AC_MSG_RESULT(no)
704
   ])
705
   AC_SUBST(LIBDC1394_CFLAGS)
706
   AC_SUBST(LIBDC1394_LIBS)
707
])
708
709
710
dnl **** DirectFB ****
711
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTFB, true)
712
AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [
713
  PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.24, HAVE_DIRECTFB="yes", [
714
    HAVE_DIRECTFB="no"
715
    AC_MSG_RESULT(no)
716
  ])
717
])
718
719
dnl **** Dirac ****
720
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRAC, true)
721
AG_GST_CHECK_FEATURE(DIRAC, [dirac], dirac, [
722
  PKG_CHECK_MODULES(DIRAC, dirac >= 0.10, HAVE_DIRAC="yes", [
723
    HAVE_DIRAC="no"
724
    AC_MSG_RESULT(no)
725
  ])
726
])
727
728
dnl *** DTS ***
729
translit(dnm, m, l) AM_CONDITIONAL(USE_DTS, true)
730
AG_GST_CHECK_FEATURE(DTS, [dts library], dtsdec, [
731
  HAVE_DTS="yes"
732
  AG_GST_CHECK_LIBHEADER(DTS, dca, dca_init, -lm, dca.h,
733
    DTS_LIBS="-ldca -lm", HAVE_DTS="no")
734
  if test $HAVE_DTS = "no"; then
735
    AG_GST_CHECK_LIBHEADER(DTS, dts_pic, dts_init, -lm, dts.h,
736
      [ DTS_LIBS="-ldts_pic -lm"
737
        AC_DEFINE(DTS_OLD, 1, [Define if an old libdts is used])
738
      ])
739
  fi
740
  AC_SUBST(DTS_LIBS)
741
])
742
743
dnl *** DIVX ***
744
translit(dnm, m, l) AM_CONDITIONAL(USE_DIVX, true)
745
AG_GST_CHECK_FEATURE(DIVX, [divx plugins], divx, [
746
  HAVE_DIVX=yes
747
  AC_CHECK_HEADER(encore2.h, , [
748
    AC_MSG_WARN([Divx4linux encore headers not found])
749
    HAVE_DIVX=no
750
  ])
751
  if [ test x$HAVE_DIVX = xyes ]; then
752
    AC_MSG_CHECKING([Checking for valid divx4linux encore version])
753
    AC_TRY_COMPILE([
754
#include <encore2.h>
755
#if ENCORE_VERSION != 20021024
756
#error Wrong version of divx encore libraries
757
#endif
758
    ], [
759
return 0;
760
    ], [
761
      HAVE_DIVX=yes
762
      AC_MSG_RESULT(yes)
763
    ], [
764
      HAVE_DIVX=no
765
      AC_MSG_RESULT(no)
766
      AC_MSG_WARN([Wrong version of divx4linux installed])
767
    ])
768
  fi
769
  if [ test x$HAVE_DIVX = xyes ]; then
770
    AC_CHECK_HEADER(decore.h, , [
771
      AC_MSG_WARN([Divx4linux decoder headers not found])
772
      HAVE_DIVX=no
773
    ])
774
  fi
775
  if [ test x$HAVE_DIVX = xyes ]; then
776
    AC_MSG_CHECKING([Checking for valid divx4linux decore version])
777
    AC_TRY_COMPILE([
778
#include <decore.h>
779
#if DECORE_VERSION != 20021112
780
#error Wrong version of divx decore libraries
781
#endif
782
    ], [
783
return 0;
784
    ], [
785
      HAVE_DIVX=yes
786
      AC_MSG_RESULT(yes)
787
    ], [
788
      HAVE_DIVX=no
789
      AC_MSG_RESULT(no)
790
      AC_MSG_WARN([Wrong version of divx4linux installed])
791
    ])
792
  fi
793
  LIBS="-lm"
794
  if test x$HAVE_DIVX = xyes; then
795
    AC_CHECK_LIB(divxencore, encore, , [
796
      AC_MSG_WARN([Divx4linux encore libs not found])
797
      HAVE_DIVX=no
798
    ])
799
  fi
800
  if test x$HAVE_DIVX = xyes; then
801
    AC_CHECK_LIB(divxdecore, decore, , [
802
      AC_MSG_WARN([Divx4linux decore libs not found])
803
      HAVE_DIVX=no
804
  ])
805
  fi
806
  if test x$HAVE_DIVX = xyes; then
807
    DIVXENC_LIBS="-ldivxencore -lm"
808
    DIVXDEC_LIBS="-ldivxdecore -lm"
809
    AC_SUBST(DIVXENC_LIBS)
810
    AC_SUBST(DIVXDEC_LIBS)
811
  fi
812
])
813
814
dnl *** dvdnav for resindvd ***
815
translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
816
AG_GST_CHECK_FEATURE(DVDNAV, [dvdnav library], resindvd, [
817
  translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
818
  translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
819
  AG_GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
820
  if test x"$HAVE_DVDNAV" = x"yes"; then
821
    dnl check version
822
    DVDNAV_VERSION=`dvdnav-config --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
823
    DVDNAV_MAJOR=`echo $DVDNAV_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
824
    DVDNAV_MINOR=`echo $DVDNAV_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
825
    DVDNAV_MICRO=`echo $DVDNAV_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
826
    if [[ "$DVDNAV_MAJOR" -lt "4" ]]; then
827
      AC_MSG_WARN([libdvdnav >= 4.1.2 is required, you have $DVDNAV_VERSION])
828
      HAVE_DVDNAV="no"
829
    elif [[ "$DVDNAV_MAJOR" -eq "4" ]] && \
830
         [[ "$DVDNAV_MINOR" -lt "1" ]]; then
831
      AC_MSG_WARN([libdvdnav >= 4.1.2 is required, you have $DVDNAV_VERSION])
832
      HAVE_DVDNAV="no"
833
    elif [[ "$DVDNAV_MAJOR" -eq "4" ]] && \
834
         [[ "$DVDNAV_MINOR" -eq "1" ]] && \
835
         [[ "$DVDNAV_MICRO" -lt "2" ]]; then
836
      AC_MSG_WARN([libdvdnav >= 4.1.2 is required, you have $DVDNAV_VERSION])
837
      HAVE_DVDNAV="no"
838
    fi
839
  fi
840
  AS_SCRUB_INCLUDE(DVDNAV_CFLAGS)
841
])
842
843
dnl *** METADATA ***
844
translit(dnm, m, l) AM_CONDITIONAL(USE_METADATA, true)
845
AG_GST_CHECK_FEATURE(METADATA, [METADATA muxer and demuxer], metadata, [
846
  HAVE_METADATA="no"
847
  PKG_CHECK_MODULES(EXIF, libexif >= 0.6.16, HAVE_EXIF="yes", [
848
    HAVE_EXIF="no"
849
  ])
850
  PKG_CHECK_MODULES(IPTC, libiptcdata >= 1.0.2, HAVE_IPTC="yes", [
851
    HAVE_IPTC="no"
852
  ])
853
  PKG_CHECK_MODULES(XMP, exempi-2.0, HAVE_XMP="yes", [
854
    HAVE_XMP="no"
855
  ])
856
  PKG_CHECK_MODULES(XMP_1_99_5, exempi-2.0 >= 1.99.5, XMP_CFLAGS="-DXMP_1_99_5 $XMP_CFLAGS", AC_MSG_RESULT(no))
857
  if test x$HAVE_EXIF = xyes; then
858
    METADATA_CFLAGS="-DHAVE_EXIF $EXIF_CFLAGS $METADATA_CFLAGS"
859
    METADATA_LIBS="$EXIF_LIBS $METADATA_LIBS -lm"
860
    HAVE_METADATA="yes"
861
  fi
862
  if test x$HAVE_IPTC = xyes; then
863
    METADATA_CFLAGS="-DHAVE_IPTC $IPTC_CFLAGS $METADATA_CFLAGS"
864
    METADATA_LIBS="$IPTC_LIBS $METADATA_LIBS"
865
    HAVE_METADATA="yes"
866
  fi
867
  if test x$HAVE_XMP = xyes; then
868
    METADATA_CFLAGS="-DHAVE_XMP $XMP_CFLAGS $METADATA_CFLAGS"
869
    METADATA_LIBS="$XMP_LIBS $METADATA_LIBS"
870
    HAVE_METADATA="yes"
871
  fi
872
  if test x$HAVE_METADATA = xno; then
873
    AC_MSG_WARN(no of metadata libraries (exif, iptc or xmp) found)
874
  else
875
    HAVE_METADATA="yes"
876
  fi
877
  AC_SUBST(METADATA_CFLAGS)
878
  AC_SUBST(METADATA_LIBS)
879
])
880
881
dnl **** Free AAC Encoder (FAAC) ****
882
translit(dnm, m, l) AM_CONDITIONAL(USE_FAAC, true)
883
AG_GST_CHECK_FEATURE(FAAC, [AAC encoder plug-in], faac, [
884
  AG_GST_CHECK_LIBHEADER(FAAC, faac, faacEncOpen, -lm, faac.h,
885
    FAAC_LIBS="-lfaac -lm")
886
  AS_SCRUB_INCLUDE(FAAC_CFLAGS)
887
  AC_SUBST(FAAC_LIBS)
888
])
889
890
dnl **** Free AAC Decoder (FAAD) ****
891
translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
892
AG_GST_CHECK_FEATURE(FAAD, [AAC decoder plug-in], faad, [
893
  HAVE_FAAD="yes"
894
  faad_hdr=""
895
  AG_GST_CHECK_LIBHEADER(FAAD, faad, faacDecOpen, -lm, faad.h,
896
    FAAD_LIBS="-lfaad -lm", HAVE_FAAD="no")
897
  if test $HAVE_FAAD = "no"; then
898
    AG_GST_CHECK_LIBHEADER(FAAD, faad, NeAACDecOpen, -lm, neaacdec.h,
899
      [ FAAD_LIBS="-lfaad -lm"
900
        AC_DEFINE(FAAD_IS_NEAAC, 1, [Define if AAC is using new api prefix])
901
        faad_hdr="neaacdec.h"
902
      ], [
903
        HAVE_FAAD="no"
904
      ],)
905
  else
906
    faad_hdr="faad.h"
907
  fi
908
  if test $HAVE_FAAD = "yes"; then
909
    AC_MSG_CHECKING([Checking for FAAD >= 2.0])
910
    AC_TRY_COMPILE([#include <faad.h>], [
911
        #if !defined(FAAD2_VERSION) || !defined(FAAD_FMT_DOUBLE)
912
        #error Not faad2
913
        #else
914
        /* Release candidate of 2.0 is not good enough for us. This field
915
         * was added only in 2.0 final and does not exist in 2.0-RC3 */
916
        faacDecConfiguration conf; conf.dontUpSampleImplicitSBR = 1;
917
        #endif
918
    ], [
919
      HAVE_FAAD="yes"
920
      AC_MSG_RESULT(yes)
921
922
      AC_MSG_CHECKING([Checking FAAD2 version in $faad_hdr])
923
      for minor in 10 9 8 7 6 5 0; do
924
        if test x$faad2_minor_version = "x"; then
925
          AC_EGREP_CPP([GST_CHECK_FAAD_VERSION \"2\.$minor\"], [
926
              #include <$faad_hdr>
927
              GST_CHECK_FAAD_VERSION FAAD2_VERSION
928
            ], [
929
              faad2_minor_version=$minor
930
            ])
931
        fi
932
      done
933
      if test x$faad2_minor_version = "x"; then
934
        AC_MSG_RESULT([no idea])
935
      else
936
        AC_MSG_RESULT([2.$faad2_minor_version])
937
        AC_DEFINE_UNQUOTED([FAAD2_MINOR_VERSION], [$faad2_minor_version], [The x in 2.x])
938
      fi
939
    ], [
940
      HAVE_FAAD="no"
941
      AC_MSG_RESULT(no)
942
    ])
943
  fi
944
  AS_SCRUB_INCLUDE(FAAD_CFLAGS)
945
  AC_SUBST(FAAD_LIBS)
946
  AC_SUBST(FAAD_IS_NEAAC)
947
])
948
949
dnl *** fbdev ***
950
translit(dnm, m, l) AM_CONDITIONAL(USE_FBDEV, true)
951
AG_GST_CHECK_FEATURE(FBDEV, [linux framebuffer], fbdevsink, [
952
  if test "x$HAVE_FBDEV" != "xyes"; then
953
    AC_CHECK_HEADER([linux/fb.h], HAVE_FBDEV=yes, HAVE_FBDEV=no)
954
  fi
955
])
956
957
dnl *** gsm ***
958
translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
959
AG_GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
960
  AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
961
  if test $HAVE_GSM != "yes"; then
962
    AG_GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
963
    if test $HAVE_GSM = "yes"; then
964
      AC_DEFINE(GSM_HEADER_IN_SUBDIR, 1, [Define if GSM header in gsm/ subdir])
965
    fi
966
  fi
967
  AC_SUBST(GSM_LIBS)
968
])
969
970
dnl *** ivorbis ***
971
dnl AM_PATH_IVORBIS only takes two options
972
translit(dnm, m, l) AM_CONDITIONAL(USE_IVORBIS, true)
973
AG_GST_CHECK_FEATURE(IVORBIS, [integer vorbis plug-in], ivorbisdec, [
974
  IVORBIS_LIBS=
975
  IVORBIS_CFLAGS=
976
  AC_CHECK_LIB(vorbisidec, vorbis_block_init,
977
    [IVORBIS_LIBS=-lvorbisidec
978
     HAVE_IVORBIS=yes
979
     case $host in
980
     arm-*-*)
981
       IVORBIS_CFLAGS="-D_ARM_ASSEM_ $IVORBIS_CFLAGS"
982
     esac
983
    ],
984
    HAVE_IVORBIS=no)
985
  AC_SUBST(IVORBIS_LIBS)
986
  AC_SUBST(IVORBIS_CFLAGS)
987
])
988
989
dnl *** Jack ***
990
translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
991
AG_GST_CHECK_FEATURE(JACK, Jack, jack, [
992
  PKG_CHECK_MODULES(JACK, jack >= 0.99.10, HAVE_JACK="yes", HAVE_JACK="no")
993
  AC_SUBST(JACK_CFLAGS)
994
  AC_SUBST(JACK_LIBS)
995
])
996
997
dnl *** jp2k ***
998
translit(dnm, m, l) AM_CONDITIONAL(USE_JP2K, true)
999
AG_GST_CHECK_FEATURE(JP2K, [jp2k], jp2kdec jp2kenc, [
1000
  AG_GST_CHECK_LIBHEADER(JP2K, jasper, jas_stream_fopen, , jasper/jasper.h,
1001
    JP2K_LIBS="-ljasper")
1002
  AC_SUBST(JP2K_LIBS)
1003
])
1004
1005
dnl *** kate ***
1006
translit(dnm, m, l) AM_CONDITIONAL(USE_KATE, true)
1007
AG_GST_CHECK_FEATURE(KATE, [Kate], kate, [
1008
  PKG_CHECK_MODULES(KATE, kate >= 0.1.7, HAVE_KATE="yes", [
1009
    HAVE_KATE="no"
1010
    AC_MSG_RESULT(no)
1011
  ])
1012
  AC_SUBST(KATE_CFLAGS)
1013
  AC_SUBST(KATE_LIBS)
1014
  PKG_CHECK_MODULES(TIGER, tiger >= 0.3.2,
1015
    [
1016
      HAVE_TIGER="yes"
1017
      AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available])
1018
    ],
1019
    [
1020
      HAVE_TIGER="no"
1021
      AC_MSG_RESULT(no)
1022
    ]
1023
  )
1024
  AM_CONDITIONAL(USE_TIGER, test "x$HAVE_TIGER" = "xyes")
1025
  AC_SUBST(TIGER_CFLAGS)
1026
  AC_SUBST(TIGER_LIBS)
1027
],,,[AM_CONDITIONAL(USE_TIGER, false)])
1028
1029
dnl *** ladspa ***
1030
translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
1031
AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
1032
  AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
1033
  
1034
  PKG_CHECK_MODULES(LRDF, lrdf, HAVE_LRDF=yes, HAVE_LRDF=no)
1035
  if test $HAVE_LRDF = "yes"; then
1036
    AC_DEFINE(HAVE_LRDF, 1, [Define if we have liblrdf])
1037
  fi
1038
  AC_SUBST(LRDF_LIBS)
1039
  AC_SUBST(LRDF_CFLAGS)
1040
])
1041
1042
dnl *** LV2 ***
1043
translit(dnm, m, l) AM_CONDITIONAL(USE_LV2, true)
1044
AG_GST_CHECK_FEATURE(LV2, [lv2], lv2, [
1045
  PKG_CHECK_MODULES(SLV2, slv2 >= 0.6.6, HAVE_LV2="yes", HAVE_LV2="no")
1046
  AC_SUBST(SLV2_CFLAGS)
1047
  AC_SUBST(SLV2_LIBS)
1048
])
1049
1050
dnl *** libmms ***
1051
translit(dnm, m, l) AM_CONDITIONAL(USE_LIBMMS, true)
1052
AG_GST_CHECK_FEATURE(LIBMMS, [mms protocol library], libmms, [
1053
  dnl check with pkg-config first
1054
  PKG_CHECK_MODULES(LIBMMS, libmms >= 0.4, HAVE_LIBMMS="yes", [
1055
    HAVE_LIBMMS="no"
1056
    AC_MSG_RESULT(no)
1057
  ])
1058
])
1059
AC_SUBST(LIBMMS_LIBS)
1060
1061
dnl *** modplug ***
1062
translit(dnm, m, l) AM_CONDITIONAL(USE_MODPLUG, true)
1063
AG_GST_CHECK_FEATURE(MODPLUG, modplug, modplug, [
1064
  if test "x$HAVE_CXX" != "xyes"; then
1065
    AC_MSG_WARN([Not compiling modplug plugin as it requires a C++ compiler])
1066
    HAVE_MODPLUG="no"
1067
  else
1068
    PKG_CHECK_MODULES(MODPLUG, libmodplug, HAVE_MODPLUG="yes", HAVE_MODPLUG="no")
1069
  fi
1070
  AC_SUBST(MODPLUG_CFLAGS)
1071
  AC_SUBST(MODPLUG_LIBS)
1072
])
1073
1074
dnl *** mimic ***
1075
translit(dnm, m, l) AM_CONDITIONAL(USE_MIMIC, true)
1076
AG_GST_CHECK_FEATURE(MIMIC, [libmimic library], mimic, [
1077
  MIMDEC_REQUIRED=1.0
1078
  PKG_CHECK_MODULES(MIMIC, libmimic >= $MIMDEC_REQUIRED,
1079
      HAVE_MIMIC=yes, HAVE_MIMIC=no)
1080
  AC_SUBST(MIMIC_CFLAGS)
1081
  AC_SUBST(MIMIC_LIBS)
1082
])
1083
1084
dnl *** mjpegtools version info ***
1085
dnl some may prefer older version (given quirks above)
1086
dnl hm, no version info seems available within mjpegtools headers
1087
dnl and API really moves along
1088
echo
1089
PKG_CHECK_EXISTS(mjpegtools >= 1.6.1.93 mjpegtools < 1.8.0, [
1090
  mjpegtools_api=10601
1091
], [
1092
  PKG_CHECK_EXISTS(mjpegtools >= 1.8.0 mjpegtools < 1.9.0, [
1093
    mjpegtools_api=10800
1094
  ], [
1095
    PKG_CHECK_MODULES(MJPEG, mjpegtools >= 1.9.0, [
1096
      dnl logging API changed in release candidates
1097
      OLD_CFLAGS="$CFLAGS"
1098
      OLD_LIBS="$LIBS"
1099
      CFLAGS="$MJPEG_CFLAGS"
1100
      LIBS="$LIBS $MJPEG_LIBS -lmjpegutils -lm -lpthread"
1101
      AC_CHECK_FUNC(mjpeg_loglev_t, [
1102
        mjpegtools_api=10903
1103
        ], [
1104
        mjpegtools_api=10900
1105
        ])
1106
      CFLAGS="$OLD_CFLAGS"
1107
      LIBS="$OLD_LIBS"
1108
    ], [
1109
      mjpegtools_api=0
1110
    ])
1111
  ])
1112
])
1113
AC_DEFINE_UNQUOTED(GST_MJPEGTOOLS_API, $mjpegtools_api,
1114
  [mjpegtools API evolution])
1115
1116
dnl *** mpeg2enc ***
1117
translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2ENC, true)
1118
AG_GST_CHECK_FEATURE(MPEG2ENC, [mpeg2enc], mpeg2enc, [
1119
  HAVE_MPEG2ENC="no"
1120
  dnl we require a c++ compiler for this one
1121
  if [ test x$HAVE_CXX = xyes ]; then
1122
    dnl libmpeg2enc was first included in mjpegtools-1.6.2-rc3 (1.6.1.92)
1123
    dnl since many distros include mjpegtools specifically without mplex
1124
    dnl and mpeg2enc, we check for mpeg2enc on its own, too.
1125
    PKG_CHECK_MODULES(MPEG2ENC, mjpegtools >= 1.6.1.93, [
1126
      dnl HACK because mpeg2enc 1.8.0 header files have a spurious 'include config.h'
1127
      touch config.h
1128
      dnl switch over to c++ to test things
1129
      AC_LANG_CPLUSPLUS
1130
      OLD_CPPFLAGS="$CPPFLAGS"
1131
      dnl HACK as above
1132
      CPPFLAGS_GOOD="$CPPFLAGS $MPEG2ENC_CFLAGS"
1133
      CPPFLAGS="$CPPFLAGS_GOOD -I."
1134
      dnl check headers
1135
      mpeg2enc_headers_ok=no
1136
      AC_CHECK_HEADER([mpeg2encoder.hh], [
1137
        MPEG2ENC_LIBS="$MPEG2ENC_LIBS -lmpeg2encpp -lm -lpthread"
1138
        OLD_LIBS="$LIBS"
1139
        LIBS="$LIBS $MPEG2ENC_LIBS"
1140
        AC_MSG_CHECKING([for valid mpeg2enc objects])
1141
        AC_TRY_RUN([
1142
          #include <mpeg2encoder.hh>
1143
          #include <mpeg2encoptions.hh>
1144
1145
          int
1146
          main (int   argc,
1147
                char *argv[])
1148
          {
1149
            MPEG2EncOptions *options = new MPEG2EncOptions ();
1150
            MPEG2Encoder *encoder = new MPEG2Encoder (*options);
1151
            return 0;
1152
          }
1153
        ],[
1154
          AC_MSG_RESULT(yes)
1155
          dnl so far so good, let's check more things:
1156
          dnl mjpegtools-1.8.0 does not install the required
1157
          dnl mpeg2syntaxcodes.h header by default, and a new release
1158
          dnl is not in sight, so check for this oversight in case
1159
          dnl distros or folks have fixed this themselves
1160
          if test "$mjpegtools_api" -ge "10800"; then
1161
            AC_CHECK_HEADER([mpeg2syntaxcodes.h], [
1162
                mpeg2enc_headers_ok=yes
1163
              ], [
1164
                mpeg2enc_headers_ok=no
1165
              ])
1166
          else
1167
            mpeg2enc_headers_ok=yes
1168
          fi
1169
          if test "x$mpeg2enc_headers_ok" = "xyes"; then
1170
            HAVE_MPEG2ENC="yes"
1171
          fi
1172
          CPP_FLAGS="$CPPFLAGS_GOOD"
1173
          AC_SUBST(MPEG2ENC_CFLAGS)
1174
          AC_SUBST(MPEG2ENC_LIBS)
1175
        ], [
1176
          AC_MSG_RESULT(no)
1177
        ])
1178
        LIBS="$OLD_LIBS"
1179
      ])
1180
1181
      CPPFLAGS="$OLD_CPPFLAGS"
1182
      AC_LANG_C
1183
    ], [
1184
      HAVE_MPEG2ENC="no"
1185
    ])
1186
  fi
1187
])
1188
1189
dnl *** mplex ***
1190
translit(dnm, m, l) AM_CONDITIONAL(USE_MPLEX, true)
1191
AG_GST_CHECK_FEATURE(MPLEX, [mplex], mplex, [
1192
  HAVE_MPLEX="no"
1193
  dnl we require a c++ compiler for this one
1194
  if [ test x$HAVE_CXX = xyes ]; then
1195
    dnl libmplex was first included in mjpegtools-1.6.2-rc4 (1.6.1.93)
1196
    dnl since many distros include mjpegtools specifically without mplex
1197
    dnl and mpeg2enc, we check for mplex on its own, too.
1198
    dnl libmplex < 1.9rc? has fuzzy ABI, valgrind and other problems
1199
    PKG_CHECK_MODULES(MPLEX, mjpegtools >= 1.9.0, [
1200
      dnl switch over to c++ to test things
1201
      AC_LANG_CPLUSPLUS
1202
      OLD_CPPFLAGS="$CPPFLAGS"
1203
      CPPFLAGS="$CPPFLAGS $MPLEX_CFLAGS"
1204
      AC_CHECK_HEADER(interact.hpp, [
1205
        MPLEX_LIBS="$MPLEX_LIBS -lmplex2 -lm"
1206
        OLD_LIBS="$LIBS"
1207
        LIBS="$LIBS $MPLEX_LIBS"
1208
        dnl older libmplex uses off_t SegmentSize (), which leads to fuzzy ABI;
1209
        dnl don't want this here
1210
        AC_MSG_CHECKING([for valid mplex objects])
1211
        AC_TRY_RUN([
1212
1213
#include <interact.hpp>
1214
#include <outputstrm.hpp>
1215
#include <multiplexor.hpp>
1216
int
1217
main (int   argc,
1218
      char *argv[])
1219
{
1220
  class TestOutputStream : public OutputStream {
1221
  public:
1222
    TestOutputStream () : OutputStream () { }
1223
    void Write (uint8_t *a, unsigned int b) { }
1224
    void NextSegment () { }
1225
    uint64_t SegmentSize () { }
1226
    void Close () { }
1227
    int Open () { }
1228
};
1229
  MultiplexJob *job = new MultiplexJob ();
1230
  vector<IBitStream *> inputs;
1231
  job->SetupInputStreams (inputs);
1232
  TestOutputStream *out = new TestOutputStream ();
1233
  Multiplexor *mux = new Multiplexor(*job, *out, NULL);
1234
  return 0;
1235
}
1236
        ],[
1237
          HAVE_MPLEX="yes"
1238
          AC_SUBST(MPLEX_CFLAGS)
1239
          AC_SUBST(MPLEX_LIBS)
1240
          AC_MSG_RESULT(yes)
1241
        ], AC_MSG_RESULT(no))
1242
        LIBS="$OLD_LIBS"
1243
      ])
1244
      CPPFLAGS="$OLD_CPPFLAGS"
1245
      AC_LANG_C
1246
    ], HAVE_MPLEX="no")
1247
  fi
1248
])
1249
1250
dnl *** musepack ***
1251
translit(dnm, m, l) AM_CONDITIONAL(USE_MUSEPACK, true)
1252
AG_GST_CHECK_FEATURE(MUSEPACK, [musepackdec], musepack, [
1253
  AC_CHECK_HEADER([mpc/mpcdec.h], [
1254
    HAVE_MUSEPACK="yes"
1255
    MUSEPACK_LIBS="-lmpcdec"
1256
    AC_SUBST(MUSEPACK_LIBS)
1257
    ], [AC_CHECK_HEADER([mpcdec/mpcdec.h], [
1258
      HAVE_MUSEPACK="yes"
1259
      MUSEPACK_LIBS="-lmpcdec"
1260
      AC_DEFINE(MPC_IS_OLD_API, 1, [Define if the old MusePack API is used])
1261
      AC_SUBST(MUSEPACK_LIBS)
1262
    ], [HAVE_MUSEPACK="no"])])
1263
])
1264
1265
dnl *** musicbrainz ***
1266
translit(dnm, m, l) AM_CONDITIONAL(USE_MUSICBRAINZ, true)
1267
AG_GST_CHECK_FEATURE(MUSICBRAINZ, [musicbrainz tag generation], musicbrainz, [
1268
  PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= 2.1.0, HAVE_MUSICBRAINZ="yes", HAVE_MUSICBRAINZ="no")
1269
  AC_SUBST(MUSICBRAINZ_CFLAGS)
1270
  AC_SUBST(MUSICBRAINZ_LIBS)
1271
])
1272
1273
dnl *** MythTV ***
1274
translit(dnm, m, l) AM_CONDITIONAL(USE_MYTHTV, true)
1275
AG_GST_CHECK_FEATURE(MYTHTV, [MythTV client plugins], mythtvsrc, [
1276
  PKG_CHECK_MODULES(GMYTH, gmyth >= 0.4 gmyth <= 0.7.99, HAVE_MYTHTV="yes", [
1277
    HAVE_MYTHTV="no"
1278
    AC_MSG_RESULT(no)
1279
  ])
1280
  AC_SUBST(GMYTH_CFLAGS)
1281
  AC_SUBST(GMYTH_LIBS)
1282
])
1283
1284
dnl *** nas ***
1285
translit(dnm, m, l) AM_CONDITIONAL(USE_NAS, true)
1286
AG_GST_CHECK_FEATURE(NAS, [nas plug-in], nassink, [
1287
  HAVE_NAS="no"
1288
  AG_GST_CHECK_X
1289
  if test "x$HAVE_X" = "xyes"; then
1290
    save_cppflags=$CFLAGS
1291
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1292
    AG_GST_CHECK_LIBHEADER(NAS, audio, AuOpenServer, $X_LIBS, audio/audiolib.h,
1293
      NAS_LIBS="$X_LIBS -laudio" NAS_CFLAGS="$X_CFLAGS")
1294
    CPPFLAGS="$save_cppflags"
1295
  fi
1296
  AC_SUBST(NAS_CFLAGS)
1297
  AC_SUBST(NAS_LIBS)
1298
])
1299
1300
dnl *** neon ***
1301
translit(dnm, m, l) AM_CONDITIONAL(USE_NEON, true)
1302
AG_GST_CHECK_FEATURE(NEON, [neon http client plugins], neonhttpsrc, [
1303
  PKG_CHECK_MODULES(NEON, neon >= 0.26.0  neon <= 0.28.99, HAVE_NEON="yes", [
1304
    HAVE_NEON="no"
1305
    AC_MSG_RESULT(no)
1306
  ])
1307
  AC_SUBST(NEON_CFLAGS)
1308
  AC_SUBST(NEON_LIBS)
1309
])
1310
1311
dnl *** ofa ***
1312
translit(dnm, m, l) AM_CONDITIONAL(USE_OFA, true)
1313
AG_GST_CHECK_FEATURE(OFA, [ofa plugins], ofa, [
1314
  PKG_CHECK_MODULES(OFA, libofa >= 0.9.3, HAVE_OFA="yes", [
1315
    HAVE_OFA="no"
1316
    AC_MSG_RESULT(no)
1317
  ])
1318
  AC_SUBST(OFA_CFLAGS)
1319
  AC_SUBST(OFA_LIBS)
1320
])
1321
1322
dnl *** rsvg ***
1323
translit(dnm, m, l) AM_CONDITIONAL(USE_RSVG, true)
1324
AG_GST_CHECK_FEATURE(RSVG, [rsvg decoder], rsvg, [
1325
  PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.14 cairo, HAVE_RSVG="yes", [
1326
    HAVE_RSVG="no"
1327
    AC_MSG_RESULT(no)
1328
  ])
1329
  AC_SUBST(RSVG_CFLAGS)
1330
  AC_SUBST(RSVG_LIBS)
1331
])
1332
1333
dnl *** timidity ***
1334
translit(dnm, m, l) AM_CONDITIONAL(USE_TIMIDITY, true)
1335
AG_GST_CHECK_FEATURE(TIMIDITY, [timidity midi soft synth plugin], timidity, [
1336
  PKG_CHECK_MODULES(TIMIDITY, libtimidity, [
1337
    HAVE_TIMIDITY="yes",
1338
	AC_MSG_CHECKING([for timidity.cfg])
1339
	timidity_cfg=""
1340
	if test -r /etc/timidity.cfg; then
1341
	  timidity_cfg=/etc/timidity.cfg
1342
	elif test -r /etc/timidity/timidity.cfg; then
1343
	  timidity_cfg=/etc/timidity/timidity.cfg
1344
	elif test -r /usr/share/timidity/timidity.cfg; then
1345
	  timidity_cfg=/usr/share/timidity/timidity.cfg
1346
	elif test -r /usr/local/share/timidity/timidity.cfg; then
1347
	  timidity_cfg=/usr/local/share/timidity/timidity.cfg
1348
	fi
1349
	if test "x$timidity_cfg" != "x"; then
1350
	  AC_MSG_RESULT($timidity_cfg)
1351
      AC_DEFINE_UNQUOTED(TIMIDITY_CFG, "$timidity_cfg", [Define location of timidity.cfg])
1352
	else
1353
	  AC_MSG_RESULT([not found])
1354
	fi
1355
  ], [
1356
    HAVE_TIMIDITY="no"
1357
    AC_MSG_RESULT(no)
1358
  ])
1359
  AC_SUBST(TIMIDITY_CFLAGS)
1360
  AC_SUBST(TIMIDITY_LIBS)
1361
])
1362
1363
dnl *** wildmidi ***
1364
translit(dnm, m, l) AM_CONDITIONAL(USE_WILDMIDI, true)
1365
AG_GST_CHECK_FEATURE(WILDMIDI, [wildmidi midi soft synth plugin], wildmidi, [
1366
  AC_CHECK_HEADER([wildmidi_lib.h],HAVE_WILDMIDI=yes, HAVE_WILDMIDI=no)
1367
  if test "x$HAVE_WILDMIDI" = "xyes"; then
1368
	 WILDMIDI_CFLAGS=
1369
	 WILDMIDI_LIBS=-lWildMidi
1370
	 AC_MSG_NOTICE(compiling gstWildMidi)
1371
  else
1372
	 WILDMIDI_CFLAGS=
1373
	 WILDMIDI_LIBS=
1374
	 AC_MSG_WARN(no WildMidi library found (libWildMidi))
1375
  fi
1376
  AC_SUBST(WILDMIDI_CFLAGS)
1377
  AC_SUBST(WILDMIDI_LIBS)
1378
])
1379
1380
dnl *** SDL ***
1381
translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
1382
AG_GST_CHECK_FEATURE(SDL, [SDL plug-in], sdlvideosink sdlaudiosink, [
1383
    AM_PATH_SDL(, HAVE_SDL=yes, HAVE_SDL=no)
1384
])
1385
1386
dnl *** sndfile ***
1387
translit(dnm, m, l) AM_CONDITIONAL(USE_SNDFILE, true)
1388
AG_GST_CHECK_FEATURE(SNDFILE, [sndfile plug-in], sfsrc sfsink, [
1389
  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.16, HAVE_SNDFILE="yes", HAVE_SNDFILE="no")
1390
  AC_SUBST(SNDFILE_CFLAGS)
1391
  AC_SUBST(SNDFILE_LIBS)
1392
])
1393
1394
dnl *** soundtouch ***
1395
translit(dnm, m, l) AM_CONDITIONAL(USE_SOUNDTOUCH, true)
1396
AG_GST_CHECK_FEATURE(SOUNDTOUCH, [soundtouch plug-in], soundtouch, [
1397
  dnl We only need -lBPM on soundtouch < 1.4
1398
  dnl We check for libSoundTouch since Debian used it before upstream
1399
  dnl added a pkgconfig file.
1400
  HAVE_SOUNDTOUCH_1_4=yes
1401
  PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.4,
1402
    [HAVE_SOUNDTOUCH=yes],
1403
    [PKG_CHECK_MODULES(SOUNDTOUCH, soundtouch-1.0,
1404
      [HAVE_SOUNDTOUCH=yes
1405
        HAVE_SOUNDTOUCH_1_4=no
1406
        SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"], 
1407
      [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch >= 1.4,
1408
        [HAVE_SOUNDTOUCH=yes],
1409
        [PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch,
1410
          [HAVE_SOUNDTOUCH=yes
1411
            HAVE_SOUNDTOUCH_1_4=no
1412
            SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS -lBPM"],
1413
          HAVE_SOUNDTOUCH=no)])])])
1414
  AC_SUBST(SOUNDTOUCH_CFLAGS)
1415
  AC_SUBST(SOUNDTOUCH_LIBS)
1416
  if test "x$HAVE_CXX" != "xyes"; then
1417
    USE_SOUNDTOUCH=false
1418
    AC_MSG_NOTICE([Not building soundtouch plugin: no C++ compiler found])
1419
  fi
1420
  if test "x$HAVE_SOUNDTOUCH" = "xyes" -a "x$HAVE_SOUNDTOUCH_1_4" = "xyes"; then
1421
     AC_DEFINE([HAVE_SOUNDTOUCH_1_4], [1],
1422
         [Defined if the available libSoundTouch is >= 1.4])
1423
  fi
1424
])
1425
1426
dnl *** spc ***
1427
translit(dnm, m, l) AM_CONDITIONAL(USE_SPC, true)
1428
AG_GST_CHECK_FEATURE(SPC, [spc decoder], spc, [
1429
  AC_CHECK_HEADER(openspc.h, [
1430
    AC_CHECK_LIB(openspc, OSPC_Init, [
1431
      SPC_LIBS="-lopenspc"
1432
      AC_SUBST(SPC_LIBS)
1433
      HAVE_SPC=yes
1434
    ], [
1435
      HAVE_SPC=no
1436
    ])
1437
  ], [
1438
    HAVE_SPC=no
1439
  ])
1440
])
1441
1442
dnl *** gme ***
1443
translit(dnm, m, l) AM_CONDITIONAL(USE_GME, true)
1444
AG_GST_CHECK_FEATURE(GME, [gme decoder], gme, [
1445
  AC_CHECK_HEADER(gme/gme.h, [
1446
    AC_CHECK_LIB(gme, gme_new_emu, [
1447
      GME_LIBS="-lgme"
1448
      AC_SUBST(GME_LIBS)
1449
      HAVE_GME=yes
1450
    ], [
1451
      HAVE_GME=no
1452
    ])
1453
  ], [
1454
    HAVE_GME=no
1455
  ])
1456
1457
  if test "x$HAVE_GME" = "xyes"; then
1458
    AC_CHECK_LIB(gme, gme_enable_accuracy, [
1459
      AC_DEFINE(HAVE_LIBGME_ACCURACY, 1, [Define if gme 0.5.6 or newer is available])
1460
      ])
1461
  fi
1462
])
1463
1464
dnl *** swfdec ***
1465
translit(dnm, m, l) AM_CONDITIONAL(USE_SWFDEC, true)
1466
AG_GST_CHECK_FEATURE(SWFDEC, [swfdec plug-in], swfdec, [
1467
  PKG_CHECK_MODULES(SWFDEC, swfdec-0.3 >= 0.3.6, HAVE_SWFDEC=yes, [
1468
    HAVE_SWFDEC=no
1469
    AC_MSG_RESULT(no)
1470
  ])
1471
  AC_SUBST(SWFDEC_CFLAGS)
1472
  AC_SUBST(SWFDEC_LIBS)
1473
])
1474
1475
dnl *** theora ***
1476
translit(dnm, m, l) AM_CONDITIONAL(USE_THEORADEC, true)
1477
AG_GST_CHECK_FEATURE(THEORADEC, [ogg theora codec], theoraexpdec, [
1478
  PKG_CHECK_MODULES(THEORADEC, theoradec, HAVE_THEORADEC="yes", [
1479
    HAVE_THEORADEC="no"
1480
    AC_MSG_RESULT(no)
1481
  ])
1482
  AC_SUBST(THEORADEC_LIBS)
1483
  AC_SUBST(THEORADEC_CFLAGS)
1484
])
1485
1486
dnl *** XVID ***
1487
translit(dnm, m, l) AM_CONDITIONAL(USE_XVID, true)
1488
AG_GST_CHECK_FEATURE(XVID, [xvid plugins], xvid, [
1489
  HAVE_XVID=no
1490
  AC_CHECK_HEADER(xvid.h, [
1491
    OLD_LIBS="$LIBS"
1492
    LIBS="-lm"
1493
    AC_CHECK_LIB(xvidcore, xvid_encore, [
1494
      AC_CHECK_LIB(xvidcore, xvid_decore, [
1495
        AC_CHECK_LIB(xvidcore, xvid_global, [
1496
          AC_MSG_CHECKING([for uptodate XviD API version])
1497
          AC_TRY_COMPILE([#include <xvid.h>], [
1498
              #if XVID_API_MAJOR(XVID_API) != 4
1499
              #error "Incompatible XviD API version"
1500
              #endif
1501
          ],[ AC_MSG_RESULT(yes)
1502
            XVID_LIBS="-lxvidcore -lm"
1503
            AC_SUBST(XVID_LIBS)
1504
            HAVE_XVID=yes
1505
          ], AC_MSG_RESULT(no) )
1506
        ], )
1507
      ], )
1508
    ], )
1509
    LIBS="$OLD_LIBS"
1510
  ], )
1511
])
1512
1513
dnl *** dvb ***
1514
translit(dnm, m, l) AM_CONDITIONAL(USE_DVB, true)
1515
AG_GST_CHECK_FEATURE(DVB, [DVB Source], dvb, [
1516
  AC_MSG_CHECKING([Checking for up to date dvb installation])
1517
  AC_CHECK_HEADER(linux/dvb/frontend.h, [HAVE_DVB="yes"], [HAVE_DVB="no"])
1518
])
1519
1520
dnl *** oss4 ***
1521
translit(dnm, m, l) AM_CONDITIONAL(USE_OSS4, true)
1522
AG_GST_CHECK_FEATURE(OSS4, [Open Sound System 4], oss4, [
1523
  AC_MSG_CHECKING([Checking if we can build the OSS4 elements])
1524
  AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/stat.h sys/types.h],
1525
      [test -z "$OSS4_MISSING_HEADER" && HAVE_OSS4="yes"],
1526
      [OSS4_MISSING_HEADER="yes";HAVE_OSS4="no"])
1527
])
1528
1529
dnl *** wininet ***
1530
translit(dnm, m, l) AM_CONDITIONAL(USE_WININET, true)
1531
AG_GST_CHECK_FEATURE(WININET, [Windows internet library], wininet, [
1532
  AC_MSG_CHECKING([Checking for windows internet support])
1533
  AC_CHECK_HEADERS([windows.h wininet.h],
1534
      [HAVE_WININET="yes"], [HAVE_WININET="no"])
1535
])
1536
1537
dnl *** acm ***
1538
translit(dnm, m, l) AM_CONDITIONAL(USE_ACM, true)
1539
AG_GST_CHECK_FEATURE(ACM, [Windows ACM library], acm, [
1540
  AC_MSG_CHECKING([Checking for ACM support])
1541
  AC_CHECK_HEADERS([windows.h msacm.h],
1542
      [HAVE_ACM="yes"
1543
       AC_SUBST(ACMENC_CFLAGS)
1544
       AC_SUBST(ACMMP3DEC_CFLAGS)
1545
      ], [HAVE_ACM="no"])
1546
])
1547
1548
dnl *** vdpau ***
1549
translit(dnm, m, l) AM_CONDITIONAL(USE_VDPAU, true)
1550
AG_GST_CHECK_FEATURE(VDPAU, [VDPAU], vdpau, [
1551
  VDPAU_CFLAGS=
1552
  VDPAU_LIBS=-lvdpau
1553
  HAVE_VDPAU=no
1554
1555
  PKG_CHECK_MODULES(VDPAU, vdpau, [HAVE_VDPAU="yes"],
1556
  [
1557
    if test "$HAVE_VDPAU" = "no"; then
1558
      saved_CPPFLAGS="$CPPFLAGS"
1559
      AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
1560
      
1561
      if test -z "$HAVE_VDPAU_H"; then
1562
        dnl Didn't find VDPAU header straight away.
1563
        dnl Try /usr/include/nvidia. Need to clear caching vars first
1564
        AC_MSG_NOTICE([VDPAU header not in standard path. Checking /usr/include/nvidia])
1565
        unset ac_cv_header_vdpau_vdpau_h
1566
        unset ac_cv_header_vdpau_vdpau_x11_h
1567
        VDPAU_CFLAGS="-I/usr/include/nvidia"
1568
        VDPAU_LIBS="-L/usr/lib/nvidia -lvdpau"
1569
        CPPFLAGS="$VDPAU_CFLAGS $saved_CPPFLAGS"
1570
        AC_CHECK_HEADER([vdpau/vdpau.h], [HAVE_VDPAU_H=yes])
1571
      fi
1572
      
1573
      AC_CHECK_HEADER([vdpau/vdpau_x11.h], [HAVE_VDPAU_X11_H=yes])
1574
  
1575
      if test "x$HAVE_VDPAU_H" = "xyes" -a "x$HAVE_VDPAU_X11_H" = "xyes"; then
1576
        dnl Found the headers - look for the lib
1577
        AC_MSG_NOTICE([VDPAU headers found. Checking libraries])
1578
        saved_LIBS="$LIBS"
1579
        LIBS="$VDPAU_LIBS $saved_LIBS"
1580
        AC_CHECK_LIB(vdpau,vdp_device_create_x11,[HAVE_VDPAU="yes"])
1581
        LIBS="$saved_LIBS"
1582
      fi
1583
    fi
1584
  ])
1585
1586
  if test "$HAVE_VDPAU" = "yes"; then
1587
    AC_MSG_NOTICE([Found up to date VDPAU installation])
1588
    AC_SUBST(VDPAU_CFLAGS)
1589
    AC_SUBST(VDPAU_LIBS)
1590
  fi
1591
])
1592
1593
dnl *** schroedinger ***
1594
translit(dnm, m, l) AM_CONDITIONAL(USE_SCHRO, true)
1595
AG_GST_CHECK_FEATURE(SCHRO, [Schroedinger video codec], schro, [
1596
  AG_GST_PKG_CHECK_MODULES(SCHRO, schroedinger-1.0 >= 1.0.7)
1597
])
1598
1599
else
1600
1601
dnl not building plugins with external dependencies,
1602
dnl but we still need to set the conditionals
1603
1604
AM_CONDITIONAL(USE_ALSA, false)
1605
AM_CONDITIONAL(USE_ASSRENDER, false)
1606
AM_CONDITIONAL(USE_AMRWB, false)
1607
AM_CONDITIONAL(USE_APEXSINK, false)
1608
AM_CONDITIONAL(USE_BZ2, false)
1609
AM_CONDITIONAL(USE_CDAUDIO, false)
1610
AM_CONDITIONAL(USE_CELT, false)
1611
AM_CONDITIONAL(USE_COG, false)
1612
AM_CONDITIONAL(USE_DC1394, false)
1613
AM_CONDITIONAL(USE_DIRECTFB, false)
1614
AM_CONDITIONAL(USE_DIRAC, false)
1615
AM_CONDITIONAL(USE_DTS, false)
1616
AM_CONDITIONAL(USE_DIVX, false)
1617
AM_CONDITIONAL(USE_DVDNAV, false)
1618
AM_CONDITIONAL(USE_METADATA, false)
1619
AM_CONDITIONAL(USE_FAAC, false)
1620
AM_CONDITIONAL(USE_FAAD, false)
1621
AM_CONDITIONAL(USE_FBDEV, false)
1622
AM_CONDITIONAL(USE_GSM, false)
1623
AM_CONDITIONAL(USE_IVORBIS, false)
1624
AM_CONDITIONAL(USE_JACK, false)
1625
AM_CONDITIONAL(USE_JP2K, false)
1626
AM_CONDITIONAL(USE_KATE, false)
1627
AM_CONDITIONAL(USE_TIGER, false)
1628
AM_CONDITIONAL(USE_LADSPA, false)
1629
AM_CONDITIONAL(USE_LV2, false)
1630
AM_CONDITIONAL(USE_LIBMMS, false)
1631
AM_CONDITIONAL(USE_MODPLUG, false)
1632
AM_CONDITIONAL(USE_MIMIC, false)
1633
AM_CONDITIONAL(USE_MPEG2ENC, false)
1634
AM_CONDITIONAL(USE_MPLEX, false)
1635
AM_CONDITIONAL(USE_MUSEPACK, false)
1636
AM_CONDITIONAL(USE_MUSICBRAINZ, false)
1637
AM_CONDITIONAL(USE_MYTHTV, false)
1638
AM_CONDITIONAL(USE_NAS, false)
1639
AM_CONDITIONAL(USE_NEON, false)
1640
AM_CONDITIONAL(USE_OFA, false)
1641
AM_CONDITIONAL(USE_RSVG, false)
1642
AM_CONDITIONAL(USE_TIMIDITY, false)
1643
AM_CONDITIONAL(USE_WILDMIDI, false)
1644
AM_CONDITIONAL(USE_SDL, false)
1645
AM_CONDITIONAL(USE_SNDFILE, false)
1646
AM_CONDITIONAL(USE_SOUNDTOUCH, false)
1647
AM_CONDITIONAL(USE_SPC, false)
1648
AM_CONDITIONAL(USE_GME, false)
1649
AM_CONDITIONAL(USE_SWFDEC, false)
1650
AM_CONDITIONAL(USE_THEORADEC, false)
1651
AM_CONDITIONAL(USE_XVID, false)
1652
AM_CONDITIONAL(USE_DVB, false)
1653
AM_CONDITIONAL(USE_OSS4, false)
1654
AM_CONDITIONAL(USE_WININET, false)
1655
AM_CONDITIONAL(USE_ACM, false)
1656
AM_CONDITIONAL(USE_VDPAU, false)
1657
AM_CONDITIONAL(USE_SCHRO, false)
1658
1659
fi dnl of EXT plugins
1660
1661
dnl *** finalize CFLAGS, LDFLAGS, LIBS
1662
1663
dnl Overview:
1664
dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
1665
dnl GST_*:              flags shared by built objects to link against GStreamer
1666
dnl GST_ALL_LDFLAGS:    linker flags shared by all
1667
dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
1668
dnl GST_LT_LDFLAGS:     library versioning of our libraries
1669
dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
1670
1671
dnl GST_OPTION_CFLAGS
1672
if test "x$USE_DEBUG" = xyes; then
1673
   PROFILE_CFLAGS="-g"
1674
fi
1675
AC_SUBST(PROFILE_CFLAGS)
1676
1677
if test "x$PACKAGE_VERSION_NANO" = "x1"; then
1678
  dnl Define _only_ during CVS (not pre-releases or releases)
1679
  DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
1680
else
1681
  DEPRECATED_CFLAGS=""
1682
fi
1683
AC_SUBST(DEPRECATED_CFLAGS)
1684
1685
dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
1686
dnl at make time with e.g. make ERROR_CFLAGS=""
1687
GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
1688
GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
1689
AC_SUBST(GST_OPTION_CFLAGS)
1690
AC_SUBST(GST_OPTION_CXXFLAGS)
1691
1692
dnl FIXME: do we want to rename to GST_ALL_* ?
1693
dnl prefer internal headers to already installed ones
1694
dnl also add builddir include for enumtypes and marshal
1695
dnl add GST_OPTION_CFLAGS, but overridable
1696
GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
1697
GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
1698
AC_SUBST(GST_CFLAGS)
1699
AC_SUBST(GST_CXXFLAGS)
1700
AC_SUBST(GST_LIBS)
1701
1702
dnl LDFLAGS really should only contain flags, not libs - they get added before
1703
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
1704
GST_ALL_LDFLAGS="-no-undefined"
1705
AC_SUBST(GST_ALL_LDFLAGS)
1706
1707
dnl this really should only contain flags, not libs - they get added before
1708
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
1709
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
1710
AC_SUBST(GST_PLUGIN_LDFLAGS)
1711
1712
SHAVE_INIT([common],[enable])
1713
1714
dnl *** output files ***
1715
1716
dnl po/Makefile.in
1717
1718
AC_CONFIG_FILES(
1719
Makefile
1720
common/Makefile
1721
common/shave
1722
common/shave-libtool
1723
common/m4/Makefile
1724
gst-plugins-bad.spec
1725
gst/Makefile
1726
gst/aacparse/Makefile
1727
gst/adpcmdec/Makefile
1728
gst/aiffparse/Makefile
1729
gst/amrparse/Makefile
1730
gst/asfmux/Makefile
1731
gst/autoconvert/Makefile
1732
gst/bayer/Makefile
1733
gst/camerabin/Makefile
1734
gst/cdxaparse/Makefile
1735
gst/dccp/Makefile
1736
gst/debugutils/Makefile
1737
gst/dtmf/Makefile
1738
gst/dvdspu/Makefile
1739
gst/festival/Makefile
1740
gst/freeze/Makefile
1741
gst/frei0r/Makefile
1742
gst/h264parse/Makefile
1743
gst/hdvparse/Makefile
1744
gst/id3tag/Makefile
1745
gst/legacyresample/Makefile
1746
gst/librfb/Makefile
1747
gst/liveadder/Makefile
1748
gst/mpegdemux/Makefile
1749
gst/mpegtsmux/Makefile
1750
gst/mpegtsmux/tsmux/Makefile
1751
gst/mpegpsmux/Makefile
1752
gst/mpeg4videoparse/Makefile
1753
gst/mpegvideoparse/Makefile
1754
gst/mve/Makefile
1755
gst/mxf/Makefile
1756
gst/nsf/Makefile
1757
gst/nuvdemux/Makefile
1758
gst/pcapparse/Makefile
1759
gst/pnm/Makefile
1760
gst/qtmux/Makefile
1761
gst/rawparse/Makefile
1762
gst/real/Makefile
1763
gst/rtpmux/Makefile
1764
gst/scaletempo/Makefile
1765
gst/sdp/Makefile
1766
gst/selector/Makefile
1767
gst/shapewipe/Makefile
1768
gst/siren/Makefile
1769
gst/speed/Makefile
1770
gst/subenc/Makefile
1771
gst/stereo/Makefile
1772
gst/tta/Makefile
1773
gst/valve/Makefile
1774
gst/videomeasure/Makefile
1775
gst/videosignal/Makefile
1776
gst/vmnc/Makefile
1777
gst-libs/Makefile
1778
gst-libs/gst/Makefile
1779
gst-libs/gst/interfaces/Makefile
1780
gst-libs/gst/signalprocessor/Makefile
1781
gst-libs/gst/video/Makefile
1782
sys/Makefile
1783
sys/dshowdecwrapper/Makefile
1784
sys/acmenc/Makefile
1785
sys/acmmp3dec/Makefile
1786
sys/directdraw/Makefile
1787
sys/directsound/Makefile
1788
sys/dshowsrcwrapper/Makefile
1789
sys/dshowvideosink/Makefile
1790
sys/dvb/Makefile
1791
sys/fbdev/Makefile
1792
sys/oss4/Makefile
1793
sys/osxvideo/Makefile
1794
sys/qtwrapper/Makefile
1795
sys/vcd/Makefile
1796
sys/vdpau/Makefile
1797
sys/wasapi/Makefile
1798
sys/wininet/Makefile
1799
sys/winks/Makefile
1800
sys/winscreencap/Makefile
1801
tests/Makefile
1802
tests/check/Makefile
1803
tests/examples/Makefile
1804
tests/examples/camerabin/Makefile
1805
tests/examples/directfb/Makefile
1806
tests/examples/mxf/Makefile
1807
tests/examples/scaletempo/Makefile
1808
tests/examples/shapewipe/Makefile
1809
tests/examples/switch/Makefile
1810
tests/icles/Makefile
1811
ext/alsaspdif/Makefile
1812
ext/amrwbenc/Makefile
1813
ext/assrender/Makefile
1814
ext/apexsink/Makefile
1815
ext/bz2/Makefile
1816
ext/cdaudio/Makefile
1817
ext/celt/Makefile
1818
ext/cog/Makefile
1819
ext/dc1394/Makefile
1820
ext/dirac/Makefile
1821
ext/directfb/Makefile
1822
ext/divx/Makefile
1823
ext/dts/Makefile
1824
ext/faac/Makefile
1825
ext/faad/Makefile
1826
ext/gsm/Makefile
1827
ext/ivorbis/Makefile
1828
ext/jack/Makefile
1829
ext/jp2k/Makefile
1830
ext/kate/Makefile
1831
ext/ladspa/Makefile
1832
ext/lv2/Makefile
1833
ext/libmms/Makefile
1834
ext/Makefile
1835
ext/metadata/Makefile
1836
ext/modplug/Makefile
1837
ext/mpeg2enc/Makefile
1838
ext/mimic/Makefile
1839
ext/mplex/Makefile
1840
ext/musepack/Makefile
1841
ext/musicbrainz/Makefile
1842
ext/mythtv/Makefile
1843
ext/nas/Makefile
1844
ext/neon/Makefile
1845
ext/ofa/Makefile
1846
ext/rsvg/Makefile
1847
ext/resindvd/Makefile
1848
ext/schroedinger/Makefile
1849
ext/sdl/Makefile
1850
ext/sndfile/Makefile
1851
ext/soundtouch/Makefile
1852
ext/gme/Makefile
1853
ext/spc/Makefile
1854
ext/swfdec/Makefile
1855
ext/theora/Makefile
1856
ext/timidity/Makefile
1857
ext/xvid/Makefile
1858
po/Makefile.in
1859
docs/Makefile
1860
docs/plugins/Makefile
1861
docs/plugins/figures/Makefile
1862
docs/version.entities
1863
m4/Makefile
1864
win32/common/config.h
1865
)
1866
AC_OUTPUT
1867
1868
AG_GST_OUTPUT_PLUGINS