summaryrefslogtreecommitdiff
blob: bec0893b66caf73e5be145c8a40fad15853f2925 (plain)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Index: kdemultimedia-3.5.6/configure.in.in
===================================================================
--- kdemultimedia-3.5.6.orig/configure.in.in
+++ kdemultimedia-3.5.6/configure.in.in
@@ -152,88 +152,19 @@ AC_DEFUN([KDE_CHECK_OSSAUDIO],
 
 AC_DEFUN([KDE_CHECK_ALSA],
 [
-  have_alsa=no
+  AC_CHECK_LIB([asound], [snd_pcm_open], [have_alsa05=yes], [have_alsa04=no])
 
-  AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
-    [have_alsa=yes])
+  PKG_CHECK_MODULES([ALSA], [alsa >= 0.9], [have_alsa09=yes], [have_alsa09=no])
 
-  AC_CHECK_LIB(asound, snd_seq_create_simple_port,
-    [:], [have_alsa=no])
-
-  AC_LANG_SAVE
-  AC_LANG_C
-  if test "x$have_alsa" = xyes; then
-    AC_TRY_COMPILE([
-      #include "confdefs.h"
-      #ifdef HAVE_SYS_ASOUNDLIB_H
-      #include <sys/asoundlib.h>
-      #endif
-      #ifdef HAVE_ALSA_ASOUNDLIB_H
-      #include <alsa/asoundlib.h>
-      #endif
-    ],[
-      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
-        /* we have ALSA 0.5.x */
-      #else
-        #error not ALSA 0.5.x
-      #endif
-    ],
-    have_alsa_0_5=yes)
-
-    AC_TRY_COMPILE([
-      #include "confdefs.h"
-      #ifdef HAVE_SYS_ASOUNDLIB_H
-      #include <sys/asoundlib.h>
-      #endif
-      #ifdef HAVE_ALSA_ASOUNDLIB_H
-      #include <alsa/asoundlib.h>
-      #endif
-    ],[
-      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
-        /* we have ALSA 0.9.x */
-      #else
-        #error not ALSA 0.9.x
-      #endif
-    ],
-    have_alsa_0_9=yes)
-
-    AC_TRY_COMPILE([
-      #include "confdefs.h"
-      #ifdef HAVE_SYS_ASOUNDLIB_H
-      #include <sys/asoundlib.h>
-      #endif
-      #ifdef HAVE_ALSA_ASOUNDLIB_H
-      #include <alsa/asoundlib.h>
-      #endif
-    ],[
-      #if (SND_LIB_MAJOR == 1)
-        /* we have ALSA 1.x */
-      #else
-        #error not ALSA 1.x
-      #endif
-    ],
-    have_alsa_1=yes)
-  fi
-  AC_LANG_RESTORE
-
-  if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
-    # for kmix/ and akode/
-    LIBASOUND="-lasound"
+  if test "x$have_alsa09" = "xyes"; then
+    have_alsa="yes"
     AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
-
-    # for arts/
-    ARTS_LIBASOUND="-lasound"
-    AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
+  elif test "x$have_alsa05" = "xyes"; then
+    have_alsa="yes"
+    AC_DEFINE(HAVE_LIBASOUND1, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
+    ALSA_LIBS="-lasound"
+    AC_SUBST([ALSA_LIBS])
   fi
-
-  if test "x$have_alsa_0_5" = xyes; then
-    # for arts/
-    ARTS_LIBASOUND="-lasound"
-    AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
-  fi
-
-  AC_SUBST(LIBASOUND)
-  AC_SUBST(ARTS_LIBASOUND)
 ])
 
 AC_DEFUN([KDE_CHECK_CDPARANOIA],
Index: kdemultimedia-3.5.6/kscd/kscd.cpp
===================================================================
--- kdemultimedia-3.5.6.orig/kscd/kscd.cpp
+++ kdemultimedia-3.5.6/kscd/kscd.cpp
@@ -108,7 +108,7 @@ KSCD::KSCD( QWidget *parent, const char 
 #if defined(BUILD_CDDA)
   audio_systems_list
                      << "arts"
-#if defined(HAVE_ARTS_LIBASOUND2)
+#if defined(HAVE_LIBASOUND2)
                      << "alsa"
 #endif
 #ifdef USE_SUN_AUDIO
Index: kdemultimedia-3.5.6/kscd/libwm/audio/audio_alsa.c
===================================================================
--- kdemultimedia-3.5.6.orig/kscd/libwm/audio/audio_alsa.c
+++ kdemultimedia-3.5.6/kscd/libwm/audio/audio_alsa.c
@@ -18,7 +18,7 @@
 
 #include <config.h>
 
-#if defined(HAVE_ARTS_LIBASOUND2)
+#if defined(HAVE_LIBASOUND2)
 
 #include <alsa/asoundlib.h>
 #include "audio.h"
Index: kdemultimedia-3.5.6/kscd/libwm/audio/audio.c
===================================================================
--- kdemultimedia-3.5.6.orig/kscd/libwm/audio/audio.c
+++ kdemultimedia-3.5.6/kscd/libwm/audio/audio.c
@@ -16,7 +16,7 @@ struct audio_oops* setup_soundsystem(con
   if(!strcmp(ss, "arts"))
     return setup_arts(dev, ctl);
 #endif
-#if defined(HAVE_ARTS_LIBASOUND2)
+#if defined(HAVE_LIBASOUND2)
   if(!strcmp(ss, "alsa"))
     return setup_alsa(dev, ctl);
 #endif
Index: kdemultimedia-3.5.6/kscd/libwm/Makefile.am
===================================================================
--- kdemultimedia-3.5.6.orig/kscd/libwm/Makefile.am
+++ kdemultimedia-3.5.6/kscd/libwm/Makefile.am
@@ -10,7 +10,7 @@ INCLUDES = $(all_includes) 
 noinst_LTLIBRARIES  = libworkman.la
 
 libworkman_la_LDFLAGS = $(ARTSC_LIBS) $(all_libraries)
-libworkman_la_LIBADD = audio/libworkmanaudio.la $(ARTS_LIBASOUND)
+libworkman_la_LIBADD = audio/libworkmanaudio.la $(ALSA_LIBS)
 
 libworkman_la_SOURCES = cddb.c cdinfo.c cdrom.c wm_helpers.c cdtext.c\
 database.c index.c scsi.c cdda.c plat_linux_cdda.c plat_sun_cdda.c\