diff -ruN xine-lib-0.9.13.orig/config.h xine-lib-0.9.13/config.h --- xine-lib-0.9.13.orig/config.h 2002-08-03 15:01:09.000000000 -0600 +++ xine-lib-0.9.13/config.h 2002-09-18 21:13:54.000000000 -0600 @@ -63,6 +63,9 @@ /* Define this if you have the Motorola 74xx CPU */ #define ENABLE_ALTIVEC 1 +/* Define this if you are running Darwin PPC or OS X */ +/* #undef ARCH_DARWINPPC */ + /* Define this if you have mlib installed */ /* #undef HAVE_MLIB */ diff -ruN xine-lib-0.9.13.orig/config.h.in xine-lib-0.9.13/config.h.in --- xine-lib-0.9.13.orig/config.h.in 2002-08-01 15:52:23.000000000 -0600 +++ xine-lib-0.9.13/config.h.in 2002-09-18 21:13:54.000000000 -0600 @@ -62,6 +62,9 @@ /* Define this if you have the Motorola 74xx CPU */ #undef ENABLE_ALTIVEC +/* Define this if you are running Darwin PPC or OS X */ +#undef ARCH_DARWINPPC + /* Define this if you have mlib installed */ #undef HAVE_MLIB diff -ruN xine-lib-0.9.13.orig/configure xine-lib-0.9.13/configure --- xine-lib-0.9.13.orig/configure 2002-08-03 15:00:16.000000000 -0600 +++ xine-lib-0.9.13/configure 2002-09-18 21:13:54.000000000 -0600 @@ -3913,7 +3913,7 @@ # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! - archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes @@ -9249,11 +9249,18 @@ if test x$ppc_arch = "xyes"; then - PPC_ARCH_TRUE= - PPC_ARCH_FALSE='#' -else - PPC_ARCH_TRUE='#' - PPC_ARCH_FALSE= + case $host_os in + darwin*) + PPC_ASM_TRUE='#' + PPC_ASM_FALSE= + DARWIN_TRUE= + DARWIN_FALSE='#' + ;; + *) + PPC_ASM_TRUE= + PPC_ASM_FALSE='#' + ;; + esac fi @@ -9273,7 +9280,7 @@ echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS $LIBS" +LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <> confdefs.h <<\EOF +#define ARCH_DARWINPPC 1 +EOF + ;; + *) + ;; +esac if test x$enable_altivec = xyes; then cat >> confdefs.h <<\EOF #define ENABLE_ALTIVEC 1 EOF - CFLAGS="$CFLAGS -Wa,-m7400" - DEBUG_CFLAGS="$DEBUG_CFLAGS -Wa,-m7400" + case $host_os in + darwin*) + CFLAGS="$CFLAGS -faltivec" + DEBUG_CFLAGS="$DEBUG_CFLAGS -faltivec" + ;; + *) + CFLAGS="$CFLAGS -Wa,-m7400" + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wa,-m7400" + ;; + esac fi ;; @@ -13794,6 +13818,10 @@ s%@HAVE_GICONV_FALSE@%$HAVE_GICONV_FALSE%g s%@PPC_ARCH_TRUE@%$PPC_ARCH_TRUE%g s%@PPC_ARCH_FALSE@%$PPC_ARCH_FALSE%g +s%@PPC_ASM_TRUE@%$PPC_ASM_TRUE%g +s%@PPC_ASM_FALSE@%$PPC_ASM_FALSE%g +s%@DARWIN_TRUE@%$DARWIN_TRUE%g +s%@DARWIN_FALSE@%$DARWIN_FALSE%g s%@HAVE_XV_TRUE@%$HAVE_XV_TRUE%g s%@HAVE_XV_FALSE@%$HAVE_XV_FALSE%g s%@XV_LIB@%$XV_LIB%g diff -ruN xine-lib-0.9.13.orig/ltmain.sh xine-lib-0.9.13/ltmain.sh --- xine-lib-0.9.13.orig/ltmain.sh 2002-08-03 15:00:03.000000000 -0600 +++ xine-lib-0.9.13/ltmain.sh 2002-09-18 21:25:24.000000000 -0600 @@ -4011,10 +4011,10 @@ # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test $need_relink = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi +# if test "$installed" = no && test $need_relink = yes; then +# $echo >> $output "\ +#relink_command=\"$relink_command\"" +# fi done fi diff -ruN xine-lib-0.9.13.orig/src/input/input_rtp.c xine-lib-0.9.13/src/input/input_rtp.c --- xine-lib-0.9.13.orig/src/input/input_rtp.c 2002-07-05 11:32:02.000000000 -0600 +++ xine-lib-0.9.13/src/input/input_rtp.c 2002-09-18 21:13:54.000000000 -0600 @@ -67,7 +67,9 @@ #endif #include -#include +#ifdef HAVE_MALLOC_H +# include +#endif #include #include #include diff -ruN xine-lib-0.9.13.orig/src/libmpeg2/cpu_state.c xine-lib-0.9.13/src/libmpeg2/cpu_state.c --- xine-lib-0.9.13.orig/src/libmpeg2/cpu_state.c 2002-04-01 06:18:21.000000000 -0700 +++ xine-lib-0.9.13/src/libmpeg2/cpu_state.c 2002-09-18 21:13:54.000000000 -0600 @@ -39,8 +39,9 @@ } #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC -static void state_save_altivec (cpu_state_t * state) + void state_save_altivec (cpu_state_t * state) { asm (" \n" " li %r9, 16 \n" @@ -98,6 +99,7 @@ ); } #endif +#endif void mpeg2_cpu_state_init (uint32_t mm_accel) { @@ -106,10 +108,12 @@ mpeg2_cpu_state_restore = state_restore_mmx; } #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC if (mm_accel & MM_ACCEL_PPC_ALTIVEC) { mpeg2_cpu_state_save = state_save_altivec; mpeg2_cpu_state_restore = state_restore_altivec; } #endif +#endif } diff -ruN xine-lib-0.9.13.orig/src/libmpeg2/idct.c xine-lib-0.9.13/src/libmpeg2/idct.c --- xine-lib-0.9.13.orig/src/libmpeg2/idct.c 2002-06-04 17:07:59.000000000 -0600 +++ xine-lib-0.9.13/src/libmpeg2/idct.c 2002-09-18 21:13:54.000000000 -0600 @@ -275,6 +275,7 @@ mpeg2_idct_mmx_init (); } else #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC if (mm_accel & MM_ACCEL_PPC_ALTIVEC) { fprintf (stderr, "Using altivec for IDCT transform\n"); @@ -283,6 +284,7 @@ mpeg2_idct_altivec_init (); } else #endif +#endif #ifdef LIBMPEG2_MLIB if (mm_accel & MM_ACCEL_MLIB) { char * env_var; diff -ruN xine-lib-0.9.13.orig/src/libmpeg2/idct_altivec.c xine-lib-0.9.13/src/libmpeg2/idct_altivec.c --- xine-lib-0.9.13.orig/src/libmpeg2/idct_altivec.c 2002-06-04 17:07:59.000000000 -0600 +++ xine-lib-0.9.13/src/libmpeg2/idct_altivec.c 2002-09-18 21:13:54.000000000 -0600 @@ -25,6 +25,7 @@ #include "config.h" +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC #include @@ -515,6 +516,7 @@ } #endif /* ARCH_PPC */ +#endif /* ARCH_DARWINPPC */ #else /* __ALTIVEC__ */ diff -ruN xine-lib-0.9.13.orig/src/libmpeg2/motion_comp.c xine-lib-0.9.13/src/libmpeg2/motion_comp.c --- xine-lib-0.9.13.orig/src/libmpeg2/motion_comp.c 2002-04-01 07:14:56.000000000 -0700 +++ xine-lib-0.9.13/src/libmpeg2/motion_comp.c 2002-09-18 21:13:54.000000000 -0600 @@ -45,12 +45,14 @@ mpeg2_mc = mpeg2_mc_mmx; } else #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC if (mm_accel & MM_ACCEL_PPC_ALTIVEC) { fprintf (stderr, "Using altivec for motion compensation\n"); mpeg2_mc = mpeg2_mc_altivec; } else #endif +#endif #ifdef LIBMPEG2_MLIB if (mm_accel & MM_ACCEL_MLIB) { fprintf (stderr, "Using mlib for motion compensation\n"); diff -ruN xine-lib-0.9.13.orig/src/libmpeg2/motion_comp_altivec.c xine-lib-0.9.13/src/libmpeg2/motion_comp_altivec.c --- xine-lib-0.9.13.orig/src/libmpeg2/motion_comp_altivec.c 2002-04-01 06:18:21.000000000 -0700 +++ xine-lib-0.9.13/src/libmpeg2/motion_comp_altivec.c 2002-09-18 21:13:54.000000000 -0600 @@ -25,6 +25,7 @@ #include "config.h" +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC #include @@ -1066,6 +1067,7 @@ MPEG2_MC_EXTERN (altivec) #endif /* ARCH_PPC */ +#endif /* ARCH_DARWINPPC */ #else /* __ALTIVEC__ */ diff -ruN xine-lib-0.9.13.orig/src/libspudec/spu.c xine-lib-0.9.13/src/libspudec/spu.c --- xine-lib-0.9.13.orig/src/libspudec/spu.c 2002-07-20 10:28:14.000000000 -0600 +++ xine-lib-0.9.13/src/libspudec/spu.c 2002-09-18 21:13:54.000000000 -0600 @@ -45,7 +45,9 @@ #include #include #include -#include +#ifdef HAVE_MALLOC_H +#include +#endif #include #include #include diff -ruN xine-lib-0.9.13.orig/src/video_out/Makefile.in xine-lib-0.9.13/src/video_out/Makefile.in --- xine-lib-0.9.13.orig/src/video_out/Makefile.in 2002-08-03 15:01:34.000000000 -0600 +++ xine-lib-0.9.13/src/video_out/Makefile.in 2002-09-18 21:13:54.000000000 -0600 @@ -197,7 +197,7 @@ libdir = $(XINE_PLUGINDIR) @HAVE_X11_TRUE@xshm_module = xineplug_vo_out_xshm.la -@HAVE_X11_TRUE@syncfb_module = xineplug_vo_out_syncfb.la +@HAVE_X11_TRUE@DARWIN_FALSE@@syncfb_module = xineplug_vo_out_syncfb.la @HAVE_X11_TRUE@@HAVE_VIDIX_TRUE@vidix_module = xineplug_vo_out_vidix.la @HAVE_X11_TRUE@@HAVE_XV_TRUE@xv_module = xineplug_vo_out_xv.la @HAVE_X11_TRUE@@HAVE_OPENGL_TRUE@opengl_module = xineplug_vo_out_opengl.la diff -ruN xine-lib-0.9.13.orig/src/xine-engine/Makefile.in xine-lib-0.9.13/src/xine-engine/Makefile.in --- xine-lib-0.9.13.orig/src/xine-engine/Makefile.in 2002-08-03 15:01:32.000000000 -0600 +++ xine-lib-0.9.13/src/xine-engine/Makefile.in 2002-09-18 21:13:54.000000000 -0600 @@ -196,7 +196,7 @@ libxine_la_SOURCES = $(nvtv) xine.c metronom.c configfile.c buffer.c load_plugins.c video_decoder.c buffer_types.c audio_decoder.c video_out.c audio_out.c resample.c events.c lrb.c video_overlay.c osd.c scratch.c locale.c demux.c -libxine_la_DEPENDENCIES = @INTLLIBS@ +libxine_la_DEPENDENCIES = @DARWIN_FALSE@@INTLLIBS@ libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) -lm libxine_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) diff -ruN xine-lib-0.9.13.orig/src/xine-engine/load_plugins.c xine-lib-0.9.13/src/xine-engine/load_plugins.c --- xine-lib-0.9.13.orig/src/xine-engine/load_plugins.c 2002-07-17 15:23:57.000000000 -0600 +++ xine-lib-0.9.13/src/xine-engine/load_plugins.c 2002-09-18 21:13:54.000000000 -0600 @@ -132,7 +132,7 @@ plugin_name = str; if(!(plugin = dlopen (str, RTLD_LAZY))) { - char *dl_error_msg = dlerror(); + char *dl_error_msg = (char *)dlerror(); xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: cannot open demux plugin %s:\n%s\n"), @@ -220,7 +220,7 @@ if(!(plugin = dlopen (str, RTLD_LAZY))) { printf ("load_plugins: cannot open demux plugin %s:\n%s\n", - str, dlerror()); + str, (char *)dlerror()); } else { void *(*initplug) (int, xine_t *); @@ -294,7 +294,7 @@ plugin_name = str; if(!(plugin = dlopen (str, RTLD_LAZY))) { - char *dl_error_msg = dlerror(); + char *dl_error_msg = (char *)dlerror(); xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: cannot open input plugin %s:\n%s\n"), @@ -522,7 +522,7 @@ plugin_name = str; if(!(plugin = dlopen (str, RTLD_LAZY))) { - char *dl_error_msg = dlerror(); + char *dl_error_msg = (char *)dlerror(); xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: failed to load plugin %s:\n%s\n"), @@ -703,7 +703,7 @@ if(!(plugin = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) { printf("load_plugins: cannot load plugin %s:\n%s\n", - str, dlerror()); + str, (char *)dlerror()); } else { @@ -833,7 +833,7 @@ if(!(plugin = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) { printf("load_plugins: video output plugin %s failed to link:\n%s\n", - str, dlerror()); + str, (char *)dlerror()); } else { vo_info_t* (*getinfo) (void); vo_info_t *vo_info; @@ -938,7 +938,7 @@ if(!(plugin = dlopen (str, RTLD_LAZY))) { printf("load_plugins: cannot load plugin %s (%s)\n", - str, dlerror()); + str, (char *)dlerror()); } else { @@ -1041,7 +1041,7 @@ /* RTLD_GLOBAL is needed when using ALSA09 */ if(!(plugin = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) { printf("load_plugins: audio output plugin %s failed to link: %s\n", - str, dlerror()); + str, (char *)dlerror()); /* return NULL; */ } else { void *(*initplug) (config_values_t *); diff -ruN xine-lib-0.9.13.orig/src/xine-utils/Makefile.in xine-lib-0.9.13/src/xine-utils/Makefile.in --- xine-lib-0.9.13.orig/src/xine-utils/Makefile.in 2002-08-03 15:01:30.000000000 -0600 +++ xine-lib-0.9.13/src/xine-utils/Makefile.in 2002-09-18 21:13:54.000000000 -0600 @@ -192,7 +192,7 @@ EXTRA_DIST = ppcasm_string.S ppc_asm.tmpl -@PPC_ARCH_TRUE@pppc_files = ppcasm_string.S +@PPC_ASM_TRUE@pppc_files = ppcasm_string.S CFLAGS = @CFLAGS@ $(THREAD_CFLAGS) @@ -217,12 +217,12 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ libxineutils_la_DEPENDENCIES = -@PPC_ARCH_FALSE@libxineutils_la_OBJECTS = utils.lo memcpy.lo monitor.lo \ -@PPC_ARCH_FALSE@cpu_accel.lo xine_mutex.lo xmllexer.lo xmlparser.lo \ -@PPC_ARCH_FALSE@color.lo -@PPC_ARCH_TRUE@libxineutils_la_OBJECTS = ppcasm_string.lo utils.lo \ -@PPC_ARCH_TRUE@memcpy.lo monitor.lo cpu_accel.lo xine_mutex.lo \ -@PPC_ARCH_TRUE@xmllexer.lo xmlparser.lo color.lo +@PPC_ASM_FALSE@libxineutils_la_OBJECTS = utils.lo memcpy.lo monitor.lo \ +@PPC_ASM_FALSE@cpu_accel.lo xine_mutex.lo xmllexer.lo xmlparser.lo \ +@PPC_ASM_FALSE@color.lo +@PPC_ASM_TRUE@libxineutils_la_OBJECTS = ppcasm_string.lo utils.lo \ +@PPC_ASM_TRUE@memcpy.lo monitor.lo cpu_accel.lo xine_mutex.lo \ +@PPC_ASM_TRUE@xmllexer.lo xmlparser.lo color.lo COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) diff -ruN xine-lib-0.9.13.orig/src/xine-utils/memcpy.c xine-lib-0.9.13/src/xine-utils/memcpy.c --- xine-lib-0.9.13.orig/src/xine-utils/memcpy.c 2002-06-24 13:55:38.000000000 -0600 +++ xine-lib-0.9.13/src/xine-utils/memcpy.c 2002-09-18 21:13:54.000000000 -0600 @@ -33,9 +33,11 @@ #include "config.h" #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC #include "ppcasm_string.h" #endif +#endif #include #include @@ -373,10 +375,12 @@ { "MMXEXT optimized memcpy()", mmx2_memcpy, 0, MM_MMXEXT }, { "SSE optimized memcpy()", sse_memcpy, 0, MM_MMXEXT|MM_SSE }, #endif /* ARCH_X86 */ +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC { "ppcasm_memcpy()", ppcasm_memcpy, 0, 0 }, { "ppcasm_cacheable_memcpy()", ppcasm_cacheable_memcpy, 0, 0 }, #endif /* ARCH_PPC */ +#endif /* ARCH_DARWINPPC */ { NULL, NULL, 0, 0 } }; @@ -387,6 +391,12 @@ __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); return x; } +#elif defined(ARCH_DARWINPPC) +static unsigned long long int rdtsc() +{ + struct tms tims; + return times(&tims); +} #else static unsigned long long int rdtsc() { @@ -426,9 +436,11 @@ #ifdef ARCH_X86 "kernel", "mmx", "mmxext", "sse", #endif +#ifndef ARCH_DARWINPPC #ifdef ARCH_PPC "ppcasm_memcpy", "ppcasm_cacheable_memcpy", #endif +#endif NULL };