[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] RE: GCL 2.6.1 on Windows XP
From: |
Page, Bill |
Subject: |
[Axiom-developer] RE: GCL 2.6.1 on Windows XP |
Date: |
Fri, 24 Oct 2003 02:32:24 -0400 |
Tim,
On Thursday, October 23, 2003 6:21 PM you asked
>
> If you get a chance could you jot down the steps you take
> to build GCL on Windows? I tried to get make to work but
> got nowhere. Windows XP make me so enfeebled that I can't
> seem to figure out how to get any of my tools working.
> I guess that's why the code name for this version was
> Kryptonite :-) I have both mingw and cygwin installed.
>
Well, this will get you started with GCL. With these
patches, the make at least starts the build of Axiom
but fails because of Windows use of file names that contain
a C:/xxx (GCL thinks this is a package name). I've solved
this by passing strings instead of symbols.
So in the next message I will send you at least one more
set of patches for this and also a patch to boot to handle
the carriage return (char = 13) found in Windows text files.
Detailed steps:
1) Go to http://www.mingw.org/download.shtml and download
http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download
http://prdownloads.sf.net/mingw/MSYS-1.0.9.exe?download
http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download
http://prdownloads.sf.net/mingw/gcc-core-3.3.1-20030804-1.tar.gz?download
2) Install these files in the same order as above. I just
accept the default locations. The last one should be extracted
into c:/mingw and overwrites the older version of gcc. When you
are done, you should be able to start MSYS and a get
$ gcc -v
gcc version 3.3.1 (mingw special 20030804-1)
3) Copy the current Axiom CVS into you MSYS home directory.
4) Now you need to apply the patches given below.
5) Set the AXIOM environment variable
echo 'export AXIOM=`pwd -W`/mnt/windows' > .profile
. .profile
6) And start your engines!
make clean
make
Let me know how it goes. Don't be afraid to ask if some
Windows silliness doesn't make sense to you.
Cheers,
Bill Page.
patch1.windows:
---------------
This patch modifies the main Axiom Makefile for Windows.
You need to do this in order to "bootstrap" noweb. Note
the use of the MSYS -W option on pwd. This produces a
windows compatible path name.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/Makefile axiom/Makefile
--- axiom-save/Makefile Fri Oct 24 00:48:05 2003
+++ axiom/Makefile Thu Oct 23 19:41:02 2003
@@ -1,4 +1,4 @@
-SPD=$(shell pwd)
+SPD=$(shell pwd -W)
SYS=$(notdir $(AXIOM))
SPAD=${SPD}/mnt/${SYS}
LSP=${SPD}/lsp
@@ -11,7 +11,7 @@
INT=${SPD}/int
OBJ=${SPD}/obj
MNT=${SPD}/mnt
-ZIPS=${SPD}/zips
+ZIPS=${shell pwd}/zips
TMP=${OBJ}/tmp
SPADBIN=${MNT}/${SYS}/bin
INC=${SPD}/src/include
@@ -49,6 +49,9 @@
cd ${OBJ}/noweb/src/c ; \
cp ${ZIPS}/noweb.modules.c.patch . ; \
patch <noweb.modules.c.patch ; \
+ cd ${OBJ}/noweb/src ; \
+ cp ${ZIPS}/noweb.src.Makefile.patch . ; \
+ patch <noweb.src.Makefile.patch ; \
cd ${OBJ}/noweb/src ; \
${MAKE} BIN=${MNT}/${SYS}/bin LIB=${MNT}/${SYS}/bin/lib \
MAN=${MNT}/${SYS}/bin/man \
This patch adds a windows section to the Makefile pamphlet
file.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/Makefile.pamphlet axiom/Makefile.pamphlet
--- axiom-save/Makefile.pamphlet Fri Oct 24 00:48:05 2003
+++ axiom/Makefile.pamphlet Thu Oct 23 19:45:08 2003
@@ -1849,6 +1849,55 @@
<<clean>>
@
+
+\subsection{Makefile.windows}
+Annoyingly enough it seems that GCL uses a default extension of .lsp
+rather than .lisp so we add the {\bf LISP} variable here. We need to
+depend on the default extension behavior because the system build
+will load either the interpreted or compiled form of a file depending
+on which is available. This varies at different stages of the build.
+<<Makefile.windows>>=
+# System dependent Makefile for the Intel/Windows/MSYS platform
+# Platform variable
+PLF:=MSYSplatform
+# C compiler flags
+CCF:="-O2 -fno-strength-reduce -Wall -D_GNU_SOURCE -D${PLF}
-I/usr/X11/include"
+#CCF:=-g -fno-strength-reduce -Wall -D_GNU_SOURCE -D${PLF}
-I/usr/X11/include
+# Loader flags
+LDF:= -L/usr/X11R6/lib
+# C compiler to use
+CC:=gcc
+AWK=awk
+RANLIB=ranlib
+TOUCH=touch
+TAR=tar
+AXIOMXLROOT=${AXIOM}/compiler
+O=o
+BYE=bye
+LISP=lsp
+DAASE=${SRC}/share
+
+ENV=PLF=${PLF} CCF=${CCF} LDF=${LDF} CC=${CC} AWK=${AWK} RANLIB=${RANLIB} \
+ TOUCH=${TOUCH} TAR=${TAR} AXIOMXLROOT=${AXIOMXLROOT} O=${O} BYE=${BYE}
\
+ LISP=${LISP} DAASE=${DAASE}
+
+all: rootdirs noweb srcsetup lspdir srcdir
+ @echo 45 Makefile.linux called
+ @echo 46 Environment : ${ENV}
+ @echo 47 finished system build on `date` | tee >lastBuildDate
+
+<<rootdirs>>
+<<noweb.windows>>
+<<literate commands>>
+<<srcsetup>>
+<<src>>
+<<lsp>>
+<<document>>
+<<clean>>
+
+@
+
+
\eject
\begin{thebibliography}{99}
\bibitem{1} CMUCL {\bf http://www.cons.org/cmucl}
This patch adds a patch to the lisp Makefile for mingw.defs
similiar to to one of linux.defs (see below). It removes one
of the windows incompatibe GCL ./configure options. It also
avoids trying to link sockio-c since we are not able to compile
it as it stands under windows. Perhaps it can be re-written
for windows, but maybe a better solution would be to use GCL's
built-in session stuff - help!
Let's just cross our fingers and hope that this omission
doesn't bit us too hard later in the build.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/lsp/Makefile.pamphlet axiom/lsp/Makefile.pamphlet
--- axiom-save/lsp/Makefile.pamphlet Fri Oct 24 00:48:12 2003
+++ axiom/lsp/Makefile.pamphlet Fri Oct 24 01:13:10 2003
@@ -20,7 +20,8 @@
This patch is to {\bf h/386-linux.defs} to include two
global variables, {\bf EXTRAS} and {\bf EXTRA\_LIB}
\begin{verbatim}
-EXTRAS = ${OBJ}/${SYS}/lib/cfuns-c.o ${OBJ}/${SYS}/lib/sockio-c.o
+EXTRAS = ${OBJ}/${SYS}/lib/cfuns-c.o
+# ${OBJ}/${SYS}/lib/sockio-c.o
EXTRA_LIB=${OBJ}/${SYS}/lib/libspad.a
\end{verbatim}
The {\bf EXTRAS} variable is used to include two files into the
@@ -45,6 +46,9 @@
@(cd ${GCLVERSION}/h ; \
echo 3 applying EXTRAS patch to h/linux.defs ; \
patch <${SPD}/zips/${GCLVERSION}.h.linux.defs.patch )
+ @(cd ${GCLVERSION}/h ; \
+ echo 3a applying EXTRAS patch to h/mingw.defs ; \
+ patch <${SPD}/zips/${GCLVERSION}.h.mingw.defs.patch )
@(echo 4 setup ini files for EXTRAS patch ; \
touch ${OBJ}/${SYS}/lib/cfuns-c.ini ; \
touch ${OBJ}/${SYS}/lib/sockio-c.ini )
@@ -174,7 +178,7 @@
relocating object files.
<<gclConfigureMake>>=
@(cd ${GCLVERSION} ; \
- ./configure --enable-vssize=65536*2 --enable-statsysbfd
--enable-readline --enable-maxpage=128*1024 ; \
+ ./configure --enable-vssize=65536*2 --enable-readline
--enable-maxpage=128*1024 ; \
${ENV} ${MAKE} ; \
cp unixport/saved_gcl ${OUT}/lisp )
@
This patch changes the lib Makefile to avoid compiling
C code that doesn't work under Windows. Note also the
assing of the platform conditional define to gcc.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/src/lib/Makefile.pamphlet axiom/src/lib/Makefile.pamphlet
--- axiom-save/src/lib/Makefile.pamphlet Fri Oct 24 00:48:35 2003
+++ axiom/src/lib/Makefile.pamphlet Thu Oct 23 23:15:58 2003
@@ -102,9 +102,10 @@
AR= ${OUT}/bsdsignal.o ${OUT}/cursor.o ${OUT}/edin.o \
${OUT}/fnct_key.o ${OUT}/halloc.o ${OUT}/openpty.o \
- ${OUT}/pixmap.o ${OUT}/prt.o ${OUT}/sockio-c.o \
- ${OUT}/spadcolors.o ${OUT}/util.o ${OUT}/wct.o \
- ${OUT}/XDither.o ${OUT}/XShade.o ${OUT}/XSpadFill.o
+ ${OUT}/pixmap.o ${OUT}/prt.o \
+
+# ${OUT}/sockio-c.o ${OUT}/spadcolors.o ${OUT}/util.o ${OUT}/XDither.o
${OUT}/XShade.o
+# ${OUT}/wct.o ${OUT}/XSpadFill.o
OTHER= ${OUT}/cfuns-c.o
@@ -130,7 +131,7 @@
${OUT}/bsdsignal.o: ${MID}/bsdsignal.c
@echo 3 making ${OUT}/bsdsignal.o from ${MID}/bsdsignal.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/bsdsignal.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/bsdsignal.c )
@
@@ -164,7 +165,7 @@
${OUT}/cfuns-c.o: ${MID}/cfuns-c.c
@echo 6 making ${OUT}/cfuns-c.o from ${MID}/cfuns-c.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/cfuns-c.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/cfuns-c.c )
@
@@ -193,7 +194,7 @@
${OUT}/cursor.o: ${MID}/cursor.c
@echo 9 making ${OUT}/cursor.o from ${MID}/cursor.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/cursor.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/cursor.c )
@
@@ -222,7 +223,7 @@
${OUT}/edin.o: ${MID}/edin.c
@echo 12 making ${OUT}/edin.o from ${MID}/edin.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/edin.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/edin.c )
@
@@ -251,7 +252,7 @@
${OUT}/fnct_key.o: ${MID}/fnct_key.c
@echo 15 making ${OUT}/fnct_key.o from ${MID}/fnct_key.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/fnct_key.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/fnct_key.c )
@
@@ -280,7 +281,7 @@
${OUT}/halloc.o: ${MID}/halloc.c
@echo 18 making ${OUT}/halloc.o from ${MID}/halloc.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/halloc.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/halloc.c )
@
@@ -309,7 +310,7 @@
${OUT}/openpty.o: ${MID}/openpty.c
@echo 21 making ${OUT}/openpty.o from ${MID}/openpty.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/openpty.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/openpty.c )
@
@@ -338,7 +339,7 @@
${OUT}/pixmap.o: ${MID}/pixmap.c
@echo 24 making ${OUT}/pixmap.o from ${MID}/pixmap.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/pixmap.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/pixmap.c )
@
@@ -367,7 +368,7 @@
${OUT}/prt.o: ${MID}/prt.c
@echo 27 making ${OUT}/prt.o from ${MID}/prt.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/prt.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/prt.c )
@
@@ -401,7 +402,7 @@
${OUT}/sockio-c.o: ${MID}/sockio-c.c
@echo 30 making ${OUT}/sockio-c.o from ${MID}/sockio-c.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/sockio-c.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/sockio-c.c )
@
@@ -430,7 +431,7 @@
${OUT}/spadcolors.o: ${MID}/spadcolors.c
@echo 33 making ${OUT}/spadcolors.o from ${MID}/spadcolors.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/spadcolors.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/spadcolors.c )
@
@@ -460,7 +461,7 @@
${OUT}/util.o: ${MID}/util.c
@echo 36 making ${OUT}/util.o from ${MID}/util.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/util.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/util.c )
@
@@ -489,7 +490,7 @@
${OUT}/wct.o: ${MID}/wct.c
@echo 39 making ${OUT}/wct.o from ${MID}/wct.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/wct.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/wct.c )
@
@@ -518,7 +519,7 @@
${OUT}/XDither.o: ${MID}/XDither.c
@echo 42 making ${OUT}/XDither.o from ${MID}/XDither.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/XDither.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/XDither.c )
@
@@ -547,7 +548,7 @@
${OUT}/XShade.o: ${MID}/XShade.c
@echo 45 making ${OUT}/XShade.o from ${MID}/XShade.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/XShade.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/XShade.c )
@
@@ -576,7 +577,7 @@
${OUT}/XSpadFill.o: ${MID}/XSpadFill.c
@echo 48 making ${OUT}/XSpadFill.o from ${MID}/XSpadFill.c
@( cd ${OUT} ; \
- gcc -c -I${INC} ${MID}/XSpadFill.c )
+ gcc -c -D${PLF} -I${INC} ${MID}/XSpadFill.c )
@
Here are some preliminary patches to the C code that
we can compile under Windows.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/src/lib/bsdsignal.c.pamphlet axiom/src/lib/bsdsignal.c.pamphlet
--- axiom-save/src/lib/bsdsignal.c.pamphlet Fri Oct 24 00:48:35 2003
+++ axiom/src/lib/bsdsignal.c.pamphlet Thu Oct 23 20:13:46 2003
@@ -44,6 +44,9 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@
+\section{Windows}
+The signal function is not available under Windows.
+
<<*>>=
<<license>>
@@ -64,6 +67,9 @@
bsdSignal(int sig,SignalHandlerFunc action,int restartSystemCall)
#endif
{
+#if defined(MSYSplatform)
+ return (SignalHandlerFunc) -1;
+#else
struct sigaction in,out;
in.sa_handler = action;
/* handler is reinstalled - calls are restarted if restartSystemCall */
@@ -81,6 +87,7 @@
return (sigaction(sig, &in, &out) ? (SignalHandlerFunc) -1 :
(SignalHandlerFunc) out.sa_handler);
+#endif
}
@
\eject
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/src/lib/cfuns-c.c.pamphlet axiom/src/lib/cfuns-c.c.pamphlet
--- axiom-save/src/lib/cfuns-c.c.pamphlet Fri Oct 24 00:48:35 2003
+++ axiom/src/lib/cfuns-c.c.pamphlet Thu Oct 23 22:05:52 2003
@@ -168,23 +168,29 @@
if (geteuid() == buf.st_uid) {
return (2 * ((buf.st_mode & S_IWUSR) != 0));
}
+#if defined(MSYSplatform)
+#else
else if (getegid() == buf.st_gid) {
return (2 * ((buf.st_mode & S_IWGRP) != 0));
}
else {
return (2 * ((buf.st_mode & S_IWOTH) != 0));
}
+#endif
}
}
else if (geteuid() == buf.st_uid) {
return ((buf.st_mode & S_IWUSR) != 0);
}
+#if defined(MSYSplatform)
+#else
else if (getegid() == buf.st_gid) {
return ((buf.st_mode & S_IWGRP) != 0);
}
else {
return ((buf.st_mode & S_IWOTH) != 0);
}
+#endif
}
@@ -206,12 +212,15 @@
else if (geteuid() == buf.st_uid) {
return ((buf.st_mode & S_IREAD) != 0);
}
+#if defined(MSYSplatform)
+#else
else if (getegid() == buf.st_gid) {
return ((buf.st_mode & S_IRGRP) != 0);
}
else {
return ((buf.st_mode & S_IROTH) != 0);
}
+#endif
}
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/src/lib/fnct_key.c.pamphlet axiom/src/lib/fnct_key.c.pamphlet
--- axiom-save/src/lib/fnct_key.c.pamphlet Fri Oct 24 00:48:35 2003
+++ axiom/src/lib/fnct_key.c.pamphlet Thu Oct 23 20:42:02 2003
@@ -44,9 +44,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@
+\section{Windows}
+These functions are not implemented in Windows.
+
<<*>>=
<<license>>
+#if defined(MSYSplatform)
+#else
#include "useproto.h"
#include <unistd.h>
@@ -83,7 +88,7 @@
static char *defaulteditor = "clefedit";
char editorfilename[100];
-
+#endif
/*
* The following function environment variable clef editor. The command
@@ -97,6 +102,8 @@
set_editor_key(void )
#endif
{
+#if defined(MSYSplatform)
+#else
int pid;
sprintf(editorfilename, "/tmp/clef%d", pid = getpid());
@@ -105,6 +112,7 @@
(function_key[12]).type = SPECIAL;
(function_key[12]).str = defaulteditor;
}
+#endif
}
@@ -121,6 +129,8 @@
If found it gets the key bindings from within
*****/
{
+#if defined(MSYSplatform)
+#else
char *HOME, path[1024], string[1024];
int key;
int fd;
@@ -187,6 +197,7 @@
* Now set the editor function key
*/
set_editor_key();
+#endif
}
@@ -201,7 +212,8 @@
get_key(int fd,char * ty)
#endif
{
-
+#if defined(MSYSplatform)
+#else
/*
* Determines the key number being mapped, and whether it is immediate
or
* delay. It reurns the key value, and modifies the parameter type
@@ -221,6 +233,7 @@
}
}
else
+#endif
return 0;
}
@@ -233,6 +246,9 @@
get_str(int fd,char * string)
#endif
{
+#if defined(MSYSplatform)
+ return 0;
+#else
/** Gets the key mapping being bound **/
char c;
int count = 0;
@@ -249,6 +265,7 @@
}
*trace = '\0';
return count;
+#endif
}
void
@@ -270,6 +287,8 @@
handle_function_key(int key,int chann)
#endif
{
+#if defined(MSYSplatform)
+#else
/** this procedure simply adds the string specified by the function key
to the buffer ****/
int count, fd;
@@ -391,7 +410,7 @@
break;
}
return;
-
+#endif
}
@
\eject
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/src/lib/pixmap.c.pamphlet axiom/src/lib/pixmap.c.pamphlet
--- axiom-save/src/lib/pixmap.c.pamphlet Fri Oct 24 00:48:35 2003
+++ axiom/src/lib/pixmap.c.pamphlet Thu Oct 23 21:07:00 2003
@@ -44,28 +44,30 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@
+/section{Windows}
+The function pixmap are not available under Windows/MSYS.
+@
<<*>>=
<<license>>
-
#include "useproto.h"
-
+#if defined(MSYSplatform)
+#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
-#include <stdlib.h>
-#include <stdio.h>
#include <netinet/in.h>
-
-#define yes 1
-#define no 0
-
-
-
#include "spadcolors.h"
#include "pixmap.H1"
#include "halloc.H1"
#include "spadcolors.H1"
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+
+#define yes 1
+#define no 0
+
@@ -303,9 +305,9 @@
#else /*OLD*/
-
+#if defined(MSYSplatform)
+#else
#include "xpm.h"
-
int
#ifdef _NO_PROTO
read_pixmap_file(display, screen, filename, xi, width, height)
@@ -369,11 +371,11 @@
xi = XGetImage(dsp, wid, x, y, width, height, AllPlanes, ZPixmap);
if (xi==0) return ;
status=XpmWriteFileFromImage(dsp,fn,xi,0,0);
-
}
#endif
+#endif
Here is the mingw.defs patch that is referred to above.
diff -Naur -xint -x*.dvi -xgcl-2.6.1 -xCVS -xbin -xobj -xnoweb -xgcldir
axiom-save/zips/gcl-2.6.1.h.mingw.defs.patch
axiom/zips/gcl-2.6.1.h.mingw.defs.patch
--- axiom-save/zips/gcl-2.6.1.h.mingw.defs.patch Wed Dec 31 19:00:00
1969
+++ axiom/zips/gcl-2.6.1.h.mingw.defs.patch Fri Oct 24 00:11:42 2003
@@ -0,0 +1,12 @@
+--- mingw.defs Thu Oct 23 23:21:39 2003
++++ mingw.defs-new Thu Oct 23 23:26:46 2003
+@@ -5,7 +5,8 @@
+ #
+
+ SHELL = sh
+-
++EXTRAS = ${OBJ}/${SYS}/lib/cfuns-c.o
++# ${OBJ}/${SYS}/lib/sockio-c.o
+ OFLAG = -O
+ LIBS += -lwsock32
+ LIBC =
------------------------