config.lib
changeset 7169 f66b869f439f
parent 7019 bcbdf12d9094
child 7307 ac1545fc0a87
equal deleted inserted replaced
7168:ef6420ef87a5 7169:f66b869f439f
   301 	if [ -z "`echo $endian | egrep '^(AUTO|LE|BE)$'`" ]; then
   301 	if [ -z "`echo $endian | egrep '^(AUTO|LE|BE)$'`" ]; then
   302 		echo "configure: error: invalid option --endian=$endian"
   302 		echo "configure: error: invalid option --endian=$endian"
   303 		echo " Available options are: --endian=[AUTO|LE|BE]"
   303 		echo " Available options are: --endian=[AUTO|LE|BE]"
   304 		exit 1
   304 		exit 1
   305 	fi
   305 	fi
   306 	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
   306 	# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
   307 	if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
   307 	if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
   308 		echo "configure: error: invalid option --os=$os"
   308 		echo "configure: error: invalid option --os=$os"
   309 		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
   309 		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
   310 		exit 1
   310 		exit 1
   311 	fi
   311 	fi
   312 	# enable_debug should be between 0 and 4
   312 	# enable_debug should be between 0 and 4
   313 	if [ -z "`echo $enable_debug | grep '^[0123]$'`" ]; then
   313 	if [ -z "`echo $enable_debug | grep '^[0123]$'`" ]; then
   314 		echo "configure: error: invalid option --enable-debug=$enable_debug"
   314 		echo "configure: error: invalid option --enable-debug=$enable_debug"
   707 		if [ $cc_version -ge 40 ]; then
   707 		if [ $cc_version -ge 40 ]; then
   708 			CFLAGS="$CFLAGS -fno-strict-aliasing"
   708 			CFLAGS="$CFLAGS -fno-strict-aliasing"
   709 		fi
   709 		fi
   710 	fi
   710 	fi
   711 
   711 
   712 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ]; then
   712 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ]; then
   713 		LIBS="$LIBS -lpthread"
   713 		LIBS="$LIBS -lpthread"
   714 		LIBS="$LIBS -lrt"
   714 		LIBS="$LIBS -lrt"
   715 	fi
   715 	fi
   716 
   716 
   717 	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
   717 	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
   729 	fi
   729 	fi
   730 
   730 
   731 	if [ "$os" = "MORPHOS" ]; then
   731 	if [ "$os" = "MORPHOS" ]; then
   732 		# -Wstrict-prototypes generates much noise because of system headers
   732 		# -Wstrict-prototypes generates much noise because of system headers
   733 		CFLAGS="$CFLAGS -Wno-strict-prototypes"
   733 		CFLAGS="$CFLAGS -Wno-strict-prototypes"
       
   734 	fi
       
   735 
       
   736 	if [ "$os" = "OPENBSD" ]; then
       
   737 		LIBS="$LIBS -pthread"
   734 	fi
   738 	fi
   735 
   739 
   736 	if [ "$os" = "OSX" ]; then
   740 	if [ "$os" = "OSX" ]; then
   737 		LDFLAGS="$LDFLAGS -framework Cocoa"
   741 		LDFLAGS="$LDFLAGS -framework Cocoa"
   738 		if [ "$enable_dedicated" = "0" ]; then
   742 		if [ "$enable_dedicated" = "0" ]; then
   743 	if [ "$os" = "BEOS" ]; then
   747 	if [ "$os" = "BEOS" ]; then
   744 		LIBS="$LIBS -lmidi -lbe"
   748 		LIBS="$LIBS -lmidi -lbe"
   745 	fi
   749 	fi
   746 
   750 
   747 	# Most targets act like UNIX, just with some additions
   751 	# Most targets act like UNIX, just with some additions
   748 	if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
   752 	if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
   749 		CFLAGS="$CFLAGS -DUNIX"
   753 		CFLAGS="$CFLAGS -DUNIX"
   750 	fi
   754 	fi
   751 	# And others like Windows
   755 	# And others like Windows
   752 	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
   756 	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
   753 		CFLAGS="$CFLAGS -DWIN"
   757 		CFLAGS="$CFLAGS -DWIN"
  1237 	log 1 "checking awk... $awk"
  1241 	log 1 "checking awk... $awk"
  1238 }
  1242 }
  1239 
  1243 
  1240 detect_os() {
  1244 detect_os() {
  1241 	if [ "$os" = "DETECT" ]; then
  1245 	if [ "$os" = "DETECT" ]; then
  1242 		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
  1246 		# Detect UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
  1243 
  1247 
  1244 		# Try first via dumpmachine, then via uname
  1248 		# Try first via dumpmachine, then via uname
  1245 		os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
  1249 		os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
  1246 					/linux/        { print "UNIX";    exit}
  1250 					/linux/        { print "UNIX";    exit}
  1247 					/darwin/       { print "OSX";     exit}
  1251 					/darwin/       { print "OSX";     exit}
  1248 					/freebsd/      { print "FREEBSD"; exit}
  1252 					/freebsd/      { print "FREEBSD"; exit}
       
  1253 					/openbsd/      { print "OPENBSD"; exit}
  1249 					/morphos/      { print "MORPHOS"; exit}
  1254 					/morphos/      { print "MORPHOS"; exit}
  1250 					/beos/         { print "BEOS";    exit}
  1255 					/beos/         { print "BEOS";    exit}
  1251 					/sunos/        { print "SUNOS";   exit}
  1256 					/sunos/        { print "SUNOS";   exit}
  1252 					/solaris/      { print "SUNOS";   exit}
  1257 					/solaris/      { print "SUNOS";   exit}
  1253 					/cygwin/       { print "CYGWIN";  exit}
  1258 					/cygwin/       { print "CYGWIN";  exit}
  1260 		if [ -z "$os" ]; then
  1265 		if [ -z "$os" ]; then
  1261 			os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | $awk '
  1266 			os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | $awk '
  1262 					/linux/        { print "UNIX";    exit}
  1267 					/linux/        { print "UNIX";    exit}
  1263 					/darwin/       { print "OSX";     exit}
  1268 					/darwin/       { print "OSX";     exit}
  1264 					/freebsd/      { print "FREEBSD"; exit}
  1269 					/freebsd/      { print "FREEBSD"; exit}
       
  1270 					/openbsd/      { print "OPENBSD"; exit}
  1265 					/morphos/      { print "MORPHOS"; exit}
  1271 					/morphos/      { print "MORPHOS"; exit}
  1266 					/beos/         { print "BEOS";    exit}
  1272 					/beos/         { print "BEOS";    exit}
  1267 					/sunos/        { print "SUNOS";   exit}
  1273 					/sunos/        { print "SUNOS";   exit}
  1268 					/cygwin/       { print "CYGWIN";  exit}
  1274 					/cygwin/       { print "CYGWIN";  exit}
  1269 					/mingw/        { print "MINGW";   exit}
  1275 					/mingw/        { print "MINGW";   exit}
  1271 			'`
  1277 			'`
  1272 		fi
  1278 		fi
  1273 
  1279 
  1274 		if [ -z "$os" ]; then
  1280 		if [ -z "$os" ]; then
  1275 			log 1 "detecting OS... none detected"
  1281 			log 1 "detecting OS... none detected"
  1276 			log 1 "I couldn't detect your OS. Please use --with-os=OS to force one"
  1282 			log 1 "I couldn't detect your OS. Please use --os=OS to force one"
  1277 			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
  1283 			log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
  1278 			exit 1
  1284 			exit 1
  1279 		fi
  1285 		fi
  1280 
  1286 
  1281 		log 1 "detecting OS... $os"
  1287 		log 1 "detecting OS... $os"
  1282 	else
  1288 	else
  1958 	echo "  --windres=WINDRES              the windres to use [HOST-windres]"
  1964 	echo "  --windres=WINDRES              the windres to use [HOST-windres]"
  1959 	echo "  --strip=STRIP                  the strip to use [HOST-strip]"
  1965 	echo "  --strip=STRIP                  the strip to use [HOST-strip]"
  1960 	echo "  --awk=AWK                      the awk to use in configure [awk]"
  1966 	echo "  --awk=AWK                      the awk to use in configure [awk]"
  1961 	echo "  --lipo=LIPO                    the lipo to use (OSX ONLY) [HOST-lipo]"
  1967 	echo "  --lipo=LIPO                    the lipo to use (OSX ONLY) [HOST-lipo]"
  1962 	echo "  --os=OS                        the OS we are compiling for [DETECT]"
  1968 	echo "  --os=OS                        the OS we are compiling for [DETECT]"
  1963 	echo "                                 DETECT/UNIX/OSX/FREEBSD/MORPHOS/BEOS/"
  1969 	echo "                                 DETECT/UNIX/OSX/FREEBSD/OPENBSD/MORPHOS/"
  1964 	echo "                                 SUNOS/CYGWIN/MINGW/OS2/WINCE/PSP"
  1970 	echo "                                 BEOS/SUNOS/CYGWIN/MINGW/OS2/WINCE/PSP"
  1965 	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
  1971 	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
  1966 	echo "  --revision=rXXXX               overwrite the revision detection."
  1972 	echo "  --revision=rXXXX               overwrite the revision detection."
  1967 	echo "                                 Use with care!"
  1973 	echo "                                 Use with care!"
  1968 	echo ""
  1974 	echo ""
  1969 	echo "Paths:"
  1975 	echo "Paths:"