--- configure
+++ configure
@@ -1090,16 +1090,6 @@
     echores "$proc"
     ;;
 
-  ia64)
-    _def_arch='#define ARCH_IA64 1'
-    _target_arch='TARGET_ARCH_IA64 = yes'
-    iproc='ia64'
-    proc=''
-    _march=''
-    _mcpu=''
-    _optimizing=''
-    ;;
-
   x86_64|amd64)
     _def_arch='#define ARCH_X86_64 1'
     _target_arch='TARGET_ARCH_X86_64 = yes'
@@ -1227,7 +1217,7 @@
     echocheck "CPU type"
     case $system_name in
       Linux)
-	proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
+	proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | sed 's/PPC//' | _head 1`
 	if test -n "`$_cpuinfo | grep altivec`"; then
 	    _altivec=yes
 	fi
@@ -1371,6 +1361,16 @@
     fi
     ;;
 
+  ia64)
+    _def_arch='#define ARCH_IA64 1'
+    _target_arch='TARGET_ARCH_IA64 = yes'
+    _def_words_endian='#undef WORDS_BIGENDIAN'
+    iproc='ia64'
+    proc=''
+    _march=''
+    _mcpu=''
+    ;;
+
   mips)
     _def_arch='#define ARCH_SGI_MIPS 1'
     _target_arch='TARGET_ARCH_SGI_MIPS = yes'
@@ -1423,6 +1423,7 @@
   s390x)
     _def_arch='#define ARCH_S390X 1'
     _target_arch='TARGET_ARCH_S390X = yes'
+    _def_words_endian='#define WORDS_BIGENDIAN 1'
     iproc='390x'
     proc=''
     _march=''
@@ -2259,7 +2260,7 @@
   else
     _res_comment="Upgrade binutils to ${_pref_as_version} ..."
     echores "failed"
-    die "obsolete binutils version"
+    #die "obsolete binutils version"
   fi
 
 fi #if x86
--- libao2/ao_alsa.c
+++ libao2/ao_alsa.c
@@ -93,7 +93,7 @@
 }
 
 /* to set/get/query special features/parameters */
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
   switch(cmd) {
   case AOCONTROL_QUERY_FORMAT:
--- libao2/ao_alsa5.c
+++ libao2/ao_alsa5.c
@@ -33,7 +33,7 @@
 static int alsa_rate = SND_PCM_RATE_CONTINUOUS;
 
 /* to set/get/query special features/parameters */
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
     return(CONTROL_UNKNOWN);
 }
--- libao2/ao_arts.c
+++ libao2/ao_arts.c
@@ -35,7 +35,7 @@
 
 LIBAO_EXTERN(arts)
 
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
 	return(CONTROL_UNKNOWN);
 }
--- libao2/ao_dsound.c
+++ libao2/ao_dsound.c
@@ -383,7 +383,7 @@
 \param arg argument
 \return CONTROL_OK or -1 in case the command can't be handled
 */
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
 	DWORD volume;
 	switch (cmd) {
--- libao2/ao_dxr2.c
+++ libao2/ao_dxr2.c
@@ -30,7 +30,7 @@
 extern int dxr2_fd;
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
   switch(cmd){
   case AOCONTROL_GET_VOLUME:
     if(dxr2_fd > 0) {
--- libao2/ao_esd.c
+++ libao2/ao_esd.c
@@ -72,7 +72,7 @@
 /*
  * to set/get/query special features/parameters
  */
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
     esd_player_info_t *esd_pi;
     esd_info_t        *esd_i;
--- libao2/ao_jack.c
+++ libao2/ao_jack.c
@@ -153,7 +153,7 @@
 
 // end ring buffer stuff
 
-static int control(int cmd, void *arg) {
+static long control(int cmd, void *arg) {
   return CONTROL_UNKNOWN;
 }
 
--- libao2/ao_macosx.c
+++ libao2/ao_macosx.c
@@ -170,7 +170,7 @@
  	return noErr;
 }
 
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
 	switch (cmd) {
 	case AOCONTROL_SET_DEVICE:
 	case AOCONTROL_GET_DEVICE:
--- libao2/ao_mpegpes.c
+++ libao2/ao_mpegpes.c
@@ -63,7 +63,7 @@
 
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
 #ifdef HAVE_DVB
     switch(cmd){
 	case AOCONTROL_GET_VOLUME:
--- libao2/ao_nas.c
+++ libao2/ao_nas.c
@@ -347,7 +347,7 @@
 }
 
 // to set/get/query special features/parameters
-static int control(int cmd, void *arg)
+static long control(int cmd, void *arg)
 {
 	AuElementParameters aep;
 	AuStatus as;
--- libao2/ao_null.c
+++ libao2/ao_null.c
@@ -42,7 +42,7 @@
 }
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
     return -1;
 }
 
--- libao2/ao_oss.c
+++ libao2/ao_oss.c
@@ -152,7 +152,7 @@
 static int oss_mixer_channel = SOUND_MIXER_PCM;
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
     switch(cmd){
 	case AOCONTROL_SET_DEVICE:
 	    dsp=(char*)arg;
--- libao2/ao_pcm.c
+++ libao2/ao_pcm.c
@@ -73,7 +73,7 @@
 static FILE *fp = NULL;
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
     return -1;
 }
 
--- libao2/ao_polyp.c
+++ libao2/ao_polyp.c
@@ -277,7 +277,7 @@
 }
 
 /** Issue special libao controls on the device */
-static int control(int cmd, void *arg) {
+static long control(int cmd, void *arg) {
     
     if (!context || !stream)
         return CONTROL_ERROR;
--- libao2/ao_sdl.c
+++ libao2/ao_sdl.c
@@ -124,7 +124,7 @@
 
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
 #ifdef USE_SDL_INTERNAL_MIXER
 	switch (cmd) {
 		case AOCONTROL_GET_VOLUME:
--- libao2/ao_sgi.c
+++ libao2/ao_sgi.c
@@ -100,7 +100,7 @@
 }
 
 // to set/get/query special features/parameters
-static int control(int cmd, void *arg){
+static long control(int cmd, void *arg){
   
   mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_INFO);
   
--- libao2/ao_sun.c
+++ libao2/ao_sun.c
@@ -377,7 +377,7 @@
 }
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg){
+static long control(int cmd,void *arg){
     switch(cmd){
     case AOCONTROL_SET_DEVICE:
 	audio_dev=(char*)arg;
--- libao2/ao_win32.c
+++ libao2/ao_win32.c
@@ -114,7 +114,7 @@
 }
 
 // to set/get/query special features/parameters
-static int control(int cmd,void *arg)
+static long control(int cmd,void *arg)
 {
 	DWORD volume;
 	switch (cmd)
--- libao2/audio_out.h
+++ libao2/audio_out.h
@@ -18,7 +18,7 @@
 typedef struct ao_functions_s
 {
 	ao_info_t *info;
-        int (*control)(int cmd,void *arg);
+        long (*control)(int cmd,void *arg);
         int (*init)(int rate,int channels,int format,int flags);
         void (*uninit)(int immed);
         void (*reset)(void);
--- libao2/audio_out_internal.h
+++ libao2/audio_out_internal.h
@@ -1,7 +1,7 @@
 
 // prototypes:
 //static ao_info_t info;
-static int control(int cmd, void *arg);
+static long control(int cmd, void *arg);
 static int init(int rate,int channels,int format,int flags);
 static void uninit(int immed);
 static void reset(void);
--- libdha/sysdep/pci_linux.c
+++ libdha/sysdep/pci_linux.c
@@ -4,6 +4,7 @@
    Modified for readability by Nick Kurshev
 */
 #include <errno.h>
+#include <unistd.h>
 #ifdef __i386__
 //#include <sys/perm.h> doesn't exist on libc5 systems
 int iopl();
--- libmpcodecs/dec_audio.c
+++ libmpcodecs/dec_audio.c
@@ -50,6 +50,8 @@
 	    mpcodecs_ad_drivers[i]->info->name);
 }
 
+void uninit_audio(sh_audio_t *sh_audio);
+
 int init_audio_codec(sh_audio_t *sh_audio)
 {
   if ((af_cfg.force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT) {
--- libmpcodecs/vf.c
+++ libmpcodecs/vf.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <malloc.h>
 
 #include "config.h"
 #ifdef HAVE_MALLOC_H
--- libswscale/rgb2rgb.c
+++ libswscale/rgb2rgb.c
@@ -24,6 +24,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <inttypes.h>
+#include <stdio.h>
 #include "config.h"
 #include "rgb2rgb.h"
 #include "swscale.h"
--- libvo/aclib.c
+++ libvo/aclib.c
@@ -8,6 +8,7 @@
   runtime cpu detection by michael niedermayer (michaelni@gmx.at) is under GPL
 */
 #include <stddef.h>
+#include <string.h>
 #include "cpudetect.h"
 #include "fastmemcpy.h"
 #undef memcpy
--- libvo/fastmemcpy.h
+++ libvo/fastmemcpy.h
@@ -2,6 +2,7 @@
 #define __MPLAYER_MEMCPY 1
 
 #include "config.h"
+#include <string.h>
 
 #ifdef USE_FASTMEMCPY
 #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \
--- mplayer.c
+++ mplayer.c
@@ -65,6 +65,8 @@
 
 #include "libao2/audio_out.h"
 
+#include "libmpcodecs/mp_image.h"
+
 #include "codec-cfg.h"
 
 #include "edl.h"
--- tremor/ivorbiscodec.h
+++ tremor/ivorbiscodec.h
@@ -161,6 +161,8 @@
 extern void     vorbis_comment_clear(vorbis_comment *vc);
 
 extern int      vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
+extern void    *_vorbis_block_alloc(vorbis_block *vb,long bytes);
+extern void     _vorbis_block_ripcord(vorbis_block *vb);
 extern int      vorbis_block_clear(vorbis_block *vb);
 extern void     vorbis_dsp_clear(vorbis_dsp_state *v);
 
--- tremor/misc.h
+++ tremor/misc.h
@@ -18,6 +18,7 @@
 #ifndef _V_RANDOM_H_
 #define _V_RANDOM_H_
 #include "ivorbiscodec.h"
+#include "codebook.h"
 #include "os_types.h"
 
 #include "asm_arm.h"
