freebsd-ports/java/openjdk6/files/alsa-enable.patch
2012-09-27 00:18:41 +00:00

57 lines
2 KiB
Diff

--- 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;
}