Martin Rubey wrote:
> 
> Could you please send me a patch for fricas-package.lisp or whatever is
> appropriate, that will load these constants?  At the moment, I'll only need
> them in nlib.lisp, but I guess this is not unlikely to change.
> 

The following minimally tested patch adds to configure new 
'--with-algebra-safety' argument to configure and creates
and links into FriCAS image a new file: fricas-config.lisp
Currently this files contains two variables:
has_fricas_config (with values t)
and fricas_algebra_safety (with value coming from configure)

Both values are defined in FRICAS-LISP package and _not_
exported, so one must use name like

FRICAS-LISP::fricas_algebra_safety

to access them.

diff -u /home/s/test/tt/fricas/trunk/src/lisp/Makefile.in 
trunk/src/lisp/Makefile.in
--- /home/s/test/tt/fricas/trunk/src/lisp/Makefile.in   2008-05-13 
21:11:19.000000000 +0000
+++ trunk/src/lisp/Makefile.in  2008-09-04 01:43:08.000000000 +0000
@@ -36,9 +36,10 @@
 
 $(OUT)/lisp$(EXEEXT): do_it.$(lisp_flavor)
 
-do_it.gcl: fricas-lisp.lisp fricas-package.lisp
+do_it.gcl: fricas-lisp.lisp fricas-package.lisp fricas-config.lisp
        @axiom_gcl_rsym_hack@
-       echo '(load "fricas-package.lisp") (load "fricas-lisp.lisp")' \
+       echo '(load "fricas-package.lisp") (load "fricas-config.lisp")' \
+            '(load "fricas-lisp.lisp")' \
             '(setq compiler::*default-system-p* t)' \
             '(compile-file "fricas-lisp.lisp")' | $(FRICAS_LISP)
        echo '(compiler::link nil "prelisp" ' \
@@ -51,7 +52,8 @@
                       ' si::*system-directory* (quote (list ".lsp")))' \
                '  "$(lisp_c_objects) @axiom_c_runtime_extra@")' \
             | $(FRICAS_LISP)
-       echo '(load "fricas-package.lisp") (load "fricas-lisp.$(OBJEXT)")' \
+       echo '(load "fricas-package.lisp") (load "fricas-config.lisp")' \
+            '(load "fricas-lisp.$(OBJEXT)")' \
             '(in-package "FRICAS-LISP") (save-core "$(OUT)/lisp$(EXEEXT)")' \
            | ./prelisp$(EXEEXT)
        $(STAMP) $@
@@ -62,29 +64,40 @@
 fricas-package.lisp: $(srcdir)/fricas-package.lisp
        cp $< $@
 
-do_it.ecl: fricas-lisp.lisp fricas-package.lisp
+fricas-config.lisp:
+       echo '(in-package "FRICAS-LISP")' > $@
+       echo '(defparameter has_fricas_config t)' >> $@
+       echo '(defparameter fricas_algebra_safety' \
+            '@fricas_algebra_safety@)' >> $@
+
+do_it.ecl: fricas-lisp.lisp fricas-package.lisp fricas-config.lisp
        echo "(in-package \"FRICAS-LISP\")" > fricas-ecl.lisp
        echo "(defvar *fricas-extra-c-files* (quote (" \
             $(patsubst %, "\"%\"", $(lisp_c_objects)) \
             ")))" >> fricas-ecl.lisp
        echo "(defvar *fricas-initial-lisp-objects* (quote (" \
              $(patsubst %, "\"$(BASE)$(abs_builddir)/%\"", \
-                 fricas-package.o fricas-ecl.o fricas-lisp.o) ")))" \
+                 fricas-package.o fricas-config.o fricas-ecl.o \
+                 fricas-lisp.o) ")))" \
                    >> fricas-ecl.lisp
        echo "(defvar *fricas-initial-lisp-forms* nil)" >> fricas-ecl.lisp
        echo '(load "fricas-package.lisp")' \
+            '(load "fricas-config.lisp")' \
             '(load "fricas-ecl.lisp")' \
             '(load "fricas-lisp.lisp")' \
             '(in-package "FRICAS-LISP")' \
              '(fricas-compile-file "fricas-package.lisp")' \
+            '(fricas-compile-file "fricas-config.lisp")' \
             '(fricas-compile-file "fricas-ecl.lisp")' \
             '(fricas-compile-file "fricas-lisp.lisp")' \
             '(make-program "${OUT}/lisp" nil)' | $(FRICAS_LISP)
        $(STAMP) $@
 
             
-do_it.sbcl do_it.clisp do_it.openmcl: fricas-lisp.lisp fricas-package.lisp
+do_it.sbcl do_it.clisp do_it.openmcl: fricas-lisp.lisp fricas-package.lisp \
+           fricas-config.lisp
        echo '(load "fricas-package.lisp")' \
+           '(load "fricas-config.lisp")' \
            '(load (compile-file "fricas-lisp.lisp"))' \
             '(in-package "FRICAS-LISP") (save-core "${OUT}/lisp")' \
          | $(FRICAS_LISP)
Common subdirectories: /home/s/test/tt/fricas/trunk/src/lisp/.svn and 
trunk/src/lisp/.svn
--- /home/s/test/tt/fricas/trunk/configure.ac   2008-05-28 23:16:06.000000000 
+0000
+++ trunk/configure.ac  2008-09-04 01:40:27.000000000 +0000
@@ -359,6 +359,19 @@
 AC_SUBST(axiom_fasl_type)
 AC_SUBST(axiom_fasl_type2)
 
+fricas_algebra_safety=nil
+
+AC_ARG_WITH([algebra-safety],
+            [  --with-algebra-safety=S
+                 use S as Lisp safety settings for compiling algebra files],
+            [case $withval in
+                    yes) fricas_algebra_safety=3 ;;
+                    no)  fricas_algebra_safety=0 ;;
+                    *) fricas_algebra_safety=$withval ;;
+             esac])
+
+AC_SUBST(fricas_algebra_safety)
+
 AC_SUBST(axiom_all_prerequisites)
 
 # FIXME: Move this out of here.  


-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to