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 CFLAGS='-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --disable-fma --enable-sse --disable-fortran --host=x86_64-apple-darwin8 --build=`sh config.guess` --prefix=/opt/local --enable-shared --enable-threads --enable-float && make && { [ -d .arch_x86_64 ] || mkdir .arch_x86_64 && listup_binaries > .arch_x86_64/.binaries.lst && tar --files-from=.arch_x86_64/.binaries.lst -cf - | (cd .arch_x86_64 && tar xf -) && listup_headers > .arch_x86_64/.headers.lst && tar --files-from=.arch_x86_64/.headers.lst -cf - | (cd .arch_x86_64 && tar xf -) } && make clean distclean && ./configure CFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --disable-fma --enable-sse --disable-fortran --host=i686-apple-darwin8 --build=`sh config.guess` --prefix=/opt/local --enable-shared --enable-threads --enable-float && 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 CFLAGS='-arch ppc64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch ppc64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-arch ppc64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --enable-fma --disable-altivec --disable-fortran --host=ppc64-apple-darwin8 --build=`sh config.guess` --prefix=/opt/local --enable-shared --enable-threads --enable-float && make && { [ -d .arch_ppc64 ] || mkdir .arch_ppc64 && listup_binaries > .arch_ppc64/.binaries.lst && tar --files-from=.arch_ppc64/.binaries.lst -cf - | (cd .arch_ppc64 && tar xf -) && listup_headers > .arch_ppc64/.headers.lst && tar --files-from=.arch_ppc64/.headers.lst -cf - | (cd .arch_ppc64 && tar xf -) } && make clean distclean && ./configure CFLAGS='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' CXXFLAGS='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' LDFLAGS='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4' --enable-fma --disable-altivec --disable-fortran --host=ppc-apple-darwin8 --build=`sh config.guess` --prefix=/opt/local --enable-shared --enable-threads --enable-float && 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 -) } && { cat .arch_ppc/.headers.lst | while read h; do diff .arch_ppc/"$h" .arch_ppc64/"$h" > /dev/null 2>&1 && diff .arch_ppc/"$h" .arch_i386/"$h" > /dev/null 2>&1 && diff .arch_ppc/"$h" .arch_x86_64/"$h" > /dev/null 2>&1 || { echo univarsalized header: "$h" cat < "$h" && #if defined(__ppc__) `cat .arch_ppc/"$h"` #elif defined(__ppc64__) `cat .arch_ppc64/"$h"` #elif defined(__i386__) `cat .arch_i386/"$h"` #elif defined(__x86_64__) `cat .arch_x86_64/"$h"` #endif /* defined(__arch__) */ EOF touch -r .arch_ppc/"$h" "$h" } done } && { listup_binaries | while read o; do echo lipo -create -output "$o" -arch ppc .arch_ppc/"$o" -arch ppc64 .arch_ppc64/"$o" -arch i386 .arch_i386/"$o" -arch x86_64 .arch_x86_64/"$o" lipo -create -output "$o" -arch ppc .arch_ppc/"$o" -arch ppc64 .arch_ppc64/"$o" -arch i386 .arch_i386/"$o" -arch x86_64 .arch_x86_64/"$o" && touch -r .arch_ppc/"$o" "$o" done }