--- gstreamer-0.8.8/tools/Makefile.am.lib64	2004-07-07 13:32:30.000000000 -0400
+++ gstreamer-0.8.8/tools/Makefile.am	2005-01-10 15:07:19.459425746 -0500
@@ -2,9 +2,13 @@
 if GST_DISABLE_REGISTRY
 GST_REGISTRY_SRC = 
 GST_REGISTRY_SRC_V = 
+GST_REGISTRY_WRAPPER_SRC = 
+GST_REGISTRY_WRAPPER_SRC_V =
 else
-GST_REGISTRY_SRC = gst-register
-GST_REGISTRY_SRC_V = gst-register-@GST_MAJORMINOR@
+GST_REGISTRY_SRC = gst-register-@host_cpu@
+GST_REGISTRY_SRC_V = gst-register-@host_cpu@-@GST_MAJORMINOR@
+GST_REGISTRY_WRAPPER_SRC = gst-register
+GST_REGISTRY_WRAPPER_SRC_V = gst-register-@GST_MAJORMINOR@
 endif
 
 if GST_DISABLE_LOADSAVE
@@ -34,16 +38,29 @@
 
 ### so all of the programs we want to build
 bin_PROGRAMS = \
-	$(GST_REGISTRY_SRC) $(GST_REGISTRY_SRC_V) \
 	$(GST_LOADSAVE_SRC) $(GST_LOADSAVE_SRC_V) \
 	$(GST_OTHER_SRC) $(GST_OTHER_SRC_V)
-bin_SCRIPTS = gst-feedback-@GST_MAJORMINOR@
+bin_SCRIPTS = gst-feedback-@GST_MAJORMINOR@ \
+	$(GST_REGISTRY_WRAPPER_SRC) $(GST_REGISTRY_WRAPPER_SRC_V)
+
+libexec_PROGRAMS = \
+	$(GST_REGISTRY_SRC) $(GST_REGISTRY_SRC_V)
 
 # make sure each versioned tool has the right source file and flags
 if !GST_DISABLE_REGISTRY
-gst_register_@GST_MAJORMINOR@_SOURCES = gst-register.c
-gst_register_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS)
-gst_register_@GST_MAJORMINOR@_LDFLAGS = $(GST_OBJ_LIBS)
+edit = sed -e 's,@libexecdir\@,$(libexecdir),g' -e 's,@GST_MAJORMINOR\@,@GST_MAJORMINOR@,g'
+
+gst-register-@GST_MAJORMINOR@: Makefile $(srcdir)/gst-register.in
+	rm -f gst-register-@GST_MAJORMINOR@ gst-register-@GST_MAJORMINOR@.tmp
+	$(edit) $(srcdir)/gst-register.in >gst-register-@GST_MAJORMINOR@.tmp
+	mv gst-register-@GST_MAJORMINOR@.tmp gst-register-@GST_MAJORMINOR@
+gst-register: Makefile $(srcdir)/gst-register.in
+	rm -f gst-register gst-register.tmp
+	$(edit) $(srcdir)/gst-register.in >gst-register.tmp
+	mv gst-register.tmp gst-register
+gst_register_@host_cpu@_@GST_MAJORMINOR@_SOURCES = gst-register.c
+gst_register_@host_cpu@_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS)
+gst_register_@host_cpu@_@GST_MAJORMINOR@_LDFLAGS = $(GST_OBJ_LIBS)
 endif
 if !GST_DISABLE_LOADSAVE
 gst_complete_@GST_MAJORMINOR@_SOURCES = gst-complete.c
@@ -78,7 +95,7 @@
 
 # make sure each unversioned tool comes from gst-run.c
 if !GST_DISABLE_REGISTRY
-gst_register_SOURCES = gst-run.c
+gst_register_@host_cpu@_SOURCES = gst-run.c
 endif
 if !GST_DISABLE_LOADSAVE
 gst_complete_SOURCES = gst-run.c
--- /dev/null	2005-01-08 18:00:38.656816824 -0500
+++ gstreamer-0.8.8/tools/gst-register.in	2005-01-10 14:51:58.883255905 -0500
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+for x in @libexecdir@/gst-register*@GST_MAJORMINOR@; do
+  $x
+done
--- gstreamer-0.8.8/docs/gst/gstreamer-sections.txt.lib64	2004-12-08 12:26:19.000000000 -0500
+++ gstreamer-0.8.8/docs/gst/gstreamer-sections.txt	2005-01-10 14:51:58.887255215 -0500
@@ -1326,10 +1326,14 @@
 GstRegistry
 GLOBAL_REGISTRY_DIR
 GLOBAL_REGISTRY_FILE
+GLOBAL_ARCH_REGISTRY_FILE
 GLOBAL_REGISTRY_FILE_TMP
+GLOBAL_ARCH_REGISTRY_FILE_TMP
 LOCAL_REGISTRY_DIR
 LOCAL_REGISTRY_FILE
+LOCAL_ARCH_REGISTRY_FILE
 LOCAL_REGISTRY_FILE_TMP
+LOCAL_ARCH_REGISTRY_FILE_TMP
 REGISTRY_DIR_PERMS
 REGISTRY_TMPFILE_PERMS
 REGISTRY_FILE_PERMS
--- gstreamer-0.8.8/gst/Makefile.am.lib64	2004-05-09 10:59:59.000000000 -0400
+++ gstreamer-0.8.8/gst/Makefile.am	2005-01-10 14:51:58.891254525 -0500
@@ -140,6 +140,7 @@
                                                                                 
 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =	\
 	-D_GNU_SOURCE				\
+	-DHOSTCPU=\"$(host_cpu)\"		\
 	$(GST_LIB_CFLAGS) 			\
 	-DG_LOG_DOMAIN=g_log_domain_gstreamer 	\
 	-DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\" 
--- gstreamer-0.8.8/gst/gstregistry.h.lib64	2004-04-29 06:02:15.000000000 -0400
+++ gstreamer-0.8.8/gst/gstregistry.h	2005-01-10 14:51:58.894254007 -0500
@@ -29,10 +29,14 @@
 #define GLOBAL_REGISTRY_DIR      GST_CACHE_DIR
 #define GLOBAL_REGISTRY_FILE     GLOBAL_REGISTRY_DIR"/registry.xml"
 #define GLOBAL_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.registry.xml.tmp"
+#define GLOBAL_ARCH_REGISTRY_FILE     GLOBAL_REGISTRY_DIR"/registry-" HOSTCPU ".xml"
+#define GLOBAL_ARCH_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.registry-" HOSTCPU ".xml.tmp"
 
 #define LOCAL_REGISTRY_DIR       ".gstreamer-"GST_MAJORMINOR
 #define LOCAL_REGISTRY_FILE      LOCAL_REGISTRY_DIR"/registry.xml"
 #define LOCAL_REGISTRY_FILE_TMP  LOCAL_REGISTRY_DIR"/.registry.xml.tmp"
+#define LOCAL_ARCH_REGISTRY_FILE      LOCAL_REGISTRY_DIR"/registry-" HOSTCPU ".xml"
+#define LOCAL_ARCH_REGISTRY_FILE_TMP  LOCAL_REGISTRY_DIR"/.registry-" HOSTCPU ".xml.tmp"
 
 /* compatibility for pre-POSIX defines */
 #ifdef S_IRUSR
--- gstreamer-0.8.8/gst/gst.c.lib64	2004-11-11 10:23:23.000000000 -0500
+++ gstreamer-0.8.8/gst/gst.c	2005-01-10 14:51:58.898253317 -0500
@@ -496,7 +496,7 @@
     const gchar *homedir;
 
     _global_registry =
-        gst_xml_registry_new ("global_registry", GLOBAL_REGISTRY_FILE);
+      gst_xml_registry_new ("global_registry", GLOBAL_ARCH_REGISTRY_FILE);
 
 #ifdef PLUGINS_USE_BUILDDIR
     /* location libgstelements.so */
@@ -516,7 +516,7 @@
       user_reg = g_strdup (g_getenv ("GST_REGISTRY"));
     } else {
       homedir = g_get_home_dir ();
-      user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL);
+      user_reg = g_build_filename (homedir, LOCAL_ARCH_REGISTRY_FILE, NULL);
     }
     _user_registry = gst_xml_registry_new ("user_registry", user_reg);
 
