1--- src/Makefile.in	2007-03-21 07:31:24.000000000 -0700
2+++ src/Makefile.in	2008-10-24 15:08:14.000000000 -0700
3@@ -952,16 +952,35 @@ RUN_TEMACS = ./temacs
4 
5 all: emacs${EXEEXT} OTHER_FILES
6 
7+#ifdef HAVE_SHM
8+NL=-nl
9+#endif
10 emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
11 #ifdef CANNOT_DUMP
12 	rm -f emacs${EXEEXT}
13 	ln temacs${EXEEXT} emacs${EXEEXT}
14 #else
15-#ifdef HAVE_SHM
16-	LC_ALL=C $(RUN_TEMACS) -nl -batch -l loadup dump
17-#else /* ! defined (HAVE_SHM) */
18-	LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
19-#endif /* ! defined (HAVE_SHM) */
20+#undef i386
21+ifneq (1,$(words $(RC_ARCHS)))
22+	mv temacs emacs-undumped
23+ifeq (i386,$(filter i386,$(RC_ARCHS)))
24+	lipo -thin i386 -output temacs emacs-undumped
25+	LC_ALL=C $(RUN_TEMACS) $(NL) -batch -l loadup dump
26+	mv emacs arch/emacs-i386
27+	rm -f emacs-[0-9]* # avoid DOC-xx incrementing
28+endif
29+ifeq (x86_64,$(filter x86_64,$(RC_ARCHS)))
30+	lipo -thin x86_64 -output temacs emacs-undumped
31+	LC_ALL=C $(RUN_TEMACS) $(NL) -batch -l loadup dump
32+	mv emacs arch/emacs-x86_64
33+	rm -f emacs-[0-9]* # avoid DOC-xx incrementing
34+endif
35+	lipo -create -output emacs "arch/"*
36+	cp emacs-undumped temacs
37+else
38+	cp temacs emacs-undumped
39+	LC_ALL=C $(RUN_TEMACS) $(NL) -batch -l loadup dump
40+endif
41 #endif /* ! defined (CANNOT_DUMP) */
42 	-./emacs -q -batch -f list-load-path-shadows
43 
44@@ -1382,6 +1393,11 @@ bootstrap-emacs${EXEEXT}: temacs${EXEEXT
45 #ifdef CANNOT_DUMP
46 	ln temacs${EXEEXT} bootstrap-emacs${EXEEXT}
47 #else
48+	if [ -n "`file temacs | grep 'Mach-O universal binary'`" ]; then        \
49+		mv temacs emacs-undumped;                               \
50+		lipo -thin `$(SRCROOT)/filearch.rb emacs-undumped` -output temacs emacs-undumped;        \
51+		rm emacs-undumped;					\
52+	fi
53 #ifdef HAVE_SHM
54 	$(RUN_TEMACS) -nl -batch -l loadup bootstrap
55 #else /* ! defined (HAVE_SHM) */
56