diff -ur orig/SDL_mixer-1.2.6/configure.in SDL_mixer-1.2.6/configure.in
--- orig/SDL_mixer-1.2.6/configure.in	2004-12-16 05:20:14.000000000 +0000
+++ SDL_mixer-1.2.6/configure.in	2009-06-11 16:20:54.000000000 +0100
@@ -166,6 +166,9 @@
     if test x$enable_music_native_midi = xyes; then
         use_music_native_midi=no
         case "$target" in
+	    *mingw32ce*)
+	        use_music_native_midi=yes
+		;;
             *-*-cygwin* | *-*-mingw32*)
                 use_music_native_midi=yes
                 SYSTEM_LIBS="$SYSTEM_LIBS -lwinmm"
@@ -233,6 +236,9 @@
 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes || test x$use_music_native_midi_gpl = xyes)
 AM_CONDITIONAL(USE_NATIVE_MIDI_GPL, test x$use_music_native_midi_gpl = xyes)
 
+AC_CHECK_HEADERS([signal.h])
+AC_CHECK_FUNCS(setbuf)
+
 dnl Expand the libraries needed for static and dynamic linking
 AC_SUBST(SYSTEM_LIBS)
 
diff -ur orig/SDL_mixer-1.2.6/effects_internal.c SDL_mixer-1.2.6/effects_internal.c
--- orig/SDL_mixer-1.2.6/effects_internal.c	2004-12-16 05:20:14.000000000 +0000
+++ SDL_mixer-1.2.6/effects_internal.c	2009-06-11 16:13:45.000000000 +0100
@@ -30,6 +30,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include "SDL_getenv.h"
 #include "SDL_mixer.h"
 
 /* Should we favor speed over memory usage and/or quality of output? */
@@ -38,7 +39,7 @@
 
 void _Mix_InitEffects(void)
 {
-    _Mix_effects_max_speed = (getenv(MIX_EFFECTSMAXSPEED) != NULL);
+    _Mix_effects_max_speed = (SDL_getenv(MIX_EFFECTSMAXSPEED) != NULL);
 }
 
 
diff -ur orig/SDL_mixer-1.2.6/playmus.c SDL_mixer-1.2.6/playmus.c
--- orig/SDL_mixer-1.2.6/playmus.c	2004-12-16 05:20:14.000000000 +0000
+++ SDL_mixer-1.2.6/playmus.c	2009-06-11 16:26:39.000000000 +0100
@@ -25,7 +25,10 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 #ifdef unix
 #include <unistd.h>
 #endif
@@ -82,6 +85,8 @@
 		   Mix_PausedMusic() ? "yes" : "no");
 }
 
+#ifdef HAVE_SIGNAL_H
+
 void IntHandler(int sig)
 {
 	switch (sig) {
@@ -91,6 +96,8 @@
 	}
 }
 
+#endif
+
 int main(int argc, char *argv[])
 {
 	int audio_rate;
@@ -154,8 +161,10 @@
 	}
 
 	atexit(CleanUp);
+#ifdef HAVE_SIGNAL_H
 	signal(SIGINT, IntHandler);
 	signal(SIGTERM, exit);
+#endif
 
 	/* Open the audio device */
 	if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) {
@@ -174,7 +183,7 @@
 	Mix_VolumeMusic(audio_volume);
 
 	/* Set the external music player, if any */
-	Mix_SetMusicCMD(getenv("MUSIC_CMD"));
+	Mix_SetMusicCMD(SDL_getenv("MUSIC_CMD"));
 
 	while (argv[i]) {
 		next_track = 0;
diff -ur orig/SDL_mixer-1.2.6/playwave.c SDL_mixer-1.2.6/playwave.c
--- orig/SDL_mixer-1.2.6/playwave.c	2004-12-16 05:20:14.000000000 +0000
+++ SDL_mixer-1.2.6/playwave.c	2009-06-11 16:26:25.000000000 +0100
@@ -25,7 +25,10 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 #ifdef unix
 #include <unistd.h>
 #endif
@@ -342,8 +345,10 @@
 	int reverse_stereo = 0;
 	int reverse_sample = 0;
 
+#ifdef HAVE_SETBUF
 	setbuf(stdout, NULL);    /* rcg06132001 for debugging purposes. */
 	setbuf(stderr, NULL);    /* rcg06192001 for debugging purposes, too. */
+#endif
 	output_test_warnings();
 
 	/* Initialize variables */
@@ -391,8 +396,10 @@
 		return(255);
 	}
 	atexit(CleanUp);
+#ifdef HAVE_SIGNAL_H
 	signal(SIGINT, exit);
 	signal(SIGTERM, exit);
+#endif
 
 	/* Open the audio device */
 	if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) < 0) {
