1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4# This file is part of libcanberra.
5#
6# Copyright 2008 Lennart Poettering
7#
8# libcanberra is free software; you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as
10# published by the Free Software Foundation, either version 2.1 of the
11# License, or (at your option) any later version.
12#
13# libcanberra is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16# Lesser General Public License for more details.
17#
18# You should have received a copy of the GNU Lesser General Public
19# License along with libcanberra. If not, see
20# <http://www.gnu.org/licenses/>.
21
22m4_define([ca_major],[0])
23m4_define([ca_minor],[30])
24m4_define([ca_version],[ca_major.ca_minor])
25
26AC_PREREQ([2.68])
27
28AC_INIT([libcanberra],
29        [ca_version],
30        [mzyvopnaoreen (at) 0pointer (dot) de],
31        [libcanberra],
32        [http://0pointer.de/lennart/projects/libcanberra/])
33
34AC_CONFIG_SRCDIR([src/common.c])
35AC_CONFIG_HEADERS([config.h])
36AC_CONFIG_MACRO_DIR(m4)
37AC_CONFIG_AUX_DIR([build-aux])
38
39AM_INIT_AUTOMAKE([foreign 1.11 -Wall silent-rules tar-pax no-dist-gzip dist-xz])
40AM_SILENT_RULES([yes])
41
42AC_SUBST(LIBCANBERRA_VERSION_INFO, [2:5:2])
43AC_SUBST(LIBCANBERRA_GTK_VERSION_INFO, [1:9:1])
44
45AC_CANONICAL_HOST
46AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
47
48if type -p stow > /dev/null && test -d /usr/local/stow ; then
49        AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
50        ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
51fi
52
53#### Checks for programs. ####
54
55AC_PROG_MKDIR_P
56AC_PROG_LN_S
57AM_PROG_AR
58
59# CC
60
61AC_PROG_CC
62AC_PROG_CC_C99
63AM_PROG_CC_C_O
64AC_PROG_GCC_TRADITIONAL
65AC_USE_SYSTEM_EXTENSIONS
66
67# C++
68
69AC_PROG_CXX
70
71CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
72        -pipe \
73        -Wall \
74        -W \
75        -Wextra \
76        -Winline \
77        -Wvla \
78        -Wundef \
79        -Wformat=2 \
80        -Wlogical-op \
81        -Wsign-compare \
82        -Wformat-security \
83        -Wmissing-include-dirs \
84        -Wformat-nonliteral \
85        -Wold-style-definition \
86        -Wpointer-arith \
87        -Winit-self \
88        -Wdeclaration-after-statement \
89        -Wfloat-equal \
90        -Wmissing-prototypes \
91        -Wstrict-prototypes \
92        -Wredundant-decls \
93        -Wmissing-declarations \
94        -Wmissing-noreturn \
95        -Wshadow \
96        -Wendif-labels \
97        -Wcast-align \
98        -Wstrict-aliasing=2 \
99        -Wwrite-strings \
100        -Wno-long-long \
101        -Wno-overlength-strings \
102        -Wno-unused-parameter \
103        -Wno-missing-field-initializers \
104        -Wno-unused-result \
105        -Wunsafe-loop-optimizations \
106        -Wpacked \
107        -Werror=overflow \
108        -Wp,-D_FORTIFY_SOURCE=2 \
109        -ffast-math \
110        -fno-common \
111        -fdiagnostics-show-option \
112        -fno-strict-aliasing \
113        -ffunction-sections \
114        -fdata-sections])
115AC_SUBST([WARNINGFLAGS], $with_cflags)
116
117CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
118        -Wl,--as-needed \
119        -Wl,--gc-sections])
120AC_SUBST([GCLDFLAGS], $with_ldflags)
121
122#### libtool stuff ####
123LT_PREREQ(2.2)
124LT_INIT([dlopen win32-dll disable-static])
125
126dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
127dnl exactly which version of libltdl is present in the system, so we
128dnl just assume that it's a working version as long as we have the
129dnl library and the header files.
130dnl
131dnl As an extra safety device, check for lt_dladvise_init() which is
132dnl only implemented in libtool 2.x, and refine as we go if we have
133dnl refined requirements.
134dnl
135dnl Check the header files first since the system may have a
136dnl libltdl.so for runtime, but no headers, and we want to bail out as
137dnl soon as possible.
138dnl
139dnl We don't need any special variable for this though, since the user
140dnl can give the proper place to find libltdl through the standard
141dnl variables like LDFLAGS and CPPFLAGS.
142
143AC_CHECK_HEADER([ltdl.h],
144    [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
145    [LIBLTDL=])
146
147AS_IF([test "x$LIBLTDL" = "x"],
148    [AC_MSG_ERROR([Unable to find libltdl.])])
149AC_SUBST([LIBLTDL])
150
151#### Determine build environment ####
152
153os_is_win32=0
154
155case "$host_os" in
156     mingw*)
157        AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
158        os_is_win32=1
159     ;;
160esac
161
162AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
163
164AM_CONDITIONAL(USE_VERSION_SCRIPT, test "x$supports_anon_versioning" = "xyes" )
165
166###################################
167#   Basic environment checks      #
168###################################
169
170#### Checks for header files. ####
171
172# ISO
173AC_HEADER_STDC
174
175# XPG4-UNIX
176AC_CHECK_HEADERS([sys/poll.h])
177
178# Other
179AC_CHECK_HEADERS([sys/ioctl.h])
180AC_CHECK_HEADERS([byteswap.h])
181
182#### Typdefs, structures, etc. ####
183
184AC_C_CONST
185AC_C_BIGENDIAN
186AC_TYPE_PID_T
187AC_TYPE_SIZE_T
188AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
189    [Define ssize_t if it is not done by the standard libs.])])
190AC_TYPE_OFF_T
191AC_TYPE_UID_T
192
193#### Check for libs ####
194
195# ISO
196AC_SEARCH_LIBS([pow], [m])
197
198# POSIX
199AC_SEARCH_LIBS([sched_setscheduler], [rt])
200
201# Non-standard
202
203#### Check for functions ####
204
205# ISO
206AC_CHECK_FUNCS([lrintf strtof])
207
208# POSIX
209AC_FUNC_SELECT_ARGTYPES
210AC_CHECK_FUNCS([gettimeofday nanosleep posix_memalign sigaction sleep sysconf pthread_yield])
211
212# SUSv3
213AC_CHECK_FUNCS([strerror_r])
214
215# BSD
216AC_CHECK_FUNCS([lstat])
217
218# GNU
219AC_CHECK_FUNCS([strndup])
220
221#### POSIX threads ####
222
223ACX_PTHREAD
224
225#### Large File-Support (LFS) ####
226
227AC_SYS_LARGEFILE
228
229###################################
230#      External libraries         #
231###################################
232
233#### pkg-config ####
234
235PKG_PROG_PKG_CONFIG
236
237#### ALSA support (optional) ####
238
239AC_ARG_ENABLE([alsa],
240    AS_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
241        [
242            case "${enableval}" in
243                yes) alsa=yes ;;
244                no) alsa=no ;;
245                *) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
246            esac
247        ],
248        [alsa=auto])
249
250if test "x${alsa}" != xno ; then
251    PKG_CHECK_MODULES(ALSA, [ alsa >= 1.0.0 ],
252        [
253            HAVE_ALSA=1
254            AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
255        ],
256        [
257            HAVE_ALSA=0
258            if test "x$alsa" = xyes ; then
259                AC_MSG_ERROR([*** ALSA not found ***])
260            fi
261        ])
262else
263    HAVE_ALSA=0
264fi
265
266AC_SUBST(ALSA_CFLAGS)
267AC_SUBST(ALSA_LIBS)
268
269### OSS support (optional) ###
270
271AC_ARG_ENABLE([oss],
272    AS_HELP_STRING([--disable-oss], [Disable optional OSS support]),
273        [
274            case "${enableval}" in
275                yes) oss=yes ;;
276                no) oss=no ;;
277                *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
278            esac
279        ],
280        [oss=auto])
281
282if test "x${oss}" != xno ; then
283    AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h)
284    if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
285	test "${ac_cv_header_soundcard_h}" = "yes" || \
286	test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
287	HAVE_OSS=1
288        AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
289    else
290	HAVE_OSS=0
291        if test "x$oss" = xyes ; then
292            AC_MSG_ERROR([*** OSS not found ***])
293        fi
294    fi
295else
296    HAVE_OSS=0
297fi
298
299### PulseAudio (optional) ####
300
301AC_ARG_ENABLE([pulse],
302    AS_HELP_STRING([--disable-pulse], [Disable optional PulseAudio support]),
303        [
304            case "${enableval}" in
305                yes) pulse=yes ;;
306                no) pulse=no ;;
307                *) AC_MSG_ERROR(bad value ${enableval} for --disable-pulse) ;;
308            esac
309        ],
310        [pulse=auto])
311
312if test "x${pulse}" != xno ; then
313
314    if test -d ../pulseaudio ; then
315        PULSE_CFLAGS='-I$(top_srcdir)/../pulseaudio/src'
316        PULSE_LIBS='-L$(top_srcdir)/../pulseaudio/src/.libs -lpulse'
317        HAVE_PULSE=1
318        AC_DEFINE([HAVE_PULSE], 1, [Have PulseAudio?])
319        echo "*** Found pulseaudio in ../pulseaudio, using that version ***"
320    else
321        PKG_CHECK_MODULES(PULSE, [ libpulse >= 0.9.11 ],
322        [
323            HAVE_PULSE=1
324            AC_DEFINE([HAVE_PULSE], 1, [Have PulseAudio?])
325        ],
326        [
327            HAVE_PULSE=0
328            if test "x$pulse" = xyes ; then
329                AC_MSG_ERROR([*** PulseAudio not found ***])
330            fi
331        ])
332    fi
333else
334    HAVE_PULSE=0
335fi
336
337AC_SUBST(PULSE_CFLAGS)
338AC_SUBST(PULSE_LIBS)
339
340#### UDEV support (optional) ####
341
342AC_ARG_ENABLE([udev],
343    AS_HELP_STRING([--disable-udev], [Disable optional udev support]),
344        [
345            case "${enableval}" in
346                yes) udev=yes ;;
347                no) udev=no ;;
348                *) AC_MSG_ERROR(bad value ${enableval} for --disable-udev) ;;
349            esac
350        ],
351        [udev=auto])
352
353if test "x${udev}" != xno ; then
354    PKG_CHECK_MODULES(UDEV, [ libudev >= 160 ],
355        [
356            HAVE_UDEV=1
357            AC_DEFINE([HAVE_UDEV], 1, [Have udev?])
358        ],
359        [
360            HAVE_UDEV=0
361            if test "x$udev" = xyes ; then
362                AC_MSG_ERROR([*** udev not found ***])
363            fi
364        ])
365else
366    HAVE_UDEV=0
367fi
368
369AC_SUBST(UDEV_CFLAGS)
370AC_SUBST(UDEV_LIBS)
371AM_CONDITIONAL([HAVE_UDEV], [test "x$HAVE_UDEV" = x1])
372
373#### GStreamer support (optional) ####
374
375AC_ARG_ENABLE([gstreamer],
376    AS_HELP_STRING([--disable-gstreamer], [Disable optional GStreamer support]),
377        [
378            case "${enableval}" in
379                yes) gstreamer=yes ;;
380                no) gstreamer=no ;;
381                *) AC_MSG_ERROR(bad value ${enableval} for --disable-gstreamer) ;;
382            esac
383        ],
384        [gstreamer=auto])
385
386if test "x${gstreamer}" != xno ; then
387    PKG_CHECK_MODULES(GST, [ gstreamer-1.0 >= 0.10.15 ],
388        [
389            HAVE_GSTREAMER=1
390            AC_DEFINE([HAVE_GSTREAMER], 1, [Have GStreamer?])
391        ],
392        [
393            HAVE_GSTREAMER=0
394            if test "x$gstreamer" = xyes ; then
395                AC_MSG_ERROR([*** GStreamer not found ***])
396            fi
397        ])
398else
399    HAVE_GSTREAMER=0
400fi
401
402AC_SUBST(GSTREAMER_CFLAGS)
403AC_SUBST(GSTREAMER_LIBS)
404
405### Null output (optional) ####
406
407AC_ARG_ENABLE([null],
408    AS_HELP_STRING([--disable-null], [Disable optional null output]),
409        [
410            case "${enableval}" in
411                yes) null=yes ;;
412                no) null=no ;;
413                *) AC_MSG_ERROR(bad value ${enableval} for --disable-null) ;;
414            esac
415        ],
416        [null=yes])
417
418if test "x${null}" != xno ; then
419    HAVE_NULL=1
420    AC_DEFINE([HAVE_NULL], 1, [Have NULL output?])
421else
422    HAVE_NULL=0
423fi
424
425### GTK (optional) ####
426
427AC_ARG_ENABLE([gtk],
428    AS_HELP_STRING([--disable-gtk], [Disable optional GTK+ support]),
429        [
430            case "${enableval}" in
431                yes) gtk=yes ;;
432                no) gtk=no ;;
433                *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk) ;;
434            esac
435        ],
436        [gtk=auto])
437
438AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
439if test "x${gtk}" != xno ; then
440    PKG_CHECK_MODULES(GTK, [ gtk+-2.0 >= 2.20.0 gthread-2.0 glib-2.0 >= 2.32 gdk-2.0 x11 ],
441        [
442            HAVE_GTK=1
443            AC_DEFINE([HAVE_GTK], 1, [Have GTK?])
444
445            GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
446            GTK_MODULES_DIR="${libdir}/gtk-2.0/modules"
447        ],
448        [
449            HAVE_GTK=0
450            if test "x$gtk" = xyes ; then
451                AC_MSG_ERROR([*** GTK not found ***])
452            fi
453        ])
454else
455    HAVE_GTK=0
456fi
457
458AC_SUBST(GTK_CFLAGS)
459AC_SUBST(GTK_LIBS)
460AC_SUBST(GTK_MODULES_DIR)
461AC_SUBST(HAVE_GTK)
462AM_CONDITIONAL([HAVE_GTK], [test "x$HAVE_GTK" = x1])
463
464AC_ARG_ENABLE([gtk3],
465    AS_HELP_STRING([--disable-gtk3], [Disable optional GTK+ 3 support]),
466        [
467            case "${enableval}" in
468                yes) gtk3=yes ;;
469                no) gtk3=no ;;
470                *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk3) ;;
471            esac
472        ],
473        [gtk3=auto])
474
475if test "x${gtk3}" != xno ; then
476    PKG_CHECK_MODULES(GTK3, [ gtk+-3.0 gthread-2.0 glib-2.0 >= 2.32 gdk-3.0 x11 ],
477        [
478            HAVE_GTK3=1
479            AC_DEFINE([HAVE_GTK3], 1, [Have GTK3?])
480
481            GTK3_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
482            GTK3_MODULES_DIR="${libdir}/gtk-3.0/modules"
483        ],
484        [
485            HAVE_GTK3=0
486            if test "x$gtk3" = xyes ; then
487                AC_MSG_ERROR([*** GTK3 not found ***])
488            fi
489        ])
490else
491    HAVE_GTK3=0
492fi
493
494AC_SUBST(GTK3_CFLAGS)
495AC_SUBST(GTK3_LIBS)
496AC_SUBST(GTK3_MODULES_DIR)
497AC_SUBST(HAVE_GTK3)
498AM_CONDITIONAL([HAVE_GTK3], [test "x$HAVE_GTK3" = x1])
499
500AM_CONDITIONAL([HAVE_GTK_ANY], [test "x$HAVE_GTK" = x1 -o "x$HAVE_GTK3" = x1])
501
502#### TDB cache support (optional) ####
503
504AC_ARG_ENABLE([tdb],
505    AS_HELP_STRING([--disable-tdb], [Disable optional tdb support]),
506        [
507            case "${enableval}" in
508                yes) tdb=yes ;;
509                no) tdb=no ;;
510                *) AC_MSG_ERROR(bad value ${enableval} for --disable-tdb) ;;
511            esac
512        ],
513        [tdb=auto])
514
515if test "x${tdb}" != xno ; then
516    PKG_CHECK_MODULES(TDB, [ tdb >= 1.1 ],
517        [
518            HAVE_TDB=1
519            AC_DEFINE([HAVE_TDB], 1, [Have TDB?])
520        ],
521        [
522            HAVE_TDB=0
523            if test "x$tdb" = xyes ; then
524                AC_MSG_ERROR([*** TDB not found ***])
525            fi
526        ])
527else
528    HAVE_TDB=0
529fi
530
531AC_SUBST(TDB_CFLAGS)
532AC_SUBST(TDB_LIBS)
533
534AC_SUBST(HAVE_TDB)
535AM_CONDITIONAL([HAVE_TDB], [test "x$HAVE_TDB" = x1])
536
537### Global cache support ###
538
539# For now, we only support tdb based caching, hence we'll shortcut this here
540
541HAVE_CACHE=$HAVE_TDB
542AC_SUBST(HAVE_CACHE)
543AM_CONDITIONAL([HAVE_CACHE], [test "x$HAVE_CACHE" = x1])
544
545if test "x${HAVE_CACHE}" = x1 ; then
546     AC_DEFINE([HAVE_CACHE], 1, [Do cacheing?])
547fi
548
549#
550# systemd
551#
552AC_ARG_WITH([systemdsystemunitdir],
553        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
554        [],
555        [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
556if test "x$with_systemdsystemunitdir" != xno; then
557        AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
558fi
559AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
560
561### LYNX documentation generation ###
562
563AC_ARG_ENABLE([lynx],
564        AS_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
565                [
566                        case "${enableval}" in
567                                yes) lynx=yes ;;
568                                no) lynx=no ;;
569                                *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
570                        esac
571                ],
572                [lynx=yes])
573
574if test x$lynx = xyes ; then
575   AC_CHECK_PROG(have_lynx, lynx, yes, no)
576
577   if test "x$have_lynx" = xno ; then
578     AC_MSG_WARN([*** lynx not found, plain text README will not be built ***])
579   fi
580fi
581
582AM_CONDITIONAL([USE_LYNX], [test "x$have_lynx" = xyes])
583
584### Vorbis (mandatory) ###
585
586PKG_CHECK_MODULES(VORBIS, [ vorbisfile ])
587
588### Chose builtin driver ###
589
590AC_ARG_WITH([builtin],
591            [AS_HELP_STRING([--with-builtin], [Choose builtin driver])],
592            [],
593            [with_builtin=dso])
594
595HAVE_DSO=0
596BUILTIN_DSO=0
597BUILTIN_PULSE=0
598BUILTIN_ALSA=0
599BUILTIN_OSS=0
600BUILTIN_GSTREAMER=0
601BUILTIN_NULL=0
602
603case "x$with_builtin" in
604     xpulse)
605        if test "x$HAVE_PULSE" != x1 ; then
606                AC_MSG_ERROR([*** PulseAudio selected for builtin driver, but not enabled. ***])
607        fi
608
609        BUILTIN_PULSE=1
610        HAVE_ALSA=0
611	HAVE_OSS=0
612	HAVE_GSTREAMER=0
613        HAVE_NULL=0
614     ;;
615
616     xalsa)
617        if test "x$HAVE_ALSA" != x1 ; then
618                AC_MSG_ERROR([*** ALSA selected for builtin driver, but not enabled. ***])
619        fi
620
621        BUILTIN_ALSA=1
622	HAVE_OSS=0
623        HAVE_PULSE=0
624	HAVE_GSTREAMER=0
625        HAVE_NULL=0
626     ;;
627
628     xgstreamer)
629        if test "x$HAVE_GSTREAMER" != x1 ; then
630                AC_MSG_ERROR([*** GStremaer selected for builtin driver, but not enabled. ***])
631        fi
632
633        BUILTIN_GSTREAMER=1
634        HAVE_ALSA=0
635	HAVE_OSS=0
636        HAVE_PULSE=0
637        HAVE_NULL=0
638     ;;
639
640     xoss)
641        if test "x$HAVE_OSS" != x1 ; then
642	        AC_MSG_ERROR([*** OSS selected for builtin driver, but not enabled. ***])
643	fi
644
645	BUILTIN_OSS=1
646	HAVE_ALSA=0
647	HAVE_PULSE=0
648	HAVE_GSTREAMER=0
649	HAVE_NULL=0
650     ;;
651
652     xnull)
653        if test "x$HAVE_NULL" != x1 ; then
654                AC_MSG_ERROR([*** Null output selected for builtin driver, but not enabled. ***])
655        fi
656
657        BUILTIN_NULL=1
658        HAVE_PULSE=0
659        HAVE_ALSA=0
660	HAVE_OSS=0
661	HAVE_GSTREAMER=0
662     ;;
663
664     xdso)
665        BUILTIN_DSO=1
666        HAVE_DSO=1
667        AC_DEFINE([HAVE_DSO], 1, [Have DSO?])
668     ;;
669
670     *)
671        AC_MSG_ERROR([*** Unknown driver $with_builtin selected for builtin ***])
672esac
673
674if test "x$HAVE_PULSE" != x1 -a "x$HAVE_ALSA" != x1 -a "x$HAVE_OSS" != x1 -a "x$HAVE_GSTREAMER" != x1 -a "x$HAVE_NULL" != x1 ; then
675   AC_MSG_ERROR([*** No backend enabled. ***])
676fi
677
678AC_SUBST(HAVE_DSO)
679AC_SUBST(HAVE_PULSE)
680AC_SUBST(HAVE_ALSA)
681AC_SUBST(HAVE_OSS)
682AC_SUBST(HAVE_GSTREAMER)
683AC_SUBST(HAVE_NULL)
684AC_SUBST(BUILTIN_DSO)
685AC_SUBST(BUILTIN_PULSE)
686AC_SUBST(BUILTIN_ALSA)
687AC_SUBST(BUILTIN_OSS)
688AC_SUBST(BUILTIN_GSTREAMER)
689AC_SUBST(BUILTIN_NULL)
690AM_CONDITIONAL([HAVE_PULSE], [test "x$HAVE_PULSE" = x1])
691AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
692AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
693AM_CONDITIONAL([HAVE_GSTREAMER], [test "x$HAVE_GSTREAMER" = x1])
694AM_CONDITIONAL([HAVE_NULL], [test "x$HAVE_NULL" = x1])
695AM_CONDITIONAL([BUILTIN_DSO], [test "x$BUILTIN_DSO" = x1])
696AM_CONDITIONAL([BUILTIN_PULSE], [test "x$BUILTIN_PULSE" = x1])
697AM_CONDITIONAL([BUILTIN_ALSA], [test "x$BUILTIN_ALSA" = x1])
698AM_CONDITIONAL([BUILTIN_OSS], [test "x$BUILTIN_OSS" = x1])
699AM_CONDITIONAL([BUILTIN_GSTREAMER], [test "x$BUILTIN_GSTREAMER" = x1])
700AM_CONDITIONAL([BUILTIN_NULL], [test "x$BUILTIN_NULL" = x1])
701
702AC_SUBST([CA_MAJOR],[ca_major])
703AC_SUBST([CA_MINOR],[ca_minor])
704
705GTK_DOC_CHECK(1.9)
706
707###################################
708#            Output               #
709###################################
710
711AC_CONFIG_FILES([
712Makefile
713src/Makefile
714libcanberra.pc
715libcanberra-gtk.pc
716libcanberra-gtk3.pc
717src/canberra.h
718gtkdoc/Makefile
719doc/Makefile
720doc/README.html
721])
722AC_OUTPUT
723
724# ==========================================================================
725ENABLE_BUILTIN_DSO=no
726if test "x$BUILTIN_DSO" = "x1" ; then
727   ENABLE_BUILTIN_DSO=yes
728fi
729
730ENABLE_PULSE=no
731if test "x$HAVE_PULSE" = "x1" ; then
732   ENABLE_PULSE=yes
733fi
734ENABLE_BUILTIN_PULSE=no
735if test "x$BUILTIN_PULSE" = "x1" ; then
736   ENABLE_BUILTIN_PULSE=yes
737fi
738
739ENABLE_ALSA=no
740if test "x$HAVE_ALSA" = "x1" ; then
741   ENABLE_ALSA=yes
742fi
743ENABLE_BUILTIN_ALSA=no
744if test "x$BUILTIN_ALSA" = "x1" ; then
745   ENABLE_BUILTIN_ALSA=yes
746fi
747
748ENABLE_OSS=no
749if test "x$HAVE_OSS" = "x1" ; then
750    ENABLE_OSS=yes
751fi
752ENABLE_BUILTIN_OSS=no
753if test "x$BUILTIN_OSS" = "x1" ; then
754    ENABLE_BUILTIN_OSS=yes
755fi
756
757ENABLE_GSTREAMER=no
758if test "x$HAVE_GSTREAMER" = "x1" ; then
759   ENABLE_GSTREAMER=yes
760fi
761ENABLE_BUILTIN_GSTREAMER=no
762if test "x$BUILTIN_GSTREAMER" = "x1" ; then
763   ENABLE_BUILTIN_GSTREAMER=yes
764fi
765
766ENABLE_NULL=no
767if test "x$HAVE_NULL" = "x1" ; then
768   ENABLE_NULL=yes
769fi
770ENABLE_BUILTIN_NULL=no
771if test "x$BUILTIN_NULL" = "x1" ; then
772   ENABLE_BUILTIN_NULL=yes
773fi
774
775ENABLE_GTK=no
776if test "x$HAVE_GTK" = "x1" ; then
777   ENABLE_GTK=yes
778fi
779
780ENABLE_GTK3=no
781if test "x$HAVE_GTK3" = "x1" ; then
782   ENABLE_GTK3=yes
783fi
784
785ENABLE_TDB=no
786if test "x$HAVE_TDB" = "x1" ; then
787   ENABLE_TDB=yes
788fi
789
790ENABLE_CACHE=no
791if test "x$HAVE_CACHE" = "x1" ; then
792   ENABLE_CACHE=yes
793fi
794
795ENABLE_UDEV=no
796if test "x$HAVE_UDEV" = "x1" ; then
797   ENABLE_UDEV=yes
798fi
799
800echo "
801 ---{ $PACKAGE_NAME $VERSION }---
802
803    prefix:                 ${prefix}
804    sysconfdir:             ${sysconfdir}
805    localstatedir:          ${localstatedir}
806    Compiler:               ${CC}
807    CFLAGS:                 ${CFLAGS}
808    C++-Compiler:           ${CXX}
809    CXXFLAGS:               ${CXXFLAGS}
810    Builtin DSO:            ${ENABLE_BUILTIN_DSO}
811    Enable PulseAudio:      ${ENABLE_PULSE}
812    Builtin PulseAudio:     ${ENABLE_BUILTIN_PULSE}
813    Enable ALSA:            ${ENABLE_ALSA}
814    Builtin ALSA:           ${ENABLE_BUILTIN_ALSA}
815    Enable OSS:             ${ENABLE_OSS}
816    Builtin OSS:            ${ENABLE_BUILTIN_OSS}
817    Enable GStreamer:       ${ENABLE_GSTREAMER}
818    Builtin GStreamer:      ${ENABLE_BUILTIN_GSTREAMER}
819    Enable Null Output:     ${ENABLE_NULL}
820    Builtin Null Output:    ${ENABLE_BUILTIN_NULL}
821    Enable tdb:             ${ENABLE_TDB}
822    Enable lookup cache:    ${ENABLE_CACHE}
823    Enable GTK+:            ${ENABLE_GTK}
824    GTK Modules Directory:  ${GTK_MODULES_DIR}
825    Enable GTK3+:           ${ENABLE_GTK3}
826    GTK3 Modules Directory: ${GTK3_MODULES_DIR}
827    Enable udev:            ${ENABLE_UDEV}
828    systemd Unit Directory: ${with_systemdsystemunitdir}
829"
830
831
832if test "x$HAVE_OSS" = "x1" -a "x$HAVE_ALSA" = "x1" ; then
833
834   echo "
835WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
836
837You enabled the OSS driver although the ALSA driver is
838available. Please note that if ALSA is available the OSS driver is a
839very bad choice, since it currently doesn't support resampling or
840converting sample types to the necessities of the hardware if the
841hardware does not directly support the format/rate of the sound file
842to play.
843
844Packagers of Linux distributions! Please think twice if you package
845the OSS driver! It is probably best to not to pacakge it at all -- at
846least until the OSS driver learned sample type conversion and the most
847basic resampling. Otherwise you might end up getting bug reports from
848users misunderstanding the OSS vs. ALSA situation.
849
850WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
851"
852
853fi
854