axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] Axiom/GCL on windows


From: Page, Bill
Subject: RE: [Axiom-developer] Axiom/GCL on windows
Date: Fri, 29 Dec 2006 17:12:53 -0500

On December 26, 2006 2:44 AM Gabriel Dos Reis wrote:
> Bill Page writes:
> ... 
> | That's excellent! Let me know how/if I can help. One thing I
> | plan to do after you commit the recent change for the SPAD
> | variable is to diff against axiom--windows--1. There were
> | several patches to Axiom that as far as I know were never
> | incorporated into the axiom--main--1 branch from which Axiom
> | silver and build-improvements were cloned, although most of
> | these might already be obsoleted by build-improvements. The
> | most critical are probably some unix system dependencies such
> | as 'rm' and 'mv' commands which should really be implemented
> | in a more portable lisp manner.
> 
> Bill --
> 
>    Let me know when you get a chance to have a shot at this diff.
> 

Here is the list of patches that I was able to isolate between
axiom--windows--1 and the current build-improvements. These patches
where first applied to the axiom--windows--1 branch by Mike Thomas.
I think they probably represents the minimum changes necessary to
allow AXIOMsys to run on natively on Windows outside of an MSYS
shell.

-------

diff -r d4e8f2a7df42 src/interp/cfuns.lisp.pamphlet
--- a/src/interp/cfuns.lisp.pamphlet    Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/cfuns.lisp.pamphlet    Fri Dec 29 16:15:41 2006 -0500
@@ -58,12 +58,23 @@
   (system:define-foreign-function :c '|copyEnvValue| :fixnum)
   )
 
+;; Staged directoryp to deal with Windows/Unix stat differences.
 #+KCL
 (progn
-  (defentry |directoryp| (string)        (int "directoryp"))
+  (defentry |directoryp-c| (string)      (int "directoryp"))
+  (defentry |makedir-c| (string)           (int "makedir"))
   (defentry |writeablep| (string)        (int "writeablep"))
   (defentry |findString| (string string) (int "findString"))
   )
+
+#+KCL
+(defun |directoryp| (fn)
+  (cond ((not (probe-file fn)) -1)
+        ((|directoryp-c| fn) 1)
+        (t 0)))
+#+KCL
+(defun |makedir| (directory-name)
+  (|makedir-c| directory-name))
 
 #+:CCL
 (defun |directoryp| (fn)
diff -r d4e8f2a7df42 src/interp/construc.lisp.pamphlet
--- a/src/interp/construc.lisp.pamphlet Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/construc.lisp.pamphlet Fri Dec 29 16:15:41 2006 -0500
@@ -147,8 +147,8 @@
    (concatenate 'string $spadroot "/../../int/algebra/" (string name)
".NRLIB/code.lsp")))
  (let (masterindex blanks index newindex (space (* 22 (length
innames))))
  (setq newindex space)
- (system::system (concatenate 'string "rm -r " (libname outname)))
- (system::system (concatenate 'string "mkdir " (libname outname)))
+ (delete-file (libname outname))
+ (ensure-directories-exist (libname outname))
  (with-open-file (out (indexname outname) :direction :output)
   (setq blanks (make-string space :initial-element #\ ))
   (write  blanks :stream out)       ; reserve space for the masterindex
@@ -171,10 +171,11 @@
      (write alist :stream out :level nil :length nil :escape t)))))
   (file-position out 0)
   (print masterindex out))
+  (with-open-file (out (lspname outname) :direction :output)
   (dolist (inname innames)
-   (format t "cat ~a >>~a~%" (fullcode inname) (lspname outname))
-   (system::system 
-    (format nil "cat ~a >>~a" (fullcode inname) (lspname outname)))))))
+     (format t "Appending file ~a to ~a~%" (fullcode inname) (lspname
outname))
+     (with-open-file (in (fullcode inname))
+      (si::copy-stream in out)))))))
 
 
 (defun |pathname| (p)
diff -r d4e8f2a7df42 src/interp/daase.lisp.pamphlet
--- a/src/interp/daase.lisp.pamphlet    Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/daase.lisp.pamphlet    Fri Dec 29 16:15:41 2006 -0500
@@ -1246,7 +1246,7 @@ database.
     (setq filename  (concatenate 'string daase "/algebra/" name))
     (format t "   Using local database ~a.." filename))
    (setq filename (concatenate 'string $spadroot "/algebra/" name)))
-  (when erase? (system::system (concatenate 'string "rm -f "
filename)))
+  (when erase? (delete-file filename))
   filename))
 
 ;; rewrite this so it works in mnt
diff -r d4e8f2a7df42 src/interp/i-syscmd.boot.pamphlet
--- a/src/interp/i-syscmd.boot.pamphlet Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/i-syscmd.boot.pamphlet Fri Dec 29 16:23:12 2006 -0500
@@ -834,9 +834,9 @@ withAsharpCmd args ==
 --% )copyright -- display copyright notice
 
 summary l ==
- OBEY STRCONC ('"cat ",getEnv('"AXIOM"),'"/lib/summary")
+ TYPE_-CONTENTS_-OF_-FILE STRCONC (getEnv('"AXIOM"),'"/lib/summary")
 copyright () ==
- OBEY STRCONC ('"cat ",getEnv('"AXIOM"),'"/lib/copyright")
+ TYPE_-CONTENTS_-OF_-FILE STRCONC (getEnv('"AXIOM"),'"/lib/copyright")
 
 --% )credits -- display credit list
 
diff -r d4e8f2a7df42 src/interp/nlib.lisp.pamphlet
--- a/src/interp/nlib.lisp.pamphlet     Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/nlib.lisp.pamphlet     Fri Dec 29 16:15:41 2006 -0500
@@ -94,6 +94,9 @@ but has been changed to read:
              optionlist)))
 
 (defun directory? (filename) (|directoryp| filename))
+;makedir (fname) fname is a directory name.
+#+:AKCL(defun makedir (fname) (|makedir| fname))
+
 
 ;; (RDEFIOSTREAM ((MODE . IO) (FILE fn ft dir))) IO is I,O,INPUT,OUTPUT
 #+:AKCL
@@ -240,11 +243,6 @@ but has been changed to read:
     (file-position stream :end)
     (write-indextable indextable stream)))
 
-;makedir (fname) fname is a directory name.
-#+:AKCL
-(defun makedir (fname)
-  (system (concat "mkdir " fname)))
-
 ;; (RREAD key rstream)
 (defun rread (key rstream &optional (error-val nil error-val-p))
   (if (equal (libstream-mode rstream) 'output) (error "not input
stream"))
diff -r d4e8f2a7df42 src/interp/sys-pkg.lisp.pamphlet
--- a/src/interp/sys-pkg.lisp.pamphlet  Tue Dec 26 10:35:30 2006 +0000
+++ b/src/interp/sys-pkg.lisp.pamphlet  Fri Dec 29 16:15:41 2006 -0500
@@ -114,7 +114,7 @@ provides support for compiler code.
 (lisp:export
     '(BOOT::|$FormalMapVariableList| BOOT::|$userModemaps|
         boot::restart boot::$IEEE
-        BOOT::|directoryp| boot::help boot::|version| boot::|pp|
+        BOOT::|directoryp| BOOT::|makedir| boot::help boot::|version|
boot::|pp|
         BOOT::POP-STACK-4 BOOT::|$BasicDomains| BOOT::|$DomainFrame|
         BOOT::|$SideEffectFreeFunctionList|
         BOOT::ATOM2STRING BOOT::|$DoubleQuote| BOOT::|$genSDVar|
@@ -220,7 +220,7 @@ provides support for compiler code.
         BOOT::GETTAIL BOOT::|QuotientField| BOOT::CURRENT-TOKEN
         BOOT::|$suffix| BOOT::|$VariableCount| BOOT::COMPARE
         LISP:SEQUENCE BOOT::|$Exit| BOOT::BOOT-EQUAL BOOT::LT
-        VMLISP::OBEY BOOT::|UnSizedBox| BOOT::|Integer| BOOT::|Nud|
+        VMLISP::OBEY BOOT::TYPE-CONTENTS-OF-FILE BOOT::|UnSizedBox|
BOOT::|Integer| BOOT::|Nud|
         BOOT::IOCLEAR BOOT::|$BigFloatOpt| BOOT::|$EmptyEnvironment|
         BOOT::|$forceDatabaseUpdate| BOOT::$LINESTACK BOOT::ULCASEFG
         BOOT::|$Boolean| BOOT::|$clamList| BOOT::COLLECT
@@ -330,7 +330,7 @@ provides support for compiler code.
 <<GCL.DEFINE-MACRO>>
 <<GCL.MEMQ>>
 <<GCL.PNAME>>
-         BOOT:|directoryp|))
+         BOOT:|directoryp| BOOT:|makedir|))
 (lisp:export
     '(VMLISP::SINTP VMLISP::$FCOPY 
 <<GCL.DEFINE-MACRO>>
@@ -338,7 +338,7 @@ provides support for compiler code.
 <<GCL.PNAME>>
          VMLISP::PUT
         VMLISP::QVELT-1 VMLISP::QSETVELT-1 vmlisp::throw-protect
-        VMLISP::|directoryp| VMLISP::EQCAR
+        VMLISP::|directoryp| VMLISP::|makedir| VMLISP::EQCAR
         VMLISP::DEFIOSTREAM VMLISP::RDEFIOSTREAM VMLISP::MLAMBDA
         VMLISP::QSLESSP VMLISP::QSDIFFERENCE VMLISP::QSQUOTIENT
         VMLISP::ERROROUTSTREAM VMLISP::CREATE-SBC VMLISP::LASTPAIR
@@ -455,7 +455,7 @@ provides support for compiler code.
 (lisp:shadow '(BOOT::MAP))
 (lisp:import
     '(VMLISP::ERROROUTSTREAM LISP:COUNT VMLISP::NE VMLISP::FLUID
-        LISP:SEQUENCE VMLISP::OBEY LISP::NUMBER VMLISP::|union|
+        LISP:SEQUENCE VMLISP::OBEY BOOT::TYPE-CONTENTS-OF-FILE
LISP::NUMBER VMLISP::|union|
         LISP:STEP VMLISP::OPTIONLIST VMLISP::EXIT VMLISP::LEXGREATERP))
 (lisp:import '(vmlisp::make-input-filename))
 (lisp:import '(vmlisp::libstream-dirname))


---------

There are still some other places in the source that make
non-portable assumptions about the shell such as those
listed below. In general these will all eventually have
to be replaced with their portable lisp equivalents as in
the patches above.

$ egrep -e '(OBEY|"rm |"mv |"cat |"awk )' *.pamphlet
as.boot.pamphlet:  OBEY '"rm -f temp.text"
as.boot.pamphlet:  OBEY '"ls as/*.asy > temp.text"
bookvol5.pamphlet:  --OBEY STRCONC('"rm -rf ", file)
br-data.boot.pamphlet:  OBEY
br-data.boot.pamphlet:  --OBEY '"mv libdb.text olibdb.text"
br-data.boot.pamphlet:  OBEY '"rm olibdb.text"
br-data.boot.pamphlet:  OBEY STRCONC('"rm -f ",keypath)
br-data.boot.pamphlet:  OBEY STRCONC('"rm -f ",htpath)
br-data.boot.pamphlet:  obey '"rm libdb.text"
br-saturn.boot.pamphlet:--    OBEY  '"cat /tmp/sat.text"
br-saturn.boot.pamphlet:--OBEY '"rm libdb.text"
br-saturn.boot.pamphlet:  OBEY STRCONC('"sort -f _"",sin,'".text_" >
_"", sout, '".text_"")
br-saturn.boot.pamphlet:  OBEY STRCONC('"rm ", sin, '".text")
br-saturn.boot.pamphlet:--  --obey STRCONC('"mv ", before, '" ", after)
br-saturn.boot.pamphlet:--  obey STRCONC('"rm ",fn)
br-search.boot.pamphlet:  OBEY x
br-search.boot.pamphlet:  obey STRCONC('"rm -f ", pathname)
c-doc.boot.pamphlet:  OBEY '"rm docreport.input"
c-doc.boot.pamphlet:  OBEY STRCONC('"echo _")bo
setOutStream('",STRINGIMAGE nam,'")_" > temp.input")
c-doc.boot.pamphlet:  OBEY '"cat docreport.header temp.input >
docreport.input"
c-doc.boot.pamphlet:  OBEY STRCONC('"awk '/",STRINGIMAGE nam,'"/
{printf(_")co %s.spad\n_",$2)}' whofiles > temp.input")
c-doc.boot.pamphlet:  OBEY '"cat docreport.input temp.input >
temp1.input"
c-doc.boot.pamphlet:  OBEY '"cat temp1.input docreport.trailer >
docreport.input"
c-doc.boot.pamphlet:  OBEY '"rm temp.input"
c-doc.boot.pamphlet:  OBEY '"rm temp1.input"
c-doc.boot.pamphlet:  OBEY STRCONC('"awk '$2 ==
",quoteChar,filename,quoteChar,'" {print $1}' whofiles > /tmp/temp")
compat.boot.pamphlet:  sayMessage ["   Return Code = ", OBEY string]
compat.boot.pamphlet:    OBEY STRCONC('"notepad ", namestring pathname
file)
compat.boot.pamphlet:  OBEY STRCONC('"$AXIOM/lib/SPADEDIT ",namestring
pathname file)
daase.lisp.pamphlet:;;  (when erase? (system::system (concatenate
'string "rm -f " filename)))
debug.lisp.pamphlet:              (RETURN (OBEY "EXEC SPADEDIT /C
TELL")))
debug.lisp.pamphlet:          (OBEY
debug.lisp.pamphlet:      (OBEY "EXEC NORMEDIT TRACE TELL")
debug.lisp.pamphlet:      (if (member '? L :test #'eq) (RETURN (OBEY
"EXEC NORMEDIT TRACE TELL")))
debug.lisp.pamphlet:            (RETURN (OBEY (if (EQ (SYSID) 1)
debug.lisp.pamphlet:       ((member '? L :test #'eq) (OBEY "EXEC
NORMEDIT EMBED TELL"))
fortcall.boot.pamphlet:  -- SYSTEM STRCONC("rm -f ",tmpFile1,"
",tmpFile2)
fortcall.boot.pamphlet:  -- if objFiles then SYSTEM STRCONC("rm -f
",addSpaces objFiles)
g-util.boot.pamphlet:  OBEY
g-util.boot.pamphlet:;  OBEY
g-util.boot.pamphlet:(DEFUN |update| NIL (PROGN (OBEY (STRCONC
(MAKESTRING "SPADEDIT ") (STRINGIMAGE /VERSION) (MAKESTRING " ")
(STRINGIMAGE /WSNAME) (MAKESTRING " A"))) (/UPDATE))) 
ht-root.boot.pamphlet:  -- OBEY STRCONC('"rm -f ", pathname)
ht-root.boot.pamphlet:  OBEY STRCONC('"$AXIOM/lib/hthits",'" _"",s,'"_"
",source,'" > ",target)
i-syscmd.boot.pamphlet:    rc := OBEY command
i-syscmd.boot.pamphlet:        rc   := OBEY cmd
i-syscmd.boot.pamphlet:    rc := OBEY cmd
i-syscmd.boot.pamphlet:    OBEY STRCONC('"$AXIOM/lib/SPADEDIT
",namestring helpFile)
i-syscmd.boot.pamphlet:  OBEY command
nlib.lisp.pamphlet:        (si::system (format nil "mv ~S ~S~%" 
nlib.lisp.pamphlet:   (system (concat "rm  -r " dirname)))
obey.lisp.pamphlet:(defun OBEY (S)
spad.lisp.pamphlet:(defun CLEARDATABASE () (OBEY "ERASE MODEMAP
DATABASE"))
spad.lisp.pamphlet:  (OBEY (STRCONC "ERASE " (STRINGIMAGE FN) " "
(STRINGIMAGE FT))))
spad.lisp.pamphlet:(defun CPSAY (X) (let (n) (if (EQ 0 (setq N (OBEY
X))) NIL (PRINT N))))
spad.lisp.pamphlet:             (OBEY (STRCONC "ERASE " (PNAME (CAR
/EDITFILE)) " NBOOT E1"))
sys-pkg.lisp.pamphlet:   LISP:SEQUENCE VMLISP::OBEY LISP:NUMBER
VMLISP::|union|
sys-pkg.lisp.pamphlet:   VMLISP::OBEY BOOT::TYPE-CONTENTS-OF-FILE
BOOT::|UnSizedBox| BOOT::|Integer| BOOT::|Nud|
sys-pkg.lisp.pamphlet:   VMLISP::CHANGELENGTH VMLISP::ECQ VMLISP::OBEY
VMLISP::QASSQ
sys-pkg.lisp.pamphlet:   LISP:SEQUENCE VMLISP::OBEY
BOOT::TYPE-CONTENTS-OF-FILE LISP::NUMBER VMLISP::|union|
util.lisp.pamphlet:  (obey "cat /tmp/boot.TAGS >> /tmp/TAGS"))
vmlisp.lisp.pamphlet:(defun OBEY (S)
vmlisp.lisp.pamphlet:(defun OBEY (S)
vmlisp.lisp.pamphlet:(defun OBEY (S) (SYSTEM S))
vmlisp.lisp.pamphlet:(defun OBEY (S) (excl::run-shell-command s))

----------

Finally, of course Axiom also requires gcc to compile
generated lisp to object code when compiling functions
and SPAD library code. To run Axiom completely natively on
Windows without MinGW installed, it is necessary to include
a subset of gcc as described here:

http://lists.nongnu.org/archive/html/axiom-developer/2005-01/msg00518.ht
ml

It is necessary that

    bin\gcc.exe
    bin\as.exe

be accessible in the Windows PATH.

Regards,
Bill Paqe.




reply via email to

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