shithub: choc

Download patch

ref: 61d40373640c0cabdaef4d4381ac5ae636fab642
parent: abc69c7cf92181461612d7126f2bdc8da6b9eb76
author: Simon Howard <[email protected]>
date: Sat Jun 6 21:56:21 EDT 2009

Detect Windows CE target and build/include libc_wince files as
necessary.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1561

--- a/Makefile.am
+++ b/Makefile.am
@@ -44,7 +44,7 @@
 MAINTAINERCLEANFILES =  $(AUX_DIST_GEN)
 
 docdir=$(prefix)/share/doc/@PACKAGE@
-SUBDIRS=textscreen pcsound src man setup
+SUBDIRS=wince textscreen pcsound src man setup
 
 if HAVE_PYTHON
 
--- a/configure.in
+++ b/configure.in
@@ -53,6 +53,19 @@
     exit -1
 ])
 
+# Windows CE build?
+
+WINDOWS_CE=false
+
+case "$host" in
+    *mingw32ce*|*cegcc*|*wince*)
+        CFLAGS="-I../wince $CFLAGS"
+        WINDOWS_CE=true
+        ;;
+    *)
+        ;;
+esac
+
 AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h])
 AC_CHECK_FUNCS(mmap sched_setaffinity)
 
@@ -61,6 +74,7 @@
 
 AC_CHECK_TOOL(WINDRES, windres, )
 
+AM_CONDITIONAL(WINDOWS_CE, $WINDOWS_CE)
 AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
 AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
 
@@ -86,6 +100,7 @@
 
 AC_OUTPUT([
 Makefile
+wince/Makefile
 textscreen/Makefile
 textscreen/examples/Makefile
 setup/Makefile
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -170,6 +170,7 @@
 endif
 
 chocolate_doom_LDADD =                               \
+                       ../wince/libc_wince.a         \
                        ../textscreen/libtextscreen.a \
                        ../pcsound/libpcsound.a       \
                        @LDFLAGS@                     \
--- a/wince/Makefile.am
+++ b/wince/Makefile.am
@@ -1,8 +1,16 @@
 
 noinst_LIBRARIES=libc_wince.a
 
+if WINDOWS_CE
+
 libc_wince_a_SOURCES =                            \
         env.c            env.h                    \
 	errno.c          errno.h                  \
         fileops.c        fileops.h
+
+else
+
+libc_wince_a_SOURCES =
+
+endif