config.lib
changeset 6004 03795fd01cb8
parent 5838 9c3129cb019b
child 6011 799eacb62d8e
--- a/config.lib	Sun Jan 21 13:16:31 2007 +0000
+++ b/config.lib	Sun Jan 21 14:14:27 2007 +0000
@@ -286,10 +286,10 @@
 		echo " Available options are: --endian=[AUTO|LE|BE]"
 		exit 1
 	fi
-	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, and MINGW, OS2
-	if ! echo $os | grep -Eq "^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2)$"; then
+	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and WINCE
+	if ! echo $os | grep -Eq "^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE)$"; then
 		echo "configure: error: invalid option --os=$os"
-		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2]"
+		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE]"
 		exit 1
 	fi
 	# enable_debug should be between 0 and 4
@@ -648,14 +648,17 @@
 		LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
 	fi
 
-	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ]; then
+	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ]; then
 		LIBS="$LIBS -lpthread"
 		LIBS="$LIBS -lrt"
 	fi
 
-	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ]; then
+	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
 		LIBS="$LIBS -lc"
 	fi
+	if [ "$os" = "WINCE" ]; then
+		LIBS="$LIBS -lcoredll -lcorelibc -laygshell -e WinMainCRTStartup"
+	fi
 
 	if [ "$os" = "MORPHOS" ]; then
 		# -Wstrict-prototypes generates much noise because of system headers
@@ -678,7 +681,7 @@
 		CFLAGS="$CFLAGS -DUNIX"
 	fi
 	# And others like Windows
-	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 		CFLAGS="$CFLAGS -DWIN"
 	fi
 
@@ -996,7 +999,7 @@
 }
 
 check_windres() {
-	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 		check_compiler "host windres" "windres" "$host" "$windres" "$WINDRES" "windres" "windres" "2" "-V"
 	fi
 }
@@ -1101,7 +1104,7 @@
 
 detect_os() {
 	if [ $os = "DETECT" ]; then
-		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW and OS2
+		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and WINCE
 
 		# Try first via dumpmachine, then via uname
 		os=`echo "$host" | tr [:upper:] [:lower:] | awk '
@@ -1114,6 +1117,7 @@
 					/cygwin/       { print "CYGWIN";  exit}
 					/mingw/        { print "MINGW";   exit}
 					/os2/          { print "OS2";     exit}
+					/wince/        { print "WINCE";   exit}
 		'`
 
 		if [ -z "$os" ]; then
@@ -1133,7 +1137,7 @@
 		if [ -z "$os" ]; then
 			log 1 "detecting OS... none detected"
 			log 1 "I couldn't detect your OS. Please use --with-os=OS to force one"
-			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, and MINGW"
+			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2 and WINCE"
 			exit 1
 		fi
 
@@ -1740,7 +1744,7 @@
 	echo "  --lipo=LIPO                    the lipo to use (OSX ONLY) [HOST-lipo]"
 	echo "  --os=OS                        the OS we are compiling for [DETECT]"
 	echo "                                 DETECT/UNIX/OSX/FREEBSD/MORPHOS/BEOS/"
-	echo "                                 SUNOS/CYGWIN/MINGW"
+	echo "                                 SUNOS/CYGWIN/MINGW/OS2/WINCE"
 	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
 	echo "  --revision=rXXXX               overwrite the revision detection."
 	echo "                                 Use with care!"