OSDN Git Service

cgen/ChangeLog:
authorjimb <jimb>
Mon, 7 Feb 2005 18:51:31 +0000 (18:51 +0000)
committerjimb <jimb>
Mon, 7 Feb 2005 18:51:31 +0000 (18:51 +0000)
2005-02-07  Jim Blandy  <jimb@redhat.com>

* guile.scm: New file, containing Guile-specific definitions and
adaptations.  This is loaded by the app-specific shell scripts.
Initially identical to fixup.scm.
* cgen-sid.scm: Don't load fixup.scm here.

sid/component/cgen-cpu/ChangeLog:
2005-02-02  Jim Blandy  <jimb@redhat.com>

* CGEN.sh.in: Request on the command line that cgen/guile.scm be
loaded before cgen-sid.scm; cgen-sid.scm no longer loads fixup.scm.

cgen/ChangeLog
cgen/cgen-sid.scm
cgen/guile.scm [new file with mode: 0644]
sid/component/cgen-cpu/CGEN.sh.in
sid/component/cgen-cpu/ChangeLog

index be71879..02edcf0 100644 (file)
@@ -1,5 +1,10 @@
 2005-02-07  Jim Blandy  <jimb@redhat.com>
 
+       * guile.scm: New file, containing Guile-specific definitions and
+       adaptations.  This is loaded by the app-specific shell scripts.
+       Initially identical to fixup.scm.
+       * cgen-sid.scm: Don't load fixup.scm here.
+
        * cos.scm: Profile elm-xset! when requested, not elm-set!; the
        latter is a macro.
 
index 7a00cc5..50a32d1 100644 (file)
@@ -10,9 +10,6 @@
 ; Load the various support routines.
 
 (define (load-files srcdir)
-  ; Fix up Scheme to be what we use (guile is always in flux).
-  (primitive-load-path (string-append srcdir "/fixup.scm"))
-
   (load (string-append srcdir "/read.scm"))
   (load (string-append srcdir "/utils-sim.scm"))
   (load (string-append srcdir "/sid.scm"))
diff --git a/cgen/guile.scm b/cgen/guile.scm
new file mode 100644 (file)
index 0000000..23d98f7
--- /dev/null
@@ -0,0 +1,59 @@
+; Guile-specific functions.
+; Copyright (C) 2000, 2004 Red Hat, Inc.
+; This file is part of CGEN.
+; See file COPYING.CGEN for details.
+
+(define *guile-major-version* (string->number (major-version)))
+(define *guile-minor-version* (string->number (minor-version)))
+
+; eval takes a module argument in 1.6 and later
+
+(if (or (> *guile-major-version* 1)
+       (>= *guile-minor-version* 6))
+    (define (eval1 expr)
+      (eval expr (current-module)))
+    (define (eval1 expr)
+      (eval expr))
+)
+
+; symbol-bound? is deprecated in 1.6
+
+(if (or (> *guile-major-version* 1)
+       (>= *guile-minor-version* 6))
+    (define (symbol-bound? table s)
+      (if table
+         (error "must pass #f for symbol-bound? first arg"))
+      ; FIXME: Not sure this is 100% correct.
+      (module-defined? (current-module) s))
+)
+
+(if (symbol-bound? #f 'load-from-path)
+    (begin
+      (define (load file)
+       (begin
+         ;(load-from-path file)
+         (primitive-load-path file)
+         ))
+      )
+)
+
+; FIXME: to be deleted
+(define =? =)
+(define >=? >=)
+
+(if (not (symbol-bound? #f '%stat))
+    (begin
+      (define %stat stat)
+      )
+)
+
+(if (symbol-bound? #f 'debug-enable)
+    (debug-enable 'backtrace)
+)
+
+; Guile 1.3 has reverse!, Guile 1.2 has list-reverse!.
+; CGEN uses reverse!
+(if (and (not (symbol-bound? #f 'reverse!))
+        (symbol-bound? #f 'list-reverse!))
+    (define reverse! list-reverse!)
+)
index ca7e9f6..b115344 100644 (file)
@@ -68,7 +68,7 @@ then
 else
     cgen=guile
 fi
-
+cgen="${cgen} -l ${cgendir}/guile.scm -s"
 
 rm -f tmp-desc-$$.h1 tmp-desc-$$.h
 rm -f tmp-cpu-$$.h1 tmp-cpu-$$.h
@@ -96,7 +96,7 @@ do
     esac
 done
 
-${cgen} -s ${cgendir}/cgen-sid.scm \
+${cgen} ${cgendir}/cgen-sid.scm \
        -s ${cgendir} \
        ${cgenflags} \
        -f "${archflags}" \
index aa13427..d097f68 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-02  Jim Blandy  <jimb@redhat.com>
+
+       * CGEN.sh.in: Request on the command line that cgen/guile.scm be
+       loaded before cgen-sid.scm; cgen-sid.scm no longer loads fixup.scm.
+
 2004-06-25  Dave Brolley  <brolley@redhat.com>
 
        * tracedis.cxx (register_name): Add parameter for the cgen MACH. Save