Index: ffmpeg.m4
diff -Nau ffmpeg.m4.orig ffmpeg.m4
--- m4/ffmpeg.m4.orig	2005-01-04 12:40:59 +0100
+++ m4/ffmpeg.m4	2005-01-04 12:43:07 +0100
@@ -55,7 +55,7 @@
                  "ac_cv_lib_avcodec_pp_get_context" \
                  "ac_cv_lib_postproc_pp_get_context" \
                  "ac_cv_lib_avcodec_register_avcodec"; do
-          $as_unset $i || test "${$i+set}" != set || { $i=; export $i; }
+          $as_unset $i || test "${i}set" != set && { $i=; export $i; }
         done
 
         dnl look for headers
Index: config.h.in
diff -Nau config.h.in.orig config.h.in
--- config.h.in.orig	2005-01-04 16:00:38 +0100
+++ config.h.in	2005-01-04 16:01:17 +0100
@@ -612,5 +612,8 @@
 /* define ssize_t to __int64 if it's missing in default includes */
 #undef ssize_t
 
+/* define intmax_t to long int if it's missing in default includes */
+#undef intmax_t
+
 /* include internal system specific header */
 #include "os_internal.h"
Index: configure.ac
diff -Nau configure.ac.orig configure.ac
--- configure.ac.orig	2005-01-04 15:49:14 +0100
+++ configure.ac	2005-01-04 15:50:33 +0100
@@ -183,7 +183,7 @@
 dnl For systems without inttypes.h would be needed extend generated replacement.
 dnl AC_CHECK_GENERATE_INTTYPES([lib])
 AC_CHECK_TYPE(ssize_t, :, AC_DEFINE(ssize_t, __int64, [define ssize_t to __int64 if it's missing in default includes]))
-
+AC_CHECK_TYPE(intmax_t, :, AC_DEFINE(intmax_t, long int, [define intmax_t to long int if it's missing in default includes]))
 
 dnl ---------------------------------------------
 dnl threads and OS specific stuff
Index: configure
diff -Nau configure.orig configure
--- configure.orig      2004-03-17 23:01:45.000000000 +0100
+++ configure   2004-03-23 14:08:23.000000000 +0100
@@ -24472,6 +24472,72 @@
 fi


+echo "$as_me:$LINENO: checking for intmax_t" >&5
+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
+if test "${ac_cv_type_intmax_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((intmax_t *) 0)
+  return 0;
+if (sizeof (intmax_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_intmax_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_intmax_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_intmax_t" >&6
+if test $ac_cv_type_intmax_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define intmax_t long int
+_ACEOF
+
+fi
+
 
 
 case "$host" in
@@ -25379,7 +25379,7 @@
                  "ac_cv_lib_avcodec_pp_get_context" \
                  "ac_cv_lib_postproc_pp_get_context" \
                  "ac_cv_lib_avcodec_register_avcodec"; do
-          $as_unset $i || test "${$i+set}" != set || { $i=; export $i; }
+          $as_unset $i || test "${i}set" != set && { $i=; export $i; }
         done
 
                 if test "${ac_cv_header_avcodec_h+set}" = set; then
@@ -30951,6 +30937,7 @@
 /* end confdefs.h.  */
 $ac_includes_default
 #include <sys/fbio.h>
+#include <sys/visual_io.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -30994,6 +30981,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/fbio.h>
+#include <sys/visual_io.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
Index: src/xine-engine/metronom.c
diff -Nau src/xine-engine/metronom.c.orig src/xine-engine/metronom.c
--- src/xine-engine/metronom.c.orig     2004-03-23 10:32:16.000000000 +0100
+++ src/xine-engine/metronom.c  2004-03-23 10:33:07.000000000 +0100
@@ -33,6 +33,18 @@
 #include <string.h>
 #include <errno.h>

+#ifndef PRId64
+# if (#cpu(i386) ||  #cpu(powerpc))
+#  define  PRId64          "lld"   /* int64_t */
+# else
+#  define  PRId64          "ld"   /* int64_t */
+# endif
+#endif
+#ifndef INT16_MAX
+# define  INT16_MAX       0x7fff
+# define  UINT16_MAX      0xffff
+#endif
+
 #define LOG_MODULE "metronom"
 #define LOG_VERBOSE
 /*
Index: src/libdts/xine_decoder.c
diff -Nau src/libdts/xine_decoder.c.orig src/libdts/xine_decoder.c
--- src/libdts/xine_decoder.c.orig	2004-12-16 14:59:10 +0100
+++ src/libdts/xine_decoder.c	2005-01-04 17:35:17 +0100
@@ -53,6 +53,12 @@
 
 #define MAX_AC5_FRAME 4096
 
+#ifndef INT16_MAX
+# define  INT16_MAX       0x7fff
+# define  UINT16_MAX      0xffff
+# define  INT16_MIN       (-0x7fff-1)
+#endif
+
 typedef struct {
   audio_decoder_class_t   decoder_class;
 } dts_class_t;
Index: src/xine-engine/audio_out.c
diff -Nau src/xine-engine/audio_out.c.orig src/xine-engine/audio_out.c
--- src/xine-engine/audio_out.c.orig    2004-03-16 21:21:58.000000000 +0100
+++ src/xine-engine/audio_out.c 2004-03-23 10:22:59.000000000 +0100
@@ -77,6 +77,24 @@
 #include <inttypes.h>
 #include <math.h>

+#ifndef PRId64
+# if (#cpu(i386) ||  #cpu(powerpc))
+#  define  PRId64          "lld"   /* int64_t */
+# else
+#  define  PRId64          "ld"   /* int64_t */
+# endif
+#endif
+#ifndef INT16_MAX
+# define  INT16_MAX       0x7fff
+# define  UINT16_MAX      0xffff
+# define  INT16_MIN       (-0x7fff-1)
+#endif
+#ifndef INT8_MAX
+# define  INT8_MAX       0x7f
+# define  UINT8_MAX      0xff
+# define  INT8_MIN       (-0x7f-1)
+#endif
+
 #define XINE_ENABLE_EXPERIMENTAL_FEATURES
 #define XINE_ENGINE_INTERNAL

Index: src/xine-engine/video_out.c
diff -Nau src/xine-engine/video_out.c.orig src/xine-engine/video_out.c
--- src/xine-engine/video_out.c.orig    2004-03-16 21:21:58.000000000 +0100
+++ src/xine-engine/video_out.c 2004-03-23 10:23:36.000000000 +0100
@@ -37,6 +37,18 @@
 #include <inttypes.h>
 #include <assert.h>

+#ifndef PRId64
+# if (#cpu(i386) ||  #cpu(powerpc))
+#  define  PRId64          "lld"   /* int64_t */
+# else
+#  define  PRId64          "ld"   /* int64_t */
+# endif
+#endif
+#ifndef INT16_MAX
+# define  INT16_MAX       0x7fff
+# define  UINT16_MAX      0xffff
+#endif
+
 #define XINE_ENABLE_EXPERIMENTAL_FEATURES
 #define XINE_ENGINE_INTERNAL

Index: src/demuxers/demux_ogg.c
diff -Nau src/demuxers/demux_ogg.c.orig src/demuxers/demux_ogg.c
--- src/demuxers/demux_ogg.c.orig    2004-03-23 14:20:30.000000000 +0100
+++ src/demuxers/demux_ogg.c 2004-03-23 14:20:50.000000000 +0100
@@ -60,6 +60,14 @@
 #include <theora/theora.h>
 #endif
 
+#ifndef PRId64
+# if (#cpu(i386) ||  #cpu(powerpc))
+#  define  PRId64          "lld"   /* int64_t */
+# else
+#  define  PRId64          "ld"   /* int64_t */
+# endif
+#endif
+
 #define LOG_MODULE "demux_ogg"
 #define LOG_VERBOSE
 /*
Index: src/video_out/video_out_sdl.c
diff -Nau src/video_out/video_out_sdl.c.orig src/video_out/video_out_sdl.c
--- src/video_out/video_out_sdl.c.orig	2003-02-14 15:47:37.000000000 +0100
+++ src/video_out/video_out_sdl.c	2003-05-08 14:28:24.000000000 +0200
@@ -48,7 +48,7 @@
 #include <inttypes.h>
 #include <math.h>
 #if defined (__FreeBSD__)
-# include <SDL11/SDL.h>
+# include <SDL.h>
 #else
 # include <SDL.h>
 #endif
Index: src/video_out/libdha/libdha.h
diff -Nau src/video_out/libdha/libdha.h.orig src/video_out/libdha/libdha.h
--- src/video_out/libdha/libdha.h.orig       2004-03-29 12:47:54.000000000 +0200
+++ src/video_out/libdha/libdha.h    2004-03-29 12:52:44.000000000 +0200
@@ -16,10 +16,14 @@
 #ifndef LIBDHA_H
 #define LIBDHA_H
 
-#if defined (__FreeBSD__)
-# include <inttypes.h>
-#else
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
 # include <stdint.h>
+#elif defined (__FreeBSD__)
+# include <inttypes.h>
+#else
+# include<sys/types.h>
 #endif
 
 #ifdef __cplusplus
Index: src/input/dvb/dmx.h
diff -Nau src/input/dvb/dmx.h.orig src/input/dvb/dmx.h
--- src/input/dvb/dmx.h.orig  2004-03-30 09:16:41.000000000 +0200
+++ src/input/dvb/dmx.h       2004-03-30 09:18:41.000000000 +0200
@@ -36,6 +36,16 @@
 #endif
 #endif
 
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
+# include <stdint.h>
+#elif defined (__FreeBSD__)
+# include <inttypes.h>
+#else
+# include<sys/types.h>
+#endif
+
 #define DMX_FILTER_SIZE 16
 
 typedef enum
Index: src/input/dvb/frontend.h
diff -Nau src/input/dvb/frontend.h.orig src/input/dvb/frontend.h
--- src/input/dvb/frontend.h.orig     2004-03-30 09:21:25.000000000 +0200
+++ src/input/dvb/frontend.h  2004-03-30 09:21:39.000000000 +0200
@@ -38,6 +38,15 @@
 #endif
 #endif
 
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
+# include <stdint.h>
+#elif defined (__FreeBSD__)
+# include <inttypes.h>
+#else
+# include<sys/types.h>
+#endif
 
 typedef enum {
         FE_QPSK,
Index: src/libfaad/common.h
diff -Nau src/libfaad/common.h.orig src/libfaad/common.h
--- src/libfaad/common.h.orig       2004-03-30 09:31:33.000000000 +0200
+++ src/libfaad/common.h    2004-03-30 09:32:27.000000000 +0200
@@ -177,35 +177,14 @@
 # include <strings.h>
 #endif
 
-/* precedence defining int-types by header files for all platforms */
-#if HAVE_INTTYPES_H
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
+# include <stdint.h>
+#elif defined (__FreeBSD__)
 # include <inttypes.h>
 #else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# else
-/* we need these... */
-#  ifdef WIN32
-typedef unsigned __int64 uint64_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int8 uint8_t;
-typedef __int64 int64_t;
-typedef __int32 int32_t;
-typedef __int16 int16_t;
-typedef __int8  int8_t;
-#  else /* WIN32 */
-typedef float float32_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uint32_t;
-typedef unsigned short uint16_t;
-typedef unsigned char uint8_t;
-typedef long long int64_t;
-typedef long int32_t;
-typedef short int16_t;
-typedef char int8_t;
-#  endif /* WIN32 */
-# endif
+# include<sys/types.h>
 #endif
 #if HAVE_UNISTD_H
 # include <unistd.h>
Index: src/libxineadec/nosefart/memguard.c
diff -Nau src/libxineadec/nosefart/memguard.c.orig src/libxineadec/nosefart/memguard.c
--- src/libxineadec/nosefart/memguard.c.orig     2004-03-30 09:34:54.000000000 +0200
+++ src/libxineadec/nosefart/memguard.c  2004-03-30 09:35:10.000000000 +0200
@@ -34,12 +34,14 @@
 #include <string.h>
 #include <stdlib.h>
 
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
+# include <stdint.h>
+#elif defined (__FreeBSD__)
+# include <inttypes.h>
 #else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
+# include<sys/types.h>
 #endif
 
 #include "memguard.h"
Index: src/post/deinterlace/speedy.h
diff -Nau src/post/deinterlace/speedy.h.orig src/post/deinterlace/speedy.h
--- src/post/deinterlace/speedy.h.orig       2004-03-30 09:40:28.000000000 +0200
+++ src/post/deinterlace/speedy.h    2004-03-30 09:40:40.000000000 +0200
@@ -19,10 +19,14 @@
 #ifndef SPEEDY_H_INCLUDED
 #define SPEEDY_H_INCLUDED
 
-#if HAVE_INTTYPES_H
-#include <inttypes.h>
+#if defined (__SVR4) && defined (__sun)
+# include <sys/int_types.h>
+#elif defined (__linux)
+# include <stdint.h>
+#elif defined (__FreeBSD__)
+# include <inttypes.h>
 #else
-#include <stdint.h>
+# include<sys/types.h>
 #endif
 
 #ifdef __cplusplus
Index: src/xine-engine/Makefile.in
--- src/xine-engine/Makefile.in.orig	2005-11-15 12:40:21 +0100
+++ src/xine-engine/Makefile.in	2005-11-21 09:51:46 +0100
@@ -547,8 +547,8 @@
 # FIXME: these are currently unused:
 EXTRA_DIST = lrb.c lrb.h accel_xvmc.h
 @INCLUDED_INTL_TRUE@INCLUDED_INTLLIBS = @INTLLIBS@
-libxine_la_DEPENDENCIES = $(INCLUDED_INTLLIBS) $(XINEUTILS_LIB) \
-                          $(pthread_dep) $(LIBXINEPOSIX)
+libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(zlib_dep) \
+                          $(dirent_lib) $(pthread_dep) $(LIBXINEPOSIX)
 
 libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) \
 		    -lm $(XINEUTILS_LIB) $(LIBICONV) $(FT2_LIBS) \
Index: src/input/input_plugin.h
diff -Nau src/input/input_plugin.h.orig src/input/input_plugin.h
--- src/input/input_plugin.h.orig	2004-09-27 00:54:52 +0200
+++ src/input/input_plugin.h	2005-01-04 15:38:00 +0100
@@ -39,6 +39,40 @@
 
 #define INPUT_PLUGIN_IFACE_VERSION   15
  
+#if !defined(PRIiMAX)
+#if defined(__alpha__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__)
+#  define PRIiMAX "li"
+#elif defined(__i386__) || defined(__powerpc__)
+#  define PRIiMAX "lli"
+#endif /* #if defined(__alpha__) || defined(__amd64__) || ... */ 
+#endif /* #if !defined(PRIiMAX) */
+
+#if !defined(PRIXMAX)
+#if defined(__alpha__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__)
+#  define PRIXMAX "lX"
+#elif defined(__i386__) || defined(__powerpc__)
+#  define PRIXMAX "llX"
+#endif /* #if defined(__alpha__) || defined(__amd64__) || ... */ 
+#endif /* #if !defined(PRIXMAX) */
+
+#if !defined(SCNdMAX)
+#if defined(__alpha__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__)
+#  define SCNdMAX "ld"
+#elif defined(__i386__) || defined(__powerpc__)
+#  define SCNdMAX "lld"
+#endif /* #if defined(__alpha__) || defined(__amd64__) || ... */ 
+#endif /* #if !defined(SCNdMAX) */
+
+#if !defined(PRIx32)
+#  define PRIx32 "x"
+#endif /* #if !defined(PRIx32) */
+#if !defined(PRIx16)
+#  define PRIx16 "x"
+#endif /* #if !defined(PRIx16) */
+#if !defined(PRIx8)
+#  define PRIx8 "x"
+#endif /* #if !defined(PRIx8) */
+
 typedef struct input_class_s input_class_t ;
 typedef struct input_plugin_s input_plugin_t;
 
Index: src/xine-engine/post.h
diff -Nau src/xine-engine/post.h.orig src/xine-engine/post.h
--- src/xine-engine/post.h.orig	2005-01-04 18:06:34 +0100
+++ src/xine-engine/post.h	2005-01-04 18:07:27 +0100
@@ -42,6 +42,17 @@
 
 #define POST_PLUGIN_IFACE_VERSION 9
 
+#ifndef INT32_MAX
+# define  INT32_MAX       0x7fffffff
+# define  UINT32_MAX      0xffffffffU
+# define  INT32_MIN       (-0x7fffffff-1)
+#endif
+#ifndef INT16_MAX
+# define  INT16_MAX       0x7fff
+# define  UINT16_MAX      0xffff
+# define  INT16_MIN       (-0x7fff-1)
+#endif
+
 
 typedef struct post_class_s post_class_t;
 typedef struct post_plugin_s post_plugin_t;
