#!/bin/sh

FLAG="${FLAG} -ansi -Wall -O2 -finline-functions"

case "$(cat /proc/cpuinfo | egrep '^model name'|cut -d ':' -f 2|cut -c 2-)" in
	'Intel(R) Pentium(R) M processor 1300MHz')
		FLAG="${FLAG} -march=pentium3 -fomit-frame-pointer -ffast-math"
		;;
	*)
		;;
esac

for flag in $(cat /proc/cpuinfo | egrep '^flags'|cut -d ':' -f 2|cut -c 2-); do
	case $flag in
		mmx)
			FLAG="${FLAG} -mmmx"
			;;
		sse)
			FLAG="${FLAG} -msse"
			;;
		sse2)
			FLAG="${FLAG} -msse2"
			;;
	esac
done

echo 'GCC_FLAGS = $(QTGCC_FLAGS)' $FLAG