config.lib
changeset 6404 1a632e5d77d0
parent 6403 6165d686c6c2
child 6405 77f12538b351
equal deleted inserted replaced
6403:6165d686c6c2 6404:1a632e5d77d0
   283 
   283 
   284 check_params() {
   284 check_params() {
   285 	# Some params want to be in full uppercase, else they might not work as
   285 	# Some params want to be in full uppercase, else they might not work as
   286 	# expected.. fix that here
   286 	# expected.. fix that here
   287 
   287 
   288 	endian=`echo $endian | tr [:lower:] [:upper:]`
   288 	endian=`echo $endian | tr '[a-z]' '[A-Z]'`
   289 	os=`echo $os | tr [:lower:] [:upper:]`
   289 	os=`echo $os | tr '[a-z]' '[A-Z]'`
   290 
   290 
   291 	# Check if all params have valid values
   291 	# Check if all params have valid values
   292 
   292 
   293 	# Endian only allows AUTO, LE and, BE
   293 	# Endian only allows AUTO, LE and, BE
   294 	if ! echo $endian | grep -Eq "^(AUTO|LE|BE)$"; then
   294 	if ! echo $endian | grep -Eq "^(AUTO|LE|BE)$"; then
   546 
   546 
   547 		if [ "$enable_osx_g5" != "0" ]; then
   547 		if [ "$enable_osx_g5" != "0" ]; then
   548 			log 1 "detecting G5... yes (forced)"
   548 			log 1 "detecting G5... yes (forced)"
   549 		else
   549 		else
   550 			# First, are we a real OSX system, else we can't detect it
   550 			# First, are we a real OSX system, else we can't detect it
   551 			native=`LC_ALL=C uname | tr [:upper:] [:lower:] | grep darwin`
   551 			native=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | grep darwin`
   552 			# If $host doesn't match $build , we are cross-compiling
   552 			# If $host doesn't match $build , we are cross-compiling
   553 			if [ -n "$native" ] && [ "$build" != "$host" ]; then
   553 			if [ -n "$native" ] && [ "$build" != "$host" ]; then
   554 				$cc_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
   554 				$cc_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
   555 				res=`./G5_detector`
   555 				res=`./G5_detector`
   556 				rm -f G5_detector
   556 				rm -f G5_detector
  1142 detect_os() {
  1142 detect_os() {
  1143 	if [ "$os" = "DETECT" ]; then
  1143 	if [ "$os" = "DETECT" ]; then
  1144 		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
  1144 		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
  1145 
  1145 
  1146 		# Try first via dumpmachine, then via uname
  1146 		# Try first via dumpmachine, then via uname
  1147 		os=`echo "$host" | tr [:upper:] [:lower:] | awk '
  1147 		os=`echo "$host" | tr '[A-Z]' '[a-z]' | awk '
  1148 					/linux/        { print "UNIX";    exit}
  1148 					/linux/        { print "UNIX";    exit}
  1149 					/darwin/       { print "OSX";     exit}
  1149 					/darwin/       { print "OSX";     exit}
  1150 					/freebsd/      { print "FREEBSD"; exit}
  1150 					/freebsd/      { print "FREEBSD"; exit}
  1151 					/morphos/      { print "MORPHOS"; exit}
  1151 					/morphos/      { print "MORPHOS"; exit}
  1152 					/beos/         { print "BEOS";    exit}
  1152 					/beos/         { print "BEOS";    exit}
  1157 					/wince/        { print "WINCE";   exit}
  1157 					/wince/        { print "WINCE";   exit}
  1158 					/psp/          { print "PSP";     exit}
  1158 					/psp/          { print "PSP";     exit}
  1159 		'`
  1159 		'`
  1160 
  1160 
  1161 		if [ -z "$os" ]; then
  1161 		if [ -z "$os" ]; then
  1162 			os=`LC_ALL=C uname | tr [:upper:] [:lower:] | awk '
  1162 			os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | awk '
  1163 					/linux/        { print "UNIX";    exit}
  1163 					/linux/        { print "UNIX";    exit}
  1164 					/darwin/       { print "OSX";     exit}
  1164 					/darwin/       { print "OSX";     exit}
  1165 					/freebsd/      { print "FREEBSD"; exit}
  1165 					/freebsd/      { print "FREEBSD"; exit}
  1166 					/morphos/      { print "MORPHOS"; exit}
  1166 					/morphos/      { print "MORPHOS"; exit}
  1167 					/beos/         { print "BEOS";    exit}
  1167 					/beos/         { print "BEOS";    exit}