#!/bin/bash set_build_arch() { : ${BUILD_HOST_ARCH:=`uname -m`} if [ -z "$BUILD_ARCH" ]; then BUILD_ARCH="$BUILD_HOST_ARCH" test i686 != "$BUILD_ARCH" || BUILD_ARCH=i586 # XXX: why? fi case $BUILD_ARCH in i686) BUILD_ARCH="i686:i586:i486:i386" ;; i586) BUILD_ARCH="i586:i486:i386" ;; i486) BUILD_ARCH="i486:i386" ;; i386) BUILD_ARCH="i386" ;; x86_64) BUILD_ARCH="x86_64:i686:i586:i486:i386" ;; sparc64v) BUILD_ARCH="sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc" ;; sparc64) BUILD_ARCH="sparc64:sparcv9:sparcv8:sparc" ;; sparcv9v) BUILD_ARCH="sparcv9v:sparcv9:sparcv8:sparc" ;; sparcv9) BUILD_ARCH="sparcv9:sparcv8:sparc" ;; sparcv8) BUILD_ARCH="sparcv8:sparc" ;; sparc) BUILD_ARCH="sparc" ;; esac if test "$BUILD_ARCH" != "${BUILD_ARCH#i686}" ; then cpuflags=`grep ^flags /proc/cpuinfo` cpuflags="$cpuflags " if test "$cpuflags" = "${cpuflags/ cx8 /}" -o "$cpuflags" = "${cpuflags/ cmov /}"; then echo "Your cpu doesn't support i686 rpms. Exit." cleanup_and_exit 1 fi fi } check_exit() { if test -e $BUILD_ROOT/exit; then echo "exit ..." cleanup_and_exit 1 fi }