summaryrefslogtreecommitdiff
path: root/java/openjdk6/files/alsa-enable.patch
blob: 3d455bd4c7e890d15a5e1de178006cdb38df629d (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
--- jdk/make/javax/sound/Makefile	2011-01-20 18:54:05.000000000 -0500
+++ jdk/make/javax/sound/Makefile	2011-02-11 16:20:52.000000000 -0500
@@ -105,6 +105,15 @@
   #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
 endif # PLATFORM linux
 
+ifeq ($(PLATFORM), bsd)
+  # build with empty MIDI i/o
+  INCLUDE_MIDI = TRUE
+  # ALSA handles directaudio and ports
+  SUBDIRS += jsoundalsa
+  EXTRA_SOUND_JNI_LIBS += jsoundalsa
+  #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
+endif # PLATFORM bsd
+
 ifeq ($(PLATFORM), solaris)
   ifneq ($(ARCH), amd64)
     # build with ports and direct audio
--- jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c	2012-05-01 17:18:35.000000000 -0400
+++ jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c	2012-09-26 17:35:48.000000000 -0400
@@ -131,6 +131,10 @@
 
 void getALSAVersion(char* buffer, int len) {
     if (!hasGottenALSAVersion) {
+#ifdef __FreeBSD__
+        // XXX We do not use ALSA drivers.  Just copy the library version.
+        strcpy(ALSAVersionString, SND_LIB_VERSION_STR);
+#else
         // get alsa version from proc interface
         FILE* file;
         int curr, len, totalLen, inVersionString;
@@ -171,6 +175,7 @@
             // null terminate
             ALSAVersionString[len] = 0;
         }
+#endif
         hasGottenALSAVersion = TRUE;
     }
     strncpy(buffer, ALSAVersionString, len);
--- jdk/src/share/native/com/sun/media/sound/Platform.c	2011-01-20 18:54:37.000000000 -0500
+++ jdk/src/share/native/com/sun/media/sound/Platform.c	2011-02-11 16:20:52.000000000 -0500
@@ -99,5 +99,15 @@
         return com_sun_media_sound_Platform_LIB_ALSA;
     }
 #endif
+#if (X_PLATFORM == X_BSD)
+    switch (feature) {
+    case com_sun_media_sound_Platform_FEATURE_MIDIIO:
+        return com_sun_media_sound_Platform_LIB_MAIN;
+    case com_sun_media_sound_Platform_FEATURE_PORTS:
+        return com_sun_media_sound_Platform_LIB_ALSA;
+    case com_sun_media_sound_Platform_FEATURE_DIRECT_AUDIO:
+        return com_sun_media_sound_Platform_LIB_ALSA;
+    }
+#endif
     return 0;
 }