1
2AC_INIT
3AC_CONFIG_SRCDIR([include/gmerlin/player.h])
4
5AM_CONFIG_HEADER(include/config.h)
6
7AM_INIT_AUTOMAKE(gmerlin, 1.2.0)
8
9BG_VERSION=$VERSION
10
11BG_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
12BG_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
13BG_VERSION_MICRO=`echo $VERSION | cut -d . -f 3 | cut -d p -f 1`
14
15LTVERSION_CURRENT="0"
16LTVERSION_REVISION="0"
17LTVERSION_AGE="0"
18
19AC_SUBST(BG_VERSION)
20AC_SUBST(BG_VERSION_MAJOR)
21AC_SUBST(BG_VERSION_MINOR)
22AC_SUBST(BG_VERSION_MICRO)
23AC_SUBST(LTVERSION_CURRENT)
24AC_SUBST(LTVERSION_REVISION)
25AC_SUBST(LTVERSION_AGE)
26
27SAVE_CFLAGS=$CFLAGS
28
29AC_DISABLE_STATIC
30dnl AM_DISABLE_STATIC
31
32AC_PROG_LIBTOOL
33
34CFLAGS=$SAVE_CFLAGS
35
36dnl
37dnl General features
38dnl
39
40AC_CHECK_SIZEOF(long)
41
42AC_CHECK_SIZEOF(float)
43AC_CHECK_SIZEOF(double)
44
45AC_CHECK_FUNCS(vasprintf)
46AC_CHECK_FUNCS(canonicalize_file_name)
47AC_C99_FUNC_LRINT
48AC_C99_FUNC_LRINTF
49
50AC_C_BIGENDIAN(,,AC_MSG_ERROR("Cannot detect endianess"))
51
52AC_CHECK_HEADERS([sys/select.h])
53
54
55AC_CHECK_DECLS([MSG_NOSIGNAL, SO_NOSIGPIPE],,,
56               [#include <sys/types.h>
57	       #include <sys/socket.h>])
58
59dnl
60dnl POSIX Semaphores
61dnl
62
63GMERLIN_CHECK_SEMAPHORES
64
65dnl
66dnl Gettext
67dnl
68
69AM_GNU_GETTEXT([external])
70
71
72dnl
73dnl Check for Dependencies package
74dnl
75
76GMERLIN_DEP_DIR=/opt/gmerlin
77
78if test -d $GMERLIN_DEP_DIR; then
79  have_opt_gmerlin="true"
80  export PKG_CONFIG_PATH=$GMERLIN_DEP_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
81  GMERLIN_DEP_CFLAGS="-I$GMERLIN_DEP_DIR/include"
82  GMERLIN_DEP_LDPATH="$GMERLIN_DEP_DIR/lib"
83  GMERLIN_DEP_LIBS="-L$GMERLIN_DEP_DIR/lib"
84  AC_MSG_CHECKING(for --rpath option)
85  OLD_LDFLAGS=$LDFLAGS
86  LDFLAGS="$LDFLAGS -Wl,--rpath -Wl,$GMERLIN_DEP_DIR/lib"
87  AC_TRY_LINK([],[],
88              [GMERLIN_DEP_RPATH="-Wl,--rpath -Wl,$GMERLIN_DEP_DIR/lib"; AC_MSG_RESULT(Supported)],
89	      [GMERLIN_DEP_RPATH="";AC_MSG_RESULT(Unsupported)])
90  LDFLAGS=$OLD_LDFLAGS
91else
92  have_opt_gmerlin="false"
93  GMERLIN_DEP_CFLAGS=""
94  GMERLIN_DEP_LDPATH=""
95  GMERLIN_DEP_LIBS=""
96  GMERLIN_DEP_RPATH=""
97fi
98
99LDFLAGS="$GMERLIN_DEP_RPATH"
100AC_SUBST(GMERLIN_DEP_LIBS)
101
102dnl
103dnl Doxygen
104dnl
105
106test_doxygen="true"
107have_doxygen="false"
108
109AC_ARG_WITH(doxygen,
110    AC_HELP_STRING([--without-doxygen],
111    [disable doxygen documentation generation]),
112    test_doxygen="false")
113
114if test "x$test_doxygen" = "xtrue"; then
115  AC_CHECK_PROG(DOXYGEN, doxygen, "doxygen")
116  if test -z "$DOXYGEN"; then
117    AC_MSG_ERROR([Doxygen not found, use --without-doxygen to disable documentation generation])
118  else
119    have_doxygen="true"
120  fi
121fi
122
123AM_CONDITIONAL(HAVE_DOXYGEN, test "x$have_doxygen" = "xtrue")
124
125dnl
126dnl texinfo (now a build requirement)
127dnl
128
129have_texinfo="false"
130
131AC_CHECK_PROG(TEXINFO, makeinfo, "makeinfo")
132if test -z "$TEXINFO"; then
133  AC_MSG_ERROR([Texinfo not found])
134fi
135
136dnl
137dnl Check for Libraries
138dnl
139
140dnl Required
141
142LT_LIB_M
143
144XML2_REQUIRED="2.4.0"
145PKG_CHECK_MODULES(XML2, libxml-2.0 >= $XML2_REQUIRED, , AC_MSG_ERROR("libxml2 not found"))
146AC_SUBST(XML2_REQUIRED)
147
148GAVL_REQUIRED="1.4.0"
149PKG_CHECK_MODULES(GAVL, gavl >= $GAVL_REQUIRED, , AC_MSG_ERROR("gavl not found"))
150AC_SUBST(GAVL_REQUIRED)
151
152FONTCONFIG_REQUIRED="2.2.3"
153PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= $FONTCONFIG_REQUIRED, , AC_MSG_ERROR("fontconfig not found"))
154
155FREETYPE_REQUIRED="9.7.3"
156PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_REQUIRED, , AC_MSG_ERROR("freetype2 not found"))
157
158ICONV_LIBS=""
159AC_CHECK_LIB(iconv, libiconv_close, ICONV_LIBS="-liconv")
160AC_SUBST(ICONV_LIBS)
161
162SQLITE3_LIBS=""
163AC_CHECK_LIB(sqlite3, sqlite3_exec, [SQLITE3_LIBS="-lsqlite3"; have_sqlite3="true"], have_sqlite3="false")
164AC_SUBST(SQLITE3_LIBS)
165
166
167dnl
168dnl Gtk
169dnl
170
171GTK_REQUIRED="2.8.0"
172AM_PATH_GTK_2_0($GTK_REQUIRED, have_gtk=true, have_gtk=false)
173AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xtrue)
174AC_SUBST(GTK_REQUIRED)
175
176dnl Always be in sync with the newest gtk
177GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_DEPRECATED"
178
179
180dnl
181dnl X11
182dnl
183
184have_x="false"
185
186X_CFLAGS=""
187X_LIBS=""
188
189
190AC_PATH_X
191
192if test x$no_x != xyes; then
193  if test "x$x_includes" != "x"; then
194    X_CFLAGS="-I$x_includes"
195  elif test -d /usr/X11R6/include; then
196    X_CFLAGS="-I/usr/X11R6/include"
197  else
198    X_CFLAGS=""
199  fi
200
201  if test "x$x_libraries" != "x"; then
202    X_LIBS="-L$x_libraries -lX11"
203  else
204    X_LIBS="-lX11"
205  fi
206  have_x="true"
207else
208  PKG_CHECK_MODULES(X, x11 >= 1.0.0, have_x=true, have_x=false)
209fi
210
211if test x$have_x = xtrue; then
212  X_LIBS="$X_LIBS -lXext"
213else
214  AC_MSG_ERROR([Gmerlin needs X11 headers])
215fi
216
217
218AC_SUBST(X_CFLAGS)
219AC_SUBST(X_LIBS)
220AM_CONDITIONAL(HAVE_X11, test x$have_x = xtrue)
221
222dnl
223dnl OpenGL
224dnl
225
226GMERLIN_CHECK_OPENGL
227
228dnl
229dnl Pulseaudio
230dnl
231
232GMERLIN_CHECK_PULSEAUDIO
233
234dnl
235dnl Xinerama
236dnl
237
238AH_TEMPLATE([HAVE_LIBXINERAMA],
239            [Do we have xinerama installed?])
240
241have_xinerama="false"
242XINERAMA_LIBS=""
243
244if test x$have_x = xtrue; then
245
246OLD_CFLAGS=$CFLAGS
247OLD_LIBS=$LIBS
248
249CFLAGS=$X_FLAGS
250LIBS="$X_LIBS -lXinerama"
251
252AC_MSG_CHECKING(for xinerama)
253AC_TRY_LINK([#include <X11/Xlib.h>
254             #include <X11/extensions/Xinerama.h>],
255            [int i = 0;
256             /* We ensure the function is here but never call it */
257             if(i)
258               XineramaQueryExtension(NULL, NULL, NULL);
259             return 0;],
260            [XINERAMA_LIBS="-lXinerama";have_xinerama=true;AC_MSG_RESULT(Yes)],
261	    AC_MSG_RESULT(No))
262
263if test x$have_xinerama = "xtrue"; then
264AC_DEFINE(HAVE_LIBXINERAMA)
265fi
266
267AC_SUBST(XINERAMA_LIBS)
268
269CFLAGS=$OLD_CFLAGS
270LIBS=$OLD_LIBS
271
272fi
273
274dnl
275dnl XTest
276dnl
277
278AH_TEMPLATE([HAVE_XTEST],
279            [Do we have xtest installed?])
280
281have_xtest="false"
282XTEST_LIBS=""
283
284if test x$have_x = xtrue; then
285
286OLD_CFLAGS=$CFLAGS
287OLD_LIBS=$LIBS
288
289CFLAGS=$X_FLAGS
290LIBS="$X_LIBS -lXtst"
291
292AC_MSG_CHECKING(for xtest)
293AC_TRY_LINK([#include <X11/Xlib.h>
294             #include <X11/extensions/XTest.h>],
295            [int i = 0;
296             /* We ensure the function is here but never call it */
297             if(i)
298               XTestQueryExtension(NULL, NULL, NULL, NULL, NULL);
299             return 0;],
300            [XTEST_LIBS="-lXtst";have_xtest=true;AC_MSG_RESULT(Yes)],
301	    AC_MSG_RESULT(No))
302
303if test x$have_xtest = "xtrue"; then
304AC_DEFINE(HAVE_XTEST)
305fi
306
307AC_SUBST(XTEST_LIBS)
308
309CFLAGS=$OLD_CFLAGS
310LIBS=$OLD_LIBS
311
312fi
313
314AM_CONDITIONAL(HAVE_XTEST, test x$have_xtest = xtrue)
315
316dnl
317dnl Xv
318dnl
319
320AH_TEMPLATE([HAVE_LIBXV],
321            [Do we have xv installed?])
322
323have_xv="false"
324XV_LIBS=""
325
326if test x$have_x = xtrue; then
327
328OLD_CFLAGS=$CFLAGS
329OLD_LIBS=$LIBS
330CFLAGS=$X_FLAGS
331LIBS="$X_LIBS -lXv"
332
333AC_MSG_CHECKING(for xv)
334AC_TRY_LINK([#include <X11/Xlib.h>
335             #include <X11/extensions/Xvlib.h>],
336            [int i = 0;
337             /* We ensure the function is here but never call it */
338             if(i)
339		 XvQueryExtension(NULL, NULL, NULL, NULL, NULL, NULL);
340             return 0;],
341            [XV_LIBS="-lXv";have_xv=true;AC_MSG_RESULT(Yes)],
342	    AC_MSG_RESULT("No"))
343
344if test x$have_xv = "xtrue"; then
345AC_DEFINE(HAVE_LIBXV)
346fi
347
348AC_SUBST(XV_LIBS)
349
350CFLAGS=$OLD_CFLAGS
351LIBS=$OLD_LIBS
352
353fi
354
355AM_CONDITIONAL(HAVE_XV, test x$have_xv = xtrue)
356
357dnl
358dnl X11 DPMS extension
359dnl
360
361AH_TEMPLATE([HAVE_XDPMS],
362            [Do we have X11 dpms extension installed?])
363
364have_xdpms="false"
365XDPMS_LIBS=""
366
367if test x$have_x = xtrue; then
368
369OLD_CFLAGS=$CFLAGS
370OLD_LIBS=$LIBS
371CFLAGS=$X_FLAGS
372LIBS="$X_LIBS -lXext"
373
374AC_MSG_CHECKING(for x11 dpms)
375AC_TRY_LINK([#include <X11/Xlib.h>
376             #include <X11/extensions/dpms.h>],
377            [int i = 0;
378             /* We ensure the function is here but never call it */
379             if(i)
380		 DPMSQueryExtension(NULL, NULL, NULL);
381             return 0;],
382            [XDPMS_LIBS="-lXext";have_xdpms=true;AC_MSG_RESULT(Yes)],
383	    AC_MSG_RESULT("No"))
384
385if test x$have_xdpms = "xtrue"; then
386AC_DEFINE(HAVE_XDPMS)
387fi
388
389AC_SUBST(XDPMS_LIBS)
390
391CFLAGS=$OLD_CFLAGS
392LIBS=$OLD_LIBS
393
394fi
395
396dnl
397dnl XFixes
398dnl
399
400AH_TEMPLATE([HAVE_XFIXES],
401            [Do we have XFixes extension installed?])
402
403have_xfixes="false"
404XFIXES_LIBS=""
405
406if test x$have_x = xtrue; then
407
408OLD_CFLAGS=$CFLAGS
409OLD_LIBS=$LIBS
410CFLAGS=$X_FLAGS
411LIBS="$X_LIBS -lXfixes"
412
413AC_MSG_CHECKING(for x11 dpms)
414AC_TRY_LINK([#include <X11/Xlib.h>
415             #include <X11/extensions/Xfixes.h>],
416            [int i = 0;
417             /* We ensure the function is here but never call it */
418             if(i)
419		 XFixesQueryExtension(NULL, NULL, NULL);
420             return 0;],
421            [XFIXES_LIBS="-lXfixes";have_xfixes=true;AC_MSG_RESULT(Yes)],
422	    AC_MSG_RESULT("No"))
423
424if test x$have_xfixes = "xtrue"; then
425AC_DEFINE(HAVE_XFIXES)
426fi
427
428AC_SUBST(XFIXES_LIBS)
429
430CFLAGS=$OLD_CFLAGS
431LIBS=$OLD_LIBS
432
433fi
434
435
436dnl
437dnl Libquicktime
438dnl
439
440LQT_REQUIRED="1.2.4"
441have_lqt=false
442AC_ARG_ENABLE(lqt,
443              AC_HELP_STRING(--disable-lqt, [Disable Libquicktime support (default: autodetect)]),
444              [case "${enableval}" in
445                 yes) test_lqt=true ;;
446                 no) test_lqt=false ;;
447               esac],
448	       test_lqt=true)
449
450if test x$test_lqt = "xtrue"; then
451PKG_CHECK_MODULES(LQT, libquicktime >= $LQT_REQUIRED, have_lqt=true, have_lqt=false)
452fi
453
454dnl AC_PATH_LQT($LQT_REQUIRED,  have_lqt=true, have_lqt=false)
455
456AM_CONDITIONAL(HAVE_LQT, test x$have_lqt = xtrue)
457AC_SUBST(LQT_REQUIRED)
458
459dnl
460dnl libexif
461dnl
462
463AH_TEMPLATE([HAVE_LIBEXIF],
464            [Do we have libexif installed?])
465
466PKG_CHECK_MODULES(LIBEXIF, libexif, have_libexif=true, have_libexif=false)
467
468if test x$have_libexif = "xtrue"; then
469AC_DEFINE(HAVE_LIBEXIF)
470fi
471
472AM_CONDITIONAL(HAVE_LIBEXIF, test x$have_libexif = xtrue)
473
474
475dnl
476dnl libv4lconvert
477dnl
478
479AH_TEMPLATE([HAVE_V4LCONVERT],
480            [Do we have libv4lconvert installed?])
481
482V4LCONVERT_REQUIRED="0.5.7"
483have_v4lconvert=false
484
485AC_ARG_ENABLE(lqt,
486              AC_HELP_STRING(--disable-v4lconvert, [Disable libv4lconvert support (default: autodetect)]),
487              [case "${enableval}" in
488                 yes) test_v4lconvert=true ;;
489                 no) test_v4lconvert=false ;;
490               esac],
491	       test_v4lconvert=true)
492
493if test x$test_v4lconvert = "xtrue"; then
494PKG_CHECK_MODULES(V4LCONVERT, libv4lconvert >= $V4LCONVERT_REQUIRED, have_v4lconvert=true, have_v4lconvert=false)
495fi
496
497AM_CONDITIONAL(HAVE_V4LVCONVERT, test x$have_v4lconvert = xtrue)
498AC_SUBST(V4LCONVERT_REQUIRED)
499
500if test x$have_v4lconvert = xtrue; then
501AC_DEFINE(HAVE_V4LCONVERT)
502fi
503
504dnl
505dnl Libvisual
506dnl
507
508AH_TEMPLATE([HAVE_LV],
509            [Do we have libvisual installed?])
510AH_TEMPLATE([LV_PLUGIN_DIR],
511            [libvisual plugin directory])
512
513LV_REQUIRED="0.4.0"
514have_LV=false
515AC_ARG_ENABLE(libvisual,
516              AC_HELP_STRING(--disable-libvisual, [Disable Libvisual support (default: autodetect)]),
517              [case "${enableval}" in
518                 yes) test_lv=true ;;
519                 no) test_lv=false ;;
520               esac],
521	       test_lv=true)
522
523if test x$test_lv = "xtrue"; then
524PKG_CHECK_MODULES(LV, libvisual-0.4 >= $LV_REQUIRED, have_lv=true, have_lv=false)
525fi
526
527if test x$have_lv = "xtrue"; then
528AC_DEFINE(HAVE_LV)
529
530lv_plugin_dir=`pkg-config --variable=pluginsbasedir libvisual-0.4`
531lv_plugin_dir="$lv_plugin_dir/actor"
532
533AC_DEFINE_UNQUOTED(LV_PLUGIN_DIR, ["$lv_plugin_dir"], [libvisual plugin directory])
534fi
535
536
537AM_CONDITIONAL(HAVE_LV, test x$have_lv = xtrue)
538AC_SUBST(LV_REQUIRED)
539
540dnl
541dnl CDrom support
542dnl
543
544have_cdio="false"
545
546CDIO_REQUIRED="0.76"
547
548AC_ARG_ENABLE(libcdio,
549[AC_HELP_STRING([--disable-libcdio],[Disable libcdio (default: autodetect)])],
550[case "${enableval}" in
551   yes) test_cdio=true ;;
552   no)  test_cdio=false ;;
553esac],[test_cdio=true])
554
555if test x$test_cdio = xtrue; then
556PKG_CHECK_MODULES(CDIO, libcdio >= $CDIO_REQUIRED, have_cdio="true", have_cdio="false")
557
558if test x$have_cdio = xtrue; then
559PKG_CHECK_MODULES(CDIO_CDDA, libcdio_cdda >= $CDIO_REQUIRED, have_cdio="true", have_cdio="false")
560fi
561
562if test x$have_cdio = xtrue; then
563PKG_CHECK_MODULES(CDIO_PARANOIA, libcdio_paranoia >= $CDIO_REQUIRED, have_cdio="true", have_cdio="false")
564fi
565
566fi
567
568AM_CONDITIONAL(HAVE_CDIO, test x$have_cdio = xtrue)
569AC_SUBST(CDIO_REQUIRED)
570
571dnl
572dnl Musicbrainz
573dnl
574
575AH_TEMPLATE([HAVE_MUSICBRAINZ],
576            [Do we have libmusicbrainz installed?])
577
578MUSICBRAINZ_REQUIRED="2.0.2"
579have_musicbrainz=false
580AC_ARG_ENABLE(musicbrainz,
581              AC_HELP_STRING(--disable-musicbrainz, [Disable musicbrainz support (default: autodetect)]),
582              [case "${enableval}" in
583                 yes) test_musicbrainz=true ;;
584                 no) test_musicbrainz=false ;;
585               esac],
586	       test_musicbrainz=true)
587
588dnl We check for musicbrainz only if we already detected CDROM support
589if test x$have_cdio = "xfalse"; then
590test_musicbrainz=false
591fi
592
593if test x$test_musicbrainz = "xtrue"; then
594PKG_CHECK_MODULES(MUSICBRAINZ, libmusicbrainz >= $MUSICBRAINZ_REQUIRED, have_musicbrainz=true, have_musicbrainz=false)
595fi
596
597if test x$have_musicbrainz = "xtrue"; then
598AC_DEFINE(HAVE_MUSICBRAINZ)
599fi
600
601AM_CONDITIONAL(HAVE_MUSICBRAINZ, test x$have_musicbrainz = xtrue)
602AC_SUBST(MUSICBRAINZ_REQUIRED)
603
604dnl
605dnl Libcddb
606dnl
607
608AH_TEMPLATE([HAVE_LIBCDDB],
609            [Do we have libcddb installed?])
610
611dnl LIBCDDB_REQUIRED="1.2.1"
612LIBCDDB_REQUIRED="1.0.2"
613have_cddb=false
614AC_ARG_ENABLE(cddb,
615              AC_HELP_STRING(--disable-cddb, [Disable cddb support (default: autodetect)]),
616              [case "${enableval}" in
617                 yes) test_cddb=true ;;
618                 no) test_cddb=false ;;
619               esac],
620	       test_cddb=true)
621
622dnl We check for cddb only of we already detected CDROM support
623if test x$have_cdio = "xfalse"; then
624test_cddb=false
625fi
626
627if test x$test_cddb = "xtrue"; then
628PKG_CHECK_MODULES(CDDB, libcddb >= $LIBCDDB_REQUIRED, have_cddb=true, have_cddb=false)
629fi
630
631if test x$have_cddb = "xtrue"; then
632AC_DEFINE(HAVE_LIBCDDB)
633fi
634
635AM_CONDITIONAL(HAVE_LIBCDDB, test x$have_cddb = xtrue)
636AC_SUBST(LIBCDDB_REQUIRED)
637
638
639dnl
640dnl ESounD
641dnl
642
643ESD_REQUIRED="0.2.19"
644have_esd=false
645AC_ARG_ENABLE(esd,
646              AC_HELP_STRING(--disable-esd, [Disable EsounD (default: autodetect)]),
647              [case "${enableval}" in
648                 yes) test_esd=true ;;
649                 no) test_esd=false ;;
650               esac],
651	       test_esd=true)
652
653if test x$test_esd = xtrue; then
654AM_PATH_ESD($ESD_REQUIRED, have_esd=true, have_esd=false)
655fi
656
657AM_CONDITIONAL(HAVE_ESD,           test x$have_esd = xtrue)
658AC_SUBST(ESD_REQUIRED)
659
660dnl
661dnl ALSA
662dnl
663
664ALSA_REQUIRED="1.0.0"
665have_alsa="false"
666
667OLD_CFLAGS=$CFLAGS
668OLD_LIBS=$LIBS
669
670AC_ARG_ENABLE(alsa,
671              AC_HELP_STRING(--disable-alsa, [Disable Alsa (default: autodetect)]),
672              [case "${enableval}" in
673                 yes) test_alsa=true ;;
674                 no) test_alsa=false ;;
675               esac],
676	       test_alsa=true)
677
678if test x$test_alsa = xtrue; then
679  AM_PATH_ALSA(1.0.0, have_alsa="true", have_alsa="false")
680fi
681
682dnl CFLAGS and LIBS must be cleared after AM_PATH_ALSA
683CFLAGS=$OLD_CFLAGS
684LIBS=$OLD_LIBS
685
686
687AM_CONDITIONAL(HAVE_ALSA, test x$have_alsa = xtrue)
688AC_SUBST(ALSA_REQUIRED)
689
690dnl
691dnl Jack
692dnl
693
694have_jack="false"
695
696AC_ARG_ENABLE(jack,
697              AC_HELP_STRING(--disable-jack, [Disable Jack (default: autodetect)]),
698              [case "${enableval}" in
699                 yes) test_jack=true ;;
700                 no) test_jack=false ;;
701               esac],
702	       test_jack=true)
703
704JACK_REQUIRED="0.109.2"
705
706if test x$test_jack = xtrue; then
707PKG_CHECK_MODULES(JACK, jack >= $JACK_REQUIRED, have_jack="true", have_jack="false")
708fi
709
710AC_SUBST(JACK_REQUIRED)
711
712AM_CONDITIONAL(HAVE_JACK, test x$have_jack = xtrue)
713
714dnl
715dnl OSS
716dnl
717
718have_oss=false
719AC_ARG_ENABLE(oss,
720              AC_HELP_STRING(--disable-oss, [Disable OSS (default: autodetect)]),
721              [case "${enableval}" in
722                 yes) test_oss=true ;;
723                 no) test_oss=false ;;
724               esac],
725	       test_oss=true)
726
727if test x$test_oss = xtrue; then
728AC_CHECK_HEADERS(sys/soundcard.h soundcard.h, have_oss=true)
729fi
730AM_CONDITIONAL(HAVE_OSS, test x$have_oss = xtrue)
731
732dnl
733dnl Video4linux
734dnl
735
736AH_TEMPLATE([HAVE_V4L],
737            [Do we have v4l support?])
738
739have_v4l=false
740AC_ARG_ENABLE(v4l,
741              AC_HELP_STRING(--disable-v4l, [Disable Video4Linux (default: autodetect)]),
742              [case "${enableval}" in
743                 yes) test_v4l=true ;;
744                 no) test_v4l=false ;;
745               esac],
746	       test_v4l=true)
747
748if test x$test_v4l = xtrue; then
749AC_CHECK_HEADERS(linux/videodev.h, have_v4l=true)
750fi
751
752if test x$have_v4l = xtrue; then
753AC_DEFINE(HAVE_V4L)
754fi
755
756AM_CONDITIONAL(HAVE_V4L, test x$have_v4l = xtrue)
757
758dnl
759dnl Video4linux2
760dnl
761
762have_v4l2=false
763AC_ARG_ENABLE(v4l2,
764              AC_HELP_STRING(--disable-v4l2, [Disable Video4Linux (default: autodetect)]),
765              [case "${enableval}" in
766                 yes) test_v4l2=true ;;
767                 no) test_v4l2=false ;;
768               esac],
769	       test_v4l2=true)
770
771if test x$test_v4l2 = xtrue; then
772AC_CHECK_HEADERS(linux/videodev2.h, have_v4l2=true)
773fi
774
775AM_CONDITIONAL(HAVE_V4L2, test x$have_v4l2 = xtrue)
776
777dnl
778dnl libjpeg
779dnl
780
781GMERLIN_CHECK_LIBJPEG
782
783dnl
784dnl png
785dnl
786
787GMERLIN_CHECK_LIBPNG
788
789dnl
790dnl libtiff
791dnl
792
793GMERLIN_CHECK_LIBTIFF
794
795dnl
796dnl inotify
797dnl
798
799GMERLIN_CHECK_INOTIFY
800
801dnl
802dnl Applications
803dnl
804
805
806dnl Plugin configurator
807
808AC_ARG_ENABLE(plugincfg,
809              AC_HELP_STRING(--disable-plugincfg, [Disable plugin configurator (default: enabled)]),
810              [case "${enableval}" in
811                 yes) have_plugincfg=true ;;
812                 no) have_plugincfg=false ;;
813               esac],
814	       have_plugincfg=true)
815
816if test "x$have_gtk" != "xtrue"; then
817have_plugincfg=false
818fi
819
820AM_CONDITIONAL(HAVE_PLUGINCFG, test x$have_plugincfg = xtrue)
821
822dnl Alsamixer
823
824AC_ARG_ENABLE(alsamixer,
825              AC_HELP_STRING(--disable-alsamixer, [Disable alsamixer (default: enabled)]),
826              [case "${enableval}" in
827                 yes) have_alsamixer=true ;;
828                 no) have_alsamixer=false ;;
829               esac],
830	       have_alsamixer=true)
831
832if test "x$have_gtk" != "xtrue" -o "x$have_alsa" = "xfalse"; then
833have_alsamixer=false
834fi
835
836AM_CONDITIONAL(HAVE_ALSAMIXER, test x$have_alsamixer = xtrue)
837
838dnl Player
839
840AC_ARG_ENABLE(player,
841              AC_HELP_STRING(--disable-player, [Disable player (default: enabled)]),
842              [case "${enableval}" in
843                 yes) have_player=true ;;
844                 no) have_player=false ;;
845               esac],
846	       have_player=true)
847
848if test "x$have_gtk" != "xtrue"; then
849have_player=false
850fi
851
852AM_CONDITIONAL(HAVE_PLAYER, test x$have_player = xtrue)
853
854dnl kbd
855
856AC_ARG_ENABLE(kbd,
857              AC_HELP_STRING(--disable-kbd, [Disable keyboard daemon (default: enabled)]),
858              [case "${enableval}" in
859                 yes) have_kbd=true ;;
860                 no) have_kbd=false ;;
861               esac],
862	       have_kbd=true)
863
864if test "x$have_gtk" != "xtrue"; then
865have_kbd=false
866fi
867
868if test "x$have_x" != "xtrue"; then
869have_kbd=false
870fi
871
872
873AM_CONDITIONAL(HAVE_KBD, test x$have_kbd = xtrue)
874
875
876
877dnl Transcoder
878
879AC_ARG_ENABLE(transcoder,
880              AC_HELP_STRING(--disable-transcoder, [Disable transcoder (default: enabled)]),
881              [case "${enableval}" in
882                 yes) have_transcoder=true ;;
883                 no) have_transcoder=false ;;
884               esac],
885	       have_transcoder=true)
886
887if test "x$have_gtk" = "xfalse"; then
888have_transcoder=false
889fi
890
891AM_CONDITIONAL(HAVE_TRANSCODER, test x$have_transcoder = xtrue)
892
893dnl Recorder
894
895AC_ARG_ENABLE(recorder,
896              AC_HELP_STRING(--disable-recorder, [Disable recorder (default: enabled)]),
897              [case "${enableval}" in
898                 yes) have_recorder=true ;;
899                 no) have_recorder=false ;;
900               esac],
901	       have_recorder=true)
902
903if test "x$have_gtk" = "xfalse"; then
904have_recorder=false
905fi
906
907AM_CONDITIONAL(HAVE_RECORDER, test x$have_recorder = xtrue)
908
909
910dnl Visualizer
911
912AC_ARG_ENABLE(visualizer,
913              AC_HELP_STRING(--disable-visualizer, [Disable visualizer (default: enabled)]),
914              [case "${enableval}" in
915                 yes) have_visualizer=true ;;
916                 no) have_visualizer=false ;;
917               esac],
918	       have_visualizer=true)
919
920if test "x$have_gtk" = "xfalse"; then
921have_visualizer=false
922fi
923
924AM_CONDITIONAL(HAVE_VISUALIZER, test x$have_visualizer = xtrue)
925
926dnl Thumbnailer
927
928AC_ARG_ENABLE(thumbnailer,
929              AC_HELP_STRING(--disable-thumbnailer, [Disable thumbnailer (default: enabled)]),
930              [case "${enableval}" in
931                 yes) have_thumbnailer=true ;;
932                 no) have_thumbnailer=false ;;
933               esac],
934	       have_thumbnailer=true)
935
936AM_CONDITIONAL(HAVE_THUMBNAILER, test x$have_thumbnailer = xtrue)
937
938dnl nmjedit
939
940AC_ARG_ENABLE(nmjedit,
941              AC_HELP_STRING(--enable-nmjedit, [Enable nmjedit (default: disabled)]),
942              [case "${enableval}" in
943                 yes) have_nmjedit=true ;;
944                 no) have_nmjedit=false ;;
945               esac],
946	       have_nmjedit=false)
947
948if test "x$have_sqlite3" = "xfalse"; then
949have_nmjedit="false"
950fi
951
952AM_CONDITIONAL(HAVE_NMJEDIT, test "x$have_nmjedit" = "xtrue")
953
954dnl
955dnl CFLAGS
956dnl
957
958LQT_OPT_CFLAGS($host_cpu, ["-O3 -funroll-all-loops -fomit-frame-pointer -ffast-math"])
959
960CFLAGS="$CFLAGS -D_REENTRANT -D_FILE_OFFSET_BITS=64 $GAVL_CFLAGS $OPT_CFLAGS"
961
962LQT_TRY_CFLAGS(-Wall, CFLAGS="$CFLAGS -Wall", )
963LQT_TRY_CFLAGS(-Wmissing-declarations, CFLAGS="$CFLAGS -Wmissing-declarations", )
964LQT_TRY_CFLAGS(-Wdeclaration-after-statement, CFLAGS="$CFLAGS -Wdeclaration-after-statement")
965
966dnl
967dnl Check for SIMD
968dnl
969
970GAVL_CHECK_SIMD($host_cpu, "$OPT_CFLAGS")
971
972dnl
973dnl libxml is necessary for all sources
974dnl
975
976CFLAGS="$CFLAGS $XML2_CFLAGS"
977
978LIBS="$GAVL_LIBS"
979
980dnl Output variables
981
982if test "x$prefix" = xNONE; then
983   prefix="${ac_default_prefix}"
984fi
985if test "x$exec_prefix" = xNONE; then
986   exec_prefix="${prefix}"
987fi
988
989AC_DEFINE_UNQUOTED(PREFIX, "$prefix", Installation prefix)
990
991INCLUDES='-I$(top_builddir)/include'
992AC_SUBST(INCLUDES)
993
994dnl Link all modules to libgmerlin so we can use them from within plugins
995MODULE_LIBADD='$(top_builddir)/lib/libgmerlin.la'
996AC_SUBST(MODULE_LIBADD)
997
998dnl Absolute src path for doxygen
999
1000TOP_SRCDIR=`cd ${srcdir} && pwd`
1001AC_SUBST(TOP_SRCDIR)
1002
1003dnl LDFLAGS for plugins
1004GMERLIN_PLUGIN_LDFLAGS='-export-symbols $(top_srcdir)/plugin.sym'
1005AC_SUBST(GMERLIN_PLUGIN_LDFLAGS)
1006
1007dnl Configuration Subdirectiories
1008
1009AC_CONFIG_FILES([Makefile  po/Makefile.in \
1010gmerlin.spec \
1011gmerlin.pc \
1012gmerlin-gtk.pc \
1013apps/Makefile \
1014apps/plugincfg/Makefile \
1015apps/player/Makefile \
1016apps/alsamixer/Makefile \
1017apps/cmdlineplayer/Makefile \
1018apps/cmdlinerecorder/Makefile \
1019apps/recorder/Makefile \
1020apps/transcoder/Makefile \
1021apps/visualizer/Makefile \
1022apps/kbd/Makefile \
1023apps/thumbnailer/Makefile \
1024apps/nmjedit/Makefile \
1025doc/Makefile \
1026doc/Doxyfile \
1027icons/Makefile \
1028m4/Makefile \
1029utils/Makefile \
1030tests/Makefile \
1031include/Makefile \
1032include/gmerlin/Makefile \
1033include/gmerlin/bg_version.h \
1034include/gui_gtk/Makefile \
1035include/x11/Makefile \
1036lib/Makefile \
1037lib/gtk/Makefile \
1038lib/x11/Makefile \
1039osd/Makefile \
1040plugins/Makefile \
1041plugins/alsa/Makefile \
1042plugins/audiofilters/Makefile \
1043plugins/x11/Makefile \
1044plugins/cdaudio/Makefile \
1045plugins/edl/Makefile \
1046plugins/esd/Makefile \
1047plugins/gavl/Makefile \
1048plugins/jack/Makefile \
1049plugins/lqt/Makefile \
1050plugins/oss/Makefile \
1051plugins/jpeg/Makefile \
1052plugins/mikmod/Makefile \
1053plugins/png/Makefile \
1054plugins/postprocessors/Makefile \
1055plugins/pulseaudio/Makefile \
1056plugins/subwriters/Makefile \
1057plugins/image/Makefile \
1058plugins/tiff/Makefile \
1059plugins/v4l/Makefile \
1060plugins/v4l2/Makefile \
1061plugins/videofilters/Makefile \
1062plugins/visualization/Makefile \
1063plugins/wavwrite/Makefile \
1064skins/Makefile \
1065skins/Default/Makefile])
1066
1067AC_OUTPUT
1068
1069echo "=== Libraries: ===================================="
1070
1071echo -n "Gtk-2.0:             "
1072if test "x$have_gtk" = "xtrue"; then
1073echo "Yes"
1074else
1075echo "Missing (GUI applications won't be compiled! Go to http://www.gtk.org/)"
1076fi
1077
1078echo
1079echo "=== Plugins: ======================================"
1080
1081echo -n "EsounD:              "
1082if test "x$have_esd" = "xtrue"; then
1083echo "Yes (CFLAGS=$ESD_CFLAGS LIBS=$ESD_LIBS)"
1084else
1085if test "x$test_esd" = "xtrue"; then
1086echo "Missing (Go to http://www.tux.org/~ricdude/EsounD.html)"
1087else
1088echo "Disabled"
1089fi
1090fi
1091
1092echo -n "Alsa:                "
1093if test "x$have_alsa" = "xtrue"; then
1094echo "Yes (CFLAGS=$ALSA_CFLAGS LIBS=$ALSA_LIBS)"
1095else
1096if test "x$test_alsa" = "xtrue"; then
1097echo "Missing (Go to http://www.alsa-project.org/)"
1098else
1099echo "Disabled"
1100fi
1101fi
1102
1103echo -n "Jack:                "
1104if test "x$have_jack" = "xtrue"; then
1105echo "Yes (CFLAGS=$JACK_CFLAGS LIBS=$JACK_LIBS)"
1106else
1107if test "x$test_jack" = "xtrue"; then
1108echo "Missing (Go to http://jackit.sourceforge.net/)"
1109else
1110echo "Disabled"
1111fi
1112fi
1113
1114echo -n "Libquicktime:        "
1115if test "x$have_lqt" = "xtrue"; then
1116echo "Yes (CFLAGS=$LQT_CFLAGS LIBS=$LQT_LIBS)"
1117else
1118if test "x$test_lqt" = "xtrue"; then
1119echo "Missing (Go to http://libquicktime.sourceforge.net/)"
1120else
1121echo "Disabled"
1122fi
1123fi
1124
1125echo -n "Libvisual:           "
1126if test "x$have_lv" = "xtrue"; then
1127echo "Yes (CFLAGS=$LV_CFLAGS LIBS=$LV_LIBS)"
1128else
1129if test "x$test_lv" = "xtrue"; then
1130echo "Missing (Go to http://libvisual.sourceforge.net/)"
1131else
1132echo "Disabled"
1133fi
1134fi
1135
1136echo -n "Libjpeg:             "
1137if test "x$have_libjpeg" = "xtrue"; then
1138echo "Yes (CFLAGS=$JPEG_CFLAGS LIBS=$JPEG_LIBS)"
1139else
1140if test "x$test_libjpeg" = "xtrue"; then
1141echo "Missing (Go to http://www.ijg.org/)"
1142else
1143echo "Disabled"
1144fi
1145fi
1146
1147echo -n "Libpng:              "
1148if test "x$have_libpng" = "xtrue"; then
1149echo "Yes (CFLAGS=$PNG_CFLAGS LIBS=$PNG_LIBS)"
1150else
1151if test "x$test_libpng" = "xtrue"; then
1152echo "Missing (Go to http://www.libpng.org/pub/png/libpng.html)"
1153else
1154echo "Disabled"
1155fi
1156fi
1157
1158echo -n "Libtiff:             "
1159if test "x$have_libtiff" = "xtrue"; then
1160echo "Yes (CFLAGS=$TIFF_CFLAGS LIBS=$TIFF_LIBS)"
1161else
1162if test "x$test_libtiff" = "xtrue"; then
1163echo "Missing (Go to http://www.remotesensing.org/libtiff/)"
1164else
1165echo "Disabled"
1166fi
1167fi
1168
1169echo -n "pulseaudio:          "
1170if test "x$have_pulseaudio" = "xtrue"; then
1171echo "Yes (CFLAGS=$PULSEAUDIO_CFLAGS LIBS=$PULSEAUDIO_LIBS)"
1172else
1173if test "x$test_pulseaudio" = "xtrue"; then
1174echo "Missing (Go to http://www.pulseaudio.org)"
1175else
1176echo "Disabled"
1177fi
1178fi
1179
1180echo -n "OSS:                 "
1181if test "x$have_oss" = "xtrue"; then
1182echo "Yes"
1183else
1184if test "x$test_oss" = "xtrue"; then
1185echo "Missing (Probably unsupported architecture)"
1186else
1187echo "Disabled"
1188fi
1189fi
1190
1191echo -n "Video4Linux:         "
1192if test "x$have_v4l" = "xtrue"; then
1193echo "Yes"
1194else
1195if test "x$test_v4l" = "xtrue"; then
1196echo "Missing (Probably unsupported architecture)"
1197else
1198echo "Disabled"
1199fi
1200fi
1201
1202echo -n "Video4Linux2:        "
1203if test "x$have_v4l2" = "xtrue"; then
1204echo "Yes"
1205else
1206if test "x$test_v4l2" = "xtrue"; then
1207echo "Missing (Probably unsupported architecture)"
1208else
1209echo "Disabled"
1210fi
1211fi
1212
1213
1214echo -n "X11:                 "
1215if test "x$have_x" = "xtrue"; then
1216echo "Yes"
1217else
1218echo "Missing"
1219fi
1220
1221echo -n "OpenGL:              "
1222if test "x$have_GL" = "xtrue"; then
1223echo "Yes (CFLAGS=$GL_CFLAGS, LIBS=$GL_LIBS)"
1224else
1225echo "Missing"
1226fi
1227
1228echo -n "GLX:                 "
1229if test "x$have_GLX" = "xtrue"; then
1230echo "Yes (CFLAGS=$GLX_CFLAGS, LIBS=$GLX_LIBS)"
1231else
1232echo "Missing"
1233fi
1234
1235echo -n "Xinerama:            "
1236if test "x$have_xinerama" = "xtrue"; then
1237echo "Yes"
1238else
1239echo "Missing"
1240fi
1241
1242echo -n "Xtest:               "
1243if test "x$have_xtest" = "xtrue"; then
1244echo "Yes"
1245else
1246echo "Missing"
1247fi
1248
1249
1250echo -n "Xvideo extension:    "
1251if test "x$have_xv" = "xtrue"; then
1252echo "Yes"
1253else
1254echo "Missing"
1255fi
1256
1257echo -n "X11 dpms extension:  "
1258if test "x$have_xdpms" = "xtrue"; then
1259echo "Yes"
1260else
1261echo "Missing"
1262fi
1263
1264echo -n "XFixes extension:    "
1265if test "x$have_xfixes" = "xtrue"; then
1266echo "Yes"
1267else
1268echo "Missing"
1269fi
1270
1271
1272echo -n "libcdio:             "
1273if test "x$have_cdio" = "xtrue"; then
1274echo "Yes (CFLAGS=$CDIO_CFLAGS $CDIO_CDDA_CFLAGS $CDIO_PARANOIA_CFLAGS LIBS=$CDIO_LIBS $CDIO_CDDA_LIBS $CDIO_PARANOIA_LIBS)"
1275else
1276if test "x$test_cdio" = "xtrue"; then
1277echo "Missing (Go to http://www.gnu.org/software/libcdio/)"
1278else
1279echo "Disabled"
1280fi
1281fi
1282
1283echo -n "Musicbrainz:         "
1284if test "x$have_musicbrainz" = "xtrue"; then
1285echo "Yes (CFLAGS=$MUSICBRAINZ_CFLAGS LIBS=$MUSICBRAINZ_LIBS)"
1286else
1287if test "x$test_musicbrainz" = "xtrue"; then
1288echo "Missing (Go to http://musicbrainz.org/products/client/index.html)"
1289else
1290echo "Disabled"
1291fi
1292fi
1293
1294echo -n "libcddb:             "
1295if test "x$have_cddb" = "xtrue"; then
1296echo "Yes (CFLAGS=$CDDB_CFLAGS LIBS=$CDDB_LIBS)"
1297else
1298if test "x$test_cddb" = "xtrue"; then
1299echo "Missing (Go to http://libcddb.sourceforge.net)"
1300else
1301echo "Disabled"
1302fi
1303fi
1304
1305echo -n "libv4lconvert:       "
1306if test "x$have_v4lconvert" = "xtrue"; then
1307echo "Yes (CFLAGS=$V4LCONVERT_CFLAGS LIBS=$V4LCONVERT_LIBS)"
1308else
1309if test "x$test_v4lconvert" = "xtrue"; then
1310echo "Missing (Go to http://people.atrpms.net/~hdegoede/)"
1311else
1312echo "Disabled"
1313fi
1314fi
1315
1316echo -n "libexif:             "
1317if test "x$have_libexif" = "xtrue"; then
1318echo "Yes (CFLAGS=$LIBEXIF_CFLAGS LIBS=$LIBEXIF_LIBS)"
1319else
1320echo "Missing (Go to http://libexif.sourceforge.net/)"
1321fi
1322
1323
1324echo
1325echo "=== Applications: ================================="
1326
1327echo -n "Plugin Configurator: "
1328if test "x$have_plugincfg" = "xtrue"; then
1329echo "Enabled"
1330else
1331echo "Disabled"
1332fi
1333
1334echo -n "Alsamixer:           "
1335if test "x$have_alsamixer" = "xtrue"; then
1336echo "Enabled"
1337else
1338echo "Disabled"
1339fi
1340
1341echo -n "Player:              "
1342if test "x$have_player" = "xtrue"; then
1343echo "Enabled"
1344else
1345echo "Disabled"
1346fi
1347
1348echo -n "Transcoder:          "
1349if test "x$have_transcoder" = "xtrue"; then
1350echo "Enabled"
1351else
1352echo "Disabled"
1353fi
1354
1355echo -n "Recorder:            "
1356if test "x$have_recorder" = "xtrue"; then
1357echo "Enabled"
1358else
1359echo "Disabled"
1360fi
1361
1362echo -n "Visualizer:          "
1363if test "x$have_visualizer" = "xtrue"; then
1364echo "Enabled"
1365else
1366echo "Disabled"
1367fi
1368
1369echo -n "Keyboard daemon:     "
1370if test "x$have_kbd" = "xtrue"; then
1371echo "Enabled"
1372else
1373echo "Disabled"
1374fi
1375
1376echo -n "Thumbnailer:         "
1377if test "x$have_thumbnailer" = "xtrue"; then
1378echo "Enabled"
1379else
1380echo "Disabled"
1381fi
1382
1383echo -n "nmjedit:             "
1384if test "x$have_nmjedit" = "xtrue"; then
1385echo "Enabled"
1386else
1387echo "Disabled"
1388fi
1389
1390echo
1391echo "If you installed a library but it was not detected, check the file INSTALL"
1392echo "for troubleshooting tips. Also note that if the configure script reaches"
1393echo "this point, all missing packages are optional so compilation should succeed"
1394echo "anyway."
1395