Changeset 13272


Ignore:
Timestamp:
04/27/11 20:30:26 (12 years ago)
Author:
Mark Evenson
Message:

Fix pprint routines using SYS:OUTPUT-OBJECT to a GRAY-STREAM.

Correct the renaming of ABCL SYSTEM functions that aren't part of the
ANSI standard.

Location:
trunk/abcl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/nbproject/build-impl.xml

    r13078 r13272  
    5656    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    5757        <available file="${manifest.file}" property="manifest.available"/>
    58         <available file="${application.splash}" property="splashscreen.available"/>
     58        <condition property="splashscreen.available">
     59            <and>
     60                <not>
     61                    <equals arg1="${application.splash}" arg2="" trim="true"/>
     62                </not>
     63                <available file="${application.splash}"/>
     64            </and>
     65        </condition>
    5966        <condition property="main.class.available">
    6067            <and>
     
    7178            </and>
    7279        </condition>
     80        <condition property="do.archive">
     81            <not>
     82                <istrue value="${jar.archive.disabled}"/>
     83            </not>
     84        </condition>
    7385        <condition property="do.mkdist">
    7486            <and>
     87                <isset property="do.archive"/>
    7588                <isset property="libs.CopyLibs.classpath"/>
    7689                <not>
     
    8598            </and>
    8699        </condition>
    87         <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
    88             <and>
    89                 <istrue value="${manifest.available+main.class+mkdist.available}"/>
    90                 <istrue value="${splashscreen.available}"/>
    91             </and>
    92         </condition>
    93         <condition property="do.archive">
    94             <not>
    95                 <istrue value="${jar.archive.disabled}"/>
    96             </not>
    97         </condition>
    98100        <condition property="do.archive+manifest.available">
    99101            <and>
     
    102104            </and>
    103105        </condition>
     106        <condition property="do.archive+main.class.available">
     107            <and>
     108                <isset property="main.class.available"/>
     109                <istrue value="${do.archive}"/>
     110            </and>
     111        </condition>
     112        <condition property="do.archive+splashscreen.available">
     113            <and>
     114                <isset property="splashscreen.available"/>
     115                <istrue value="${do.archive}"/>
     116            </and>
     117        </condition>
    104118        <condition property="do.archive+manifest.available+main.class">
    105119            <and>
     
    108122            </and>
    109123        </condition>
    110         <condition property="do.archive+manifest.available+main.class+mkdist.available">
    111             <and>
    112                 <istrue value="${manifest.available+main.class+mkdist.available}"/>
    113                 <istrue value="${do.archive}"/>
    114             </and>
    115         </condition>
    116         <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
    117             <and>
    118                 <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
    119                 <istrue value="${do.archive}"/>
    120             </and>
     124        <condition property="manifest.available-mkdist.available">
     125            <or>
     126                <istrue value="${manifest.available}"/>
     127                <isset property="do.mkdist"/>
     128            </or>
     129        </condition>
     130        <condition property="manifest.available+main.class-mkdist.available">
     131            <or>
     132                <istrue value="${manifest.available+main.class}"/>
     133                <isset property="do.mkdist"/>
     134            </or>
    121135        </condition>
    122136        <condition property="have.tests">
     
    174188            <length length="0" string="${endorsed.classpath}" when="greater"/>
    175189        </condition>
    176         <property name="javac.fork" value="false"/>
     190        <condition else="false" property="jdkBug6558476">
     191            <and>
     192                <matches pattern="1\.[56]" string="${java.specification.version}"/>
     193                <not>
     194                    <os family="unix"/>
     195                </not>
     196            </and>
     197        </condition>
     198        <property name="javac.fork" value="${jdkBug6558476}"/>
    177199        <property name="jar.index" value="false"/>
     200        <property name="jar.index.metainf" value="${jar.index}"/>
    178201        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
    179202    </target>
     
    303326                    <files includesfile="${javac.includesfile.binary}"/>
    304327                </delete>
    305                 <delete file="${javac.includesfile.binary}"/>
     328                <delete>
     329                    <fileset file="${javac.includesfile.binary}"/>
     330                </delete>
    306331            </sequential>
    307332        </macrodef>
     
    313338            <attribute default="**" name="testincludes"/>
    314339            <sequential>
    315                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
     340                <property name="junit.forkmode" value="perTest"/>
     341                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
    316342                    <batchtest todir="${build.test.results.dir}">
    317343                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
     
    329355                    <formatter type="xml"/>
    330356                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
     357                    <jvmarg value="-ea"/>
    331358                    <jvmarg line="${run.jvmargs}"/>
    332359                </junit>
    333360            </sequential>
    334361        </macrodef>
     362    </target>
     363    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
     364    <target name="-profile-pre-init">
     365        <!-- Empty placeholder for easier customization. -->
     366        <!-- You can override this target in the ../build.xml file. -->
     367    </target>
     368    <target name="-profile-post-init">
     369        <!-- Empty placeholder for easier customization. -->
     370        <!-- You can override this target in the ../build.xml file. -->
     371    </target>
     372    <target name="-profile-init-macrodef-profile">
     373        <macrodef name="resolve">
     374            <attribute name="name"/>
     375            <attribute name="value"/>
     376            <sequential>
     377                <property name="@{name}" value="${env.@{value}}"/>
     378            </sequential>
     379        </macrodef>
     380        <macrodef name="profile">
     381            <attribute default="${main.class}" name="classname"/>
     382            <element name="customize" optional="true"/>
     383            <sequential>
     384                <property environment="env"/>
     385                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
     386                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
     387                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
     388                    <jvmarg line="${profiler.info.jvmargs}"/>
     389                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
     390                    <arg line="${application.args}"/>
     391                    <classpath>
     392                        <path path="${run.classpath}"/>
     393                    </classpath>
     394                    <syspropertyset>
     395                        <propertyref prefix="run-sys-prop."/>
     396                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
     397                    </syspropertyset>
     398                    <customize/>
     399                </java>
     400            </sequential>
     401        </macrodef>
     402    </target>
     403    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
     404        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
     405        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
    335406    </target>
    336407    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
     
    428499    <target name="-init-macrodef-copylibs">
    429500        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
     501            <attribute default="${manifest.file}" name="manifest"/>
    430502            <element name="customize" optional="true"/>
    431503            <sequential>
     
    443515                </pathconvert>
    444516                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
    445                 <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
     517                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
    446518                    <fileset dir="${build.classes.dir}"/>
    447519                    <manifest>
     
    572644        <!-- You can override this target in the ../build.xml file. -->
    573645    </target>
    574     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
     646    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
    575647        <j2seproject1:jar/>
    576648    </target>
    577     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
     649    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
    578650        <j2seproject1:jar manifest="${manifest.file}"/>
    579651    </target>
     
    584656            </j2seproject1:manifest>
    585657        </j2seproject1:jar>
    586         <echo>To run this application from the command line without Ant, try:</echo>
     658        <echo level="info">To run this application from the command line without Ant, try:</echo>
    587659        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
    588660        <property location="${dist.jar}" name="dist.jar.resolved"/>
     
    591663            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
    592664        </pathconvert>
    593         <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
    594     </target>
    595     <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
     665        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
     666    </target>
     667    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
     668        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
     669        <touch file="${tmp.manifest.file}" verbose="false"/>
     670    </target>
     671    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
     672        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
     673        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
     674    </target>
     675    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
     676        <manifest file="${tmp.manifest.file}" mode="update">
     677            <attribute name="Main-Class" value="${main.class}"/>
     678        </manifest>
     679    </target>
     680    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
    596681        <basename file="${application.splash}" property="splashscreen.basename"/>
    597682        <mkdir dir="${build.classes.dir}/META-INF"/>
    598683        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
    599         <j2seproject3:copylibs>
    600             <customize>
    601                 <attribute name="Main-Class" value="${main.class}"/>
    602                 <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
    603             </customize>
    604         </j2seproject3:copylibs>
    605         <echo>To run this application from the command line without Ant, try:</echo>
     684        <manifest file="${tmp.manifest.file}" mode="update">
     685            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
     686        </manifest>
     687    </target>
     688    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
     689        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
     690        <echo level="info">To run this application from the command line without Ant, try:</echo>
    606691        <property location="${dist.jar}" name="dist.jar.resolved"/>
    607         <echo>java -jar "${dist.jar.resolved}"</echo>
    608     </target>
    609     <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
    610         <j2seproject3:copylibs>
    611             <customize>
    612                 <attribute name="Main-Class" value="${main.class}"/>
    613             </customize>
    614         </j2seproject3:copylibs>
    615         <echo>To run this application from the command line without Ant, try:</echo>
    616         <property location="${dist.jar}" name="dist.jar.resolved"/>
    617         <echo>java -jar "${dist.jar.resolved}"</echo>
    618     </target>
     692        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
     693    </target>
     694    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
     695        <delete>
     696            <fileset file="${tmp.manifest.file}"/>
     697        </delete>
     698    </target>
     699    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
    619700    <target name="-post-jar">
    620701        <!-- Empty placeholder for easier customization. -->
    621702        <!-- You can override this target in the ../build.xml file. -->
    622703    </target>
    623     <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
     704    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
    624705    <!--
    625706                =================
     
    686767    </target>
    687768    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
     769    <!--
     770                =================
     771                PROFILING SECTION
     772                =================
     773            -->
     774    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
     775        <nbprofiledirect>
     776            <classpath>
     777                <path path="${run.classpath}"/>
     778            </classpath>
     779        </nbprofiledirect>
     780        <profile/>
     781    </target>
     782    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
     783        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
     784        <nbprofiledirect>
     785            <classpath>
     786                <path path="${run.classpath}"/>
     787            </classpath>
     788        </nbprofiledirect>
     789        <profile classname="${profile.class}"/>
     790    </target>
     791    <!--
     792                =========================
     793                APPLET PROFILING  SECTION
     794                =========================
     795            -->
     796    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
     797        <nbprofiledirect>
     798            <classpath>
     799                <path path="${run.classpath}"/>
     800            </classpath>
     801        </nbprofiledirect>
     802        <profile classname="sun.applet.AppletViewer">
     803            <customize>
     804                <arg value="${applet.url}"/>
     805            </customize>
     806        </profile>
     807    </target>
     808    <!--
     809                =========================
     810                TESTS PROFILING  SECTION
     811                =========================
     812            -->
     813    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
     814        <nbprofiledirect>
     815            <classpath>
     816                <path path="${run.test.classpath}"/>
     817            </classpath>
     818        </nbprofiledirect>
     819        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
     820            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
     821            <jvmarg value="${profiler.info.jvmargs.agent}"/>
     822            <jvmarg line="${profiler.info.jvmargs}"/>
     823            <test name="${profile.class}"/>
     824            <classpath>
     825                <path path="${run.test.classpath}"/>
     826            </classpath>
     827            <syspropertyset>
     828                <propertyref prefix="test-sys-prop."/>
     829                <mapper from="test-sys-prop.*" to="*" type="glob"/>
     830            </syspropertyset>
     831            <formatter type="brief" usefile="false"/>
     832            <formatter type="xml"/>
     833        </junit>
     834    </target>
    688835    <!--
    689836                ===============
     
    732879        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
    733880    </target>
    734     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
     881    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
    735882        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
    736883        <copy todir="${build.test.classes.dir}">
     
    747894        <!-- You can override this target in the ../build.xml file. -->
    748895    </target>
    749     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
     896    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
    750897        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
    751898        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  • trunk/abcl/nbproject/genfiles.properties

    r13078 r13272  
    55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    66nbproject/build-impl.xml.data.CRC32=742204ce
    7 nbproject/build-impl.xml.script.CRC32=330b50b7
    8 nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
     7nbproject/build-impl.xml.script.CRC32=1b34e6ea
     8nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45
    99nbproject/profiler-build-impl.xml.data.CRC32=71623fcd
    1010nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
  • trunk/abcl/src/org/armedbear/lisp/gray-streams.lisp

    r13255 r13272  
    165165(defvar *ansi-write-string* #'write-string)
    166166(defvar *ansi-write-line* #'write-line)
    167 (defvar *ansi-force-output* #'sys::%force-output)
    168 (defvar *ansi-finish-output* #'sys::%finish-output)
    169 (defvar *ansi-clear-output* #'sys::%clear-output)
     167(defvar *sys-%force-output* #'sys::%force-output)
     168(defvar *sys-%finish-output* #'sys::%finish-output)
     169(defvar *sys-%clear-output* #'sys::%clear-output)
     170(defvar *sys-%output-object* #'sys::%output-object)
    170171(defvar *ansi-clear-input* #'clear-input)
    171172(defvar *ansi-read-byte* #'read-byte)
     
    462463        (stream-clear-input stream))))
    463464
     465(defun gray-output-object (object stream)
     466  (if (ansi-streamp stream)
     467      (funcall *sys-%output-object* object stream)
     468      (stream-write-string stream
     469                           (with-output-to-string (s)
     470                             (funcall *sys-%output-object* object s)))))
     471
    464472(defun gray-read-char-no-hang (&optional input-stream (eof-errorp t)
    465473                                         eof-value recursive-p)
     
    506514  (let ((stream (decode-print-arg output-stream)))
    507515    (if (ansi-streamp stream)
    508         (funcall *ansi-force-output* stream)
     516        (funcall *sys-%force-output* stream)
    509517        (stream-force-output stream))))
    510518
     
    512520  (let ((stream (decode-print-arg output-stream)))
    513521    (if (ansi-streamp stream)
    514         (funcall *ansi-finish-output* stream)
     522        (funcall *sys-%finish-output* stream)
    515523        (stream-finish-output stream))))
    516524
     
    518526  (let ((stream (decode-print-arg output-stream)))
    519527    (if (ansi-streamp stream)
    520         (funcall *ansi-clear-output* stream)
     528        (funcall *sys-%clear-output* stream)
    521529        (stream-clear-output stream))))
    522530
     
    618626(setf (symbol-function 'sys::%finish-output) #'gray-finish-output)
    619627(setf (symbol-function 'sys::%clear-output) #'gray-clear-output)
     628(setf (symbol-function 'sys::%output-object) #'gray-output-object)
    620629(setf (symbol-function 'common-lisp::read-byte) #'gray-read-byte)
    621630(setf (symbol-function 'common-lisp::write-byte) #'gray-write-byte)
Note: See TracChangeset for help on using the changeset viewer.