axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Compiling Axiom on FreeBSD - patches


From: Mark Murray
Subject: [Axiom-developer] Compiling Axiom on FreeBSD - patches
Date: Sun, 09 Nov 2003 22:29:29 +0000

Hi

Enclosed are patches to compile Axiom on FreeBSD. The result works,
but hasn't been extensively tested.

NOTES -

I'm using a local port of GCL to do the build. In the lsp/ dir, I
create a symlink to where the GCL sources are checked out (a hacked
GCL HEAD). The symlink is called GCL-2.7.0 for reasons that even I
can't remember. ;-)

FreeBSD uses "Berkely make", or pmake, NOT GNU make, so the GNU
make port is used to do the build, so makefiles must have "make foo
..." replaced with "${MAKE} foo ..." to pick this up.  This must
also be done to noweb, or FreeBSD's noweb port needs to be installed.

The FreeBSD build is kicked off with
$ cd <ToWhereAxiomIs>
$ export AXIOM=`pwd`/mnt/freebsd
$ gmake GCLVERSION=GCL-2.7.0

Good Luck!

M
--
Mark Murray
iumop ap!sdn w,I idlaH
Index: Makefile
===================================================================
RCS file: /cvsroot/axiom/axiom/Makefile,v
retrieving revision 1.3
diff -u -d -r1.3 Makefile
--- Makefile    31 Oct 2003 11:42:57 -0000      1.3
+++ Makefile    9 Nov 2003 20:36:40 -0000
@@ -71,8 +73,9 @@
        @echo 78 installing Axiom in ${INSTALL}
        @mkdir -p ${INSTALL}
        @cp -pr ${MNT} ${INSTALL}
-       @echo AXIOM=${INSTALL}/mnt/${SYS} >${COMMAND}
-       @cat ${SRC}/etc/axiomcmd >>${COMMAND}
+       @echo '#!/bin/sh -' >${COMMAND}
+       @echo AXIOM=${INSTALL}/mnt/${SYS} >>${COMMAND}
+       @cat ${SRC}/etc/axiom >>${COMMAND}
        @chmod +x ${COMMAND}
        @echo 79 Axiom installation finished.
        @echo
Index: Makefile.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/Makefile.pamphlet,v
retrieving revision 1.12
diff -u -d -r1.12 Makefile.pamphlet
--- Makefile.pamphlet   31 Oct 2003 11:42:57 -0000      1.12
+++ Makefile.pamphlet   9 Nov 2003 20:36:44 -0000
@@ -236,11 +236,12 @@
        @mkdir -p ${MNT}/${SYS}/bin
        @( cd ${OBJ}/noweb ; \
        tar -zxf ${ZIPS}/noweb-2.10a.tgz ; \
+       cd ${OBJ}/noweb ; \
+       patch < ${ZIPS}/noweb.makefiles.patch ; \
        cd ${OBJ}/noweb/src ; \
-       ./awkname gawk ; \
+       ./awkname ${AWK} ; \
        cd ${OBJ}/noweb/src/c ; \
-       cp ${ZIPS}/noweb.modules.c.patch . ; \
-       patch <noweb.modules.c.patch ; \
+       patch < ${ZIPS}/noweb.modules.c.patch ; \
        cd ${OBJ}/noweb/src ; \
        ${MAKE} BIN=${MNT}/${SYS}/bin LIB=${MNT}/${SYS}/bin/lib \
                 MAN=${MNT}/${SYS}/bin/man \
@@ -271,7 +272,7 @@
        @( cd ${OBJ}/noweb ; \
        tar -zxf ${ZIPS}/noweb-2.10a.tgz ; \
        cd ${OBJ}/noweb/src ; \
-       ./awkname gawk ; \
+       ./awkname ${AWK} ; \
        cd ${OBJ}/noweb/src/c ; \
        cp ${ZIPS}/noweb.modules.c.patch . ; \
        patch <noweb.modules.c.patch ; \
@@ -368,8 +369,9 @@
        @echo 78 installing Axiom in ${INSTALL}
        @mkdir -p ${INSTALL}
        @cp -pr ${MNT} ${INSTALL}
-       @echo AXIOM=${INSTALL}/mnt/${SYS} >${COMMAND}
-       @cat ${SRC}/etc/axiomcmd >>${COMMAND}
+       @echo '#!/bin/sh -' >${COMMAND}
+       @echo AXIOM=${INSTALL}/mnt/${SYS} >>${COMMAND}
+       @cat ${SRC}/etc/axiom >>${COMMAND}
        @chmod +x ${COMMAND}
        @echo 79 Axiom installation finished.
        @echo
@@ -778,6 +780,51 @@
        @echo 42 Makefile.irixmips3 called
        @echo 43 Environment : ${ENV} 
        @echo 44 finished system build on `date` | tee >lastBuildDate
+
+<<rootdirs>>
+<<noweb>>
+<<literate commands>>
+<<srcsetup>>
+<<src>>
+<<lsp>>
+<<document>>
+<<clean>>
+
+@
+\subsection{Makefile.freebsd}
+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.freebsd>>=
+# System dependent Makefile for the freebsd platform
+# Platform variable
+PLF:=FREEBSDplatform
+# C compiler flags
+CCF:="-O -pipe -fno-strength-reduce -Wall -D_GNU_SOURCE -D${PLF} 
-I/usr/X11R6/include -I/usr/local/include"
+# Loader flags
+LDF:="-L/usr/X11R6/lib -L/usr/local/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.freebsd called
+       @echo 46 Environment : ${ENV} 
+       @echo 47 finished system build on `date` | tee >lastBuildDate
 
 <<rootdirs>>
 <<noweb>>
Index: lsp/Makefile.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/lsp/Makefile.pamphlet,v
retrieving revision 1.3
diff -u -d -r1.3 Makefile.pamphlet
--- lsp/Makefile.pamphlet       23 Oct 2003 11:21:21 -0000      1.3
+++ lsp/Makefile.pamphlet       9 Nov 2003 20:36:45 -0000
@@ -289,6 +289,84 @@
        @( cd ccl ; ${ENV} ${MAKE} clean )
 
 @
+\subsection{The GCL-2.7.0 stanza}
+\subsubsection{Configure and Make GCL}
+We enable several features of GCL. 
+The [[--enable-readline]] uses GNU readline for the prompts. 
+The [[--enable-maxpage]] is set to allow the image to grow 4 times what it 
would by default. 
+The [[--enable-vssize]] allows virtual stack to grow by twice the normal size. 
+The [[--enable-statsysbfd]] uses a static system bfd library for loading and
+relocating object files.
+<<gclConfigureMake270>>=
+       @(cd ${GCLVERSION} ; \
+       ${ENV} ./configure \
+               --prefix=/usr/local \
+               --enable-machine=FreeBSD \
+               --infodir=/usr/local/info \
+               --enable-info=/usr/local/info \
+               --enable-tkconfig=/usr/local/lib/tk8.4 \
+               --enable-tclconfig=/usr/local/lib/tcl8.4 \
+               --with-x \
+               --x-includes=/usr/X11R6/include \
+               --x-libraries=/usr/X11R6/lib \
+               --disable-dlopen \
+               --disable-dynsysbfd \
+               --disable-statsysbfd \
+               --disable-locbfd \
+               --enable-custreloc \
+               --enable-vssize=65536*2 \
+               --enable-readline \
+               --enable-maxpage=128*1024 \
+               i386-portbld-freebsd5.1 ; \
+       ${ENV} ${MAKE} ; \
+       cp unixport/saved_gcl ${OUT}/lisp )
+@
+GCL 2.7.0 changes are due to Mark R V Murray <address@hidden>
+The key problem to solve is that 2.7.0 may use the common lisp 2.0
+standard if it has been compiled with [[--with-ansi]]. Axiom builds
+GCL 2.7.0 without this option.  In Common Lisp 1.0 if you do
+(in-package 'foo) and the foo package does not exist it is created.
+In Common Lisp 2.0 if you do (in-package 'foo) and the foo package
+does not exist it is an error.  This is an incorrect fix in the
+long term. Axiom should be changed everywhere to conform to the
+common lisp 2.0 standard.
+
+This stanza will be written out when the GCLVERSION variable is
+``gcl-2.7.0''. It will overwrite the default version. See the 
+top level Makefile.pamphlet.
+<<gcl-2.7.0>>=
+# gcl version 2.7.0
+OUT=${OBJ}/${SYS}/bin
+
+all:
+       @echo 14 building ${LSP} ${GCLVERSION}
+
+gcldir: 
+       @echo 15 building ${GCLVERSION}
+       @touch ${OBJ}/${SYS}/lib/cfuns-c.ini
+       @touch ${OBJ}/${SYS}/lib/sockio-c.ini
+<<gclConfigureMake270>>
+       @echo 13 finished system build on `date` | tee >gcldir
+
+ccldir: ${LSP}/ccl/Makefile
+       @echo 22 building CCL
+       @mkdir -p ${INT}/ccl
+       @mkdir -p ${OBJ}/${SYS}/ccl
+       @( cd ccl ; ${ENV} ${MAKE} )
+
+${LSP}/ccl/Makefile: ${LSP}/ccl/Makefile.pamphlet
+       @echo 23 making ${LSP}/ccl/Makefile from ${LSP}/ccl/Makefile.pamphlet
+       @( cd ccl ; ${SPADBIN}/document ${NOISE} Makefile )
+
+document:
+       @echo 24 making docs in ${LSP}
+       @mkdir -p ${INT}/doc/lsp/ccl
+       @( cd ccl ; ${ENV} ${MAKE} document )
+
+clean:
+       @echo 25 cleaning ${LSP}/ccl
+       @( cd ccl ; ${ENV} ${MAKE} clean )
+@
 \section{Gnu Common Lisp 2.5}
 GCL 2.5 requires a different Makefile. In particular, GCL 2.5
 has a different method of building the lisp image. And, just to
Index: src/algebra/Makefile.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/algebra/Makefile.pamphlet,v
retrieving revision 1.4
diff -u -d -r1.4 Makefile.pamphlet
--- src/algebra/Makefile.pamphlet       29 Oct 2003 13:01:11 -0000      1.4
+++ src/algebra/Makefile.pamphlet       9 Nov 2003 20:38:17 -0000
@@ -32499,7 +32499,7 @@
 #all:  ${SUBPART}
 
 everything: check lib db cmd gloss
-       @ echo invoking make in `pwd` with parms:
+       @ echo invoking ${MAKE} in `pwd` with parms:
        @ echo SYS= ${SYS} LSP= ${LSP} PART= ${PART} SUBPART= ${SUBPART}
        @ echo SPAD= ${SPAD} SRC= ${SRC} INT= ${INT}
        @ echo OBJ= ${OBJ} MNT= ${MNT} O=${O} LISP=${LISP} BYE=${BYE}
Index: src/boot/Makefile.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/boot/Makefile.pamphlet,v
retrieving revision 1.1
diff -u -d -r1.1 Makefile.pamphlet
--- src/boot/Makefile.pamphlet  28 Aug 2003 12:15:28 -0000      1.1
+++ src/boot/Makefile.pamphlet  9 Nov 2003 20:38:29 -0000
@@ -1565,7 +1565,7 @@
 # this stanza will create the final bootsys image
  
 ${SAVESYS}:    ${OBJS} ${LOADSYS}
-       @ echo 44 invoking make in `pwd` with parms:
+       @ echo 44 invoking ${MAKE} in `pwd` with parms:
        @ echo SYS= ${SYS} 
        @ echo LSP= ${LSP} 
        @ echo PART= ${PART} 
Index: src/etc/axiom
===================================================================
RCS file: /cvsroot/axiom/axiom/src/etc/axiom,v
retrieving revision 1.1
diff -u -d -r1.1 axiom
--- src/etc/axiom       31 Oct 2003 11:42:58 -0000      1.1
+++ src/etc/axiom       9 Nov 2003 20:38:29 -0000
@@ -1,3 +1 @@
 $AXIOM/bin/clef -e $AXIOM/bin/AXIOMsys
-
-
Index: src/interp/Makefile.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/interp/Makefile.pamphlet,v
retrieving revision 1.6
diff -u -d -r1.6 Makefile.pamphlet
--- src/interp/Makefile.pamphlet        31 Oct 2003 11:42:58 -0000      1.6
+++ src/interp/Makefile.pamphlet        9 Nov 2003 20:38:55 -0000
@@ -506,9 +506,9 @@
 gives the path to the version of AKCL. Now that the system is running
 on GCL this variable has been renamed to GCLDIR. This cannot be eliminated
 entirely because the system uses this variable to look up a file 
-called collectfn.lsp which is part of the GCL distribution. This
+called gcl_collectfn.lsp which is part of the GCL distribution. This
 file lookup is in conditional lisp code so other lisps will not 
-see the file load. The collectfn.lsp code is used by GCL to generate
+see the file load. The gcl_collectfn.lsp code is used by GCL to generate
 the ``.fn'' files which are used to optimize function calling.
 \end{verbatim}
 <<depsys>>=
@@ -583,7 +583,7 @@
                ${MNT}/${SYS}/algebra/exposed.${O} \
                ${SRC}/doc/msgs/s2-us.msgs \
                ${INT}/algebra/warm.data
-       @ echo 5 invoking make in `pwd` with parms:
+       @ echo 5 invoking ${MAKE} in `pwd` with parms:
        @ echo SYS= ${SYS} 
        @ echo LSP= ${LSP} 
        @ echo PART= ${PART} 
Index: src/interp/util.lisp.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/interp/util.lisp.pamphlet,v
retrieving revision 1.2
diff -u -d -r1.2 util.lisp.pamphlet
--- src/interp/util.lisp.pamphlet       9 Oct 2003 10:46:23 -0000       1.2
+++ src/interp/util.lisp.pamphlet       9 Nov 2003 20:39:04 -0000
@@ -68,10 +68,10 @@
   ;; perform system initializations for building a starter system
   (init-memory-config)
   #+:AKCL
-  (let ((collectfn (concatenate 'string (string lsp) "/cmpnew/collectfn")))
-   (unless (probe-file (concatenate 'string collectfn ".o"))
-     (compile-file collectfn))
-   (load collectfn)
+  (let ((gcl_collectfn (concatenate 'string (string lsp) 
"/cmpnew/gcl_collectfn")))
+   (unless (probe-file (concatenate 'string gcl_collectfn ".o"))
+     (compile-file gcl_collectfn))
+   (load gcl_collectfn)
    (compiler::emit-fn t)
    (mapcar
      #'load
Index: src/lib/XDither.c.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/lib/XDither.c.pamphlet,v
retrieving revision 1.2
diff -u -d -r1.2 XDither.c.pamphlet
--- src/lib/XDither.c.pamphlet  9 Oct 2003 10:46:28 -0000       1.2
+++ src/lib/XDither.c.pamphlet  9 Nov 2003 20:39:04 -0000
@@ -51,7 +51,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <malloc.h>
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
Index: src/lib/XShade.c.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/lib/XShade.c.pamphlet,v
retrieving revision 1.2
diff -u -d -r1.2 XShade.c.pamphlet
--- src/lib/XShade.c.pamphlet   9 Oct 2003 10:46:28 -0000       1.2
+++ src/lib/XShade.c.pamphlet   9 Nov 2003 20:39:05 -0000
@@ -50,7 +50,6 @@
 #include "useproto.h"
 
 #include <stdio.h>
-#include <malloc.h>
 #include <stdlib.h>
 
 #include <X11/Xlib.h>
Index: src/lib/cfuns-c.c.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/lib/cfuns-c.c.pamphlet,v
retrieving revision 1.2
diff -u -d -r1.2 cfuns-c.c.pamphlet
--- src/lib/cfuns-c.c.pamphlet  9 Oct 2003 10:46:28 -0000       1.2
+++ src/lib/cfuns-c.c.pamphlet  9 Nov 2003 20:39:05 -0000
@@ -52,7 +52,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
Index: src/lib/fnct_key.c.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/lib/fnct_key.c.pamphlet,v
retrieving revision 1.2
diff -u -d -r1.2 fnct_key.c.pamphlet
--- src/lib/fnct_key.c.pamphlet 9 Oct 2003 10:46:29 -0000       1.2
+++ src/lib/fnct_key.c.pamphlet 9 Nov 2003 20:39:06 -0000
@@ -352,7 +352,7 @@
                 close(fd);
             }
         }
-        bsdSignal(SIGCLD, null_fnct,RestartSystemCalls);
+        bsdSignal(SIGCHLD, null_fnct,RestartSystemCalls);
         switch (id = fork()) {
           case -1:
             perror("Special key");
Index: src/lib/openpty.c.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/lib/openpty.c.pamphlet,v
retrieving revision 1.4
diff -u -d -r1.4 openpty.c.pamphlet
--- src/lib/openpty.c.pamphlet  31 Oct 2003 11:42:58 -0000      1.4
+++ src/lib/openpty.c.pamphlet  9 Nov 2003 20:39:07 -0000
@@ -92,7 +92,7 @@
 #endif
 
 {
-#if defined(SUNplatform) || defined (HP9platform) || defined(LINUXplatform) || 
defined(RTplatform) ||defined(AIX370platform) 
+#if defined(SUNplatform) || defined (HP9platform) || defined(LINUXplatform) || 
defined(RTplatform) ||defined(AIX370platform) || defined(FREEBSDplatform)
   int looking = 1, i;
   int oflag = O_RDWR;                  /* flag for opening the pty */
   
@@ -204,7 +204,7 @@
        sprintf(serv, "/dev/ttyp%02x", channelNo);
        channelNo++;
 #endif
-#if defined(SUNplatform) || defined (HP9platform) || defined(linux) 
+#if defined(SUNplatform) || defined (HP9platform) || defined(FREEBSDplatform) 
|| defined(linux) 
        static int channelNo = 0;
        static char group[] = "pqrstuvwxyzPQRST";
        static int groupNo = 0;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]