From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17531 invoked by alias); 7 Feb 2005 17:56:07 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 17224 invoked from network); 7 Feb 2005 17:55:42 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 7 Feb 2005 17:55:42 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j17HtgKh030452; Mon, 7 Feb 2005 12:55:42 -0500 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j17HteO30889; Mon, 7 Feb 2005 12:55:41 -0500 To: cgen@sources.redhat.com, sid@sources.redhat.com Subject: RFC: fixup.scm -> guile.scm, update sid From: Jim Blandy Date: Mon, 07 Feb 2005 17:56:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-q1/txt/msg00012.txt.bz2 [I'd posted this earlier, as two separate messages, but it seems to have been swallowed.] I need review from both SID and CGEN folks for this. One of the changes I outlined in my original post was to move away >From loading fixup.scm from every cgen-APP.scm file, and instead have the app-specific shell script wrappers (which are the ones that know which Scheme will be used) specify an implementation-specific file like guile.scm or mzscheme.scm. The nice thing is that this can be done one app at a time. We can convert, say, sid/component/cgen-cpu/CGEN.sh.in and cgen/cgen-sid.scm at the same time, without affecting, say, opcodes. While we're in transition, some apps will be using fixup.scm, and some will be using guile.scm. So we'll need to keep the transition brief, and keep fixup.scm and guile.scm synchronized. Here's the first step. cgen/ChangeLog: 2005-02-02 Jim Blandy * 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 * 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. Index: sid/component/cgen-cpu/CGEN.sh.in =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/CGEN.sh.in,v retrieving revision 1.4 diff -c -p -r1.4 CGEN.sh.in *** sid/component/cgen-cpu/CGEN.sh.in 8 Sep 2003 18:55:35 -0000 1.4 --- sid/component/cgen-cpu/CGEN.sh.in 2 Feb 2005 23:17:16 -0000 *************** then *** 68,74 **** else cgen=guile fi ! rm -f tmp-desc-$$.h1 tmp-desc-$$.h rm -f tmp-cpu-$$.h1 tmp-cpu-$$.h --- 68,74 ---- 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 *************** do *** 96,102 **** esac done ! ${cgen} -s ${cgendir}/cgen-sid.scm \ -s ${cgendir} \ ${cgenflags} \ -f "${archflags}" \ --- 96,102 ---- esac done ! ${cgen} ${cgendir}/cgen-sid.scm \ -s ${cgendir} \ ${cgenflags} \ -f "${archflags}" \ Index: sid/component/cgen-cpu/ChangeLog =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/ChangeLog,v retrieving revision 1.52 diff -c -p -r1.52 ChangeLog *** sid/component/cgen-cpu/ChangeLog 25 Jun 2004 17:44:35 -0000 1.52 --- sid/component/cgen-cpu/ChangeLog 2 Feb 2005 23:17:16 -0000 *************** *** 1,3 **** --- 1,8 ---- + 2005-02-02 Jim Blandy + + * 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 * tracedis.cxx (register_name): Add parameter for the cgen MACH. Save Index: cgen/cgen-sid.scm =================================================================== RCS file: /cvs/src/src/cgen/cgen-sid.scm,v retrieving revision 1.3 diff -c -p -r1.3 cgen-sid.scm *** cgen/cgen-sid.scm 8 Sep 2003 17:17:22 -0000 1.3 --- cgen/cgen-sid.scm 2 Feb 2005 23:17:21 -0000 *************** *** 10,18 **** ; 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")) --- 10,15 ---- Index: cgen/guile.scm =================================================================== RCS file: cgen/guile.scm diff -N cgen/guile.scm *** cgen/guile.scm 1 Jan 1970 00:00:00 -0000 --- cgen/guile.scm 2 Feb 2005 23:17:21 -0000 *************** *** 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!) + )