summaryrefslogtreecommitdiffstats
path: root/audio/libcanberra/files/patch-configure.ac
blob: 324d80d3b668ae0acdd323ba89ddf83f441deb82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
--- configure.ac.orig   2008-08-09 15:27:28.000000000 -0400
+++ configure.ac    2008-08-09 15:27:59.000000000 -0400
@@ -219,6 +219,35 @@ fi
 AC_SUBST(ALSA_CFLAGS)
 AC_SUBST(ALSA_LIBS)
 
+### OSS support (optional) ###
+AC_ARG_ENABLE([oss],
+    AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
+        [
+            case "${enableval}" in
+                yes) alsa=yes ;;
+                no) alsa=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
+            esac
+        ],
+        [oss=auto])
+
+if test "x${oss}" != xno ; then
+    AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h)
+    if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
+   test "${ac_cv_header_soundcard_h}" = "yes" || \
+   test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
+   HAVE_OSS=1
+        AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
+    else
+   HAVE_OSS=0
+        if test "x$oss" = xyes ; then
+            AC_MSG_ERROR([*** OSS not found ***])
+        fi
+    fi
+else
+    HAVE_OSS=0
+fi
+
 ### PulseAudio (optional) ####
 
 AC_ARG_ENABLE([pulse],
@@ -333,6 +362,7 @@ HAVE_DSO=0
 BUILTIN_DSO=0
 BUILTIN_PULSE=0
 BUILTIN_ALSA=0
+BUILTIN_OSS=0
 BUILTIN_NULL=0
 
 case "x$with_builtin" in
@@ -343,6 +373,7 @@ case "x$with_builtin" in
 
         BUILTIN_PULSE=1
         HAVE_ALSA=0
+   HAVE_OSS=0
         HAVE_NULL=0
      ;;
 
@@ -352,10 +383,22 @@ case "x$with_builtin" in
         fi
 
         BUILTIN_ALSA=1
+   HAVE_OSS=0
         HAVE_PULSE=0
         HAVE_NULL=0
      ;;
 
+     xoss)
+        if test "x$HAV_OSS" != x1 ; then
+           AC_MSG_ERROR([*** OSS selected for builtin driver, but not enabled. ***])
+   fi
+
+   BUILTIN_OSS=1
+   HAVE_ALSA=0
+   HAVE_PULSE=0
+   HAVE_NULL=0
+     ;;
+
      xnull)
         if test "x$HAVE_NULL" != x1 ; then
                 AC_MSG_ERROR([*** Null output selected for builtin driver, but not enabled. ***])
@@ -364,6 +407,7 @@ case "x$with_builtin" in
         BUILTIN_NULL=1
         HAVE_PULSE=0
         HAVE_ALSA=0
+   HAVE_OSS=0
      ;;
 
      xdso)
@@ -376,24 +420,28 @@ case "x$with_builtin" in
         AC_MSG_ERROR([*** Unknown driver $with_builtin selected for builtin ***])
 esac
 
-if test "x$HAVE_PULSE" != x1 -a "x$HAVE_ALSA" != x1 -a "x$HAVE_NULL" != x1 ; then
+if test "x$HAVE_PULSE" != x1 -a "x$HAVE_ALSA" != x1 -a "x$HAVE_OSS" != x1 -a "x$HAVE_NULL" != x1 ; then
    AC_MSG_ERROR([*** No backend enabled. ***])
 fi
 
 AC_SUBST(HAVE_DSO)
 AC_SUBST(HAVE_PULSE)
 AC_SUBST(HAVE_ALSA)
+AC_SUBST(HAVE_OSS)
 AC_SUBST(HAVE_NULL)
 AC_SUBST(BUILTIN_DSO)
 AC_SUBST(BUILTIN_PULSE)
 AC_SUBST(BUILTIN_ALSA)
+AC_SUBST(BUILTIN_OSS)
 AC_SUBST(BUILTIN_NULL)
 AM_CONDITIONAL([HAVE_PULSE], [test "x$HAVE_PULSE" = x1])
 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
+AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
 AM_CONDITIONAL([HAVE_NULL], [test "x$HAVE_NULL" = x1])
 AM_CONDITIONAL([BUILTIN_DSO], [test "x$BUILTIN_DSO" = x1])
 AM_CONDITIONAL([BUILTIN_PULSE], [test "x$BUILTIN_PULSE" = x1])
 AM_CONDITIONAL([BUILTIN_ALSA], [test "x$BUILTIN_ALSA" = x1])
+AM_CONDITIONAL([BUILTIN_OSS], [test "x$BUILTIN_OSS" = x1])
 AM_CONDITIONAL([BUILTIN_NULL], [test "x$BUILTIN_NULL" = x1])
 
 GTK_DOC_CHECK(1.9)
@@ -435,6 +483,15 @@ if test "x$BUILTIN_ALSA" = "x1" ; then
    ENABLE_BUILTIN_ALSA=yes
 fi
 
+ENABLE_OSS=no
+if test "x$HAVE_OSS" = "x1" ; then
+    ENABLE_OSS=yes
+fi
+ENABLE_BUILTIN_OSS=no
+if test "x$BUILTIN_OSS" = "x1" ; then
+    ENABLE_BUILTIN_OSS=yes
+fi
+
 ENABLE_NULL=no
 if test "x$HAVE_NULL" = "x1" ; then
    ENABLE_NULL=yes
@@ -464,6 +521,8 @@ echo "
     Builtin PulseAudio:     ${ENABLE_BUILTIN_PULSE}
     Enable ALSA:            ${ENABLE_ALSA}
     Builtin ALSA:           ${ENABLE_BUILTIN_ALSA}
+    Enable OSS:             ${ENABLE_OSS}
+    Builtin OSS:            ${ENABLE_BUILTIN_OSS}
     Enable Null Output:     ${ENABLE_NULL}
     Builtin Null Output:    ${ENABLE_BUILTIN_NULL}
     Enable GTK+:            ${ENABLE_GTK}