config.lib
branchnoai
changeset 9701 d1ac22c62f64
parent 9694 e72987579514
child 9703 d2a6acdbd665
--- a/config.lib	Sun Aug 19 14:04:13 2007 +0000
+++ b/config.lib	Sun Sep 02 11:17:33 2007 +0000
@@ -308,11 +308,16 @@
 	# Check if all params have valid values
 
 	# Endian only allows AUTO, LE and, BE
-	if [ -z "`echo $endian | egrep '^(AUTO|LE|BE)$'`" ]; then
+	if [ -z "`echo $endian | egrep '^(AUTO|LE|BE|PREPROCESSOR)$'`" ]; then
 		echo "configure: error: invalid option --endian=$endian"
 		echo " Available options are: --endian=[AUTO|LE|BE]"
 		exit 1
 	fi
+	if [ "$endian" = "PREPROCESSOR" ] && [ "$os" != "OSX" ]; then
+		echo "configure: error: invalid option --endian=$endian"
+		echo " PREPROCESSOR is only available for OSX"
+		exit 1
+	fi
 	# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
 	if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
 		echo "configure: error: invalid option --os=$os"
@@ -838,6 +843,14 @@
 		CFLAGS="$CFLAGS -fno-strict-aliasing"
 	fi
 
+	# GCC 4.2+ automatically assumes that signed overflows do
+	# not occur in signed arithmetics, whereas we are not
+	# sure that they will not happen. It furthermore complains
+	# about it's own optimized code in some places.
+	if [ $cc_version -ge 42 ]; then
+		CFLAGS="$CFLAGS -fno-strict-overflow"
+	fi
+
 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 		LIBS="$LIBS -lpthread"
 		LIBS="$LIBS -lrt"