listup_binaries(){ find . -type f | while read o; do case "$o" in ./.arch_ppc/*|./.arch_ppc64/*|./.arch_i386/*|./.arch_x86_64/*) continue ;; *) t="`file -b \"$o\"`" case "$t" in *"Mach-O"*" executable"*) ;; *"current ar archive"*|*"ar archive random library"*) ;; *"Mach-O"*" dynamically linked shared library"*) ;; *"Mach-O"*" object"*) ;; *) continue ;; esac ;; esac echo "$o" done } listup_headers(){ find . -type f | while read o; do case "$o" in ./.arch_ppc/*|./.arch_ppc64/*|./.arch_i386/*|./.arch_x86_64/*) continue ;; *.h|*.hpp) t="`file -b \"$o\"`" case "$t" in *"program text"*) ;; *) continue ;; esac ;; *) continue ;; esac echo "$o" done } #make clean distclean && ./configure CPPFLAGS='-I/opt/local/include' CFLAGS='-arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-L/opt/local/lib -arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --host=i386-apple-darwin --build=`sh config.guess` --x-includes=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include --x-libraries=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib --prefix=/opt/local --without-pop --without-sound --with-x-toolkit=lucid --without-xpm --without-rsvg --without-libotf --without-m17n-flt --without-toolkit-scroll-bars --without-xaw3d --without-ns --without-gpm --without-dbus --without-gconf --with-x && make && { [ -d .arch_i386 ] || mkdir .arch_i386 && listup_binaries > .arch_i386/.binaries.lst && tar --files-from=.arch_i386/.binaries.lst -cf - | (cd .arch_i386 && tar xf -) && listup_headers > .arch_i386/.headers.lst && tar --files-from=.arch_i386/.headers.lst -cf - | (cd .arch_i386 && tar xf -) } && make clean distclean && ./configure CPPFLAGS='-I/opt/local/include' CFLAGS='-arch ppc -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch ppc -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-L/opt/local/lib -arch ppc -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --host=ppc-apple-darwin --build=`sh config.guess` --x-includes=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include --x-libraries=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib --prefix=/opt/local --without-pop --without-sound --with-x-toolkit=lucid --without-xpm --without-rsvg --without-libotf --without-m17n-flt --without-toolkit-scroll-bars --without-xaw3d --without-ns --without-gpm --without-dbus --without-gconf --with-x && make && { [ -d .arch_ppc ] || mkdir .arch_ppc && listup_binaries > .arch_ppc/.binaries.lst && tar --files-from=.arch_ppc/.binaries.lst -cf - | (cd .arch_ppc && tar xf -) && listup_headers > .arch_ppc/.headers.lst && tar --files-from=.arch_ppc/.headers.lst -cf - | (cd .arch_ppc && tar xf -) } && { listup_binaries | while read o; do echo lipo -create -output "$o" -arch ppc .arch_ppc/"$o" -arch i386 .arch_i386/"$o" lipo -create -output "$o" -arch ppc .arch_ppc/"$o" -arch i386 .arch_i386/"$o" && touch -r .arch_ppc/"$o" "$o" done }