--- kscd/cddb.cpp.orig	Thu Apr  4 16:34:39 2002
+++ kscd/cddb.cpp	Thu Apr  4 16:34:49 2002
@@ -24,6 +24,7 @@
  *
  */
 
+#include <strings.h>
 #include <netdb.h>
 #include <pwd.h>
 #include <stdio.h>
--- kmidi/TIMIDITY/Makefile.am.orig	Thu Apr  4 15:32:19 2002
+++ kmidi/TIMIDITY/Makefile.am	Thu Apr  4 15:32:36 2002
@@ -11,7 +11,7 @@
 INCLUDES = $(X_INCLUDES) `$(ARTSCCONFIG) --cflags`
 AM_CFLAGS = -DDEFAULT_PATH=\"$(TIMID_DIR)\" $(EXTRATDEFS) $(EXTRATCFLAGS)
 LDFLAGS = `$(ARTSCCONFIG) --libs`
-LDADD = $(LIBALIB) $(LIBAUDIO) $(LIBMME) $(EXTRATLIBS) $(X_LIBS) -lm
+LDADD = $(LIBALIB) $(LIBAUDIO) $(LIBMME) $(EXTRATLIBS) $(X_LIBS) -lm -lXmu -lXext
 
 # Where to install the patches, config files, and MIDI files.
 # If you change this, it's a good idea to recompile the binary,
--- kmidi/config.h.orig	Thu Apr  4 15:24:00 2002
+++ kmidi/config.h	Thu Apr  4 15:27:27 2002
@@ -231,9 +231,15 @@
 #define AUDIO_BUFFER_SIZE (1<<AUDIO_BUFFER_BITS)
 #define BB_SIZE (AUDIO_BUFFER_SIZE*512)
 
+#ifdef _AIX
+#include <sys/inttypes.h>
+#endif
+
 #if SIZEOF_LONG == 4
 	typedef unsigned long uint32;
+#ifndef _AIX
 	typedef long int32; 
+#endif
 #elif SIZEOF_LONG == 8
 	typedef unsigned int uint32;
 	typedef int int32; 
@@ -241,9 +247,11 @@
 	#error "We don't know where to find a 32 of our bits!!"
 #endif
 typedef unsigned short uint16;
-typedef short int16;
 typedef unsigned char uint8;
+#ifndef _AIX
+typedef short int16;
 typedef char int8;
+#endif
 
 /* Instrument files are little-endian, MIDI files big-endian, so we
    need to do some conversions. */
--- kmidi/ctl.cpp.orig	Thu Apr  4 16:26:42 2002
+++ kmidi/ctl.cpp	Thu Apr  4 16:27:54 2002
@@ -20,6 +20,11 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  */
+#if defined(_AIX) && !defined(_AIX51)
+extern char *sys_errlist[ ];
+extern int sys_nerr;
+#endif
+
 #if defined(KMIDI) || defined(IA_GTK)
 
 #include <stdio.h>
--- kmidi/celeste_e.cpp.orig	Thu Apr  4 15:30:40 2002
+++ kmidi/celeste_e.cpp	Thu Apr  4 15:30:55 2002
@@ -40,6 +40,9 @@
  */
 
 /** abs macro */
+#ifdef abs
+#undef abs
+#endif
 #define abs(x) ( ( (x) >= 0 ) ? (x) : (-(x)) )
 
 /* >> choice of the day >> */
--- kmidi/common.cpp.orig	Thu Apr  4 15:27:53 2002
+++ kmidi/common.cpp	Thu Apr  4 15:28:39 2002
@@ -21,6 +21,11 @@
 
    */
 
+#if defined(_AIX) && !defined(_AIX51)
+extern char *sys_errlist[ ];
+extern int sys_nerr;
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 
--- kmidi/playmidi.cpp.orig	Thu Apr  4 15:29:19 2002
+++ kmidi/playmidi.cpp	Thu Apr  4 15:29:30 2002
@@ -1839,7 +1839,7 @@
 static unsigned xxmp_epoch = 0;
 static unsigned time_expired = 0;
 static unsigned last_time_expired = 0;
-#if !defined( _UNIXWARE ) && ! defined(__hpux__) && ! defined (sun) && ! defined(_SCO_DS) && ! defined (sgi)
+#if !defined( _UNIXWARE ) && ! defined(__hpux__) && ! defined (sun) && ! defined(_SCO_DS) && ! defined (sgi) && !defined(_AIX)
 extern int gettimeofday(struct timeval *, struct timezone *);
 #endif
 static struct timeval tv;
--- kmidi/raw_a.cpp.orig	Thu Apr  4 15:30:15 2002
+++ kmidi/raw_a.cpp	Thu Apr  4 15:30:20 2002
@@ -23,6 +23,11 @@
 
 */
 
+#if defined(_AIX) && !defined(_AIX51)
+extern char *sys_errlist[ ];
+extern int sys_nerr;
+#endif
+
 #ifdef __WIN32__
 #include <stdlib.h>
 #include <io.h>
--- kmidi/readmidi.cpp.orig	Thu Apr  4 15:28:57 2002
+++ kmidi/readmidi.cpp	Thu Apr  4 15:29:04 2002
@@ -20,6 +20,11 @@
 
 */
 
+#if defined(_AIX) && !defined(_AIX51)
+extern char *sys_errlist[ ];
+extern int sys_nerr;
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
--- kmidi/wave_a.cpp.orig	Thu Apr  4 15:29:55 2002
+++ kmidi/wave_a.cpp	Thu Apr  4 15:30:01 2002
@@ -23,6 +23,11 @@
 
 */
 
+#if defined(_AIX) && !defined(_AIX51)
+extern char *sys_errlist[ ];
+extern int sys_nerr;
+#endif
+
 #ifdef __WIN32__
 #include <stdlib.h>
 #include <io.h>
--- mpeglib/lib/mpegplay/decoderClass.cpp.orig	Fri Apr  5 12:22:46 2002
+++ mpeglib/lib/mpegplay/decoderClass.cpp	Fri Apr  5 12:23:03 2002
@@ -19,7 +19,6 @@
 
 
 
-#define NDEBUG
 #include <assert.h>
 
 
--- kscd/libwm/include/wm_config.h.orig	Wed Apr 24 14:50:56 2002
+++ kscd/libwm/include/wm_config.h	Wed Apr 24 14:51:06 2002
@@ -344,7 +344,7 @@
  ***  **  ****  *****    ******************************************
  ***  **  **      **  **  *****************************************
  ******************************************************************/
-#if defined(AIXV3) || defined(__AIXV3)
+#if defined(AIXV3) || defined(__AIXV3) || defined(_AIX)
 
 #define DEFAULT_CD_DEVICE	"/dev/cd0"
 
--- kscd/libwm/plat_aix.c.orig	Wed Apr 24 14:46:10 2002
+++ kscd/libwm/plat_aix.c	Wed Apr 24 14:49:51 2002
@@ -34,7 +34,7 @@
 
 static char plat_aix_id[] = "$Id: plat_aix.c,v 1.6 2001/04/10 17:34:52 dfoerste Exp $";
 
-#if defined(AIXV3) || defined(__AIXV3)
+#if defined(AIXV3) || defined(__AIXV3) || defined(_AIX)
 
 #include <stdio.h>
 #include <errno.h>
@@ -49,6 +49,8 @@
 #include "include/wm_config.h"
 #include "include/wm_struct.h"
 #include "include/wm_cdtext.h"
+#include "include/wm_cdrom.h"
+#include "include/wm_helpers.h"
 
 #define WM_MSG_CLASS WM_MSG_CLASS_PLATFORM
 
