[PATCH] Microwindows 0.87 ELKS build patch

Jody Bruchon <[email protected]> Sun, 08 Mar 2015 15:53:10 -0400
Newsgroups org.kernel.vger.linux-8086
Message-ID <[email protected]>
** Note: this is a build patch only; the software is still broken **

Microwindows is a windowing system that used to build and work on ELKS:

https://en.wikipedia.org/wiki/Microwindows
http://microwindows.org/

The documentation in the most "recent" versions (Microwindows hasn't 
seen a release since 2011) indicates that all of the ELKS support has 
been untested since version 0.86, and some of the ELKS-specific 
configuration options have been hidden or removed.

The latest snapshot fails to build for ELKS and is basically useless to 
us. However, since 0.86 was the last version indicated in the 
documentation to be tested against ELKS, I decided to grab 0.87 and see 
if it could still be done.

This patch will convert a stock Microwindows 0.87 source tree to build 
with ELKS and changes default options to be geared towards ELKS. You 
must invoke 'make' with an ELKSDIR variable which points to your ELKS 
repository source code directory (NOT to the kernel source, but to the 
directory containing it!)

Get Microwindows 0.87 at:

ftp://microwindows.censoft.com/pub/microwindows/Historic/microwindows-0.87.tar.gz

Basic directions:

tar -xzf microwindows-0.87.tar.gz
cd microwin
patch -p1 < ../0001-microwin-087-elks-build.patch
cd src
make ELKSDIR=/path/to/elks/repo

The demo/test binaries will be in "microwin/src/bin". In my testing, 
these binaries do NOT currently work under ELKS, but they compile and 
most of them execute when copied to a "full3" image. If someone wants to 
try it out and figure out how to make it actually work, go for it!

-Jody Bruchon
0001-microwin-087-elks-build.patch (text/plain, 2.9 KB)
diff -Naur microwin/src/Arch.rules microwin-0.87/src/Arch.rules
--- microwin/src/Arch.rules	2000-02-05 21:33:48.000000000 -0500
+++ microwin-0.87/src/Arch.rules	2015-03-08 15:41:00.860430273 -0400
@@ -50,10 +50,10 @@
 HOSTCC = gcc
 CXX_COMPILER =
 TOOLSPREFIX =
-INCLUDEDIRS += -I/usr/bcc/include -I/home/greg/net/elks/include
+INCLUDEDIRS += -I/usr/lib/bcc/include -I/usr/bcc/include -I$(ELKSDIR)/elks/include
 DEFINES += -DELKS=1 -DUNIX=1 -Dconst= -Dvolatile=
 CFLAGS += -0 -ansi -O
-LDFLAGS +=
+LDFLAGS += -s
 endif
 
 ifeq ($(ARCH), DJGPP)
diff -Naur microwin/src/Makefile.rules microwin-0.87/src/Makefile.rules
--- microwin/src/Makefile.rules	2000-02-13 00:58:34.000000000 -0500
+++ microwin-0.87/src/Makefile.rules	2015-03-08 15:38:49.197099913 -0400
@@ -125,7 +125,7 @@
 #
 .depend: $(OBJS:.o=.c) $(CXXOBJS:.o=.cc)
 	@echo "Updating dependencies in $(CURDIR) ..."
-	$(SHELL) -ec '$(HOSTCC) -MM $(CPPFLAGS) $(CFLAGS) $(OBJS:.o=.c) \
+	$(SHELL) -ec '$(HOSTCC) -MM $(CPPFLAGS) $(HOSTCFLAGS) $(OBJS:.o=.c) \
 	| sed '\''s/\($*\)\.o[ :]*/\1.o \$@ : $$(TOP)\/config /g'\'' > $@; \
 	[ -s $@ ] || rm -f $@'
 
@@ -150,7 +150,7 @@
 
 clean:
 	@echo "Cleaning directory $(CURDIR) ..."
-	$(RM) core *~ *.bak *.o TAGS
+	$(RM) core *~ *.bak *.o TAGS .depend
 	$(RM) $(TOP)/lib/*.a
 	$(shell cd $(TOP)/bin; \
 		for file in `\ls`; do if [ ! -d $$file ]; \
diff -Naur microwin/src/config microwin-0.87/src/config
--- microwin/src/config	2000-02-13 00:51:32.000000000 -0500
+++ microwin-0.87/src/config	2015-03-08 14:33:10.730522074 -0400
@@ -31,7 +31,7 @@
 # note: ELKS can't build client/server nano-X, nor widget lib
 #
 ####################################################################
-ARCH                     = LINUX-NATIVE
+ARCH                     = ELKS
 ARMTOOLSPREFIX           = arm-linux-
 MIPSTOOLSPREFIX          = mipsel-linux-
 RTEMSTOOLSPREFIX         = i386-rtemself-
@@ -43,7 +43,7 @@
 ####################################################################
 OPTIMIZE                 = Y
 DEBUG                    = N
-VERBOSE                  = N
+VERBOSE                  = Y
 
 ####################################################################
 #
@@ -51,7 +51,7 @@
 #
 ####################################################################
 MICROWIN                 = Y
-NANOX                    = Y
+NANOX                    = N
 NWIDGET                  = N
 OBJFRAMEWORK             = N
 
@@ -62,7 +62,7 @@
 #
 ####################################################################
 MICROWINDEMO             = Y
-NANOXDEMO                = Y
+NANOXDEMO                = N
 
 ####################################################################
 #
@@ -119,7 +119,7 @@
 # UPDATEREGIONS paints in update clipping region only for better look and feel
 #
 ####################################################################
-ERASEMOVE                = Y
+ERASEMOVE                = N
 UPDATEREGIONS            = N
 
 ####################################################################