]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.1.1 release/1.1.1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 2 Nov 1998 15:25:15 +0000 (16:25 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 2 Nov 1998 15:25:15 +0000 (16:25 +0100)
210 files changed:
Documentation/faq.yo
Documentation/ntweb/index.yo
Documentation/tex/GNUmakefile
Documentation/topdocs/INSTALL.yo
Documentation/topdocs/index.yo
NEWS
PATCHES.txt
TODO
VERSION
bin/GNUmakefile [deleted file]
bin/clean-diaper.sh [deleted file]
bin/clean-fonts.sh [deleted file]
bin/convert-mudela.py [deleted file]
bin/docxx-lily.sh [deleted file]
bin/find-typenames.pl [deleted file]
bin/gen-sitemap.sh [deleted file]
bin/genheader.py [deleted file]
bin/html-accents.py [deleted file]
bin/lilypond-login.sh [deleted file]
bin/lilypond-profile.sh [deleted file]
bin/localpackage.py [deleted file]
bin/ltmain.sh [deleted file]
bin/ly2dvi-old.sh [deleted file]
bin/ly2dvi.py [deleted file]
bin/mail-address.sh [deleted file]
bin/mf-to-table.py [deleted file]
bin/mf-to-xpms.sh [deleted file]
bin/mudela-book.py [deleted file]
bin/mutopia-index.py [deleted file]
bin/profile-conf.sh [deleted file]
bin/ps-to-gifs.sh [deleted file]
bin/ps-to-pngs.sh [deleted file]
bin/run-lilypond.sh [deleted file]
bin/set-lily.sh [deleted file]
bin/show-current.sh [deleted file]
bin/template.py [deleted file]
buildscripts/GNUmakefile [new file with mode: 0644]
buildscripts/clean-diaper.sh [new file with mode: 0755]
buildscripts/clean-fonts.sh [new file with mode: 0755]
buildscripts/docxx-lily.sh [new file with mode: 0644]
buildscripts/find-typenames.pl [new file with mode: 0644]
buildscripts/gen-sitemap.sh [new file with mode: 0644]
buildscripts/genheader.py [new file with mode: 0644]
buildscripts/html-accents.py [new file with mode: 0644]
buildscripts/lilypond-login.sh [new file with mode: 0644]
buildscripts/lilypond-profile.sh [new file with mode: 0644]
buildscripts/localpackage.py [new file with mode: 0644]
buildscripts/ltmain.sh [new file with mode: 0644]
buildscripts/mail-address.sh [new file with mode: 0644]
buildscripts/mf-to-table.py [new file with mode: 0644]
buildscripts/mf-to-xpms.sh [new file with mode: 0644]
buildscripts/mutopia-index.py [new file with mode: 0644]
buildscripts/profile-conf.sh [new file with mode: 0644]
buildscripts/ps-to-gifs.sh [new file with mode: 0755]
buildscripts/ps-to-pngs.sh [new file with mode: 0755]
buildscripts/run-lilypond.sh [new file with mode: 0644]
buildscripts/set-lily.sh [new file with mode: 0755]
buildscripts/show-current.sh [new file with mode: 0644]
buildscripts/template.py [new file with mode: 0644]
flower/axis.cc
flower/include/array.hh
flower/include/dictionary.hh
flower/include/vector.hh
flower/include/virtual-methods.hh
lily/GNUmakefile
lily/abbrev.cc
lily/abbreviation-beam-engraver.cc
lily/atom.cc
lily/audio-item.cc
lily/auto-plet-engraver.cc
lily/axis-group-element.cc
lily/axis-group-item.cc
lily/axis-group-spanner.cc
lily/bar-column-engraver.cc
lily/bar-column.cc
lily/bar-engraver.cc
lily/bar-number-engraver.cc
lily/beam-engraver.cc
lily/beam.cc
lily/chord-iterator.cc
lily/clef-engraver.cc
lily/collision-engraver.cc
lily/collision.cc
lily/command-request.cc
lily/dot-column-engraver.cc
lily/dot-column.cc
lily/dynamic-engraver.cc
lily/engraver.cc
lily/hara-kiri-line-group-engraver.cc
lily/hara-kiri-vertical-group-spanner.cc
lily/head-engraver.cc
lily/heads-engraver.cc
lily/identifier.cc
lily/include/atom.hh
lily/include/axis-group-element.hh
lily/include/command-request.hh
lily/include/engraver.hh
lily/include/graphical-element.hh
lily/include/identifier.hh
lily/include/item.hh
lily/include/lily-guile.hh
lily/include/lyric-performer.hh
lily/include/music-list.hh
lily/include/musical-request.hh
lily/include/performer.hh
lily/include/protected-scm.hh [new file with mode: 0644]
lily/include/request.hh
lily/include/score-element.hh
lily/include/span-bar.hh
lily/include/spanner.hh
lily/include/spring-spacer.hh
lily/include/timing-engraver.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/include/type-swallow-trans.hh
lily/item.cc
lily/key-engraver.cc
lily/key-performer.cc
lily/lexer.ll
lily/lily-guile.cc
lily/local-key-engraver.cc
lily/lookup.cc
lily/lyric-engraver.cc
lily/lyric-performer.cc
lily/main.cc
lily/mark-engraver.cc
lily/midi-item.cc
lily/midi-walker.cc
lily/multi-measure-rest-engraver.cc
lily/music-iterator.cc
lily/music-list.cc
lily/music-output-def.cc
lily/music-sequence.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-column.cc
lily/note-performer.cc
lily/p-score.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/parser.yy
lily/performer.cc
lily/pitch-squash-engraver.cc
lily/plet-engraver.cc
lily/plet-spanner.cc
lily/plet-swallow-engraver.cc
lily/priority-halign-engraver.cc
lily/protected-scm.cc [new file with mode: 0644]
lily/request-iterator.cc
lily/request.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rhythmic-column-engraver.cc
lily/rhythmic-head.cc
lily/score-element.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/score-priority-engraver.cc
lily/score.cc
lily/script-column.cc
lily/script-def.cc
lily/script-engraver.cc
lily/script.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/single-malt-grouping-item.cc
lily/slur-engraver.cc
lily/slur.cc
lily/span-bar-engraver.cc
lily/span-bar.cc
lily/span-score-bar-engraver.cc
lily/spanner.cc
lily/spring-spacer.cc
lily/staff-margin-engraver.cc
lily/staff-performer.cc
lily/stem-engraver.cc
lily/stem.cc
lily/symtable.cc
lily/text-def.cc
lily/text-item.cc
lily/tie.cc
lily/ties-engraver.cc
lily/time-signature-engraver.cc
lily/timing-translator.cc
lily/type-swallow-trans.cc
lily/vertical-align-engraver.cc
make/generic-vars.make
make/lilypond-vars.make
make/lilypond.spec.in
make/mudela-rules.make
make/mutopia-rules.make
make/mutopia-targets.make
make/out/lelievijver.lsm
make/out/lilypond.lsm
make/out/lilypond.spec
make/toplevel.make.in
scripts/GNUmakefile [new file with mode: 0644]
scripts/convert-mudela.py [new file with mode: 0644]
scripts/ly2dvi-old.sh [new file with mode: 0644]
scripts/ly2dvi.py [new file with mode: 0644]
scripts/mudela-book.py [new file with mode: 0644]
stepmake/NEWS
stepmake/bin/package-zip32.sh
stepmake/stepmake/c++-vars.make
stepmake/stepmake/executable-vars.make
stepmake/stepmake/generic-vars.make
stepmake/stepmake/metafont-targets.make
stepmake/stepmake/metapost-rules.make

index 327a83eb5ca7eaf9f264b8e22f34ae137582e990..059cc78381be1b3e8d4c03d99e56548ae15d6240 100644 (file)
@@ -381,7 +381,7 @@ wrong symbols and dvi-checksum errors!)
 We obviously mucked with the fonts in the upgrade.  Remove em(all)
 previous fonts, including the file(.pk) and file(.tfm) fonts in
 file(/var/lib/texmf).  A script automating this has been included, see
-file(bin/clean-fonts.sh).
+file(buildscripts/clean-fonts.sh).
 
 
 question(The beams and slurs are gone if use the XDvi magnifying glass!?)
index 4460f700c880eea3d573ca0e041c1cee9df0232b..1a3a8df1f19444ff8aad11028e15cceb4529e7e9 100644 (file)
@@ -4,11 +4,12 @@ sect(Windows NT Binary Distribution)
 
 subsect(Introduction) label(introduction)
 
-This page is dedicated to the distribution of precompiled and preformatted
-LilyPond binaries for Windows NT 4.0 .  This package is covered under the 
-GNU General Public License and all of the source and documentation are 
+This page is dedicated to the distribution of precompiled and
+preformatted LilyPond binaries for Windows NT 4.0 .  This package is
+covered under the GNU General Public License and all of the source is
 available on the official 
 url(LilyPond Homepage)(http://www.cs.ruu.nl/people/hanwen/lilypond/index.html).
+A full set of url(documentation)(http://www.cs.ruu.nl/people/hanwen/lilypond/Documentation/tex/out-www/index.html) in various formats is also available.
 
 includefile(../BLURB.in)
 
@@ -69,8 +70,8 @@ itemize(
       In a batch file you can add the following entries: nl()
       bf(set LILYPONDPREFIX=em(LilyPond-dir)) nl()
       bf(set path=%path%;%LILYPONDPREFIX%\bin;em(MiKTeX-dir)\miktex\bin) nl()
-      bf(set TEXINPUTS=%LILYPONDPREFIX%\texmf\tex\lilypond;;) nl()
-      bf(set MFINPUTS=%LILYPONDPREFIX%\texmf\mf\public\lilypond;;) nl()
+      bf(set TEXINPUTS=%LILYPONDPREFIX%\share\lilypond\tex;;) nl()
+      bf(set MFINPUTS=%LILYPONDPREFIX%\share\lilypond\mf;;) nl()
 COMMENT(    dit(Windows Environment)
       In the Windows environment you can select
       properties menu of the My Computer icon. Click on
index 8b4a15a5d457edcb101f47db9340e47dd0f8158f..6102deb049873953422eb730520ece392c86c9d9 100644 (file)
@@ -4,6 +4,7 @@ depth=../..
 
 DATA_FILES = $(wildcard *.data)
 datafiles = $(addprefix $(outdir)/,$(DATA_FILES:.data=.html))
+TEX_FILES = $(wildcard *.tex)
 DOC_FILES = $(wildcard *.doc)
 DVI_FILES = $(addprefix $(outdir)/,$(DOC_FILES:.doc=.dvi) $(YO_FILES:.yo=.dvi))
 OUT_BIB_FILES = $(addprefix $(outdir)/, $(BIB_FILES))
@@ -11,10 +12,11 @@ OUT_BIB_FILES = $(addprefix $(outdir)/, $(BIB_FILES))
 # just include me
 YO_URG_FILES = $(wildcard *.yo-urg)
 
+OUTTEX_FILES = $(addprefix $(outdir)/, $(TEX_FILES))
 OUTDOC_FILES = $(addprefix $(outdir)/, $(DOC_FILES))
 EL_FILES = $(wildcard *.el)
 BIB_FILES= $(wildcard *.bib)
-EXTRA_DIST_FILES= $(BIB_FILES) $(DOC_FILES) $(DATA_FILES) $(EL_FILES) $(YO_URG_FILES)
+EXTRA_DIST_FILES= $(BIB_FILES) $(DOC_FILES) $(DATA_FILES) $(EL_FILES) $(YO_URG_FILES) $(TEX_FILES)
 HTML_FILES = $(addprefix $(outdir)/, $(YO_FILES:.yo=.html))
 PS_FILES = $(DVI_FILES:.dvi=.ps)
 
@@ -54,9 +56,9 @@ $(outdir)/glossary.dvi: $(outdir)/glossary-table.tex
 $(outdir)/glossary.html: $(outdir)/glossary-table.html
 
 
-local-WWW: $(HTML_FILES) $(OUTDOC_FILES:.doc=.ps.gz) $(OUTYO_FILES:.yo=.latex) $(OUTYO_FILES:.yo=.ps.gz) $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html)) $(datafiles)
+local-WWW: $(HTML_FILES) $(OUTDOC_FILES:.doc=.ps.gz) $(OUTTEX_FILES:.tex=.ps.gz) $(OUTYO_FILES:.yo=.latex) $(OUTYO_FILES:.yo=.ps.gz) $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html)) $(datafiles)
        $(PYTHON) $(step-bindir)/ls-latex.py --package=$(topdir) --title 'LaTeX documents about LilyPond' \
-         $(YO_FILES) $(OUTYO_FILES:.yo=.latex) $(BIB_FILES) $(DOC_FILES) \
+         $(YO_FILES) $(OUTYO_FILES:.yo=.latex) $(BIB_FILES) $(DOC_FILES) $(TEX_FILES)\
          | sed "s!$(outdir)/!!g" > $(outdir)/index.html
          $(PYTHON) $(step-bindir)/add-html-footer.py --package=$(topdir) $(outdir)/index.html
 
index 9a7251676467dcd5ec66128b3b5fa381940c2966..54147f74e19a612023899c00aee23dc20c92d5ba 100644 (file)
@@ -4,13 +4,13 @@ sect(ABSTRACT)
 
 You do something which looks remotely like
 verb(
-       configure    # Check out the bin/set-lily.sh script
+       configure    # Check out the buildscripts/set-lily.sh script
        make
        make install
 )
 
 The detailed instructions follow here.  The
-file(bin/set-lily.sh) script sets some environment variables
+file(buildscripts/set-lily.sh) script sets some environment variables
 and symlinks, which comes in handly when you have to compile LilyPond
 very often.  It is aimed at people who run (or debug) LilyPond without 
 installing.
@@ -35,6 +35,8 @@ it() GNU C++ version 2.7 or newer (2.8 and egcs are also fine).
 it() Python 1.5 (Strictly speaking, you shouldn't need Python for 
    compiling and installing, but you'll need it to regenerate the font
    tables, e.g.). 
+
+it() GUILE 1.3 (no, GUILE 1.2 won't work)
 )
 
 sect(RUNNING)
@@ -60,8 +62,8 @@ export TEXINPUTS="/usr/local/share/lilypond/tex:"
 The empty path component
 represents TeX() and MetaFont's default search paths.  Scripts with
 the proper paths for the bourne and C-shell respectively are generated in
-file(bin/out/lilypond-profile) and
-file(bin/out/lilypond-login) during compilation.
+file(buildscripts/out/lilypond-profile) and
+file(buildscripts/out/lilypond-login) during compilation.
 
 
 sect(RECOMMENDED)
index fc1675b1329680014e3618a842c5589229fec9dd..1307c60e3bc888c29ac3c615e2c30e74cd3baf72 100644 (file)
@@ -39,7 +39,6 @@ nsect(Sites)
 
 description(
 dit(lurl(http://www.cs.uu.nl/people/hanwen/lilypond/))Han-Wen's site.
-dit(lurl(http://www.xs4all.nl/~jantien/lilypond/))Jan's site.
 dit(lurl(http://www.realtime.net/~daboys/lilypond/))Jeff's Windows NT Distribution site.
 )
 
diff --git a/NEWS b/NEWS
index 577495b1952a893b56584164edbfe90d0a3fe5bd..c11ce8fd55a429bac86f50823a519c01299ac110 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,27 +1,45 @@
---- ../lilypond-1.1.0.uu2.jcn1/NEWS    Fri Oct 30 17:01:27 1998
-++ b/NEWS      Fri Oct 30 18:15:48 1998
-@@ -1,3 +1,8 @@
-pl 0.uu2.jcn2
+pl 0.uu5
+       - fixed MIDI output.
+
+pl 0.jcn3
        - dropped stepmake/aclocal.m4
        - removed silly -lguile (BLA_LIBS, EXTRA_LIBS ??)
        - added debugging output format: -fscm
-
- pl 0.uu2.jcn1
-       - ly2dvi.py -I fix
-       - too annoying buildscripts, scripts -> bin--- ../lilypond-1.1.0.uu2/NEWS       Thu Oct 29 00:59:19 1998
-++ b/NEWS      Fri Oct 30 17:01:27 1998
-@@ -1,3 +1,8 @@
-pl 0.uu2.jcn1
        - ly2dvi.py -I fix
-       - too annoying buildscripts, scripts -> bin
        - Documentation/tex/feta.tex
        - doco fixes: PATCHES.yo, yodl-1.31.7
- pl 0.uu2
-       - undone type_info::before hack. (Ugh.  RTFM).pl 0.jcn1
+
+pl 0.uu4
+       - Protected_scm to fixup GUILE gc
+
+pl 0.uu3
+       - more RTTI cleaning.
+
+pl 0.uu2
+       - undone type_info::before hack. (Ugh.  RTFM).
+
+pl 0.uu1
+       - more RTTI stuff: is_type_b -> type_info::before
+
+pl 0.jcn1
 pl 17.jcn7
        - added: set*text, timesig, beam
        - guile-1.3 is fine; my egcs-1.0.2's -O2 is broken
+pl 17.jbr1
+       - stepmake/stepmake/bin/package-zip32.sh: Updated configure statement
+         and modified win32 specific distribution file names to match
+         pl 16.hwn1 changes.
+       - scripts/ly2dvi.py: Modified search paths to match the new lilypond
+         installation tree.
+       - scripts/convert-mudela.py: Remove the an existing backup file
+         before renaming original.  This is a WIN32 Python requirement.
+       - Documentation/ntweb/index.html: Updated documentation to match
+         new lilypond installation tree.
+       - lily/main.cc: Fixed LILYPONDPREFIX search paths.
+          
+  
+
+**********
 
 1.1.0
 
index 2f32fb94874884d77238dea3b0f74bbaeb0b9d5c..f801d8ef5aa9c69b71efeee3503b27a248851d68 100644 (file)
@@ -62,13 +62,17 @@ Then, from the top of Lily's source tree, type
 
 
 
+         make dist
          make diff
 
 
 
 
 
-which leaves your patch as ./lilypond-0.1.73.jcn1.diff.
+which rolls the  tarball  ../releases/lilypond-0.1.73.tar.gz
+and leaves your patch as  ./lilypond-0.1.73.jcn1.diff.   [1]
+We  assume that there is a tarball lilypond-0.1.73.tar.gz in
+the directory ../releases.
 
 If you didn't configure Lily using --srcdir, you can do:
 
@@ -102,6 +106,10 @@ o    GNU diff
 o    Python  (version 1.5 or newer).  You can of course make
      a patch by hand, which would go something like:
 
+-----------
+[1] 'Make diff' generates a patch between two tar-
+balls.  For more info type 'make diff help=='.
+
 
               make distclean
               cd ..
diff --git a/TODO b/TODO
index e22c3f60e80d26e2dcf43a80a9b9b7a086bf6663..b22fe9a2447bc07bb0e6d4b811dd15d83969a889 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,8 +9,12 @@ grep for TODO and ugh/ugr/urg
 
 
 BUGS:
+       * disallow backslashes
+
+       * \breathmark TeX macro 
+
+       * catch GUILE errors?
 
-       
        * add new glyphs to font.ly
 
        * formatting of input stuff. 
@@ -103,8 +107,6 @@ BUGS:
 
        * include MIDI list 
 
-       * make GNU style webpages.
-
        * midi_instrument -> midiInstrument
 
        * horizontal centering of dynamics 
@@ -350,7 +352,6 @@ PROJECTS
        -  indentation
        -  notenames?
        -  fontlock: \melodic \melodic
 
        * use properties for:
        - plet?
@@ -372,9 +373,8 @@ PROJECTS
 
        * Spring_spacer:
        - write a faster Spring_spacer (without matrices if possible)
-       - use straight LP to find minimal "fitting force"
        - relate energybound to linelen unitspace fontsize etc.
-       - used fixed point fp
+       - used fixed point fp?
 
        * \header
        - output header info to MIDI too.
@@ -458,7 +458,7 @@ PROJECTS
        * Documentation
        - Doc (C) stuff of sheet music
        - a better format?  SGML?  TeX?  Info?
-       - a tutorial
+       - a better tutorial
 
        * more spanners (smallish)
        - Glissando
diff --git a/VERSION b/VERSION
index ea9afb6b71d2d66769e952cfd865669ae56b3177..deeabc172bca7a1156bdac5eb84c52081a6b0339 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
-PATCH_LEVEL=0
-MY_PATCH_LEVEL=uu2.jcn2
+PATCH_LEVEL=1
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/bin/GNUmakefile b/bin/GNUmakefile
deleted file mode 100644 (file)
index b954530..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# bin/Makefile
-
-depth = ..
-SEXECUTABLES=convert-mudela mudela-book ly2dvi 
-STEPMAKE_TEMPLATES=script
-
-
-include $(depth)/make/stepmake.make 
-
-include $(stepdir)/executable-targets.make
-
-
diff --git a/bin/clean-diaper.sh b/bin/clean-diaper.sh
deleted file mode 100644 (file)
index 47c2a06..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# unclobber current dir.
-rm -vf *.aux *.log *.orig *~  *dvi *.dep
-
-# subdirs
-rm -vf `grep -li "^% Creator: GNU LilyPond" *.out *.tex` 
-rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
-rm -vf `grep -li "%Creator: dvipsk" *.ps`
-rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
-rm -vf `grep -li "Creator: ly2dvi" *.tex`
-rm -vf `find -name 'core'`
-rm -vf `find -name '*.orig'`
-rm -vf `find -name '*.rej'`
-
-
-
-
-    
-# docxx mess
-rm -vf *.class  HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
-    aindex.html index.html
diff --git a/bin/clean-fonts.sh b/bin/clean-fonts.sh
deleted file mode 100644 (file)
index 597efa9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-case  $# in
-0) 
-    WHAT="" ;;
-1)
-    WHAT=$1;;
-esac
-
-# should use kpsepath 
-
-if [ -d /var/lib/texmf ]; then
-    TEXDIR=/var/lib/texmf
-elif [ -d /var/texfonts ]; then
-    TEXDIR=/var/texfonts
-else
-    TEXDIR=/var/
-fi
-
-# remove possibly stale .pk/.tfm files 
-echo> /tmp/cleaning-font-dummy
-FILES=`find .  $TEXDIR -name "feta*$WHAT*tfm" -or -name "feta*$WHAT*pk"`
-
-echo removing $FILES
-rm  -f $FILES /tmp/cleaning-font-dummy
diff --git a/bin/convert-mudela.py b/bin/convert-mudela.py
deleted file mode 100644 (file)
index ee6d05a..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-#!@PYTHON@
-
-# convert-mudela.py -- convertor for mudela versions
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1998 
-
-# TODO
-#   use -f and -t for -s output
-
-# NEWS
-# 0.2
-#  - rewrite in python
-
-program_name = 'convert-mudela'
-version = '0.3'
-
-
-import os
-import sys
-import __main__
-import getopt
-from string import *
-import re
-
-import time
-mudela_version_re_str = '\\\\version *\"(.*)\"'
-mudela_version_re = re.compile(mudela_version_re_str)
-
-def program_id ():
-       return '%s version %s' %(program_name,  version);
-
-def identify ():
-       sys.stderr.write (program_id () + '\n')
-
-def gulp_file(f):
-       try:
-               i = open(f)
-               i.seek (0, 2)
-               n = i.tell ()
-               i.seek (0,0)
-       except:
-               print 'can\'t open file: ' + f + '\n'
-               return ''
-       s = i.read (n)
-       if len (s) <= 0:
-               print 'gulped empty file: ' + f + '\n'
-       i.close ()
-       return s
-
-
-def str_to_tuple (s):
-       return tuple (map (atoi, split (s,'.')))
-
-def tup_to_str (t):
-       return join (map (lambda x: '%s' % x, list (t)), '.')
-
-def version_cmp (t1, t2):
-       for x in [0,1,2]:
-               if t1[x] - t2[x]:
-                       return t1[x] - t2[x]
-       return 0
-               
-
-def guess_mudela_version(filename):
-       s = gulp_file (filename)
-       m = mudela_version_re.search (s)
-       if m:
-               return m.group(1)
-       else:
-               return ''
-
-def help ():
-       sys.stdout.write (
-               ("Usage: %s [OPTION]... [FILE]...\n" 
-               + "Try to convert to newer mudela-versions\n"
-               + "Options:\n"
-               + "  -h, --help             print this help\n"
-               + '  -e, --edit             in place edit\n'
-               + '  -f, --from=VERSION     start from version\n'
-               + '  -s, --show-rules       print out all rules.\n'
-               + '  -t, --to=VERSION       target version\n') % program_name)
-       sys.exit (0)
-
-class FatalConversionError:
-       pass
-
-conversions = []
-
-def show_rules (file):
-       for x in conversions:
-               file.write  ('%s: %s\n' % (tup_to_str (x[0]), x[2]))
-
-############################
-               
-if 1:                                  # need new a namespace
-       def conv (lines):
-               found =0
-               for x in lines:
-                       if re.search ('\\\\octave', x):
-                               found = 1
-                               break
-               if found:
-                       sys.stderr.write ('\nNot smart enough to convert \\octave')
-                       raise FatalConversionError()
-               return lines
-               
-
-       conversions.append (
-               ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically'))
-
-
-if 1:                                  # need new a namespace
-       def conv (lines):
-               newlines = []
-               for x in lines:
-                       x = re.sub ('\\\\textstyle([^;]+);',
-                                        '\\\\property Lyrics . textstyle = \\1', x)
-                       x = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', x)
-                       newlines.append (x)
-               return newlines
-               
-
-       conversions.append (
-               ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax'))
-
-
-if 1:                                  # need new a namespace
-       def conv (lines):
-               newlines = []
-               for x in lines:
-                       x = re.sub ('\\\\musical_pitch',
-                                        '\\\\musicalpitch',x)
-                       x = re.sub ('\\\\meter',
-                                        '\\\\time',x)
-                       newlines.append (x)
-               return newlines
-               
-
-       conversions.append (
-               ((0,1,21), conv, '\\musical_pitch -> \\musicalpitch, '+
-                '\\meter -> \\time'))
-
-if 1:                                  # need new a namespace
-       def conv (lines):
-               return lines
-
-       conversions.append (
-               ((1,0,0), conv, '0.1.21 -> 1.0.0 '))
-
-
-if 1:                                  # need new a namespace
-       def conv (lines):
-               newlines = []
-               for x in lines:
-                       x = re.sub ('\\\\accidentals',
-                                   '\\\\keysignature',x)
-                       x = re.sub ('specialaccidentals *= *1',
-                                        'keyoctaviation = 0',x)
-                       x = re.sub ('specialaccidentals *= *0',
-                                        'keyoctaviation = 1',x)
-                       newlines.append (x)
-               return newlines
-               
-
-       conversions.append (
-               ((1,0,1), conv, '\\accidentals -> \\keysignature, ' +
-                'specialaccidentals -> keyoctaviation'))
-
-if 1:
-       def conv(lines):
-               found = 0
-               for x in lines:
-                       if re.search ('\\\\header', x):
-                               found = 1
-                               break
-               if found:
-                       sys.stderr.write ('\nNot smart enough to convert to new \\header format')
-               return lines
-       
-       conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }')
-
-if 1:
-       def conv(lines):
-               newlines =[]
-               for x in lines:
-                       x =  re.sub ('\\\\melodic', '\\\\notes',x)
-                       newlines.append (x)
-               return newlines
-       
-       conversions.append ((1,0,3), conv, '\\melodic -> \\notes')
-
-if 1:
-       def conv(lines):
-               newlines =[]
-               for x in lines:
-                       x =  re.sub ('default_paper *=', '',x)
-                       x =  re.sub ('default_midi *=', '',x)                   
-                       newlines.append (x)
-               return newlines
-       
-       conversions.append ((1,0,4), conv, 'default_{paper,midi}')
-
-if 1:
-       def conv(lines):
-               newlines =[]
-               for x in lines:
-                       x =  re.sub ('ChoireStaff', 'ChoirStaff',x)
-                       x =  re.sub ('\\output', 'output = ',x)
-                       newlines.append (x)
-               return newlines
-       
-       conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff')
-
-if 1:
-       def conv(lines):
-               newlines =[]
-               found = None
-               for x in lines:
-                       found = re.search ('[a-zA-Z]+ = *\\translator',x)
-                       newlines.append (x)
-                       if found: break
-               if found:
-                       sys.stderr.write ('\nNot smart enough to \\translator syntax')
-                       raise FatalConversionError()
-               return newlines
-       
-       conversions.append ((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }')
-
-
-if 1:
-       def conv(lines):
-               newlines =[]
-               for x in lines:
-                       x =  re.sub ('\\\\lyric', '\\\\lyrics',x)
-                       newlines.append (x)
-               return newlines
-       
-       conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics')
-
-
-############################
-       
-
-def get_conversions (from_version, to_version):
-       def version_b (v, f = from_version, t = to_version):
-               return version_cmp (v[0], f) > 0 and version_cmp (v[0], t) <= 0
-       return filter (version_b, conversions)
-
-
-def latest_version ():
-       return conversions[-1][0]
-
-def do_conversion (infile, from_version, outfile, to_version):
-       
-       conv_list = get_conversions (from_version, to_version)
-
-       sys.stderr.write ('Applying conversions: ')
-       lines = infile.readlines();
-       last_conversion = ()
-       try:
-               for x in conv_list:
-                       sys.stderr.write (tup_to_str (x[0])  + ', ')
-                       lines = x[1] (lines)
-                       last_conversion = x[0]
-                       
-
-       except FatalConversionError:
-               sys.stderr.write ('Error while converting; I won\'t convert any further')
-
-       for x in lines:
-               if last_conversion:
-                       x = re.sub (mudela_version_re_str, '\\\\version \"%s\"' % tup_to_str (last_conversion), x)
-               outfile.write(x)
-
-class UnknownVersion:
-       pass
-
-def do_one_file (infile_name):
-       sys.stderr.write ('Processing `%s\' ... '% infile_name)
-       outfile_name = ''
-       if __main__.edit:
-               outfile_name = infile_name + '.NEW'
-       elif __main__.outfile_name:
-               outfile_name = __main__.outfile_name
-
-       if __main__.from_version:
-               from_version = __main__.from_version
-       else:
-               guess = guess_mudela_version (infile_name)
-               if not guess:
-                       raise UnknownVersion()
-               from_version = str_to_tuple (guess)
-
-       if __main__.to_version:
-               to_version = __main__.to_version
-       else:
-               to_version = latest_version ()
-
-
-       if infile_name:
-               infile = open (infile_name,'r')
-       else:
-               infile = sys.stdin
-
-       if outfile_name:
-               outfile =  open (outfile_name, 'w')
-       else:
-               outfile = sys.stdout
-
-       
-       do_conversion (infile, from_version, outfile, to_version)
-
-       if infile_name:
-               infile.close ()
-
-       if outfile_name:
-               outfile.close ()
-
-       if __main__.edit:
-               os.rename (infile_name, infile_name + '~')
-               os.rename (infile_name + '.NEW', infile_name)
-
-       sys.stderr.write ('\n')
-       sys.stderr.flush ()
-
-edit = 0
-to_version = ()
-from_version = ()
-outfile_name = ''
-
-identify ()
-(options, files) = getopt.getopt (
-       sys.argv[1:], 'f:t:seh', ['show-rules', 'help', 'edit', 'from', 'to'])
-
-for opt in options:
-       o = opt[0]
-       a = opt[1]
-       if o== '--help' or o == '-h':
-               help ()
-       elif o== '--from' or o=='-f':
-               from_version = str_to_tuple (a)
-       elif o== '--to' or o=='-t':
-               to_version = str_to_tuple (a)
-       elif o== '--edit' or o == '-e':
-               edit = 1
-       elif o== '--show-rules' or o == '-s':
-               show_rules (sys.stdout)
-               sys.exit(0)
-       else:
-               print o
-               raise getopt.error
-
-
-for f in files:
-       if f == '-':
-               f = ''
-       try:
-               do_one_file (f)
-       except UnknownVersion:
-               pass
diff --git a/bin/docxx-lily.sh b/bin/docxx-lily.sh
deleted file mode 100644 (file)
index 82407ed..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-cwd=`pwd`
-
-{ cd $LILYPOND_SOURCEDIR; cd ..; 
-export LILYPOND_ROOTDIR=`pwd` }
-
-if [ "$1" = "" ]; then
-  VERSION=`show-current`
-  TARBALL=$LILYPOND_ROOTDIR/releases/lilypond-$VERSION.tar.gz
-  cwd=`pwd`
-else
-  TARBALL=$1
-fi
-
-
-tar-docxx $TARBALL
diff --git a/bin/find-typenames.pl b/bin/find-typenames.pl
deleted file mode 100644 (file)
index 890f9ca..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!@PERL@
-
-open GREP, "egrep -h '^struct|^class' *.hh *.cc|";
-open OUT, "|sort | uniq";
-while (<GREP>) {
-
-       s/^struct/class/;
-       if (! /; *$/) {
-               s/:[^{]+{.*$//;
-               s/ *{.*$/;/;
-       }
-       if (! /; *$/) {
-               chop;
-               $_ .= ";\n";
-               
-       }
-       print OUT;
-}
-close OUT;
-close GREP;
diff --git a/bin/gen-sitemap.sh b/bin/gen-sitemap.sh
deleted file mode 100644 (file)
index 7f9bcbc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-TMPDIR=/tmp/gen-sitemap
-for tarball in $*; do
-    tar -C $TMPDIR -xfz $tarball '*.html'
-done
diff --git a/bin/genheader.py b/bin/genheader.py
deleted file mode 100644 (file)
index 4dbb07f..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#!@PYTHON@
-
-# genheader.py -- do headers (like these) 
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-import os
-import sys
-import pwd
-import regex
-import regsub
-import string
-import getopt
-import time
-
-class My_options:
-    def __init__(self):
-       self.commentify = None
-       self.add_hdr_def = 0
-       self.classname = ''
-
-my_options = My_options()
-
-
-def name():
-       return os.environ['USERNAME']
-
-# field 4 of passwd is also used for finger info (phone no.,  office etc)
-#   return pwd.getpwuid(os.getuid())[4]
-
-def c_commentify(str):
-    return  '/* ' + regsub.gsub('^','  ', str) + '\n */';
-
-def sh_commentify(str):
-    return regsub.gsub('^', '# ', str)
-
-def tex_commentify(str):
-    return regsub.gsub('^', '% ', str)
-
-def project_str():
-    cwd = os.getcwd()
-    if regex.search('flower', cwd) <> -1:
-       PROJECT = "the Flower Library"
-    elif regex.search('mf$', cwd) <> -1:
-       PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font"
-    else:
-       PROJECT = "the GNU LilyPond music typesetter"
-    return PROJECT
-
-def head_str(filename):
-    if my_options.add_hdr_def:
-       what = "declare " 
-    else:
-       what=" implement "
-
-       
-    mailaddres = ''
-    try:
-           mailaddres = '<%s>' % os.environ['MAILADDRESS']
-    except KeyError:
-           pass
-    headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \
-             %(filename, what, project_str(),
-               time.localtime (time.time ())[0], name(), mailaddres)
-    return headstr
-
-
-def c_include(filename):
-    startdef= filename;
-    trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__')
-    startdef = string.translate(filename, trans)
-
-   
-    headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef)
-    terminatestr = "#endif /* %s */\n"  % (startdef);
-
-    return headstr+ '\n\n'+ terminatestr;
-
-
-def help ():
-    sys.stdout.write ("Usage: genheader [options] FILENAME\n"
-                + "Generate file with header FILENAME\n\n"
-                + "Options:\n"
-                + "  -h, --header           generate header\n"
-                + "  --help                 print this help\n"
-                + "  -p, --package=DIR      specify package\n"
-                     )
-    
-    sys.exit (0)
-
-
-(options, files) = getopt.getopt(sys.argv[1:], 'tcshp:', ['class', 'package=', 'help']) 
-
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o == '-c':
-       my_options.commentify = c_commentify
-    elif o == '-t':
-       my_options.commentify = tex_commentify
-    elif o == '-s':
-       my_options.commentify = sh_commentify
-    elif o == '-h' or o == '--header':
-       my_options.add_hdr_def = 1
-    elif o == '--class':
-       my_options.classname = a
-    elif o == '--help':
-       help ()
-
-# FIXME:  should create xxx.cc and include/xxx.hh, with implement/declare Xxx
-# in  one run
-if my_options.classname:
-    pass
-       
-def do_file(nm):
-    s = my_options.commentify(head_str(nm)) 
-    if my_options.add_hdr_def:
-       s = s + c_include(nm)
-    return s
-
-
-def extension(ext,nm):
-    ext = '\\.' + ext
-    return regex.search(ext, nm) <> -1
-
-def c_extension(nm):
-    return extension('hh',nm) or extension('cc',nm) \
-          or extension('icc', nm) or extension('tcc',nm)
-
-def select_commentification(nm):
-    if c_extension (nm):
-       return c_commentify
-    elif extension('py',nm) or extension('pl',nm) or extension('sh',nm):
-       return  sh_commentify
-    elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm):
-       return tex_commentify
-    else:
-       sys.stderr.write ('unknown extension for file %s\n' % nm)
-       raise 'help'
-
-for nm in files:
-    if extension('hh', nm) or extension('icc', nm) or  extension('tcc', nm): 
-       my_options.add_hdr_def = 1
-    if my_options.commentify == None:
-       my_options.commentify = select_commentification(nm)
-    print do_file(nm)
-
diff --git a/bin/html-accents.py b/bin/html-accents.py
deleted file mode 100644 (file)
index 228ed74..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#!@PYTHON@
-
-# html-accents.py -- convert (some) latin1 chars to html
-# pod2html is so broken...
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
-
-name = 'html-accents'
-version = '0.1'
-
-import os
-import sys
-sys.path.append ('@abs-step-bindir@')
-sys.path.append (os.environ['HOME'] + '/usr/src/lilypond/stepmake/bin')
-
-import getopt
-from string import *
-import regex
-import regsub
-import time
-
-def program_id ():
-    return name + ' version ' + version;
-
-def identify ():
-    sys.stdout.write (program_id () + '\n')
-
-def help ():
-    sys.stdout.write ("Usage: " + name + " [options] INFILE OUTFILE\n"
-                + "Convert (some) latin1 chars to html &xxx;\n\n"
-                + "Options:\n"
-                + "  -h, --help             print this help\n"
-                + "  -p, --package=DIR      specify package\n"
-                     )
-    sys.exit (0)
-
-# chars = {'è':'&egrave;', }
-chars = { 
-'á':'&aacute;',
-'â':'&acirc;', 
-'æ':'&aelig;',
-'à':'&agrave;', 
-'Ã¥':'&aring;', 
-'ã':'&atilde;',
-'ä':'&auml;',
-
-'ç':'&ccedil;',
-
-'é':'&eacute;', 
-'ê':'&ecirc;',
-'è':'&egrave;', 
-'ë':'&euml;',
-
-'í':'&iacute;',
-'î':'&icirc;',
-'ì':'&igrave;', 
-'ï':'&iuml;',
-
-'ñ':'&ntilde;',
-
-'ó':'&oacute;',
-'ô':'&ocirc;',
-'ò':'&ograve;', 
-'ø':'&oslash;',
-'õ':'&otilde;',
-'ö':'&ouml;',
-
-'ú':'&uacute;',
-'û':'&ucirc;',
-'ù':'&ugrave;', 
-'ü':'&uuml;' 
-}
-
-def convert_accents (inname, outname):
-    from flower import *
-    text = File (inname)
-    # ugh
-    html = File (outname, 'w')
-
-    while not text.eof ():
-       line = text.readline ()
-       for i in chars.keys ():
-           line = regsub.gsub (i, chars[i], line)
-       html.write (line)
-    text.close ()
-    html.close ()
-
-def main ():
-    identify ()
-    (options, files) = getopt.getopt (
-       sys.argv[1:], 'hp:', ['help', 'package='])
-    for opt in options:
-       o = opt[0]
-       a = opt[1]
-       if o== '--help' or o == '-h':
-           help ()
-       elif o == '-p' or o == '--package':
-           topdir = a
-       else:
-           print o
-           raise getopt.error
-
-    sys.path.append (topdir + '/stepmake/bin')
-    from packagepython import *
-    package = Package (topdir)
-    packager = Packager ()
-
-    from flower import *
-
-    convert_accents (files[0], files[1])
-
-main ()
-
diff --git a/bin/lilypond-login.sh b/bin/lilypond-login.sh
deleted file mode 100644 (file)
index d4a482e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/csh
-
-# env. vars for the C-shell.
-
-# set environment for LilyPond.  To be installed in /etc/profile.d/
-setenv GS_LIB "@datadir@/afm"
-setenv GS_FONTPATH "@datadir@/ps"
-setenv LILYINCLUDE "@datadir@/ly:@datadir@/afm"
-
-# include an empty path component for the system wide includes.
-setenv MFINPUTS "@datadir@/mf:"${MFINPUTS:=":"}
-setenv TEXINPUTS "@datadir@/tex:"${TEXINPUTS:=":"}
-
diff --git a/bin/lilypond-profile.sh b/bin/lilypond-profile.sh
deleted file mode 100644 (file)
index 176f636..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-
-# set environment for LilyPond.  To be installed in /etc/profile.d/
-GS_LIB="@datadir@/afm"
-GS_FONTPATH="@datadir@/ps"
-LILYINCLUDE="@datadir@/ly:@datadir@/afm"
-
-# include an empty path component for the system wide includes.
-MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"}
-TEXINPUTS="@datadir@/tex:"${TEXINPUTS:=":"}
-
-export LILYINCLUDE MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH
-
-# echo  $LILYINCLUDE $MFINPUTS $TEXINPUTS $GS_LIB $GS_FONTPATH
-
-
diff --git a/bin/localpackage.py b/bin/localpackage.py
deleted file mode 100644 (file)
index f37fc82..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# localpackage.py
-# must be included in package's python bin dir
-
-def localpackage (n):
-    p=lower (n)
-    P=upper (n)
-    if topdir == '':
-       try:
-           topdir = os.environ[P + '_SOURCEDIR']
-       except:
-           topdir = os.environ['HOME'] + '/usr/src/' + p
-    sys.path.append (topdir + '/stepmake/bin')
-    from packagepython import *
-    package = Package (topdir)
-    packager = Packager ()
-
diff --git a/bin/ltmain.sh b/bin/ltmain.sh
deleted file mode 100644 (file)
index e9350b3..0000000
+++ /dev/null
@@ -1,2453 +0,0 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun ltconfig.
-#
-# Copyright (C) 1996-1998 Free Software Foundation, Inc.
-# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# The name of this program.
-progname=`$echo "$0" | sed 's%^.*/%%'`
-modename="$progname"
-
-# Constants.
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.2
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-
-if test "$LTCONFIG_VERSION" != "$VERSION"; then
-  echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
-  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit 1
-fi
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  echo "$modename: not configured to build any kind of library" 1>&2
-  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit 1
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-
-# Parse our command line options once, thoroughly.
-while test $# -gt 0
-do
-  arg="$1"
-  shift
-
-  case "$arg" in
-  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  # If the previous option needs an argument, assign it.
-  if test -n "$prev"; then
-    case "$prev" in
-    execute_dlfiles)
-      eval "$prev=\"\$$prev \$arg\""
-      ;;
-    *)
-      eval "$prev=\$arg"
-      ;;
-    esac
-
-    prev=
-    prevopt=
-    continue
-  fi
-
-  # Have we seen a non-optional argument yet?
-  case "$arg" in
-  --help)
-    show_help=yes
-    ;;
-
-  --version)
-    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
-    exit 0
-    ;;
-
-  --dry-run | -n)
-    run=:
-    ;;
-
-  --features)
-    echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-    exit 0
-    ;;
-
-  --finish) mode="finish" ;;
-
-  --mode) prevopt="--mode" prev=mode ;;
-  --mode=*) mode="$optarg" ;;
-
-  --quiet | --silent)
-    show=:
-    ;;
-
-  -dlopen)
-    prevopt="-dlopen"
-    prev=execute_dlfiles
-    ;;
-
-  -*)
-    $echo "$modename: unrecognized option \`$arg'" 1>&2
-    $echo "$help" 1>&2
-    exit 1
-    ;;
-
-  *)
-    nonopt="$arg"
-    break
-    ;;
-  esac
-done
-
-if test -n "$prevopt"; then
-  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
-  $echo "$help" 1>&2
-  exit 1
-fi
-
-if test -z "$show_help"; then
-
-  # Infer the operation mode.
-  if test -z "$mode"; then
-    case "$nonopt" in
-    *cc | *++ | gcc* | *-gcc*)
-      mode=link
-      for arg
-      do
-        case "$arg" in
-        -c)
-           mode=compile
-           break
-           ;;
-        esac
-      done
-      ;;
-    *db | *dbx)
-      mode=execute
-      ;;
-    *install*|cp|mv)
-      mode=install
-      ;;
-    *rm)
-      mode=uninstall
-      ;;
-    *)
-      # If we have no mode, but dlfiles were specified, then do execute mode.
-      test -n "$execute_dlfiles" && mode=execute
-
-      # Just use the default operation mode.
-      if test -z "$mode"; then
-        if test -n "$nonopt"; then
-          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-        else
-          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-        fi
-      fi
-      ;;
-    esac
-  fi
-
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
-    $echo "$help" 1>&2
-    exit 1
-  fi
-
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$modename --help --mode=$mode' for more information."
-
-  # These modes are in order of execution frequency so that they run quickly.
-  case "$mode" in
-  # libtool compile mode
-  compile)
-    modename="$modename: compile"
-    # Get the compilation command and the source file.
-    base_compile=
-    lastarg=
-    srcfile="$nonopt"
-    suppress_output=
-
-    for arg
-    do
-      # Accept any command-line options.
-      case "$arg" in
-      -o)
-       $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
-       $echo "$help" 1>&2
-       exit 1
-       ;;
-
-      -static)
-       build_libtool_libs=no
-       build_old_libs=yes
-       continue
-       ;;
-      esac
-
-      # Accept the current argument as the source file.
-      lastarg="$srcfile"
-      srcfile="$arg"
-
-      # Aesthetically quote the previous argument.
-
-      # Backslashify any backslashes, double quotes, and dollar signs.
-      # These are the only characters that are still specially
-      # interpreted inside of double-quoted scrings.
-      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
-      # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly in scan
-      # sets, so we specify it separately.
-      case "$lastarg" in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
-       lastarg="\"$lastarg\""
-       ;;
-      esac
-
-      # Add the previous argument to base_compile.
-      if test -z "$base_compile"; then
-       base_compile="$lastarg"
-      else
-       base_compile="$base_compile $lastarg"
-      fi
-    done
-
-    # Get the name of the library object.
-    libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
-
-    # Recognize several different file suffixes.
-    xform='[cCFSfms]'
-    case "$libobj" in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.f90) xform=f90 ;;
-    *.for) xform=for ;;
-    esac
-
-    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
-    case "$libobj" in
-    *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
-    *)
-      $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
-      exit 1
-      ;;
-    esac
-
-    if test -z "$base_compile"; then
-      $echo "$modename: you must specify a compilation command" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      $run $rm $obj $libobj
-      trap "$run $rm $obj $libobj; exit 1" 1 2 15
-    else
-      $run $rm $libobj
-      trap "$run $rm $libobj; exit 1" 1 2 15
-    fi
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      # All platforms use -DPIC, to notify preprocessed assembler code.
-      $show "$base_compile$pic_flag -DPIC $srcfile"
-      if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
-      else
-        test -n "$obj" && $run $rm $obj
-        exit 1
-      fi
-
-      # If we have no pic_flag, then copy the object into place and finish.
-      if test -z "$pic_flag"; then
-        $show "$LN_S $obj $libobj"
-        $run $LN_S $obj $libobj
-        exit $?
-      fi
-
-      # Just move the object, then go on to compile the next one
-      $show "$mv $obj $libobj"
-      $run $mv $obj $libobj || exit 1
-
-      # Allow error messages only from the first compilation.
-      suppress_output=' >/dev/null 2>&1'
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      # Suppress compiler output if we already did a PIC compilation.
-      $show "$base_compile $srcfile$suppress_output"
-      if $run eval "$base_compile \$srcfile$suppress_output"; then :
-      else
-        $run $rm $obj $libobj
-        exit 1
-      fi
-    fi
-
-    # Create an invalid libtool object if no PIC, so that we do not
-    # accidentally link it into a program.
-    if test "$build_libtool_libs" != yes; then
-      $show "echo timestamp > $libobj"
-      $run eval "echo timestamp > \$libobj" || exit $?
-    fi
-
-    exit 0
-    ;;
-
-  # libtool link mode
-  link)
-    modename="$modename: link"
-    CC="$nonopt"
-    allow_undefined=yes
-    compile_command="$CC"
-    finalize_command="$CC"
-
-    compile_shlibpath=
-    finalize_shlibpath=
-    deplibs=
-    dlfiles=
-    dlprefiles=
-    export_dynamic=no
-    hardcode_libdirs=
-    libobjs=
-    link_against_libtool_libs=
-    ltlibs=
-    objs=
-    prev=
-    prevarg=
-    release=
-    rpath=
-    perm_rpath=
-    temp_rpath=
-    vinfo=
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case "$arg" in
-      -all-static | -static)
-        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-           $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
-        fi
-        build_libtool_libs=no
-       build_old_libs=yes
-        break
-        ;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    for arg
-    do
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-        case "$prev" in
-        output)
-          compile_command="$compile_command @OUTPUT@"
-          finalize_command="$finalize_command @OUTPUT@"
-          ;;
-        esac
-
-        case "$prev" in
-        dlfiles|dlprefiles)
-          case "$arg" in
-          *.la | *.lo) ;;  # We handle these cases below.
-          *)
-            dlprefiles="$dlprefiles $arg"
-            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
-            prev=
-            ;;
-          esac
-          ;;
-       release)
-         release="-$arg"
-         prev=
-         continue
-         ;;
-        rpath)
-          rpath="$rpath $arg"
-         prev=
-         continue
-         ;;
-        *)
-          eval "$prev=\"\$arg\""
-          prev=
-          continue
-          ;;
-        esac
-      fi
-
-      prevarg="$arg"
-
-      case "$arg" in
-      -all-static)
-       if test -n "$link_static_flag"; then
-          compile_command="$compile_command $link_static_flag"
-         finalize_command="$finalize_command $link_static_flag"
-        fi
-        continue
-       ;;
-
-      -allow-undefined)
-       # FIXME: remove this flag sometime in the future.
-       $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
-       continue
-       ;;
-
-      -dlopen)
-        prev=dlfiles
-        continue
-        ;;
-
-      -dlpreopen)
-        prev=dlprefiles
-        continue
-        ;;
-
-      -export-dynamic)
-        if test "$export_dynamic" != yes; then
-          export_dynamic=yes
-         if test -n "$export_dynamic_flag_spec"; then
-           eval arg=\"$export_dynamic_flag_spec\"
-         else
-           arg=
-         fi
-
-          # Add the symbol object into the linking commands.
-         compile_command="$compile_command @SYMFILE@"
-         finalize_command="$finalize_command @SYMFILE@"
-        fi
-        ;;
-
-      -L*)
-        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
-        case "$dir" in
-        /* | [A-Za-z]:\\*)
-         # Add the corresponding hardcode_libdir_flag, if it is not identical.
-          ;;
-        *)
-          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
-          exit 1
-          ;;
-        esac
-        deplibs="$deplibs $arg"
-        ;;
-
-      -l*) deplibs="$deplibs $arg" ;;
-
-      -no-undefined)
-       allow_undefined=no
-       continue
-       ;;
-
-      -o) prev=output ;;
-
-      -release)
-       prev=release
-       continue
-       ;;
-
-      -rpath)
-        prev=rpath
-        continue
-        ;;
-
-      -static)
-       # If we have no pic_flag, then this is the same as -all-static.
-       if test -z "$pic_flag" && test -n "$link_static_flag"; then
-          compile_command="$compile_command $link_static_flag"
-         finalize_command="$finalize_command $link_static_flag"
-        fi
-       continue
-       ;;
-
-      -version-info)
-        prev=vinfo
-        continue
-        ;;
-
-      # Some other compiler flag.
-      -* | +*)
-       # Unknown arguments in both finalize_command and compile_command need
-       # to be aesthetically quoted because they are evaled later.
-       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-       case "$arg" in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
-         arg="\"$arg\""
-         ;;
-       esac
-        ;;
-
-      *.o | *.a)
-        # A standard object.
-        objs="$objs $arg"
-        ;;
-
-      *.lo)
-        # A library object.
-       if test "$prev" = dlfiles; then
-         dlfiles="$dlfiles $arg"
-         if test "$build_libtool_libs" = yes; then
-           prev=
-           continue
-         else
-           # If libtool objects are unsupported, then we need to preload.
-           prev=dlprefiles
-         fi
-       fi
-
-       if test "$prev" = dlprefiles; then
-         # Preload the old-style object.
-         dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
-         prev=
-       fi
-       libobjs="$libobjs $arg"
-        ;;
-
-      *.la)
-        # A libtool-controlled library.
-
-        dlname=
-        libdir=
-        library_names=
-        old_library=
-
-        # Check to see that this really is a libtool archive.
-        if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
-        else
-          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
-          exit 1
-        fi
-
-        # If there is no directory component, then add one.
-        case "$arg" in
-        */* | *\\*) . $arg ;;
-        *) . ./$arg ;;
-        esac
-
-        if test -z "$libdir"; then
-          $echo "$modename: \`$arg' contains no -rpath information" 1>&2
-          exit 1
-        fi
-
-        # Get the name of the library we link against.
-        linklib=
-        for l in $old_library $library_names; do
-          linklib="$l"
-        done
-
-        if test -z "$linklib"; then
-          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
-          exit 1
-        fi
-
-        # Find the relevant object directory and library name.
-        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
-        dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-        if test "X$dir" = "X$arg"; then
-          dir="$objdir"
-        else
-          dir="$dir/$objdir"
-        fi
-
-        # This library was specified with -dlopen.
-        if test "$prev" = dlfiles; then
-          dlfiles="$dlfiles $arg"
-          if test -z "$dlname"; then
-            # If there is no dlname, we need to preload.
-            prev=dlprefiles
-          else
-            # We should not create a dependency on this library, but we
-           # may need any libraries it requires.
-           compile_command="$compile_command$dependency_libs"
-           finalize_command="$finalize_command$dependency_libs"
-            prev=
-            continue
-          fi
-        fi
-
-        # The library was specified with -dlpreopen.
-        if test "$prev" = dlprefiles; then
-          # Prefer using a static library (so that no silly _DYNAMIC symbols
-          # are required to link).
-          if test -n "$old_library"; then
-            dlprefiles="$dlprefiles $dir/$old_library"
-          else
-            dlprefiles="$dlprefiles $dir/$linklib"
-          fi
-          prev=
-        fi
-
-        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
-          link_against_libtool_libs="$link_against_libtool_libs $arg"
-          if test -n "$shlibpath_var"; then
-            # Make sure the rpath contains only unique directories.
-            case "$temp_rpath " in
-            *" $dir "*) ;;
-            *) temp_rpath="$temp_rpath $dir" ;;
-            esac
-          fi
-
-         # This is the magic to use -rpath.
-          if test -n "$hardcode_libdir_flag_spec"; then
-            if test -n "$hardcode_libdir_separator"; then
-              if test -z "$hardcode_libdirs"; then
-                # Put the magic libdir with the hardcode flag.
-                hardcode_libdirs="$libdir"
-                libdir="@HARDCODE_LIBDIRS@"
-              else
-                # Just accumulate the unique libdirs.
-               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
-               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-                 ;;
-               *)
-                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-                 ;;
-               esac
-                libdir=
-              fi
-            fi
-
-            if test -n "$libdir"; then
-              eval flag=\"$hardcode_libdir_flag_spec\"
-
-              compile_command="$compile_command $flag"
-              finalize_command="$finalize_command $flag"
-            fi
-          elif test -n "$runpath_var"; then
-            # Do the same for the permanent run path.
-            case "$perm_rpath " in
-            *" $libdir "*) ;;
-            *) perm_rpath="$perm_rpath $libdir" ;;
-            esac
-          fi
-
-
-          case "$hardcode_action" in
-          immediate)
-            if test "$hardcode_direct" = no; then
-              compile_command="$compile_command $dir/$linklib"
-            elif test "$hardcode_minus_L" = no; then
-              compile_command="$compile_command -L$dir -l$name"
-            elif test "$hardcode_shlibpath_var" = no; then
-              compile_shlibpath="$compile_shlibpath$dir:"
-              compile_command="$compile_command -l$name"
-            fi
-            ;;
-
-          relink)
-            # We need an absolute path.
-            case "$dir" in
-            /* | [A-Za-z]:\\*) ;;
-            *)
-              absdir=`cd "$dir" && pwd`
-              if test -z "$absdir"; then
-                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-                exit 1
-              fi
-              dir="$absdir"
-              ;;
-            esac
-
-            if test "$hardcode_direct" = yes; then
-              compile_command="$compile_command $dir/$linklib"
-            elif test "$hardcode_minus_L" = yes; then
-              compile_command="$compile_command -L$dir -l$name"
-            elif test "$hardcode_shlibpath_var" = yes; then
-              compile_shlibpath="$compile_shlibpath$dir:"
-              compile_command="$compile_command -l$name"
-            fi
-            ;;
-
-          *)
-            $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
-            exit 1
-            ;;
-          esac
-
-          # Finalize command for both is simple: just hardcode it.
-          if test "$hardcode_direct" = yes; then
-            finalize_command="$finalize_command $libdir/$linklib"
-          elif test "$hardcode_minus_L" = yes; then
-            finalize_command="$finalize_command -L$libdir -l$name"
-          elif test "$hardcode_shlibpath_var" = yes; then
-            finalize_shlibpath="$finalize_shlibpath$libdir:"
-            finalize_command="$finalize_command -l$name"
-          else
-            # We cannot seem to hardcode it, guess we'll fake it.
-            finalize_command="$finalize_command -L$libdir -l$name"
-          fi
-        else
-          # Transform directly to old archives if we don't build new libraries.
-          if test -n "$pic_flag" && test -z "$old_library"; then
-            $echo "$modename: cannot find static library for \`$arg'" 1>&2
-            exit 1
-          fi
-
-         # Here we assume that one of hardcode_direct or hardcode_minus_L
-         # is not unsupported.  This is valid on all known static and
-         # shared platforms.
-         if test "$hardcode_direct" != unsupported; then
-           test -n "$old_library" && linklib="$old_library"
-           compile_command="$compile_command $dir/$linklib"
-           finalize_command="$finalize_command $dir/$linklib"
-         else
-           compile_command="$compile_command -L$dir -l$name"
-           finalize_command="$finalize_command -L$dir -l$name"
-         fi
-        fi
-
-       # Add in any libraries that this one depends upon.
-       compile_command="$compile_command$dependency_libs"
-       finalize_command="$finalize_command$dependency_libs"
-       continue
-        ;;
-
-      # Some other compiler argument.
-      *)
-       # Unknown arguments in both finalize_command and compile_command need
-       # to be aesthetically quoted because they are evaled later.
-       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-       case "$arg" in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
-         arg="\"$arg\""
-         ;;
-       esac
-        ;;
-      esac
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-       compile_command="$compile_command $arg"
-       finalize_command="$finalize_command $arg"
-      fi
-    done
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    if test -n "$vinfo" && test -n "$release"; then
-      $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    oldlib=
-    oldobjs=
-    case "$output" in
-    "")
-      $echo "$modename: you must specify an output file" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-      ;;
-
-    */* | *\\*)
-      $echo "$modename: output file \`$output' must have no directory components" 1>&2
-      exit 1
-      ;;
-
-    *.a)
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      build_old_libs=yes
-      oldlib="$output"
-      $show "$rm $oldlib"
-      $run $rm $oldlib
-      ;;
-
-    *.la)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case "$output" in
-      lib*) ;;
-      *)
-       $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
-       $echo "$help" 1>&2
-       exit 1
-       ;;
-      esac
-
-      name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-      eval libname=\"$libname_spec\"
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-      current=0
-      revision=0
-      age=0
-
-      if test -n "$objs"; then
-        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
-        exit 1
-      fi
-
-      # How the heck are we supposed to write a wrapper for a shared library?
-      if test -n "$link_against_libtool_libs"; then
-        $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
-        exit 1
-      fi
-
-      if test -n "$dlfiles$dlprefiles"; then
-        $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
-        # Nullify the symbol file.
-        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-      fi
-
-      if test -z "$rpath"; then
-        $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
-       $echo "$help" 1>&2
-        exit 1
-      fi
-
-      set dummy $rpath
-      if test $# -gt 2; then
-       $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
-      fi
-      install_libdir="$2"
-
-      # Parse the version information argument.
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=':'
-      set dummy $vinfo
-      IFS="$save_ifs"
-
-      if test -n "$5"; then
-        $echo "$modename: too many parameters to \`-version-info'" 1>&2
-        $echo "$help" 1>&2
-        exit 1
-      fi
-
-      test -n "$2" && current="$2"
-      test -n "$3" && revision="$3"
-      test -n "$4" && age="$4"
-
-      # Check that each of the things are valid numbers.
-      case "$current" in
-      0 | [1-9] | [1-9][0-9]*) ;;
-      *)
-        $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
-        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-        exit 1
-        ;;
-      esac
-
-      case "$revision" in
-      0 | [1-9] | [1-9][0-9]*) ;;
-      *)
-        $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
-        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-        exit 1
-        ;;
-      esac
-
-      case "$age" in
-      0 | [1-9] | [1-9][0-9]*) ;;
-      *)
-        $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
-        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-        exit 1
-        ;;
-      esac
-
-      if test $age -gt $current; then
-        $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
-        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-        exit 1
-      fi
-
-      # Calculate the version variables.
-      version_vars="version_type current age revision"
-      case "$version_type" in
-      none) ;;
-
-      linux)
-        version_vars="$version_vars major versuffix"
-        major=`expr $current - $age`
-        versuffix="$major.$age.$revision"
-        ;;
-
-      osf)
-        version_vars="$version_vars versuffix verstring"
-        major=`expr $current - $age`
-        versuffix="$current.$age.$revision"
-        verstring="$versuffix"
-
-        # Add in all the interfaces that we are compatible with.
-        loop=$age
-        while test $loop != 0; do
-          iface=`expr $current - $loop`
-          loop=`expr $loop - 1`
-          verstring="$verstring:${iface}.0"
-        done
-
-        # Make executables depend on our current version.
-        verstring="$verstring:${current}.0"
-        ;;
-
-      sunos)
-        version_vars="$version_vars major versuffix"
-        major="$current"
-        versuffix="$current.$revision"
-        ;;
-
-      *)
-        $echo "$modename: unknown library version type \`$version_type'" 1>&2
-        echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-        exit 1
-        ;;
-      esac
-
-      # Create the output directory, or remove our outputs if we need to.
-      if test -d $objdir; then
-        $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
-        $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
-      else
-        $show "$mkdir $objdir"
-        $run $mkdir $objdir
-       status=$?
-       if test $status -eq 0 || test -d $objdir; then :
-       else
-         exit $status
-       fi
-      fi
-
-      # Check to see if the archive will have undefined symbols.
-      if test "$allow_undefined" = yes; then
-        if test "$allow_undefined_flag" = unsupported; then
-          $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
-          build_libtool_libs=no
-         build_old_libs=yes
-        fi
-      else
-        # Don't allow undefined symbols.
-        allow_undefined_flag="$no_undefined_flag"
-      fi
-
-      # Add libc to deplibs on all systems.
-      dependency_libs="$deplibs"
-      deplibs="$deplibs -lc"
-
-      if test "$build_libtool_libs" = yes; then
-        # Get the real and link names of the library.
-        eval library_names=\"$library_names_spec\"
-        set dummy $library_names
-        realname="$2"
-        shift; shift
-
-        if test -n "$soname_spec"; then
-          eval soname=\"$soname_spec\"
-        else
-          soname="$realname"
-        fi
-
-        lib="$objdir/$realname"
-       for link
-       do
-         linknames="$linknames $link"
-       done
-
-        # Use standard objects if they are PIC.
-        test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
-
-        # Do each of the archive commands.
-        eval cmds=\"$archive_cmds\"
-        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
-        for cmd in $cmds; do
-          IFS="$save_ifs"
-          $show "$cmd"
-          $run eval "$cmd" || exit $?
-        done
-        IFS="$save_ifs"
-
-        # Create links to the real library.
-        for linkname in $linknames; do
-          $show "(cd $objdir && $LN_S $realname $linkname)"
-          $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
-        done
-
-        # If -export-dynamic was specified, set the dlname.
-        if test "$export_dynamic" = yes; then
-          # On all known operating systems, these are identical.
-          dlname="$soname"
-        fi
-      fi
-
-      # Now set the variables for building old libraries.
-      oldlib="$objdir/$libname.a"
-      ;;
-
-    *.lo | *.o)
-      if test -n "$link_against_libtool_libs"; then
-        $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
-        exit 1
-      fi
-
-      if test -n "$deplibs"; then
-        $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
-      fi
-
-      if test -n "$dlfiles$dlprefiles"; then
-        $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
-        # Nullify the symbol file.
-        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-      fi
-
-      if test -n "$rpath"; then
-        $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-        $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
-      fi
-
-      if test -n "$release"; then
-        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
-      fi
-
-      case "$output" in
-      *.lo)
-        if test -n "$objs"; then
-          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-          exit 1
-        fi
-        libobj="$output"
-        obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
-        ;;
-      *)
-        libobj=
-        obj="$output"
-        ;;
-      esac
-
-      # Delete the old objects.
-      $run $rm $obj $libobj
-
-      # Create the old-style object.
-      reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
-
-      output="$obj"
-      eval cmds=\"$reload_cmds\"
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
-      for cmd in $cmds; do
-        IFS="$save_ifs"
-        $show "$cmd"
-        $run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-
-      # Exit if we aren't doing a library object file.
-      test -z "$libobj" && exit 0
-
-      if test "$build_libtool_libs" != yes; then
-        # Create an invalid libtool object if no PIC, so that we don't
-        # accidentally link it into a program.
-        $show "echo timestamp > $libobj"
-        $run eval "echo timestamp > $libobj" || exit $?
-        exit 0
-      fi
-
-      if test -n "$pic_flag"; then
-        # Only do commands if we really have different PIC objects.
-        reload_objs="$libobjs"
-        output="$libobj"
-        eval cmds=\"$reload_cmds\"
-        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
-        for cmd in $cmds; do
-          IFS="$save_ifs"
-          $show "$cmd"
-          $run eval "$cmd" || exit $?
-        done
-        IFS="$save_ifs"
-      else
-        # Just create a symlink.
-        $show "$LN_S $obj $libobj"
-        $run $LN_S $obj $libobj || exit 1
-      fi
-
-      exit 0
-      ;;
-
-    *)
-      if test -n "$vinfo"; then
-        $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
-      fi
-
-      if test -n "$release"; then
-        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
-      fi
-
-      if test -n "$rpath"; then
-       # If the user specified any rpath flags, then add them.
-       for libdir in $rpath; do
-          if test -n "$hardcode_libdir_flag_spec"; then
-            if test -n "$hardcode_libdir_separator"; then
-              if test -z "$hardcode_libdirs"; then
-                # Put the magic libdir with the hardcode flag.
-                hardcode_libdirs="$libdir"
-                libdir="@HARDCODE_LIBDIRS@"
-              else
-                # Just accumulate the unique libdirs.
-               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
-               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-                 ;;
-               *)
-                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-                 ;;
-               esac
-                libdir=
-              fi
-            fi
-
-            if test -n "$libdir"; then
-              eval flag=\"$hardcode_libdir_flag_spec\"
-
-              compile_command="$compile_command $flag"
-              finalize_command="$finalize_command $flag"
-            fi
-          elif test -n "$runpath_var"; then
-            case "$perm_rpath " in
-            *" $libdir "*) ;;
-            *) perm_rpath="$perm_rpath $libdir" ;;
-            esac
-          fi
-       done
-      fi
-
-      # Substitute the hardcoded libdirs into the compile commands.
-      if test -n "$hardcode_libdir_separator"; then
-       compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
-       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
-      fi
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-        # Transform all the library objects into standard objects.
-        compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
-        finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
-      fi
-
-      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
-        dlsyms="${output}S.c"
-      else
-        dlsyms=
-      fi
-
-      if test -n "$dlsyms"; then
-        # Add our own program objects to the preloaded list.
-        dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
-
-       # Discover the nlist of each of the dlfiles.
-        nlist="$objdir/${output}.nm"
-
-       if test -d $objdir; then
-         $show "$rm $nlist ${nlist}T"
-         $run $rm "$nlist" "${nlist}T"
-       else
-         $show "$mkdir $objdir"
-         $run $mkdir $objdir
-         status=$?
-         if test $status -eq 0 || test -d $objdir; then :
-         else
-           exit $status
-         fi
-       fi
-
-        for arg in $dlprefiles; do
-         $show "extracting global C symbols from \`$arg'"
-         $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-        done
-
-        # Parse the name list into a source file.
-        $show "creating $objdir/$dlsyms"
-        if test -z "$run"; then
-         # Make sure we at least have an empty file.
-         test -f "$nlist" || : > "$nlist"
-
-         # Try sorting and uniquifying the output.
-         if sort "$nlist" | uniq > "$nlist"T; then
-           mv -f "$nlist"T "$nlist"
-           wcout=`wc "$nlist" 2>/dev/null`
-           count=`echo "X$wcout" | $Xsed -e 's/^[      ]*\([0-9][0-9]*\).*$/\1/'`
-           (test "$count" -ge 0) 2>/dev/null || count=-1
-         else
-           $rm "$nlist"T
-           count=-1
-         fi
-
-         case "$dlsyms" in
-         "") ;;
-         *.c)
-           $echo > "$objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define dld_preloaded_symbol_count some_other_symbol
-#define dld_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
-           if test -f "$nlist"; then
-             sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
-           else
-             echo '/* NONE */' >> "$objdir/$dlsyms"
-           fi
-
-           $echo >> "$objdir/$dlsyms" "\
-
-#undef dld_preloaded_symbol_count
-#undef dld_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define __ptr_t void *
-#else
-# define __ptr_t char *
-#endif
-
-/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
-int dld_preloaded_symbol_count = $count;
-
-/* The mapping between symbol names and symbols. */
-struct {
-  char *name;
-  __ptr_t address;
-}
-dld_preloaded_symbols[] =
-{\
-"
-
-           if test -f "$nlist"; then
-             sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
-           fi
-
-           $echo >> "$objdir/$dlsyms" "\
-  {0, (__ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif\
-"
-           ;;
-
-         *)
-           $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-           exit 1
-           ;;
-         esac
-        fi
-
-        # Now compile the dynamic symbol file.
-        $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
-        $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
-
-        # Transform the symbol file into the correct name.
-        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
-        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
-      elif test "$export_dynamic" != yes; then
-        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
-      else
-        # We keep going just in case the user didn't refer to
-        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
-        # really was required.
-        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
-
-        # Nullify the symbol file.
-        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-      fi
-
-      if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
-        # Replace the output file specification.
-        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-
-        # We have no uninstalled library dependencies, so finalize right now.
-        $show "$compile_command"
-        $run eval "$compile_command"
-        exit $?
-      fi
-
-      # Replace the output file specification.
-      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
-      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
-
-      # Create the binary in the object directory, then wrap it.
-      if test -d $objdir; then :
-      else
-        $show "$mkdir $objdir"
-       $run $mkdir $objdir
-       status=$?
-       if test $status -eq 0 || test -d $objdir; then :
-       else
-         exit $status
-       fi
-      fi
-
-      if test -n "$shlibpath_var"; then
-        # We should set the shlibpath_var
-        rpath=
-        for dir in $temp_rpath; do
-          case "$dir" in
-          /* | [A-Za-z]:\\*)
-            # Absolute path.
-            rpath="$rpath$dir:"
-            ;;
-          *)
-            # Relative path: add a thisdir entry.
-            rpath="$rpath\$thisdir/$dir:"
-            ;;
-          esac
-        done
-        temp_rpath="$rpath"
-      fi
-
-      # Delete the old output file.
-      $run $rm $output
-
-      if test -n "$compile_shlibpath"; then
-        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      if test -n "$runpath_var" && test -n "$perm_rpath"; then
-        # We should set the runpath_var.
-        rpath=
-        for dir in $perm_rpath; do
-          rpath="$rpath$dir:"
-        done
-        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
-        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
-      fi
-
-      case "$hardcode_action" in
-      relink)
-        # AGH! Flame the AIX and HP-UX people for me, will ya?
-        $echo "$modename: warning: using a buggy system linker" 1>&2
-        $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
-        ;;
-      esac
-
-      $show "$compile_command"
-      $run eval "$compile_command" || exit $?
-
-      # Now create the wrapper script.
-      $show "creating $output"
-
-      # Quote the finalize command for shipping.
-      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
-
-      # Quote $echo for shipping.
-      qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
-
-      # Only actually do things if our run command is non-null.
-      if test -z "$run"; then
-        $rm $output
-        trap "$rm $output; exit 1" 1 2 15
-
-        $echo > $output "\
-#! /bin/sh
-
-# $output - temporary wrapper script for $objdir/$output
-# Generated by ltmain.sh - GNU $PACKAGE $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of \``pwd`'.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  link_against_libtool_libs='$link_against_libtool_libs'
-  finalize_command=\"$finalize_command\"
-else
-  # When we are sourced in execute mode, \$file and \$echo are already set.
-  if test \"\$libtool_execute_magic\" = \"$magic\"; then :
-  else
-    echo=\"$qecho\"
-    file=\"\$0\"
-  fi\
-"
-        $echo >> $output "\
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
-  done
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-
-  progdir=\"\$thisdir/$objdir\"
-  program='$output'
-
-  if test -f \"\$progdir/\$program\"; then"
-
-        # Export our shlibpath_var if we have one.
-        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-          $echo >> $output "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
-
-    export $shlibpath_var
-"
-        fi
-
-        $echo >> $output "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-
-      # Export the path to the program.
-      PATH=\"\$progdir:\$PATH\"
-      export PATH
-
-      exec \$program \${1+\"\$@\"}
-
-      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
-      exit 1
-    fi
-  else
-    # The program doesn't exist.
-    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
-    \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-        chmod +x $output
-      fi
-      exit 0
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    if test "$build_old_libs" = "yes"; then
-      # Transform .lo files to .o files.
-      oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       eval cmds=\"$old_archive_from_new_cmds\"
-      else
-       eval cmds=\"$old_archive_cmds\"
-      fi
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
-      for cmd in $cmds; do
-        IFS="$save_ifs"
-        $show "$cmd"
-        $run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    fi
-
-    # Now create the libtool archive.
-    case "$output" in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.a"
-
-      $show "creating $output"
-
-      # Only create the output if not a dry run.
-      if test -z "$run"; then
-        $echo > $output "\
-# $output - a libtool library file
-# Generated by ltmain.sh - GNU $PACKAGE $VERSION
-
-# The name that we can dlopen(3).
-dlname='$dlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'\
-"
-      fi
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      $show "(cd $objdir && $LN_S ../$output $output)"
-      $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
-      ;;
-    esac
-    exit 0
-    ;;
-
-  # libtool install mode
-  install)
-    modename="$modename: install"
-
-    # There may be an optional /bin/sh argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL"; then
-      # Aesthetically quote it.
-      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
-      case "$arg" in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
-       arg="\"$arg\""
-       ;;
-      esac
-      install_prog="$arg "
-      arg="$1"
-      shift
-    else
-      install_prog=
-      arg="$nonopt"
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-    case "$arg" in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
-      arg="\"$arg\""
-      ;;
-    esac
-    install_prog="$install_prog$arg"
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-        files="$files $dest"
-        dest="$arg"
-        continue
-      fi
-
-      case "$arg" in
-      -d) isdir=yes ;;
-      -f) prev="-f" ;;
-      -g) prev="-g" ;;
-      -m) prev="-m" ;;
-      -o) prev="-o" ;;
-      -s)
-        stripme=" -s"
-        continue
-        ;;
-      -*) ;;
-
-      *)
-        # If the previous option needed an argument, then skip it.
-        if test -n "$prev"; then
-          prev=
-        else
-          dest="$arg"
-          continue
-        fi
-        ;;
-      esac
-
-      # Aesthetically quote the argument.
-      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-      case "$arg" in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
-       arg="\"$arg\""
-       ;;
-      esac
-      install_prog="$install_prog $arg"
-    done
-
-    if test -z "$install_prog"; then
-      $echo "$modename: you must specify an install program" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prev' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-        $echo "$modename: no file or destination specified" 1>&2
-      else
-        $echo "$modename: you must specify a destination" 1>&2
-      fi
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    # Strip any trailing slash from the destination.
-    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test -n "$isdir"; then
-      destdir="$dest"
-      destname=
-    else
-      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$destdir" = "X$dest" && destdir=.
-      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      if test $# -gt 2; then
-        $echo "$modename: \`$dest' is not a directory" 1>&2
-        $echo "$help" 1>&2
-        exit 1
-      fi
-    fi
-    case "$destdir" in
-    /* | [A-Za-z]:\\*) ;;
-    *)
-      for file in $files; do
-        case "$file" in
-        *.lo) ;;
-        *)
-          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
-          $echo "$help" 1>&2
-          exit 1
-          ;;
-        esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case "$file" in
-      *.a)
-        # Do the static libraries later.
-        staticlibs="$staticlibs $file"
-        ;;
-
-      *.la)
-        # Check to see that this really is a libtool archive.
-        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
-        else
-          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
-          $echo "$help" 1>&2
-          exit 1
-        fi
-
-        library_names=
-        old_library=
-        # If there is no directory component, then add one.
-        case "$file" in
-        */* | *\\*) . $file ;;
-        *) . ./$file ;;
-        esac
-
-        # Add the libdir to current_libdirs if it is the destination.
-        if test "X$destdir" = "X$libdir"; then
-          case "$current_libdirs " in
-          *" $libdir "*) ;;
-          *) current_libdirs="$current_libdirs $libdir" ;;
-          esac
-        else
-          # Note the libdir as a future libdir.
-          case "$future_libdirs " in
-          *" $libdir "*) ;;
-          *) future_libdirs="$future_libdirs $libdir" ;;
-          esac
-        fi
-
-        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
-        test "X$dir" = "X$file/" && dir=
-        dir="$dir$objdir"
-
-        # See the names of the shared library.
-        set dummy $library_names
-        if test -n "$2"; then
-          realname="$2"
-          shift
-          shift
-
-          # Install the shared library and build the symlinks.
-          $show "$install_prog $dir/$realname $destdir/$realname"
-          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
-          test "X$dlname" = "X$realname" && dlname=
-
-          if test $# -gt 0; then
-            # Delete the old symlinks.
-            rmcmd="$rm"
-            for linkname
-            do
-              rmcmd="$rmcmd $destdir/$linkname"
-            done
-            $show "$rmcmd"
-            $run $rmcmd
-
-            # ... and create new ones.
-            for linkname
-            do
-              test "X$dlname" = "X$linkname" && dlname=
-              $show "(cd $destdir && $LN_S $realname $linkname)"
-              $run eval "(cd $destdir && $LN_S $realname $linkname)"
-            done
-          fi
-
-          if test -n "$dlname"; then
-            # Install the dynamically-loadable library.
-            $show "$install_prog $dir/$dlname $destdir/$dlname"
-            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
-          fi
-
-          # Do each command in the postinstall commands.
-          lib="$destdir/$realname"
-          eval cmds=\"$postinstall_cmds\"
-          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
-          for cmd in $cmds; do
-            IFS="$save_ifs"
-            $show "$cmd"
-            $run eval "$cmd" || exit $?
-          done
-          IFS="$save_ifs"
-        fi
-
-        # Install the pseudo-library for information purposes.
-        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-        $show "$install_prog $file $destdir/$name"
-        $run eval "$install_prog $file $destdir/$name" || exit $?
-
-        # Maybe install the static library, too.
-        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-        ;;
-
-      *.lo)
-        # Install (i.e. copy) a libtool object.
-
-        # Figure out destination file name, if it wasn't already specified.
-        if test -n "$destname"; then
-          destfile="$destdir/$destname"
-        else
-          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-          destfile="$destdir/$destfile"
-        fi
-
-        # Deduce the name of the destination old-style object file.
-        case "$destfile" in
-        *.lo)
-          staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
-          ;;
-        *.o)
-          staticdest="$destfile"
-          destfile=
-          ;;
-        *)
-          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
-          $echo "$help" 1>&2
-          exit 1
-          ;;
-        esac
-
-        # Install the libtool object if requested.
-        if test -n "$destfile"; then
-          $show "$install_prog $file $destfile"
-          $run eval "$install_prog $file $destfile" || exit $?
-        fi
-
-        # Install the old object if enabled.
-        if test "$build_old_libs" = yes; then
-          # Deduce the name of the old-style object file.
-          staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
-
-          $show "$install_prog $staticobj $staticdest"
-          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
-        fi
-        exit 0
-        ;;
-
-      *)
-        # Do a test to see if this is really a libtool program.
-        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
-          link_against_libtool_libs=
-          finalize_command=
-
-          # If there is no directory component, then add one.
-          case "$file" in
-          */* | *\\*) . $file ;;
-          *) . ./$file ;;
-          esac
-
-          # Check the variables that should have been set.
-          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
-            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
-            exit 1
-          fi
-
-          finalize=yes
-          for lib in $link_against_libtool_libs; do
-            # Check to see that each library is installed.
-            libdir=
-            if test -f "$lib"; then
-              # If there is no directory component, then add one.
-              case "$lib" in
-              */* | *\\*) . $lib ;;
-              *) . ./$lib ;;
-              esac
-            fi
-            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
-            if test -z "$libdir"; then
-              $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
-            elif test -f "$libfile"; then :
-            else
-              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-              finalize=no
-            fi
-          done
-
-          if test "$hardcode_action" = relink; then
-            if test "$finalize" = yes; then
-              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
-              $show "$finalize_command"
-              if $run eval "$finalize_command"; then :
-              else
-                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-                continue
-              fi
-              file="$objdir/$file"T
-            else
-              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
-            fi
-          else
-            # Install the binary that we compiled earlier.
-           file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-          fi
-        fi
-
-        $show "$install_prog$stripme $file $dest"
-        $run eval "$install_prog\$stripme \$file \$dest" || exit $?
-        ;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-
-      $show "$install_prog $file $oldlib"
-      $run eval "$install_prog \$file \$oldlib" || exit $?
-
-      # Do each command in the postinstall commands.
-      eval cmds=\"$old_postinstall_cmds\"
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
-      for cmd in $cmds; do
-        IFS="$save_ifs"
-        $show "$cmd"
-        $run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
-
-    if test -n "$future_libdirs"; then
-      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
-    fi
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec $SHELL $0 --finish$current_libdirs
-      exit 1
-    fi
-
-    exit 0
-    ;;
-
-  # libtool finish mode
-  finish)
-    modename="$modename: finish"
-    libdirs="$nonopt"
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-        libdirs="$libdirs $dir"
-      done
-
-      for libdir in $libdirs; do
-       if test -n "$finish_cmds"; then
-         # Do each command in the finish commands.
-         eval cmds=\"$finish_cmds\"
-          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
-          for cmd in $cmds; do
-            IFS="$save_ifs"
-            $show "$cmd"
-            $run eval "$cmd"
-          done
-          IFS="$save_ifs"
-       fi
-       if test -n "$finish_eval"; then
-         # Do the single finish_eval.
-         eval cmds=\"$finish_eval\"
-         $run eval "$cmds"
-       fi
-      done
-    fi
-
-    echo "------------------------------------------------------------------------------"
-    echo "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      echo "   $libdir"
-    done
-    echo
-    echo "To link against installed libraries in a given directory, LIBDIR,"
-    echo "you must use the \`-LLIBDIR' flag during linking."
-    echo
-    echo " You will also need to do one of the following:"
-    if test -n "$shlibpath_var"; then
-      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      echo "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      echo "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      echo "   - use the \`$flag' linker flag"
-    fi
-    if test -f /etc/ld.so.conf; then
-      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    echo
-    echo "See any operating system documentation about shared libraries for"
-    echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    echo "------------------------------------------------------------------------------"
-    exit 0
-    ;;
-
-  # libtool execute mode
-  execute)
-    modename="$modename: execute"
-
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit 1
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test -f "$file"; then :
-      else
-       $echo "$modename: \`$file' is not a file" 1>&2
-       $echo "$help" 1>&2
-       exit 1
-      fi
-
-      dir=
-      case "$file" in
-      *.la)
-        # Check to see that this really is a libtool archive.
-        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
-        else
-          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-          $echo "$help" 1>&2
-          exit 1
-        fi
-
-       # Read the libtool library.
-       dlname=
-       library_names=
-
-        # If there is no directory component, then add one.
-       case "$file" in
-       */* | *\\*) . $file ;;
-        *) . ./$file ;;
-       esac
-
-       # Skip this library if it cannot be dlopened.
-       if test -z "$dlname"; then
-         # Warn if it was a shared library.
-         test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-         continue
-       fi
-
-       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-       test "X$dir" = "X$file" && dir=.
-
-       if test -f "$dir/$objdir/$dlname"; then
-         dir="$dir/$objdir"
-       else
-         $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-         exit 1
-       fi
-       ;;
-
-      *.lo)
-       # Just add the directory containing the .lo file.
-       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-       test "X$dir" = "X$file" && dir=.
-       ;;
-
-      *)
-       $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-        continue
-       ;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-       eval "$shlibpath_var=\"\$dir\""
-      else
-       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case "$file" in
-      -*) ;;
-      *)
-        # Do a test to see if this is really a libtool program.
-        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
-         # If there is no directory component, then add one.
-         case "$file" in
-         */* | *\\*) . $file ;;
-         *) . ./$file ;;
-         esac
-
-         # Transform arg to wrapped name.
-         file="$progdir/$program"
-       fi
-        ;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
-
-    if test -z "$run"; then
-      # Export the shlibpath_var.
-      eval "export $shlibpath_var"
-
-      # Now actually exec the command.
-      eval "exec \$cmd$args"
-
-      $echo "$modename: cannot exec \$cmd$args"
-      exit 1
-    else
-      # Display what would be done.
-      eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-      $echo "export $shlibpath_var"
-      $echo "$cmd$args"
-      exit 0
-    fi
-    ;;
-
-  # libtool uninstall mode
-  uninstall)
-    modename="$modename: uninstall"
-    rm="$nonopt"
-    files=
-
-    for arg
-    do
-      case "$arg" in
-      -*) rm="$rm $arg" ;;
-      *) files="$files $arg" ;;
-      esac
-    done
-
-    if test -z "$rm"; then
-      $echo "$modename: you must specify an RM program" 1>&2
-      $echo "$help" 1>&2
-      exit 1
-    fi
-
-    for file in $files; do
-      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$dir" = "X$file" && dir=.
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      rmfiles="$file"
-
-      case "$name" in
-      *.la)
-        # Possibly a libtool archive, so verify it.
-        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
-          . $dir/$name
-
-          # Delete the libtool libraries and symlinks.
-          for n in $library_names; do
-            rmfiles="$rmfiles $dir/$n"
-            test "X$n" = "X$dlname" && dlname=
-          done
-          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
-          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
-
-         $show "$rm $rmfiles"
-         $run $rm $rmfiles
-
-         if test -n "$library_names"; then
-           # Do each command in the postuninstall commands.
-           eval cmds=\"$postuninstall_cmds\"
-           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
-           for cmd in $cmds; do
-             IFS="$save_ifs"
-             $show "$cmd"
-             $run eval "$cmd"
-           done
-           IFS="$save_ifs"
-         fi
-
-          if test -n "$old_library"; then
-           # Do each command in the old_postuninstall commands.
-           eval cmds=\"$old_postuninstall_cmds\"
-           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
-           for cmd in $cmds; do
-             IFS="$save_ifs"
-             $show "$cmd"
-             $run eval "$cmd"
-           done
-           IFS="$save_ifs"
-         fi
-
-          # FIXME: should reinstall the best remaining shared library.
-        fi
-        ;;
-
-      *.lo)
-        if test "$build_old_libs" = yes; then
-          oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
-          rmfiles="$rmfiles $dir/$oldobj"
-        fi
-       $show "$rm $rmfiles"
-       $run $rm $rmfiles
-        ;;
-
-      *)
-       $show "$rm $rmfiles"
-       $run $rm $rmfiles
-       ;;
-      esac
-    done
-    exit 0
-    ;;
-
-  "")
-    $echo "$modename: you must specify a MODE" 1>&2
-    $echo "$generic_help" 1>&2
-    exit 1
-    ;;
-  esac
-
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$generic_help" 1>&2
-  exit 1
-fi # test -z "$show_help"
-
-# We need to display help for each of the modes.
-case "$mode" in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
--n, --dry-run         display commands without modifying any files
-    --features        display configuration information and exit
-    --finish          same as \`--mode=finish'
-    --help            display this help message and exit
-    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
-    --quiet           same as \`--silent'
-    --silent          don't print informational messages
-    --version         print version information
-
-MODE must be one of the following:
-
-      compile         compile a source file into a libtool object
-      execute         automatically set library path, then run a program
-      finish          complete the installation of libtool libraries
-      install         install libraries or executables
-      link            create a library or an executable
-      uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE."
-  exit 0
-  ;;
-
-compile)
-  $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-  ;;
-
-execute)
-  $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-  ;;
-
-finish)
-  $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-  ;;
-
-install)
-  $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-  ;;
-
-link)
-  $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -static           do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
-library objects (\`.lo' files) may be specified, and \`-rpath' is required.
-
-If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
-and \`ranlib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
-created, otherwise an executable program is created."
-  ;;
-
-uninstall)
-  $echo
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-*)
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$help" 1>&2
-  exit 1
-  ;;
-esac
-
-echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit 0
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/bin/ly2dvi-old.sh b/bin/ly2dvi-old.sh
deleted file mode 100644 (file)
index b2e0330..0000000
+++ /dev/null
@@ -1,1005 +0,0 @@
-#!/bin/sh
-#
-# Script to make a LaTeX file for Lilypond
-#
-# Written by Jan Arne Fagertun <Jan.A.Fagertun@energy.sintef.no>
-#  Sat Nov 22 22:26:43 CET 1997
-#
-# $Id: ly2dvi.sh,v 1.16 1998/05/08 21:18:34 janaf Exp $
-#
-#  Original LaTeX file made by Mats Bengtsson, 17/8 1997
-#
-
-VERSION="0.12.jcn1"
-NAME=ly2dvi.sh
-IDENTIFICATION="$NAME $VERSION" 
-NOW=`date`
-echo "$IDENTIFICATION" 1>&2
-
-# TODO:
-#  prevent orphaned "Lily is here" strings
-
-# NEWS
-
-# 0.12.jcn1
-#  - mudelaDefs really fixed (sorry, PC)
-
-# 0.12
-#  - -S/--sourcedir switch
-
-#
-#0.11.jcn3
-# - mudelaDefs fixes, (thanks PC)
-#0.11.jcn2
-# - pass -I, --include to Lily
-# - bf: split $LILYINCLUDE and try all dirs
-# - bf: geometry left/top
-#
-#0.11.pc
-# - fix backslash gobbling, reduce number of separate processes used
-# - require readable rc files, allow rc file in /usr/local/share/lilypond/lilyrc
-# - use latex path, not tex path
-# - Don't override if kpsepath returns non-NULL
-# - Don't clobber x.tex if it wasn't created by ly2dvi
-#
-#
-#0.11.jcn1
-# - find .fly files too
-#
-#0.11.hwn1
-# - height vs heigth
-# - robustification: give \nonstopmode as LaTeX arg; no hanging if no TeX file.
-# - robustification: notice failed cp.
-
-#0.11
-#      - more papersizes (thanks Han-Wen) - don't expect LaTeX to accept all...
-#      - -W,--Width=       : set paper width  (points)
-#       - -H,--Height=      : set paper height (points)
-#      - -H and -W is used only when an unknown papersize is to be specified,
-#        and has to be combined with a papersize option known to LaTeX
-#NB!   - -F,--headers=     : name of additional LaTeX headers input file.
-#NB!      Changed from -H to -F
-#      - -d,--dependencies : passed to lilypond
-
-
-#0.10.jcn1
-#      - HEIGHT -> HEIGHT
-#      - vertical margins (for a4), same on both sides
-#      - textheight from lilypond output file (mudelapapertextheight)
-#      - piece titling
-#      - mudelapiece, mudelaopus
-#
-#0.10
-#      - -K,--keeplilypond : Keep lilypond output files (default delete)
-#      - -k,--keeply2dvi   : Keep ly2dvi   output files (default delete)
-#      - -L,--landscape    : Set landscape orientation
-#      - -N,--nonumber     : Turn off page numbering (\pagestyle{empty})
-#      - Could not reinsert "\usepackage[T1]{fontenc}" because
-#        "los-toros" won't work with it
-#      - Ekstra LaTeX headers from input file
-#0.9.hwn1
-#       - option to remove output of lily
-# 0.9
-#      - Trap Lilypond abort
-#      - Replaced "\usepackage[T1]{fontenc}" with
-#        \usepackage[latin1]{inputenc} (takk, Mats)
-#      - Removed "()" around "\LilyIdString" (Janne didn't want it)
-# 0.8  - Trap Lilypond segmentation fault
-#      - Function for cleanup
-#      - Trap line
-#      - More human-readable variables
-#      - Some logics concerning rc-files
-# 0.7
-#      - Improved Lilypond error checking
-#      - Output orientation (landscape...). Overrides mudela file
-#        variable orientation="landscape";
-#      - Paper width and height put into variables (only A4!)
-#      - Adjusted top margin to default.....
-#
-#TODO
-#      - Include more papersizes.
-#      - Manual page.......
-# 0.6.jaf2
-#      - LILYINCLUDE update
-#
-# 0.6.hwn1
-#      - handle LILYINCLUDE
-#       - --output
-#
-# 0.6
-#      - Source rc-files, if present. Files are:
-#        /usr/local/share/lilyrc /etc/lilyrc $HOME/.lilyrc ./.lilyrc
-#      - tee output from Lilypond
-#      - Handles margins for A4 paper (equal on both sides)
-#      - new option -s (--separate) for one LaTeX run per file,
-#        else all files are run together
-#
-# 0.5
-#      - More useful ("two-level") debug.
-#      - The Q&D hack to find file names and not handling \include
-#        is replaced by grabbing output file names from Lilypond.
-#      = Detects multiple output files - adds them when running
-#        LaTeX.
-#      - Works with multiple input files - no matter if they are
-#        (a mix of) input to or output from Lilypond.
-#
-#TODO
-#      - Still no margins handling.
-#      - We have to discuss how to handle multiple output files
-#        from Lilypond - 'ly2dvi standchen' gives a rather odd
-#        result....
-
-# 0.4.1
-#      - Always exit after printing help info
-# 0.4
-#      - Changes to ensure for more strict grep'ing of parameters
-#        Thanks to from G.B.Stott@bolton.ac.uk
-#      - More efficient use of sed -e 's///' -e 's///'
-#        Thanks to Johan Vromans <jvromans@squirrel.nl> and GBS
-#      - Ask tex for location of titledefs.tex (Thanks to JV)
-#      - Accept only exact match of "\def\mudelacomposer{"
-#        (or whatever mudela* defined in titledefs.tex)
-#      - Even more efficient use of sed (Thanks to JV)
-#      - Default file name for single output file implemented.
-#      - Moved help into function - finally included from 0.1.jcn1
-#
-#TODO
-#      - Still doesn't handle \include
-#      - The Q&D for finding output file name from the sequence of
-#        \paper \output \midi \output really needs to be looked at.
-#        I have improved it a lot, but it's only capable of finding
-#        one (the last) file name.
-#        Well, I have to rewrite this entirely to handle \include,
-#        then I can fix it.
-#      - Still no margins handling.
-#
-#WARNING
-#      - Some lines of output from lilypond do NOT start
-#        at first character position, therefore I have removed "^"
-#        in sed'ing and grep'ing.
-
-# 0.3.hwn1
-#      - add "Creator: " line to output
-#
-# 0.3
-#      - multiple input files to make score from several files
-#        (extra files assumed to be Lilypond output)
-#      - cp dvi-file instead of mv, to allow for xdvi reload
-#      - check for illegal long options
-#      - put in pt in text width, if not given
-#      - put in \nonstopmode in LaTeX file
-#      - restored LaTeX exit value check
-# 0.2.1
-#      - temporarily omit LaTeX exit value check
-#      - remove ALL temporary files
-
-# 0.2
-#      - fix for solaris          - included from 0.1.jcn1
-#      - long option hack         - included from 0.1.jcn1 - modified
-#      - moved help into function - NOT included from 0.1.jcn1 yet
-#      - various improvements     - included from 0.1.jcn1
-#      - find mudela definitions from titledefs.tex
-#      - find papersize from lilypond output file (mudelapapersize),
-#        overridden by option '-p size' or '--papersize=size'
-#      - option -l lang or --language=lang overrides
-#        lilypond output file definition (mudelalanguage)
-#      - textwidth from lilypond output file (mudelapaperlinewidth)
-
-# 0.1.jcn1
-#      - fix for solaris
-#      - long option hack
-#      - moved help into function
-
-#
-# Clean up
-#
-cleanup() {
-  if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
-  then
-    [ -n "$LatF" -a -f "$LatF" ]       && rm -f $LatF
-    [ -n "$LOGFILE" -a -f "$LOGFILE" ] && rm -f $LOGFILE
-    [ -n "$FN" ]                       && rm -f $FN.*
-    for F in *$$* $TMP/*$$*
-    do
-      rm -f $F
-    done
-  fi
-  if [ "$KEEP_LILY_OUTPUT" != "Y" ]
-  then
-    for F in $LILY_OUTPUT_FILES
-    do
-      [ -f $F ] && rm -f $F
-    done
-  fi
-}
-
-#
-# print usage
-#
-help() {
-  cat << EOF
-Generate dvi file from mudela or lilypond output
-Usage: $0 [OPTION]... [FILE]...
-
-Options:
-  -D,--debug           increase verbosity
-  -F,--headers=        name of additional LaTeX headers file
-  -H,--Height=         set paper height (points) (see manual page)
-  -I,--include=DIR     add DIR to search path of LilyPond
-  -K,--keeplilypond    keep lilypond output files
-  -L,--landscape       set landscape orientation
-  -N,--nonumber        switch off page numbering
-  -O,--orientation=    set orientation (obsolete - use -L instead) 
-  -W,--Width=          set paper width (points) (see manual page)
-  -d,--dependencies    tell lilypond make a dependencies file
-  -h,--help            this help text
-  -k,--keeply2dvi      keep ly2dvi output files
-  -l,--language=       give LaTeX language (babel)
-  -o,--output=         set output directory
-  -p,--papersize=      give LaTeX papersize (eg. a4)
-  -s,--separate        run all files separately through LaTeX
-  -S,--sourcedir       set sourcedir 
-
-  files may be (a mix of) input to or output from lilypond(1)
-EOF
-}
-
-
-#
-# SVr4 echo swallows backslashes, and there's no way to turn it off.
-# Therefore use Echo whenever backslashes may be important.
-# printf is in the posix.2 standard -- which means it's in 
-# all modern shells.
-#
-Echo() {
-       printf "%s\n" "$@"
-}
-
-#
-setPaperZize() {
-case "$PAPERSIZE" in
-  a0*)
-    PWIDTH=2389
-    PHEIGHT=3381
-    PAPERSIZE=a0paper
-    ;;
-  a1|a1p*)
-    PWIDTH=1690
-    PHEIGHT=2389
-    PAPERSIZE=a1paper
-    ;;
-  a2*)
-    PWIDTH=1194
-    PHEIGHT=1690
-    PAPERSIZE=a2paper
-    ;;
-  a3*)
-    PWIDTH=845
-    PHEIGHT=1194
-    PAPERSIZE=a3paper
-    ;;
-  a4*)
-    PWIDTH=597
-    PHEIGHT=845
-    PAPERSIZE=a4paper
-    ;;
-  a5*)
-    PWIDTH=423
-    PHEIGHT=597
-    PAPERSIZE=a5paper
-    ;;
-  a6*)
-    PWIDTH=298
-    PHEIGHT=423
-    PAPERSIZE=a6paper
-    ;;
-  a7*)
-    PWIDTH=211
-    PHEIGHT=298
-    PAPERSIZE=a7paper
-    ;;
-  a8*)
-    PWIDTH=305
-    PHEIGHT=211
-    PAPERSIZE=a8paper
-    ;;
-  a9*)
-    PWIDTH=105
-    PHEIGHT=305
-    PAPERSIZE=a9paper
-    ;;
-  a10*)
-    PWIDTH=74
-    PHEIGHT=105
-    PAPERSIZE=a10paper
-    ;;
-  b0*)
-    PWIDTH=2847
-    PHEIGHT=4023
-    PAPERSIZE=b0paper
-    ;;
-  b1*)
-    PWIDTH=2012
-    PHEIGHT=2847
-    PAPERSIZE=b1paper
-    ;;
-  b2*)
-    PWIDTH=1423
-    PHEIGHT=2012
-    PAPERSIZE=b2paper
-    ;;
-  b3*)
-    PWIDTH=1006
-    PHEIGHT=1423
-    PAPERSIZE=b3paper
-    ;;
-  b4*)
-    PWIDTH=712
-    PHEIGHT=1006
-    PAPERSIZE=b4paper
-    ;;
-  b5*)
-    PWIDTH=503
-    PHEIGHT=712
-    PAPERSIZE=b5paper
-    ;;
-  archA)
-    PWIDTH=650
-    PHEIGHT=867
-    ;;
-  archB)
-    PWIDTH=867
-    PHEIGHT=1301
-    ;;
-  archC)
-    PWIDTH=1301
-    PHEIGHT=1734
-    ;;
-  archD)
-    PWIDTH=1734
-    PHEIGHT=2602
-    ;;
-  archE)
-    PWIDTH=2602
-    PHEIGHT=3469
-    ;;
-  flsa|flse)
-    PWIDTH=614
-    PHEIGHT=940
-    ;;
-  halfletter)
-    PWIDTH=397
-    PHEIGHT=614
-    ;;
-  ledger)
-    PWIDTH=1229
-    PHEIGHT=795
-    ;;
-  legal)
-    PWIDTH=614
-    PHEIGHT=1012
-    ;;
-  letter)
-    PWIDTH=614
-    PHEIGHT=795
-    ;;
-  note)
-    PWIDTH=542
-    PHEIGHT=723
-    ;;
-  *)
-    echo ""
-    echo $0": unknown papersize -- "$PAPERSIZE
-    echo ""
-    ;;
-esac
-}
-
-doRcFiles()
-{
-#
-# RC-files ?
-#
-for D in /usr/local/share/ /usr/local/share/lilypond/ /etc/ $HOME/. ./.
-do
-  RCfile=$D"lilyrc"
-  [ -r $RCfile ] && . $RCfile
-done
-fORI=$ORIENTATION
-fLNG=$LANGUAGE
-fPSZ=$PAPERSIZE
-fLHF=$LATEXHF
-unset ORIENTATION LANGUAGE PAPERSIZE LATEXHF
-}
-
-
-
-#
-# Trap function (cleanup)
-#
-
-
-
-trap cleanup 0 9 15
-
-
-
-#
-# Various defaults
-#
-[ -z "$TMP" ] && TMP=/tmp
-if [ ! -d $TMP ]
-then
-  $debug_echo $IDENTIFICATION": temporary directory "$TMP" not found, set to /tmp"
-  TMP=/tmp
-fi
-LOGFILE=$TMP/lilylog.$$                        # Logfile for lilypond
-PAPERSIZE=a4                            # Default papersize name
-PWIDTH=597                              # Default paperwidth
-PHEIGHT=845                             # Default paperheight
-PNUM="%"                                # Page numbering on
-LILYOPTS=""                             # Options to lilypond
-SOURCEDIR=""
-LILYPOND_EXECUTABLE=lilypond
-doRcFiles
-
-
-
-# Keywords defined in titledefs.tex
-#
-TF="`kpsewhich -n latex tex titledefs.tex`"
-MU_DEF=""
-if [ -r "${TF:=/usr/local/share/texmf/tex/lilypond/titledefs.tex}" ]
-then
-  MU_DEF=`sed -n -e 's/.*newcommand\*{.\(mudela[^}]*\)}.*$/\1/p' "$TF"`
-fi
-
-: "${MU_DEF:=mudelatitle mudelasubtitle mudelacomposer \
-          mudelameter mudelaopus mudelaarranger mudelapiece \
-         mudelapoet mudelainstrument \
-         }"
-
-#
-# debugging
-#
-debug_echo=:
-#
-# All files in one LaTeX run
-#
-SEPFILE=N
-#
-# Find command line options and switches
-#
-# "x:" x takes argument
-#
-switches="DF:H:I:KLNO:W:dhkl:o:p:S:s\?"
-options=""
-#
-# ugh, "\-" is a hack to support long options
-# while getopts \-:$options$switches O
-# must be in double quotes for bash-2.0
-while getopts "\-:$options$switches" O
-do
-  $debug_echo "O: \`$O'"
-  $debug_echo "arg: \`$OPTARG'"
-  case $O in
-    D  )
-      [ $debug_echo = echo ] && set -x
-      debug_echo=echo
-      ;;
-    F  )
-      LATEXHF=$OPTARG
-      ;;
-    H  )
-      PHEIGHT=$OPTARG
-      ;;
-    I  )
-      LILYOPTS="$LILYOPTS -I $OPTARG"
-      LILYINCLUDE="$LILYINCLUDE:$OPTARG"
-      ;;
-    K  )
-      KEEP_LILY_OUTPUT=Y
-      ;;
-    L  )
-      ORIENTATION=landscape
-      ;;
-    O  )
-      ORIENTATION=$OPTARG
-      ;;
-    N  )
-      PNUM="\pagestyle{empty}"
-      ;;
-    W  )
-      PWIDTH=$OPTARG
-      ;;
-    d  )
-      LILYOPTS=$LILYOPTS" -d"
-      ;;
-    h  )
-      help;
-      exit 0
-      ;;
-    k  )
-      KEEP_LY2DVI_OUTPUT=Y
-      ;;
-    l  )
-      LANGUAGE=$OPTARG
-      ;;
-    o  )
-      OUTPUTDIR=$OPTARG
-      ;;
-    p  )
-      PAPERSIZE=$OPTARG
-      ;;
-    s  )
-      SEPFILE=Y
-      ;;
-    S  )
-      SOURCEDIR=$OPTARG
-      ;;
-    \? )
-      help;
-      exit -1
-      ;;
-    # a long option!
-    -)
-      $debug_echo "long option: \`$OPTARG'"
-      case "$OPTARG" in
-        He*|-He*)
-          PHEIGHT"`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"=
-          ;;
-        W*|-W*)
-          PWIDTH="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-          ;;
-        dep*|-dep*)
-          LILYOPTS="$LILYOPTS -d"
-          ;;
-        d*|-d*)
-          [ $debug_echo = echo ] && set -x
-          debug_echo=echo
-          ;;
-        hea*|-hea*)
-          LATEXHF="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-          ;;
-        h*|-h*)
-          help;
-         exit 0
-          ;;
-        i*|-i*)
-          dir="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-         LILYOPTS="$LILYOPTS --include=$dir"
-         LILYINCLUDE="$LILYINCLUDE:$dir"
-         ;;
-        keepli*|-keepli*)
-          KEEP_LILY_OUTPUT=Y
-          ;;
-        k*|-k*)
-          KEEP_LY2DVI_OUTPUT=Y
-          ;;
-        land*|-land*)
-          ORIENTATION=landscape
-          ;;
-        lang*|-lang*)
-          LANGUAGE="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-          ;;
-       n*|-n*)
-         PNUM="\pagestyle{empty}"
-         ;;
-       or*|-or*)
-         ORIENTATION="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-         ;;
-       ou*|-ou*)
-         OUTPUTDIR="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-         ;;
-        p*|-p*)
-          PAPERSIZE="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
-          ;;
-        separa*|-sep*)
-         SEPFILE=Y
-          ;;
-       sourcedir*|-sourcedir*)
-         SOURCEDIR=$OPTARG
-         ;;
-        *|-*)
-          echo "$0: illegal option -- \"$OPTARG\""
-          help;
-          exit -1
-          ;;
-      esac
-  esac
-done
-shift `expr $OPTIND - 1`
-
-if [ "$SOURCEDIR" != "" ]; then
-# apparently MakeTeXTFM can't handle relative dirs
-       SOURCEDIR=`cd $SOURCEDIR; pwd`
-       LILYINCLUDE="$SOURCEDIR/init:$SOURCEDIR/mf/out:$LILYINCLUDE"
-       TEXINPUTS="$SOURCEDIR/tex:$TEXINPUTS:"
-       MFINPUTS="$SOURCEDIR/mf:$MFINPUTS:"
-       LILYPOND_EXECUTABLE="$SOURCEDIR/lily/out/lilypond"
-       export MFINPUTS LILYPOND_EXECUTABLE TEXINPUTS SOURCEDIR 
-fi
-
-#
-# Input file name
-#
-if [ "$1" = "" ]
-then
-  help
-  $debug_echo "$IDENTIFICATION: No input file name given"
-  exit 1
-fi
-# regexp_quote -- quote a string as a regular expression for egrep or sed
-regexp_quote(){
-       Echo "$@" | sed 's/\([]\[\.*?+^$]\)/\\\1/g'
-}
-#
-#
-mudelaDefs(){
-# Include \def\mudela-definitions
-# The aim here is to pick up the definition for the 
-# current file, then any other file.
-#
-mudelatmp=$TMP/mudelaDefs$$
-# Use `cat' to prevent filenames being prepended
-# 
-cat "$File" $OF | fgrep "$MU_DEF" > $mudelatmp
-for L in $MU_DEF
-do
-    # This converts \def\mudelatitle{fred}
-    # to \mudelatitle{fred} or to
-    # \def\mudelatitle{fred}
-    # and stops after the first one found.
-    sed -n '/\\def\\'"$L"'{\([^}]*\)}.*$/{
-       s//'"`regexp_quote \"$1\"`"'\\'"$L"'{\1}%/p
-       q
-    }'  $mudelatmp  >> $LatF
-done
-rm -f $mudelatmp
-}
-#
-#
-startFile(){
-#
-# LaTeX file name
-#
-BN=`basename "$File" .tex`
-FN="$BN.$$"
-if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
-then
-  LatF="$TMP/$FN.tex"
-else
-  LatF="$FN.tex"
-fi
-#
-# Find:
-#   paper size        (PAPERSIZE, overridden by command line option -p)
-#   paper orientation (ORIENTATION, overridden by option -o)
-#   language          (LANGUAGE, overridden by option -l)
-#   textwidth
-#
-eval `sed -n \\
-  -e 's/\\\\def\\\\mudelalanguage{\([^}]*\).*$/fLNG=\1;/p' \\
-  -e 's/\\\\def\\\\mudelalatexheaders{\([^}]*\).*$/fLHF=\1;/p' \\
-  -e 's/\\\\def\\\\mudelaorientation{\([^}]*\).*$/fORI=\1;/p' \\
-  -e 's/\\\\def\\\\mudelapaperlinewidth{\([^}]*\).*$/TWN=\1;/p' \\
-  -e 's/\\\\def\\\\mudelapapertextheight{\([^}]*\).*$/THN=\1;/p' \\
-  -e 's/\\\\def\\\\mudelapapersize{\([^}]*\).*$/fPSZ=\1;/p' \\
-    "$File"`
-#
-if [ -z "$LATEXHF" ]
-then
-  LATEXHF="$fLHF"
-fi
-LLHF="%"
-if [ -n "$LATEXHF" ]
-then
-  [ -f         "$LATEXHF" ] && LLHF="\input{$LATEXHF}"
-fi
-#
-if [ -z "$PAPERSIZE" ]
-then
-  PAPERSIZE="$fPSZ"
-fi
-if [ -n "$PAPERSIZE" ]
-then
-  setPaperZize
-  PAPEROPT="$PAPERSIZE"
-fi
-#
-if [ -z "$ORIENTATION" ]
-then
-  ORIENTATION="$fORI"
-fi
-if [ -n "$ORIENTATION" ]
-then
-  if [ -z "$PAPEROPT" ]
-  then
-    PAPEROPT="$ORIENTATION"
-  else
-    PAPEROPT="$PAPEROPT,$ORIENTATION"
-  fi
-fi
-#
-if [ -n "$PAPEROPT" ]
-then
-  PAPER="[$PAPEROPT]"
-fi
-#
-if [ -z "$LANGUAGE" ]
-then
-  LANGUAGE="$fLNG"
-fi
-if [ -n "$LANGUAGE" ]
-then
-  LLNG="\usepackage[$LANGUAGE]{babel}"
-else
-  LLNG="%"
-fi
-
-#
-# Find textwidth
-#
-if [ -n "$TWN" ]
-then
-  TW="$TWN"
-  case "$TW" in
-    *mm)
-      ;;
-    *cm)
-      ;;
-    *pt)
-      ;;
-    *)
-      TW="${TW}pt"
-      ;;
-  esac
-  $debug_echo "Text width = $TW"
-fi
-TWp=`Echo $TW | sed -e 's/\..*$//'`
-PWp="$PWIDTH"
-#
-# Find textheight
-#
-if [ -n "$THN" ]
-then
-  TH=$THN
-  case $TH in
-    *mm)
-      ;;
-    *cm)
-      ;;
-    *pt)
-      ;;
-    *)
-      TH="${TH}pt"
-      ;;
-  esac
-  $debug_echo "Text height = $TH"
-fi
-THp="`echo $TH | sed -e 's/\..*$//'`"
-PHp="$PHEIGHT"
-if [ "$ORIENTATION" = "landscape" ]
-then
-  PWp="$PHEIGHT"
-  PHp="$PWIDTH"
-fi
-HMARG="`expr '(' $PWp - $TWp ')' / 2`"pt
-$debug_echo "Text left = $HMARG"
-VMARG="`expr '(' $PHp - $THp ')' / 2`"pt
-$debug_echo "Text top = $VMARG"
-#
-# Geometry: /var/lib/texmf/latex/geometry/geometry.dvi
-#
-#
-# Write LaTeX file
-#
-cat << EOF > $LatF
-% Creator: $IDENTIFICATION
-% Automatically generated from  $IF, $NOW
-
-\documentclass$PAPER{article}
-
-$LLNG
-\usepackage{geometry}
-\usepackage[latin1]{inputenc}
-%\usepackage[T1]{fontenc}
-$PNUM
-%\addtolength{\oddsidemargin}{-1cm}
-%\addtolength{\topmargin}{-1cm}
-%\setlength{\textwidth}{$TW}
-%\setlength{\textheight}{$TH}
-\geometry{width=$TW, left=$HMARG, height=$TH, top=$VMARG}
-\input lilyponddefs
-\input titledefs
-$LLHF
-\begin{document}
-EOF
-mudelaDefs
-cat << EOF >> $LatF
-\cmrtwenty% ugh
-\makelilytitle
-EOF
-}
-nextFile(){
-cat << EOF >> $LatF
-\def\theopus{}%
-\def\thepiece{}%
-\def\mudelaopus{}%
-\def\mudelapiece{}%
-EOF
-mudelaDefs "\\def"
-cat << EOF >> $LatF
-\def\theopus{\mudelaopus}% ugh
-\def\thepiece{\mudelapiece}%
-\makelilypiecetitle
-EOF
-}
-#
-# Conclusion
-#
-endFile(){
-cat << EOF >> $LatF
-\vfill\hfill{\LilyIdString}
-\end{document}
-EOF
-#
-# Run LaTeX
-#
-latex '\nonstopmode \input '$LatF || exit 5
-#
-# Rename dvi file
-#
-if [ -f $FN.dvi ]
-then
-    RESULT="$BN.dvi"
-    [ -n "$OUTPUTDIR" ] && RESULT="$OUTPUTDIR/$RESULT"
-    
-    cp "$FN.dvi" "$RESULT" || exit 5
-fi
-#
-# Output some info
-#
-cat << EOF
-
-$IDENTIFICATION: dvi file name is $RESULT
-
-EOF
-}
-
-# ugh. GF is side-effect.
-findInput() {
-# should check for LILYINCLUDE
-  OIFS="$IFS"
-  IFS=':'
-  x=`echo $LILYINCLUDE | sed "s!:! !g"`
-  IFS="$OIFS"
-  for lypath in . $x
-  do
-    if [ -f "$lypath/$1" ]
-    then
-      GF="$lypath/$1"
-      return
-    fi
-
-    if [ -f "$lypath/$1.ly" ]
-    then
-      GF="$lypath/$1.ly"
-      return
-    fi
-    if [ -f "$lypath/$1.fly" ]
-    then
-       GF="$lypath/$1.fly"
-       return
-    fi
-  done
-  $debug_echo "$IDENTIFICATION: Input file \"$GF\" not found"
-  echo "$NAME: Input file \"$GF\" not found"                       1>&2
-  exit 2
-}
-#
-# Loop through all files
-#
-
-LILY_OUTPUT_FILES=
-
-for GF 
-do
-    findInput $GF
-
-  #
-  # Check whether the file is input to or output from lilypond
-  #
-  L1=`head -1 $GF` 
-  OP=`echo $L1 | grep "^% Creator: GNU LilyPond"`
-  if [ -n "$OP" ]
-  then
-    #
-    # OK - it's the output from lilypond.
-    #
-    # Get lilypond source file name
-    #
-    OF=$GF
-    IFL=`grep mudelafilename $OF`
-    if [ "$IFL" != "" ]
-    then
-      IF=`echo $IFL | sed -e 's/.*{//' -e 's/}*.$//'`
-      #
-      # Check if source file exists
-      #
-      if [ ! -f $IF ]
-      then
-        $debug_echo $IDENTIFICATION": Mudela file not found."
-        TW=15.5cm
-        TH=25.0cm
-      fi
-    else
-      $debug_echo $IDENTIFICATION": Mudela file name not found."
-      TW=15.5cm
-      TH=25.0cm
-    fi
-  else
-    #
-    # I have to assume this is the lilypond input file
-    # Find output file name, if defined
-    #
-    IF=$GF
-    #
-    # Run lilypond
-    # Grab output file names
-    #
-    $debug_echo "lilypond "$LILYOPTS $IF
-
-    $LILYPOND_EXECUTABLE $LILYOPTS $IF 2>&1  | tee $LOGFILE
-    OF="`sed -n -e 's/TeX output to \([^\.]*\.tex\)\.\.\.$/\1/p' $LOGFILE`"
-    $debug_echo "==> $OF"
-    LILY_OUTPUT_FILES="$LILY_OUTPUT_FILES $OF"
-    STATUS=`egrep -i "error|segmentation|abort" $LOGFILE`
-    echo $STATUS
-    if [ ! -z "$STATUS" ]
-    then
-      exit 10
-    fi
-  fi
-  #
-  # "Spin through" all the files
-  #
-  for File in $OF
-  do
-    $debug_echo "--- "$File
-    #
-    # Check if output file is generated
-    #
-    if [ ! -f "$File" ]
-    then
-      $debug_echo "$IDENTIFICATION: hmm, I could not find the output file $File"
-      exit 4
-    fi
-    #
-    # Is this the first file?
-    #
-    if [ -z "$FFile" ]
-    then
-      FFile="$File"
-      startFile
-    else
-      nextFile
-    fi
-    cat << EOF >> $LatF
-\input{$File}
-EOF
-    if [ $SEPFILE = Y ]
-    then
-      FFile=""
-      endFile
-    fi
-  done
-done
-if [ $SEPFILE = N ]
-then
-  endFile
-fi
-#
-# OK - finished
-#
diff --git a/bin/ly2dvi.py b/bin/ly2dvi.py
deleted file mode 100644 (file)
index 943aef7..0000000
+++ /dev/null
@@ -1,1118 +0,0 @@
-#!@PYTHON@
-
-"""
-=======================================================================
-LilyPond to dvi converter
-
-Features include Title information, paper size specification, and image
-orientation.  
-
-Usage: ly2dvi.py [OPTION]... [FILE]...
-Input: LilyPond source or LilyPond generated TeX files
-Output: DVI file
-=======================================================================
-"""
-
-name = 'ly2dvi'
-version = '0.0.6'
-errorlog = ''
-
-import sys
-import os
-import getopt
-import re
-import string
-import time
-import glob
-
-
-class Input:
-    """
-    This class handles all ly2dvi.py input file methods
-
-    Public methods:
-    
-    __init__()  Constructor
-    open(file)  Open a .ly file or .tex file using lilyinclude path
-    close()     Close current file
-    type()      Determine file type .ly (input) or .tex (output)
-    setVars()   Set title definitions found in .tex (output) file
-    """
-
-    #
-    # Constructors
-    #
-
-    def __init__(this):
-       this.__fd = None 
-
-    #
-    # open
-    #
-    def open(this,file):
-        """
-        open file and set private class variable __fd.  The search
-        sequence is: current directory followed by the directories
-        found in include property list.  Each directory is searched
-        for file, file.ly, and file.fly.
-        
-        input:  file   filename
-        output: void
-        error:  ExitNotFound Exception
-        """
-
-        for i in [''] + Props.get('include')[0:]:
-            ifile = os.path.join(i,file)
-            for j in ['','.ly','.fly']:
-                jfile = ifile+j
-                try:
-                    this.__fd = open( jfile, 'r' )
-                    return
-                except:
-                    pass
-        sys.exit('ExitNotFound', file)
-
-
-    #
-    # close
-    #
-    def close(this):
-        """
-        close file object __fd
-        
-        input:  void
-        output: void
-        error:  None
-        """
-        this.__fd.close()
-
-
-    #
-    # type
-    #
-    def type(this):
-        """
-        Determine input file type.  LilyPond source is 'input' type
-        and LilyPond generated TeX file is 'output' type
-
-        input:  void
-        output: 'input' | 'output'
-        error:  None
-        """
-
-        firstline = this.__fd.readline()
-        this.__fd.seek(0)
-        if  re.match('% Creator: GNU LilyPond [0-9]+[.0-9]+',firstline ):
-            return 'output'
-        else:
-            return 'source'
-
-
-    #
-    # setVars
-    #
-    def setVars(this): 
-        """
-        Search for properties in the current input file and set the
-        appropriate values.  The supported properties names are in
-        local variable varTable along with the property list
-        titledefs.
-
-        input:  void
-        output: None
-        error:  None
-        """
-
-        varTable = [
-            #   regexp              set method
-            #   ------              ----------
-            ( 'language',        Props.setLanguage ),
-            ( 'latexheaders',    Props.setHeader ),
-            ( 'orientation',     Props.setOrientation ),
-            ( 'paperpapersize',  Props.setPaperZize ),
-            ( 'papertextheight', Props.setTextHeight ),
-            ( 'paperlinewidth',  Props.setLineWidth ),
-            ( 'filename',        Props.setFilename ),
-            ]
-
-        titles={}
-        for line in this.__fd.readlines():
-            m=re.match('\\\\def\\\\mudela([\w]+){(.*)}',line)
-            if m:
-                for var in varTable:
-                    if m.group(1) == var[0]:
-                        var[1](m.group(2),'file')
-                        break
-                for var in Props.get('titledefs'):
-                    if m.group(1) == var:
-                        titles[var]=m.group(2)
-                        break
-        Props.setTitles(titles,'file')
-        this.__fd.seek(0)
-
-\f
-
-class TeXOutput:
-    """
-    This class handles all ly2dvi.py output file methods
-
-    private methods:
-     __mudelaDefs(opt)  Send title info to output file
-
-    Public methods:
-    __init__()  Constructor
-    write(str)  Write a string to output file 
-    start(file) Start the latex file
-    next()      Process next output file
-    end()       Finish latex file and run latex 
-    """
-
-    #
-    # constructor
-    #
-    def __init__(this):
-       this.__fd = None 
-       this.__base = ''
-       this.__outfile = ''
-
-    #
-    # __medelaDefs
-    #
-    def __mudelaDefs(this,opt):
-        """
-        Write titles to output
-
-        input:  opt   Supports header and subheader output
-        output: None
-        error:  None
-        """
-
-        titles = Props.get('titles')
-        for key in titles.keys():
-            this.write('%s\\mudela%s{%s}%%\n' % (opt,key,titles[key]))
-
-    #
-    # write
-    #
-    def write(this,str):
-        """
-        Write str to current output file
-
-        input:  str  String to write
-        output: None
-        error:  None
-        """
-        
-        this.__fd.write(str)
-
-    #
-    # start
-    #
-    def start(this,file):
-        """
-        Start LaTeX file.  Calculates the horizontal and vertical
-        margin using pagewidth, pageheight, linewidth, and textheight.
-        Creates temporary output filename and opens it for write.
-        Sends the LaTeX header information to output.  Lastly sends
-        the title information to output.
-
-        input:  file  output file name 
-        output: None
-        error:  None
-        """
-
-        now=time.asctime(time.localtime(time.time()))
-        linewidth = Props.get('linewidth')
-        textheight = Props.get('textheight')
-
-        if Props.get('orientation') == 'landscape':
-            pagewidth = Props.get('pageheight')
-            pageheight = Props.get('pagewidth')
-        else:
-            pageheight = Props.get('pageheight')
-            pagewidth = Props.get('pagewidth')
-                             
-        horizontalMarginArg =  ( (pagewidth - linewidth)/2 )   
-        verticalMarginArg =  ( (pageheight - textheight)/2  )
-
-        top="""\
-%% Creator: %s
-%% Automatically generated from  %s, %s
-
-\\documentclass[%s]{article}
-
-%s 
-\\usepackage{geometry}
-\\usepackage[latin1]{inputenc} 
-%%\\usepackage[T1]{fontenc} 
-%s 
-%%\\addtolength{\\oddsidemargin}{-1cm} 
-%%\\addtolength{\\topmargin}{-1cm} 
-%%\\setlength{\\textwidth}{%s} 
-%%\\setlength{\\textheight}{%s} 
-\\geometry{width=%spt, left=%spt, height=%spt, top=%spt} 
-\\input lilyponddefs 
-\\input titledefs 
-%s 
-\\begin{document}
-""" % ( program_id(), Props.get('filename'), now, Props.get('papersize'),
-        Props.get('language'), Props.get('pagenumber'), linewidth, textheight,
-        linewidth, horizontalMarginArg, textheight, verticalMarginArg,
-        Props.get('header') )
-        
-        pathcomp = os.path.splitext(file)
-        this.__base = pathcomp[0]
-        this.__outfile = '%s.%d%s' % (pathcomp[0], os.getpid(), pathcomp[1])
-        try:
-            this.__fd = open(this.__outfile,"w")
-        except:
-            sys.exit('ExitNoWrite', this.__outfile)
-        this.write(top)
-        this.__mudelaDefs('')
-        this.write("""\
-\\cmrtwenty% ugh
-\\makelilytitle
-""") 
-
-    #
-    # next
-    #
-    def next(this):
-        """
-        Write LaTeX subheader information to support more than one
-        score in a document.  Lastly send current title information to
-        output.
-
-        input:  None
-        output: None
-        error:  None
-        """
-
-        this.write("""\
-\\def\\theopus{}%
-\\def\\thepiece{}%
-\\def\\mudelaopus{}%
-\\def\\mudelapiece{}%
-""")
-        this.__mudelaDefs("\\def")
-        this.write("""\
-\\def\\theopus{\\mudelaopus}% ugh
-\\def\\thepiece{\\mudelapiece}%
-\\makelilypiecetitle
-""")
-
-
-    #
-    # end
-    #
-    def end(this):
-        """
-        Close output file and run latex on it.
-
-        input:  None
-        output: None
-        error:  ExitBadLatex Exception
-        """
-
-        outfile=this.__base + '.dvi'
-        if Props.get('output') != '':
-            outfile = os.path.join(Props.get('output'), outfile )
-            
-        this.write("""\
-\\vfill\\hfill{\\LilyIdString}
-\\end{document}
-""")
-        this.__fd.close()
-        if ( os.name == 'posix' ):
-            stat = os.system('latex \'\\nonstopmode \\input %s\'' %
-                             (this.__outfile))
-        else: # Windows shells don't eat the single quotes
-            stat = os.system('latex \\nonstopmode \\input %s' %
-                             (this.__outfile))
-        if stat:
-            sys.exit('ExitBadLatex')
-        if os.path.isfile(outfile):
-            os.remove(outfile)
-        os.rename(this.__base + '.' + str(os.getpid()) + '.dvi', outfile)
-        sys.stderr.write( '\n' + program_id() + ': dvi file name is %s\n\n'
-                   % (outfile))
-
-        if Props.get('postscript'):
-            psoutfile=this.__base + '.ps'
-            if Props.get('output') != '':
-                psoutfile = os.path.join(Props.get('output'), psoutfile )
-            stat = os.system('dvips -o %s %s 2>&1' % (psoutfile,outfile))
-            if stat:
-                sys.exit('ExitBadPostscript')
-            
-
-\f
-
-class Properties:
-    """
-    This class handles all ly2dvi.py property manipulation
-
-    Public methods:
-    
-    __init__()  Constructor
-    set<property> methods
-    """
-
-    def __init__(this):
-
-        #
-        # Following is the order of priority for property assignment.  The
-        # list is organized from lowest to highest priority.  Each
-        # assignment is overridden by the next requester in the list.
-        #
-        # Requester     Description
-        # ---------     -----------
-        # init          Initial default values
-        # file          The values found in the lilypond generated TeX files
-        # environment   Envrionment variables LILYINCLUDE, LILYPONDPREFIX
-        # rcfile        $LILYPONDPREFIX/share/lilypond/.lilyrc
-        # rcfile        $HOME/.lilyrc
-        # rcfile        ./.lilyrc
-        # commandline   command line arguments
-        # 
-        this.__overrideTable = {
-            'init'        : 0,
-            'file'        : 1,
-            'environment' : 2,
-            'rcfile'      : 3,
-            'commandline' : 4,
-            'program'     : 5
-            }
-
-        this.__roverrideTable = {} # reverse lookup used for debug
-        for i in this.__overrideTable.items():
-            this.__roverrideTable[i[1]]=i[0]
-        
-        this.__data = {
-            'pagewidth'    :  [597, this.__overrideTable['init']],
-            'pageheight'   :  [845, this.__overrideTable['init']],
-            'papersize'    :  ['a4paper', this.__overrideTable['init']],
-            'textheight'   :  [0, this.__overrideTable['init']],
-            'linewidth'    :  [0, this.__overrideTable['init']],
-            'orientation'  :  ['portrait', this.__overrideTable['init']],
-            'language'     :  ['%', this.__overrideTable['init']],
-            'include'      :  [[], this.__overrideTable['init']],
-            'debug'        :  [0, this.__overrideTable['init']],
-            'keeplilypond' :  [0, this.__overrideTable['init']],
-            'keeply2dvi'   :  [0, this.__overrideTable['init']],
-            'pagenumber'   :  ['%', this.__overrideTable['init']],
-            'separate'     :  [0, this.__overrideTable['init']],
-            'output'       :  ['', this.__overrideTable['init']],
-            'header'       :  ['%', this.__overrideTable['init']],
-            'dependencies' :  [0, this.__overrideTable['init']],
-            'root'         :  ['', this.__overrideTable['init']],
-            'tmp'          :  ['d:\tmp', this.__overrideTable['init']],
-            'filename'     :  ['', this.__overrideTable['init']],
-            'titledefs'    :  [[], this.__overrideTable['init']],
-            'titles'       :  [{}, this.__overrideTable['init']],
-            'lilyOutputFiles' :  [[], this.__overrideTable['init']],
-            'postscript'   :  [0, this.__overrideTable['init']],
-            }
-
-        #
-        # Try to set root and HOME first before calling rcfile
-        #
-        if os.environ.has_key('LILYPONDPREFIX'):
-            this.setRoot(os.environ['LILYPONDPREFIX'], 'environment')
-        else:
-            p=os.path.split(sys.argv[0])
-            p=os.path.split(p[0])
-            this.setRoot(p[0],'init')
-
-        if not os.environ.has_key('HOME'):
-            if os.environ.has_key('HOMEDRIVE') and \
-                 os.environ.has_key('HOMEPATH'):
-                os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
-                                     os.environ['HOMEPATH']
-            else:
-                os.environ['HOME'] = os.curdir
-
-        this.rcfile() # Read initialization file(s)
-
-        if os.environ.has_key('LILYINCLUDE'):
-            tmp=this.get('include')
-            for s in string.split(os.environ['LILYINCLUDE'],os.pathsep):
-                tmp.append(s)
-            this.__set('include', tmp, 'environment')    
-
-
-        t=''
-       if os.environ.has_key ('TEXINPUTS'):
-               t = os.pathsep + os.environ['TEXINPUTS']
-        os.environ['TEXINPUTS'] = os.path.join(this.get('root'), 'texmf',
-                                              'tex', 'lilypond' ) + t
-
-        t=''
-       if os.environ.has_key ('MFINPUTS'):
-               t = os.pathsep + os.environ['MFINPUTS']
-        os.environ['MFINPUTS'] = os.path.join(this.get('root'), 'texmf',
-                                              'mf', 'public', 'lilypond' ) + t
-
-        if os.environ.has_key('TMP'):
-            this.__set('tmp',os.environ['TMP'],'environment')
-
-        
-       fd=this.get_texfile_path ('titledefs.tex')
-        mudefs=[]    
-
-        for line in fd.readlines():
-            m=re.match('\\\\newcommand\*{\\\\mudela([\w]+)}',line)
-            if m:
-                mudefs.append(m.group(1))
-       fd.close
-        this.__set('titledefs', mudefs, 'init')
-
-    #
-    # __set
-    #
-    def __set(this,var,value,requester):
-        """
-        All of the set methods call this to set a property.  If the value
-        was last set by a requestor of lesser priority the new value is
-        assigned, else the old value has priority and is unchanged.
-        """
-
-        if this.__overrideTable[requester] < this.__data[var][1]:
-            return 0
-        else:
-            this.__data[var] = [value, this.__overrideTable[requester]]
-
-    #
-    # get
-    #
-    def get(this,var):
-        """
-        All of the get methods call this to get a property value.  List
-        variable types are return by value to facilitate an append operation.
-        """
-
-        if var == 'include' or var == 'lilyOutputFiles':
-            return this.__data[var][0][0:]  # return a copy not a ref
-        else:
-            return this.__data[var][0]
-
-    #
-    # get_texfile_path
-    #
-    def get_texfile_path (this, var):
-        """
-        locate and open titledefs.tex file
-        """
-
-        if os.name == 'nt':
-            path = os.path.join(this.get('root'), 'texmf', 'tex',
-                                'lilypond', var)
-        else:
-            path =''
-            cmd =('kpsewhich tex %s %s' % (var,errorlog))
-            pipe = os.popen (cmd, 'r')
-            path = pipe.readline ()[:-1] # chop off \n
-            return_status =  pipe.close()
-            if return_status and not path:
-                path = os.path.join(this.get('root'), 'texmf', 'tex',
-                                    'lilypond', var)
-       fd = open(path, 'r')
-        return fd
-
-
-    #
-    # Read rc file
-    #
-    def rcfile(this):
-       """
-        Read initialization file(s)
-        """
-        varTable = [
-            #   name              set method
-            #   ----              ----------
-            ( 'DEBUG',          this.setDebug ),
-            ( 'DEPENDENCIES',   this.setDependencies ),
-            ( 'KEEPLILYPOND',   this.setKeeplilypond ),
-            ( 'KEEPLY2DVI',     this.setKeeply2dvi ),
-            ( 'LANGUAGE',       this.setLanguage ),
-            ( 'LATEXHF',        this.setHeader ),
-            ( 'LILYINCLUDE',    this.setInclude ),
-            ( 'LILYPONDPREFIX', this.setRoot ),
-            ( 'NONUMBER',       this.setNonumber ),
-            ( 'ORIENTATION',    this.setOrientation ),
-            ( 'OUTPUTDIR',      this.setOutput ),
-            ( 'PAPERSIZE',      this.setPaperZize ),
-            ( 'PHEIGHT',        this.setTextHeight ),
-            ( 'POSTSCRIPT',     this.setPostscript ),
-            ( 'PWIDTH',         this.setLineWidth ),
-            ( 'SEPARATE',       this.setSeparate ),
-            ( 'TMP',            this.setTmp ),
-            ]
-
-        if ( os.name == 'posix' ):
-            dotFilename='.lilyrc'
-        else: # Windows apps like edit choke on .lilyrc
-            dotFilename='_lilyrc'
-
-       for d in [os.path.join(this.get('root'),'share','lilypond'), \
-                  os.environ['HOME'], os.curdir ]:
-           file=os.path.join(d,dotFilename)
-           try:
-               fd = open( file, 'r' )
-           except:
-               continue
-           
-            for line in fd.readlines():
-               if re.match('#.*',line):
-                   continue
-               m=re.search('([\w]+)=(.*)',line)
-               if m:
-                    for var in varTable:
-                        if m.group(1) == var[0]:
-                            var[1](m.group(2),'rcfile')
-                            break
-           fd.close
-
-    #
-    # setPaperZize
-    #
-    def setPaperZize(this,size,requester):
-        """
-        Set paper size properties
-        """
-
-        paperTable = [
-            # regex          width    height      name
-            # -----          -----    ------      ----
-            ( 'a0.*',        2389,    3381,    'a0paper' ),
-            ( 'a1$|a1p.*',   1690,    2389,    'a1paper' ),
-            ( 'a2.*',        1194,    1690,    'a2paper' ),
-            ( 'a3.*',        845,     1194,    'a3paper' ),
-            ( 'a4.*',        597,     845,     'a4paper' ),
-           ( 'a5.*',        423,     597,     'a5paper' ),
-            ( 'a6.*',        298,     423,     'a6paper' ),
-            ( 'a7.*',        211,     298,     'a7paper' ),
-            ( 'a8.*',        305,     211,     'a8paper' ),
-            ( 'a9.*',        105,     305,     'a9paper' ),
-            ( 'a10.*',       74,      105,     'a10paper' ),
-            ( 'b0.*',        2847,    4023,    'b0paper' ),
-            ( 'b1.*',        2012,    2847,    'b1paper' ),
-            ( 'b2.*',        1423,    2012,    'b2paper' ),
-            ( 'b3.*',        1006,    1423,    'b3paper' ),
-            ( 'b4.*',        712,     1006,    'b4paper' ),
-            ( 'b5.*',        503,     712,     'b5paper' ),
-            ( 'archA$',      650,     867,     'archApaper' ),
-            ( 'archB$',      867,     1301,    'archBpaper' ),
-            ( 'archC$',      1301,    1734,    'archCpaper' ),
-            ( 'archD$',      1734,    2602,    'archDpaper' ),
-            ( 'archE$',      2602,    3469,    'archEpaper' ),
-            ( 'flsa$|flse$', 614,     940,     'flsapaper' ),
-            ( 'halfletter$', 397,     614,     'halfletterpaper' ),
-            ( 'ledger$',     1229,    795,     'ledgerpaper' ),
-            ( 'legal$',      614,     1012,    'legalpaper' ),
-            ( 'letter$',     614,     795,     'letterpaper' ),
-            ( 'note$',       542,     723,     'notepaper' )
-            ]
-
-        found=0
-        for paper in paperTable:
-            if re.match(paper[0],size):
-                found=1
-                this.__set('pagewidth',paper[1],requester)
-                this.__set('pageheight',paper[2],requester)
-                this.__set('papersize',paper[3],requester)
-                break
-
-        if not found:
-            sys.exit('ExitBadPaper',size)
-
-    #
-    # setTextHeight
-    #
-    def setTextHeight(this,size,requester):
-        """
-        Set textheight property
-        """
-
-       m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
-       if m:
-           if m.group(2) == 'cm':
-               this.__set('textheight',\
-                           float(m.group(1)) * 72.27/2.54, requester )
-           elif m.group(2) == 'mm':
-               this.__set('textheight',\
-                           float(m.group(1)) * 72.27/25.4, requester )
-           elif m.group(2) == 'pt':
-               this.__set('textheight', float(m.group(1)), requester )
-           elif m.group(2) == '':
-               this.__set('textheight', float(m.group(1)), requester )
-           else:
-               sys.exit('ExitBadHeight', m.group(2))
-       else:           
-           sys.exit('ExitBadHeight', size)
-
-    #
-    # setLineWidth
-    #
-    def setLineWidth(this,size,requester):
-        """
-        Set linewidth propery
-        """
-
-       m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
-       if m:
-           if m.group(2) == 'cm':
-               this.__set('linewidth', \
-               float(m.group(1)) * 72.27/2.54, requester )
-           elif m.group(2) == 'mm':
-               this.__set('linewidth', \
-               float(m.group(1)) * 72.27/25.4, requester )
-           elif m.group(2) == 'pt':
-               this.__set('linewidth', float(m.group(1)), requester )
-           elif m.group(2) == '':
-               this.__set('linewidth', float(m.group(1)), requester )
-           else:
-               sys.exit('ExitBadWidth', m.group(2))
-       else:           
-           sys.exit('ExitBadWidth', size)
-
-    #
-    # setOrientation
-    #
-    def setOrientation(this,orient,requester):
-        """
-        Set orientation property
-        """
-
-       if orient == 'landscape' or orient == 'portrait':
-           this.__set('orientation', orient, requester )
-       else:
-           sys.exit('ExitBadOrient', orient)
-
-    #
-    # setLanguage
-    #
-    def setLanguage(this,lang,requester):
-        """
-        Set language property
-        """
-
-       this.__set('language', '\\usepackage[%s]{babel}' % (lang), requester )
-
-    #
-    # setInclude
-    #
-    def setInclude(this,inc, requester):
-        """
-        Append an include path
-        """
-
-        tmp = this.get('include')
-        tmp.append(inc)
-        this.__set('include', tmp, requester )
-
-    #
-    # setDebug
-    #
-    def setDebug(this,value,requester):
-        """
-        Set or Clear debug flag
-        """
-
-        if int(value) == 1:
-            this.__set('debug',1,requester)
-        else:
-            this.__set('debug',0,requester)
-
-    #
-    # setKeeplilypond
-    #
-    def setKeeplilypond(this, value, requester):       
-        """
-        Set or Clear keeplilypond flag
-        """
-
-        if int(value) == 1:
-            this.__set('keeplilypond',1,requester)
-        else:
-            this.__set('keeplilypond',0,requester)
-
-    #
-    # setKeeply2dvi
-    #
-    def setKeeply2dvi(this, value, requester): 
-        """
-        Set or Clear keeply2dvi flag
-        """
-
-        if int(value) == 1:
-            this.__set('keeply2dvi',1,requester)
-        else:
-            this.__set('keeply2dvi',0,requester)
-
-    #
-    # setNonumber 
-    #
-    def setNonumber(this, value, requester):   
-        """
-        Set nonumber flag
-        """
-
-        if int(value) == 1:
-            this.__set('pagenumber',1,requester)
-        else:
-            this.__set('pagenumber',0,requester)
-
-    #
-    # setSeparate
-    #
-    def setSeparate(this, value, requester):   
-        """
-        Set or Clear separate flag
-        """
-
-        if int(value) == 1:
-            this.__set('separate',1,requester)
-        else:
-            this.__set('separate',0,requester)
-
-    #
-    # Set output directory name
-    #
-    def setOutput(this,out,requester):
-       this.__set('output',out,requester)
-
-    #
-    # Set latex header name
-    #
-    def setHeader(this,head, requester):
-       this.__set('header',head,requester)
-
-    #
-    # Set or Clear Dependencies flag to generate makefile dependencies
-    #
-    def setDependencies(this, requester):      
-        """
-        Set or Clear dependencies flag
-        """
-
-        if int(value) == 1:
-            this.__set('dependencies',1,requester)
-        else:
-            this.__set('dependencies',0,requester)
-
-    #
-    # Set tmp directory
-    #
-    def setTmp(this,dir, requester):   
-       this.__set('tmp',dir,requester)
-
-    #
-    # Set mudela source file name
-    #
-    def setFilename(this,file, requester):     
-       this.__set('filename',file,requester)
-
-    #
-    # Set title commands
-    #
-    def setTitles(this,titles, requester):     
-       this.__set('titles',titles,requester)
-
-    #
-    # Set title commands
-    #
-    def addLilyOutputFiles(this,filelist,requester):
-        """
-        Add a to the lily output list
-        """
-
-        tmp = this.get('lilyOutputFiles')
-        tmp = tmp + filelist
-        this.__set('lilyOutputFiles',tmp,requester)
-
-    #
-    # Set/Clear postscript flag
-    #
-    def setPostscript(this,value,requester):
-        """
-        Set postscript flag
-        """
-
-        if int(value) == 1:
-            this.__set('postscript',1,requester)
-        else:
-            this.__set('postscript',0,requester)
-
-    #
-    # Set root
-    #
-    def setRoot(this,path, requester): 
-        """
-        Set lilypond root directory
-        """
-
-        os.environ['LILYPONDPREFIX'] = path
-       this.__set('root',path,requester)
-
-    #
-    # printProps
-    #
-    def printProps(this):
-        """
-        Print properties
-        """
-        
-        for key in this.__data.keys():
-            print "%s <%s>:<%s>" % (key,this.get(key),
-                                    this.__roverrideTable[this.__data[key][1]])
-
-\f
-
-#
-# Misc functions
-#
-
-def getLilyopts():
-    inc = ''   
-    if len(Props.get('include')) > 0: 
-        # inc = '-I ' + string.join(Props.get('include'), os.pathsep ())
-        inc = '-I ' + string.join(Props.get('include'), " -I ")
-    else:
-
-        if Props.get('dependencies'):
-            dep=' -d'
-        else:
-            dep=''
-       return inc + dep
-    return inc
-
-def writeLilylog(contents):
-    if Props.get('keeplilypond'):
-        file='lilylog.' + str(os.getpid())
-        output = Props.get('output')
-        if output != '':
-            file = os.path.join( output, file )
-        try:
-            fd = open( file, 'w' )
-        except:
-            sys.exit('ExitNoWrite', file)
-        fd.write(contents)
-        fd.close()
-
-def getTeXFile(contents):
-    texfiles=[]
-    for line in string.split(contents,'\n'):
-        m = re.search('^TeX output to (.+)\.\.\.', line)
-        if m:
-            texfiles.append(m.group(1))
-
-    if texfiles == []:
-        sys.exit('ExitNoTeXName')
-    else:
-        return texfiles
-
-def program_id ():
-    return name + ' ' + version;
-
-
-def mailaddress():
-    try:
-       return os.environ['MAILADDRESS']
-    except KeyError:
-       return '(address unknown)'
-
-
-def identify ():
-    sys.stderr.write (program_id () + '\n')
-
-def help ():
-    sys.stderr.write (
-        'Generate dvi file from mudela or lilypond output\n'
-        'Usage: ' + name + ' [OPTION]... [FILE]...\n'
-        '\n'
-        'Options:\n'
-        '  -D,--debug           increase verbosity\n'
-        '  -F,--headers=        name of additional LaTeX headers file\n'
-        '  -H,--Height=         set paper height (points) (see manual page)\n'
-        '  -I,--include=DIR     add DIR to LilyPond\'s search path\n'
-        '  -K,--keeplilypond    keep lilypond output files\n'
-        '  -L,--landscape       set landscape orientation\n'
-        '  -N,--nonumber        switch off page numbering\n'
-        '  -O,--orientation=    set orientation (obsolete - use -L instead)\n'
-        '  -P,--postscript      generate postscript file\n'
-        '  -W,--Width=          set paper width (points) (see manual page)\n'
-        '  -d,--dependencies    tell lilypond make a dependencies file\n'
-        '  -h,--help            this help text\n'
-        '  -k,--keeply2dvi      keep ly2dvi output files\n'
-        '  -l,--language=       give LaTeX language (babel)\n'
-        '  -o,--output=         set output directory\n'
-        '  -p,--papersize=      give LaTeX papersize (eg. a4)\n'
-        '  -s,--separate        run all files separately through LaTeX\n'
-        '\n'
-        'files may be (a mix of) input to or output from lilypond(1)\n'
-        )
-
-\f
-
-#
-# main
-#
-
-def main():
-    """Generate dvi files from lilypond source/output"""
-
-    infile = Input()
-    outfile = TeXOutput()
-    texInputFiles=[]
-
-    (options, files) = getopt.getopt (sys.argv[1:],
-                                      'DF:H:I:KLNPW:dhkl:o:p:s',
-                                      ['debug', 'headers=', 'Height=',
-                                       'include=', 'keeplilypond', 'landscape',
-                                       'nonumber', 'Width=', 'dependencies',
-                                       'help', 'keeply2dvi', 'language=',
-                                       'output=', 'papersize=', 'separate',
-                                       'postscript'])
-    for opt in options:
-        o = opt[0]
-        a = opt[1]
-        if o == '--debug' or o == '-D':
-           Props.setDebug(1,'commandline')
-        elif o == '--headers' or o == '-F':
-           Props.setHeader(a,'commandline')
-        elif o == '--include' or o == '-I':
-           Props.setInclude(a,'commandline')
-        elif o == '--Height' or o == '-H':
-           Props.setTextHeight(a,'commandline')
-        elif o == '--keeplilypond' or o == '-K':
-           Props.setKeeplilypond(1,'commandline')
-        elif o == '--landscape' or o == '-L':
-           Props.setOrientation('landscape','commandline')
-        elif o == '--nonumber' or o == '-N':
-           Props.setNonumber('commandline')
-        elif o == '--Width' or o == '-W':
-           Props.setLineWidth(a,'commandline')
-        elif o == '--dependencies' or o == '-d':
-           Props.setDependencies(1,'commandline')
-        elif o == '--help' or o == '-h':
-            help()
-            return 0
-        elif o == '--keeply2dvi' or o == '-k':
-           Props.setKeeply2dvi(1,'commandline')
-        elif o == '--language' or o == '-l':
-           Props.setLanguage(a,'commandline')
-        elif o == '--output' or o == '-o':
-           Props.setOutput(a,'commandline')
-        elif o == '--papersize' or o == '-p':
-           Props.setPaperZize(a,'commandline')
-        elif o == '--separate' or o == '-s':
-           Props.setSeparate(1,'commandline')
-        elif o == '--postscript' or o == '-P':
-           Props.setPostscript(1,'commandline')
-
-    if len(files):
-        for file in files:
-            infile.open(file)
-            type = infile.type()
-            infile.close()
-            if type == 'source':
-                cmd = 'lilypond %s %s 2>&1' % (getLilyopts(), file)
-                fd = os.popen( cmd , 'r' )
-                log = ''
-                line=fd.readline()
-                while line:
-                    log = log + line
-                    sys.stderr.write( line )
-                    line=fd.readline()
-                stat = fd.close()
-                if stat:
-                    sys.exit('ExitBadLily', cmd )
-                texFiles=getTeXFile(log)
-                writeLilylog(log)
-                Props.addLilyOutputFiles(texFiles,'program')
-                texInputFiles = texInputFiles + texFiles
-            else:
-                texInputFiles.append(file)
-
-        firstfile=1
-        for file in texInputFiles:
-            infile.open(file)
-            infile.setVars() # first pass set variables
-            infile.close()
-            if Props.get('debug'):
-                Props.printProps()
-            if firstfile:
-                outfile.start(file)
-            else:
-                outfile.next()
-            outfile.write("""\
-\\input{%s}
-""" % (file))
-            if Props.get('separate'):
-                outfile.end()
-            else:
-                firstfile=0
-        if not Props.get('separate'):
-            outfile.end()
-    else:
-        help()
-        sys.exit('ExitBadArgs','No files specified')
-
-#
-# Exit values
-#
-ExitTable = {
-    'ExitInterupt'         : ['Ouch!', 1 ],
-    'ExitBadArgs'          : ['Wrong number of arguments', 2 ],
-    'ExitNotFound'         : ['File not found', 3 ],
-    'ExitBadPaper'         : ['Unknown papersize', 4 ],
-    'ExitBadHeight'        : ['Invalid Height specification', 5 ],
-    'ExitBadWidth'         : ['Invalid Width specification', 6 ],
-    'ExitBadOrient'        : ['Invalid Orientation specification', 7 ],
-    'ExitNoWrite'          : ['Permission denied', 8 ],
-    'ExitNoTeXName'        : ['hmm, I could not find an output file name', 9 ],
-    'ExitBadLily'          : ['Lilypond failed', 10 ],
-    'ExitBadLatex'         : ['Latex failed', 11 ],
-    'ExitBadPostscript'    : ['Postscript failed', 12 ],
-    'ExitUnknown'          : ['Unknown Exit Code', 20 ],
-    }
-
-def cleanup():
-    lilyfiles = []
-    tmpfiles = []
-    if not Props.get('keeplilypond'):
-        lilyfiles = Props.get('lilyOutputFiles')
-    if not Props.get('keeply2dvi'):
-        tmpfiles = glob.glob('*.' + str(os.getpid()) + '.*' )
-    for file in lilyfiles + tmpfiles:
-        if os.path.isfile(file):
-            os.remove(file)
-
-
-identify()
-Props = Properties()
-
-try:
-    main()
-
-except KeyboardInterrupt:
-    print ExitTable['ExitInterupt'][0]
-    cleanup()
-    sys.exit(ExitTable['ExitInterupt'][1])
-
-except SystemExit, errno:
-    if ExitTable.has_key(errno.args[0]):
-        msg = ExitTable[errno.args[0]]
-    else:
-        msg = ExitTable['ExitUnknown']
-    if len(errno.args) > 1:  
-        sys.stderr.write( '%s: %s: %s\n' % (name, msg[0], errno.args[1]))
-    else:
-        sys.stderr.write( '%s %s\n' % (name, msg[0]))
-    if Props.get('debug'):
-        Props.printProps()
-    cleanup()
-    sys.exit(msg[1])
-else:
-    cleanup()
diff --git a/bin/mail-address.sh b/bin/mail-address.sh
deleted file mode 100644 (file)
index 37e1141..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# mail-address
-if [ "$MAILADDRESS" != "" ]; then
-       echo $MAILADDRESS
-else
-       echo "mail-address:6: warning: \$MAILADDRESS undefined" > /dev/stderr
-       echo $USER@`hostname`
-fi
diff --git a/bin/mf-to-table.py b/bin/mf-to-table.py
deleted file mode 100644 (file)
index 4d4b505..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-#!@PYTHON@
-
-# mf-to-table.py -- convert spacing info in  MF logs .ly and .tex
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-import os
-import sys
-import getopt
-from string import *
-import regex
-import regsub
-import time
-
-
-(options, files) = getopt.getopt(
-    sys.argv[1:], 'a:d:hl:o:p:t:', 
-    ['afm=', 'outdir=', 'dep=', 'ly=', 'tex=', 'debug', 'help', 'package='])
-
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o == '-p' or o == '--package':
-       topdir = a
-
-sys.path.append (topdir + '/stepmake/bin')
-from packagepython import *
-package = Package (topdir)
-packager = Packager ()
-
-from packagepython import *
-from flower import *
-
-begin_autometric_re = regex.compile('@{')
-end_autometric_re = regex.compile('@}')
-include_re = regex.compile ('(\([a-zA-Z_0-9-]+\.mf\)')
-autometric_re = regex.compile('@{\(.*\)@}')
-version = '0.7'
-postfixes = ['log', 'dvi', '2602gf', 'tfm']
-
-class Feta_file(File):
-    """Read Feta metrics from a metafont log-file."""
-
-    def include_scan (self, line):
-       include_pos =  include_re.search (line)
-       while include_pos <> -1:
-           self.dependencies.append (include_re.group (1))
-
-           line = line[include_pos + 1:]
-           include_pos =  include_re.search (line)
-
-    def read_autometricline(self):
-       line = ''
-       while end_autometric_re.search(line) == -1 and not self.eof():
-           suf = File.readline(self)
-           self.include_scan (suf)
-           if begin_autometric_re.search(line) == -1:
-               line = ''
-           line = line + regsub.sub('\n','', suf)
-            line = regsub.sub('\r','', line)
-
-       if self.eof():
-          return ''
-
-       return line;
-    def readline(self):
-       """return what is enclosed in one @{ @} pair"""
-       line = '';
-       while autometric_re.search(line) == -1 and not self.eof():
-           line = self.read_autometricline()
-
-       if self.eof():
-           return '';
-
-       return autometric_re.group(1);
-    def __init__(self, nm):
-       File.__init__(self, nm)
-       self.dependencies = []
-    def do_file(infile_nm):
-       infile = readline();
-
-#
-# FIXME: should parse output for {} to do indenting.
-#
-class Indentable_file(File):
-    """Output file with support for indentation"""
-    def __init__(self,nm, mode):
-       File.__init__(self,nm,mode)
-       self.current_indent_ = 0
-       self.delta_indent_ = 4
-    def writeline (self, str):
-       File.write(self, str)
-    def writeeol(self):
-       File.write(self, '\n')
-       File.write(self, ' '* self.current_indent_)
-
-    def indent(self):
-       self.current_indent_ = self.delta_indent_ + self.current_indent_;
-    def dedent(self):
-       self.current_indent_ = self.current_indent_ - self.delta_indent_;
-       if self.current_indent_ < 0:
-           raise 'Nesting!'
-
-    def write(self, str):
-       lines = split(str, '\n')
-       for l in lines[:-1]:
-           self.writeline(l)
-           self.writeeol()
-        self.writeline (lines[-1])
-
-class Afm_file (File):
-    def print_f_dimen(self, f):
-       f = f * 1000
-    
-       dimstr = '%.2f' % f
-
-       # try to mask rounding errors
-       if (dimstr == '-0.00'):
-               dimstr = '0.00'
-       self.write( dimstr  +' ');
-
-    def neg_print_dimen(self, str):
-       self.print_f_dimen(-atof(str))
-    def print_dimen(self, str):
-       self.print_f_dimen(atof(str))
-    def def_symbol (self, code, lily_id, tex_id, xdim, ydim):
-       self.write ('C %s; N %s-%s; B ' % (code, self.groupname, lily_id))
-
-       self.neg_print_dimen(xdim [0])
-       self.neg_print_dimen(ydim [0])
-       self.print_dimen(xdim [1])
-       self.print_dimen(ydim [1])
-
-       self.write (';\n');
-       
-    def start (self,nm):
-       self.write ('Start%s\n' % nm)
-    def end (self,nm):
-       self.write ('End%s\n' % nm)
-
-class Ly_file(Indentable_file):
-    """extra provisions for mozarella quirks"""
-    def print_lit(self, str):
-       self.write('\"%s\"\t' % str)
-
-    def print_f_dimen(self, f):
-       dimstr = '%.2f' % f
-
-       # try to mask rounding errors
-       if (dimstr == '-0.00'):
-               dimstr = '0.00'
-       self.write( dimstr  +'\\pt\t');
-
-    def print_dimen(self, str):
-       self.print_f_dimen(atof(str))
-    
-    def neg_print_dimen(self, str):
-       self.print_f_dimen(-atof(str));
-       
-    def def_symbol(self, code, lily_id, tex_id, xdim, ydim):
-       self.print_lit(lily_id)
-       self.print_lit('\\\\' + tex_id)
-
-       self.neg_print_dimen(xdim [0])
-       self.print_dimen(xdim [1])
-       self.neg_print_dimen(ydim [0])
-       self.print_dimen(ydim [1])
-       self.write('\n')
-       
-       
-class Log_reader:
-    """Read logs, destill info, and put into output files"""
-    def output_label(self, line):
-
-       if not line:
-           return;
-       tags = split(line, '@:')
-       label = tags[0]
-       name = tags[1]
-       ly = self.lyfile
-       afm = self.afmfile
-       if tags[0] == 'font':
-           ly.indent()
-           ly.write("% name=\\symboltables {\n")
-           self.texfile.write("% name\n")
-
-           afm.write ('FontName %s\n' % name)
-           afm.start ('FontMetrics')
-           afm.start ('CharMetrics')       
-           
-       elif label == "group":
-           ly.indent()
-           ly.print_lit(name)
-           ly.write(' = \\table {\n')
-           self.texfile.write("% " + name + "\n")
-           afm.groupname = name
-       elif label == "puorg":
-           ly.dedent()
-           ly.write("}\n")
-           self.texfile.write("\n")
-       elif label == "tnof":
-           ly.dedent()
-           ly.write("%  } % $name\n")
-           afm.end ('CharMetrics')
-           afm.end('FontMetrics');
-       elif label == "char":
-           code = tags[2]
-           id = tags [7]
-           texstr = tags [8]
-           xdim = tags[3:5]
-           ydim = tags[5:7]
-           ly.def_symbol(code, id, texstr, xdim, ydim)
-           
-           self.texfile.write("\\fetdef\\%s{%s}\n" % (texstr, code))
-           afm.def_symbol (code, id, texstr, xdim, ydim)
-       else:
-           raise 'unknown label: ' + label
-
-    def writedeps (self, deps):
-       if not len (deps):
-           sys.stderr.write  ('Huh, no main target??')
-           return
-       filename = deps[0]
-       split = os.path.splitext(filename)      
-       basename=split[0];
-
-       targets =  map (lambda x,y = basename, z = self.outdir: z + '/' + y + '.' + x, postfixes)
-       depstring = reduce(lambda x,y: x + ' ' + y, deps) 
-       dependencies = map (lambda x, y=depstring: x + ': ' + y, targets)
-       for x in dependencies: 
-           self.depfile.write (x + '\n')
-       
-    def do_file(self,filenm):
-       self.lyfile.write ('\n% input from ' + filenm + '\n')
-       self.texfile.write ('\n% input from ' + filenm + '\n')
-       feta = Feta_file(filenm)
-       while not feta.eof():
-           line = feta.readline()
-           self.output_label(line)
-       feta.close()
-       
-       self.writedeps (feta.dependencies)
-
-    def __init__(self, lyfile_nm, texfile_nm, depfile_nm, afmfile_nm):     
-       self.lyfile = Ly_file(lyfile_nm, 'w')
-       self.texfile = Indentable_file(texfile_nm, 'w')
-       self.depfile = File (depfile_nm, 'w')
-       self.afmfile = Afm_file (afmfile_nm, 'w')
-       headerstr = '%% Creator: %s\n%% Automatically generated on\n%% Do not edit' % \
-                  (program_id() )
-
-       self.lyfile.write(headerstr)
-       self.texfile.write(headerstr)
-       self.depfile.write ('# automatically generated by %s\n' % program_id ())
-
-    def close(self):
-       self.lyfile.close()
-       self.texfile.close()
-       self.depfile.close ()
-
-    def __del__(self):
-       self.close()
-
-def today_str():
-    return time.asctime(time.localtime(time.time()))
-       
-def program_id():
-    return 'mf-to-table.py version ' + version;
-
-def identify():
-    sys.stdout.write(program_id() + '\n')
-    
-def help():
-    sys.stdout.write("Usage: mf-to-table [options] LOGFILEs\n"
-                + "Generate mozarella metrics table from preparated feta log\n\n"
-                + "Options:\n"
-                + "  -a, --afm=FILE         .afm file\n"
-                + "  -d, --dep=FILE         print dependency info to FILE\n"
-                + "  -h, --help             print this help\n"
-                + "  -l, --ly=FILE          name output table\n"
-                + "  -o, --outdir=DIR       prefix for dependency info\n"
-                + "  -p, --package=DIR      specify package\n"
-                + "  -t, --tex=FILE         name output tex chardefs\n"
-                    )
-    sys.exit (0)
-
-
-def main():
-    identify()
-
-    lyfile_nm = texfile_nm = '';
-    depfile_nm = ''
-    afmfile_nm = ''
-    outdir_prefix = '.'
-    for opt in options:
-       o = opt[0]
-       a = opt[1]
-       if o == '--dep' or o == '-d':
-           depfile_nm = a
-       elif o == '--outdir' or o == '-o':
-           outdir_prefix = a
-       elif o == '--ly' or o == '-l':
-           lyfile_nm = a
-       elif o == '--tex' or o == '-t':
-           texfile_nm = a
-       elif o== '--help' or o == '-h':
-           help()
-       elif o=='--afm' or o == '-a':
-           afmfile_nm = a
-       elif o == '--debug':
-           debug_b = 1
-       elif o == '-p' or o == '--package':
-           topdir = a
-       else:
-           print o
-           raise getopt.error
-
-    log_reader = Log_reader(lyfile_nm, texfile_nm, depfile_nm, afmfile_nm)
-    log_reader.outdir = outdir_prefix
-    for filenm in files:
-       log_reader.do_file(filenm)
-    log_reader.close()
-
-
-main()
diff --git a/bin/mf-to-xpms.sh b/bin/mf-to-xpms.sh
deleted file mode 100644 (file)
index 0372989..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!@SHELL@
-# mf-to-xpms.sh
-
-if [ $# -ne 1 ]; then
-       echo Usage: mf-to-xpms feta20
-       exit 2
-fi
-
-font=`basename $1 .mf`
-mf=$font.mf
-afm=out/$font.afm
-PKTOPBM=pktopbm
-MODE=ibmvga
-RESOLUTION=110
-named=yes
-
-if [ ! -e out/$font.${RESOLUTION}pk ]; then
-       mf "\\mode=${MODE}; \\input $mf"
-       mv $font.${RESOLUTION}gf out
-       rm -f $font.log $font.tfm
-       gftopk out/$font.${RESOLUTION}gf out/$font.${RESOLUTION}pk
-fi
-
-# num=`grep "^C *[0-9]*;" $afm | tail -1 | sed "s!^C *\([^;]*\).*!\\1!"`
-# num=66
-# tex=out/$font.tex
-# cat > $tex <<EOF
-# \font\fetatwenty=feta20
-# \fetatwenty
-# \nopagenumbers
-# \newcount\c\c64
-# \char\c
-# \loop\ifnum\c<$num\advance\c by1
-#      \vfill\eject
-#      \char\c
-# \repeat
-# \vfill\eject
-# \end
-# EOF
-
-# for i in $NUMS; do
-#      $PKTOPBM out/$font.${RESOLUTION}pk -c $i out/$font-$i.pbm
-# done
-
-# numbered files
-if [ "x$named" = "x" ]; then
-       NUMS=`grep "^C *[0-9]*;" $afm | sed "s!^C *\([^;]*\).*!\\1!"`
-       PBMS=`grep "^C *[0-9]*;" $afm | sed "s!^C *\([^;]*\).*!out/$font-\\1.pbm!"`
-else
-       NUMS=`grep "^C *[0-9]*;" $afm | sed "s!^C [^;]*; *N *\([^;]*\).*!\\1!"`
-       PBMS=`grep "^C *[0-9]*;" $afm | sed "s!^C [^;]*; *N *\([^;]*\).*!out/$font-\\1.pbm!"`
-fi
-
-# $PKTOPBM out/$font.${RESOLUTION}pk -x 100 -y 100 $PBMS
-$PKTOPBM out/$font.${RESOLUTION}pk $PBMS
-
-for i in $NUMS; do
-       ppmtoxpm out/$font-$i.pbm > out/$font-$i.xpm
-done
-rm -f $PBMS
diff --git a/bin/mudela-book.py b/bin/mudela-book.py
deleted file mode 100644 (file)
index 3faa60d..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-#!@PYTHON@
-# All non-english comments are NOT in swedish, they are norwegian!
-
-#  TODO:  center option (??)
-# * clean up handling of filename of inputfile
-# * steal Props class from ly2dvi?
-# * \onecolumn, \twocolumn
-# * fontsize change with commandline parameters
-# * the   verbatim  option should not be visible in the created latex file
-# * what the h.. does castingalgorithm do/mean???
-# * compile all regular expressions
-# * the following fails because mudelabook doesn't care that the
-#   last } after \end{mudela} finishes the marginpar:
-#     \marginpar{
-#     \begin{mudela}[fragment]
-#        c d e f g
-#     \end{mudela}}
-# * Command line parameter that force all inline mudela to be verbatim, and
-#   one that forces all to be printed
-# log:
-
-# 0.3:
-#   rewrite in Python.
-# 0.4:
-#   much rewritten by new author. I think the work has been split more
-#   logical between different classes.
-#   
-
-import os
-import string
-import re
-import getopt
-import sys
-import regsub
-
-outdir = 'out'
-program_version = '0.4'
-default_paper_size_global = 'a4'
-default_mudela_fontsize = '16pt'
-force_mudela_fontsize_b = 0
-
-fontsize_i2a = {11:'eleven', 13:'thirteen', 16:'sixteen', 20:'twenty', 26:'twentysix'}
-fontsize_pt2i = {'11pt':11, '13pt':13, '16pt':16, '20pt':20, '26pt':26}
-
-def file_exist_b(name):
-    try: 
-       f = open(name)
-    except IOError:
-       return 0
-    f.close ()
-    return 1
-
-def ps_dimention(fname):
-    fd = open(fname)
-    lines = fd.readlines()
-    reg = re.compile('%%BoundingBox: ([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)')
-    for line in lines:
-        s = reg.search(line)
-        if s:
-            break
-    return (int(s.groups()[2])-int(s.groups()[0]), 
-            int(s.groups()[3])-int(s.groups()[1]))
-
-
-class CompileStatus:
-    pass
-
-def file_mtime (name):
-    return os.stat (name)[8] #mod time
-#
-# executes os.system(command) if infile is newer than
-# outfile or outfile don't exist
-#
-def compile (command, workingdir, infile, outfile):
-    indate = file_mtime (workingdir+infile)
-    try:
-        outdate = file_mtime (outfile)
-        recompile = indate > outdate
-
-    except os.error:
-        recompile = 1
-
-    if recompile:
-        sys.stderr.write ('invoking `%s\'\n' % command)
-        if workingdir == '':
-            status = os.system (command)
-        else:
-            status = os.system ('cd %s; %s' %(workingdir, command))
-        if status:
-            raise CompileStatus
-
-
-class PaperDef:
-    __onecolumn_linewidth = {
-        'a4':{'10pt': 345, '11pt': 360, '12pt':390},
-        'a5':{'10pt': 276, '11pt': 276, '12pt':276},
-        'b5':{'10pt': 345, '11pt': 356, '12pt':356},
-        'letter':{'10pt': 345, '11pt': 360, '12pt':390},
-        'legal':{'10pt': 345, '11pt': 360, '12pt':390},
-        'executive':{'10pt': 345, '11pt': 360, '12pt':379}
-        }
-    __twocolumn_linewidth = {
-         'a4':{'10pt': 167, '11pt': 175, '12pt':190},
-        'a5':{'10pt': 133, '11pt': 133, '12pt':133},
-        'b5':{'10pt': 167, '11pt': 173, '12pt':173},
-        'letter':{'10pt': 167, '11pt': 175, '12pt':190},
-        'legal':{'10pt': 167, '11pt': 175, '12pt':190},
-        'executive':{'10pt': 167, '11pt': 175, '12pt':184}
-        }
-    __numcolumn = 1
-    __fontsize = '11pt'
-    #
-    # init
-    #
-    def __init__(self):
-        self.__papersize = default_paper_size_global
-    def set_papersize (self, p):
-        if not self.__onecolumn_linewidth.has_key(p):
-            print "warning:unsupported papersize", p, \
-                  "will use", default_paper_size_global
-            self.__papersize = default_paper_size_global
-        else:
-            self.__papersize = p
-    def set_fontsize(self, pt):
-        self.__fontsize = pt
-    def get_linewidth (self):
-        if self.__numcolumn == 1:
-            return self.__onecolumn_linewidth[self.__papersize][self.__fontsize]
-        else:
-            return self.__twocolumn_linewidth[self.__papersize][self.__fontsize]
-    def onecolumn (slef):
-        self.__numcolumn = 1
-    def twocolumn (self):
-        self.__numcolumn = 2
-
-
-class Mudela_output:
-    def __init__ (self, basename):
-        self.basename = basename
-        # it's an integer!
-        self.feta_pt_size = fontsize_pt2i[default_mudela_fontsize]
-        self.temp_filename = "%s/%s" %(outdir, 'mudela-temp.ly')
-        self.file = open (self.temp_filename, 'w')
-        # 'tex' or 'eps'
-        self.graphic_type = 'tex'
-        self.fragment = 0
-    def write (self, line):
-        # match only if there is nothing but whitespace before \begin
-        if re.search('^\s*\\\\begin{mudela}', line):
-            self.scan_begin_statement(line)
-            self.write_red_tape()
-        else:
-            self.file.write (line)
-    def scan_begin_statement(self, line):
-        r  = begin_mudela_opts_re.search(line)
-        if r:
-            o = r.group()[1:][:-1]
-            optlist =  re.compile('[ ,]*').split(o)
-        else:
-            optlist = []
-        if 'floating' in optlist:
-            self.graphic_type = 'eps'
-        else:
-            self.graphic_type = 'tex'
-        if 'fragment' in optlist:
-            self.fragment = 1
-        else:
-            self.fragment = 0
-        for pt in fontsize_pt2i.keys():
-            if pt in optlist:
-                self.feta_pt_size = fontsize_pt2i[pt]
-    def write_red_tape(self):
-        self.file.write ('\\include \"paper%d.ly\"\n' % self.feta_pt_size)
-        s = fontsize_i2a[self.feta_pt_size]
-        if self.fragment:
-            self.file.write("default_paper = \\paper {"
-                            + "\\paper_%s\n linewidth = -1.\\pt;" % s
-                            + "castingalgorithm = \Wordwrap; indent = 2.\cm; \n}")
-            self.file.write("\\score{\n\\notes") #HACK
-        else:
-            self.file.write ("default_paper = \\paper {"
-                             + "\\paper_%s\n linewidth = %i.\\pt;" % \
-                             (s, Paper.get_linewidth()) \
-                             + "castingalgorithm = \Wordwrap; indent = 2.\cm;\n}")
-    def close (self):
-        if self.fragment:
-            self.file.write ('\\paper { \\default_paper; } }\n')
-        self.file.close ()
-
-        inf = self.basename + '.ly'
-        outf = self.basename + '.tex'          
-        if not file_exist_b (inf):
-            status = 1
-        else:
-            status = os.system ('diff -q %s %s' % (self.temp_filename, inf))
-
-        if status:
-            os.rename (self.temp_filename, inf)
-        compile ('lilypond  -o %s %s;'%  (self.basename, inf), '', inf, outf)
-        if self.graphic_type == 'eps':
-            bname = self.basename[string.rfind(self.basename, '/')+1:]
-            tex_name = bname+'.tex'
-            dvi_name = bname+'.dvi'
-            eps_name = bname+'.eps'
-            compile ('tex %s' % tex_name, outdir, tex_name, dvi_name)
-            compile ('dvips -E -o %s %s' % (eps_name, dvi_name), outdir, dvi_name, eps_name)
-    def insert_me_string(self):
-        "Returns a string that can be used directly in latex."
-        if self.graphic_type == 'tex':
-            return '\\preMudelaExample\\input %s\n\postMudelaExample\n' % self.basename
-        elif self.graphic_type == 'eps':
-            ps_dim = ps_dimention('%s.eps' % self.basename)
-            return '\\parbox{%ipt}{\includegraphics{%s.eps}}' % (ps_dim[0], self.basename)
-        else:
-            print "Unsupported graphic type '%s'" % self.graphic_type
-            sys.exit(1)
-
-class Tex_output:
-    def __init__ (self, name):
-        self.output_fn = '%s/%s' % (outdir, name)
-        self.file = open (self.output_fn , 'w')
-    def open_mudela (self, basename):
-        self.mudela_basename = basename
-    def open_verbatim (self):
-        self.file.write ('\\begin{verbatim}\n')
-    def close_verbatim (self):
-        self.file.write ('\\end{verbatim}\n')
-    def write (self, s):
-        self.file.write (s)
-
-begin_mudela_re = re.compile ('^ *\\\\begin{mudela}')
-begin_mudela_opts_re = re.compile('\[[^\]]*\]')
-end_mudela_re = re.compile ('^ *\\\\end{mudela}')
-section_re = re.compile ('\\\\section')
-chapter_re = re.compile ('\\\\chapter')
-input_re = re.compile ('^\\\\input{([^}]*)')
-include_re = re.compile ('^\\\\include{([^}]*)')
-begin_document_re = re.compile ('^ *\\\\begin{document}')
-documentclass_re = re.compile('\\\\documentclass')
-twocolumn_re = re.compile('\\\\twocolumn')
-onecolumn_re = re.compile('\\\\onecolumn')
-
-class Tex_input:
-    def __init__ (self,name):
-        # HACK
-        if (name[-4:] != '.tex') and (name[-4:] != '.doc'):
-            name = name + '.tex'
-        self.filename = name
-        self.infile = open (name)
-               
-    def get_lines (self):
-        lines = self.infile.readlines ()
-        (retlines, retdeps) = ([],[self.filename])
-        for line in lines:
-            r = input_re.search (line)
-            ri = include_re.search (line)
-            if r:
-                t = Tex_input (r.groups()[0])
-                ls =t.get_lines ()
-                retlines = retlines + ls[0]
-                retdeps = retdeps + ls[1]
-            elif ri:
-                t = Tex_input (ri.groups()[0])
-                ls =t.get_lines ()
-                ls[0].insert(0, '\\newpage')
-                ls[0].append('\\newpage')
-                retlines = retlines + ls[0]
-                retdeps = retdeps + ls[1]                
-            else:
-                retlines.append (line)
-        return (retlines, retdeps)
-
-
-class Main_tex_input(Tex_input):
-    def __init__ (self, name, outname):
-               
-        Tex_input.__init__ (self, name) # ugh
-
-        self.outname = outname
-        self.chapter = 0
-        self.section = 0
-        self.fine_count =0
-        self.mudtex = Tex_output (self.outname)
-        self.mudela = None
-        self.deps = []
-        self.verbatim = 0
-        # set to 'mudela' when we are processing mudela code,
-        # both verbatim and graphic-to-be
-        self.mode = 'latex'
-    def set_sections (self, l):
-        if section_re.search (l):
-            self.section = self.section + 1
-        if chapter_re.search (l):
-            self.section = 0
-            self.chapter = self.chapter + 1
-
-    def gen_basename (self):
-        return '%s/%s-%d.%d.%d' % (outdir, self.outname,self.chapter,self.section,self.fine_count)
-
-    def extract_papersize_from_documentclass(self, line):
-        pre = re.search('\\\\documentclass[\[, ]*(\w*)paper[\w ,]*\]\{\w*\}', line)
-        if not pre:
-            return default_paper_size_global
-        return pre.groups()[0]
-    def extract_fontsize_from_documentclass(self, line):
-        if re.search('\\\\documentclass\[[^\]]*\]\{[^\}]*\}', line):
-            r = re.search('[ ,\[]*([0-9]*pt)', line)
-            if r:
-                return r.groups()[0]
-        return '10pt'
-    def do_it(self):
-        (lines, self.deps) = self.get_lines ()
-        for line in lines:
-            if documentclass_re.search (line):
-                Paper.set_papersize (self.extract_papersize_from_documentclass (line) )
-                Paper.set_fontsize (self.extract_fontsize_from_documentclass (line) )
-            elif twocolumn_re.search (line):
-                Paper.twocolumn ()
-            elif onecolumn_re.search (line):
-                Paper.onecolumn ()
-            elif begin_document_re.search (line):
-                self.mudtex.write ('\\def\\preMudelaExample{}\n')
-                self.mudtex.write ('\\def\\postMudelaExample{}\n')
-            elif begin_mudela_re.search (line):
-                if __debug__:
-                    if self.mode == 'mudela':
-                        raise AssertionError
-                self.mode = 'mudela'
-                r  = begin_mudela_opts_re.search (line)
-                if r:
-                    o = r.group()[1:][:-1]
-                    optlist =  re.compile('[ ,]*').split(o)
-                else:
-                    optlist = []
-                if 'verbatim' in optlist:
-                    self.verbatim = 1
-                    self.mudtex.open_verbatim ()
-                else:
-                    self.verbatim = 0
-                    self.mudela = Mudela_output (self.gen_basename ())
-
-            elif end_mudela_re.search (line):
-                if __debug__:
-                    if self.mode != 'mudela':
-                        raise AssertionError
-                if self.mudela:
-                    self.mudela.close ()
-                    self.mudtex.write (self.mudela.insert_me_string())
-                    del self.mudela
-                    self.mudela = None
-                    self.fine_count = self.fine_count + 1
-                else:                    
-                    self.mudtex.write (line)
-                    self.mudtex.close_verbatim ()
-                self.mode = 'latex'
-                continue
-
-            if self.mode == 'mudela' and not self.verbatim:
-                self.mudela.write (line)
-            else:
-                self.mudtex.write (line)
-                self.set_sections(line)
-        del self.mudtex
-               
-
-def help():
-    sys.stdout.write("Usage: mudela-book [options] FILE\n"
-                + "Generate hybrid LaTeX input from Latex + mudela"
-                + "Options:\n"
-                + "  -h, --help             print this help\n"
-                + "  -d, --outdir=DIR       directory to put generated files\n" 
-                + "  -o, --outname=FILE     prefix for filenames\n"
-                 + "  --mudela-fontsize=??pt default fontsize when no parameter for \\begin{mudela}\n"
-                 + "  --force-mudela-fontsize=??pt force fontsize for all inline mudela\n"
-                    )
-    sys.exit (0)
-
-
-def write_deps (fn, out,  deps):
-       out_fn = outdir + '/' + fn
-       print '\`writing \`%s\'\n\'' % out_fn
-       
-       f = open (out_fn, 'w')
-       f.write ('%s: %s\n'% (outdir + '/' + out + '.dvi',
-                             reduce (lambda x,y: x + ' '+ y, deps)))
-       f.close ()
-
-def identify():
-    sys.stderr.write('*** Lokal versjon av mudela-book ***\n')
-    sys.stderr.write ('This is %s version %s\n' % ('mudela-book', program_version))
-
-def main():
-    global default_mudela_fontsize, outdir
-    outname = ''
-    try:
-        (options, files) = getopt.getopt(
-            sys.argv[1:], 'hd:o:', ['outdir=', 'outname=', 'mudela-fontsize=',
-                                    'force-mudela-fontsize=', 'help', 'dependencies'])
-    except getopt.error, msg:
-        print "error:", msg
-        sys.exit(1)
-        
-    do_deps = 0
-    for opt in options:
-       o = opt[0]
-       a = opt[1]
-       if o == '--outname' or o == '-o':
-            outname = a
-        if o == '--outdir' or o == '-d':
-            outdir = a
-        if o == '--help' or o == '-h':
-            help ()
-       if o == '--dependencies':
-            do_deps = 1
-        if o == '--mudela-fontsize':
-            default_mudela_fontsize = a
-       if o == '--force-mudela-fontsize':
-            default_mudela_fontsize = a
-            force_mudela_fontsize_b = 1
-
-    if outdir[-1:] != '/':
-        outdir = outdir + '/'
-
-    if not file_exist_b(outdir):
-        os.system('mkdir %s' % outdir)
-
-    if not fontsize_pt2i.has_key(default_mudela_fontsize):
-        print "warning: fontsize %s is not supported using 16pt" % default_mudela_fontsize
-        default_mudela_fontsize = '16pt'
-    
-    for f in files:
-        my_outname = outname
-        if not my_outname:
-            my_outname = regsub.sub ('\\(.*\\)\\.doc', '\\1', f)
-
-        my_depname = my_outname + '.dep'
-        
-        inp = Main_tex_input (f, my_outname)
-        inp.do_it ()
-
-    if do_deps:
-               write_deps (my_depname, my_outname, inp.deps)
-
-
-
-identify()
-Paper = PaperDef()
-main()
diff --git a/bin/mutopia-index.py b/bin/mutopia-index.py
deleted file mode 100644 (file)
index b72042c..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-#!@PYTHON@
-# mutopia-index.py
-
-name = 'mutopia-index'
-
-import regex
-import os
-import sys
-import stat
-sys.path.append ('@abs-step-bindir@')
-
-
-
-header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}')
-header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;')
-
-#
-# FIXME breaks on multiple strings.
-#
-def read_mudela_header (fn):
-       s = gulp_file(fn)
-       s = regsub.gsub('%.*$', '', s)
-       s = regsub.gsub('\n', ' ', s)   
-
-       dict = {}
-       if header_regex.search(s) <> -1:
-               h = header_regex.group(1)
-       else:
-               return dict
-
-       while regex.search('=', h) <> -1: 
-
-               if header_entry_regex.search (h) == -1:
-
-                       raise 'format error'
-
-               h = regsub.sub(header_entry_regex, '', h)
-               left = header_entry_regex.group(1)
-               right = header_entry_regex.group(2)
-
-               right = regsub.gsub('\([^\\]\)\"', '\\1', right)
-               right = regsub.gsub('^"', '', right)            
-               left = regsub.gsub('\([^\\]\)\"', '', left)
-               left = regsub.gsub('^"', '', left)
-
-               dict[left] = right
-
-       return dict
-   
-
-
-
-def help ():
-    sys.stdout.write ("Usage: " + name + " [options] INFILE OUTFILE\n"
-                + "Generate index for mutopia\n\n"
-                + "Options:\n"
-                + "  -h, --help             print this help\n"
-                + "  -p, --package=DIR      specify package\n"
-                + "  --prefix=PRE           specify prefix\n"
-                + "  -s, --subdirs=DIR      add subdir\n"
-                + "  --suffix=SUF           specify suffix\n"
-                     )
-    sys.exit (0)
-
-def gen_list(inputs, subdir, filename):
-    (pre, subdirs, post)=subdir
-    print "generating HTML list %s\n" % filename
-    list = open(filename, 'w')
-    list.write ('<html><TITLE>Rendered Examples</TITLE>\n')
-    list.write ('<body bgcolor=white>')
-    if len(subdirs):
-       list.write  ('<h2>subdirectories</h2>')
-       list.write  ('<ul>')    
-        for ex in subdirs:
-           print 'subdir %s ' % ex
-           list.write ('<li><a href=%s/index.html>Subdirectory: %s</a></li>\n' % (pre + ex + post , ex))
-
-       list.write ('</ul>')
-
-    list.write('<h2>Contents of this directory</h2>\n');
-    list.write (
-    'These example files are taken from the LilyPond distribution. '
-    'LilyPond currently only outputs TeX and MIDI.  The pictures and '
-    'PostScript files were generated using TeX, Ghostscript and some '
-    'graphics tools.  The papersize used for these examples is A4. '
-    'As you know, <a href="http://www.gnu.org/philosophy/gif.html">no gifs due to patent problems</a>, '
-    'but the png images should be viewable with any current browser '
-    '(jpeg is inappropriate for music images).'
-    '\n');
-
-
-    for ex in inputs:
-       ex_ext = '.ly'
-       print '%s, ' % ex
-       try:
-           header = read_mudela_header(ex + ex_ext + '.txt')
-       except:
-           ex_ext = '.fly'
-           header = read_mudela_header(ex + ex_ext + '.txt')
-       
-       def read_dict(s, default, h =header):
-               try:
-                   ret = h[s]
-               except KeyError:
-                   ret = default
-               return ret
-       head = read_dict('title', ex)
-       composer = read_dict('composer', '')
-       desc = read_dict('description', '')
-       list.write('<hr>')
-       list.write('<h1>example file: %s</h1>' % head);
-       if composer <> '':
-           list.write('<h2>%s</h2>\n' % composer)
-       if desc <> '':
-           list.write('%s<p>' % desc)
-       list.write ('<ul>')
-       def list_item(filename, desc, type, l = list):
-           if file_exist_b(filename):
-               l.write ('<li><a href=%s>%s</a>' % (filename, desc))
-               size=os.stat(filename)[stat.ST_SIZE]
-               l.write (' (%s %dk)' % (type, (size + 512) / 1024))
-               pictures = ['jpeg', 'png', 'xpm']
-               # silly, no?
-               if 0 and type in pictures:
-                   l.write (' <a href="http://www.gnu.org/philosophy/gif.html">no gifs due to patent problems</a>')
-               l.write ('\n')
-       list_item(ex + ex_ext + '.txt', 'The input', 'ASCII')
-       for pageno in range(1,100):
-           f  = ex + '-page%d.png' % pageno
-           if not file_exist_b (f):
-               break
-           list_item(f, 'The output, page %d' % pageno, 'png')
-       list_item(ex + '.ps.gz', 'The output', 'gzipped PostScript')
-       list_item(ex + '.midi', 'The output', 'MIDI')
-       list.write ("</ul>");
-
-    list.write( "</BODY></HTML>");
-    list.close()
-
-import getopt
-
-(options, files) = getopt.getopt(sys.argv[1:], 
-  'hp:s:', ['help', 'subdirs=', 'suffix=', 'package=', 'prefix='])
-subdir_pre=''
-subdir_suf =''
-
-subdirs =[]
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o == '--subdirs' or o == '-s':
-       subdirs.append (a)
-    elif o == '--prefix':
-       subdir_pre = a
-    elif o == '-p' or o == '--package':
-       topdir = a
-    elif o == '--suffix':
-       subdir_suf = a
-
-    sys.path.append (topdir + '/stepmake/bin')
-    from packagepython import *
-    package = Package (topdir)
-    packager = Packager ()
-
-    from flower import *
-
-       
-# huh?
-allfiles = multiple_find (['*.*ly.txt'], '.')
-
-gen_list (files, (subdir_pre, subdirs, subdir_suf), 'index.html')
-
diff --git a/bin/profile-conf.sh b/bin/profile-conf.sh
deleted file mode 100644 (file)
index 79dbd73..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-configure --prefix=~ --enable-profiling --enable-config=optprof --enable-optimise --disable-checking
diff --git a/bin/ps-to-gifs.sh b/bin/ps-to-gifs.sh
deleted file mode 100644 (file)
index 0f4afe0..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-# ps-to-gifs, convert PS to multiple gifs or other bitmaps
-
-usage()
-{
-    cat <<EOF
-Convert PS to multiple gifs or other bitmaps
-Usage: ps-to-gifs.sh [OPTION]... [FILE]
-Options:
-  -h, --help         this help
-  -c, --crop         crop output
-  -o, --output=NAME  set output base
-  -p, --png          convert to png
-  -s, --size=SIZE    set papersize
-  -t, --transparent  change white to transparent
-EOF
-}
-
-if [ $# -lt 1 ]; then
-    usage;
-    exit 2;
-fi
-CROP=cat
-GIF=gif
-PNMTOGIF=ppmtogif
-
-while [ $# -gt 0 ]; do
-opt=$1
-shift
-    case $opt in
-    -t|--t*)
-       color='-transparent white'
-       ;;
-    -h|--h*)
-       usage;
-       exit 0
-       ;;
-    -c|--c*)
-       CROP=" pnmcrop "
-       ;;
-    -o) OUTFILE=$2; shift
-        ;;
-    --o*=*) OUTFILE=`echo $opt | sed -e s/"^.*="//`
-        ;;
-    -p|--p*)
-       GIF=png
-       PNMTOGIF=pnmtopng
-       ;;
-    -s) SIZE="-sPAPERSIZE=$2"; shift
-        ;;
-    --s*=*)
-        SIZE="-sPAPERSIZE=`echo $opt | sed -e s/"^.*="//`"
-       ;;
-    -*)
-        echo "ps-to-gifs: unknown option: \`$opt'"
-       exit 1
-       ;;
-    *)
-       FILE=$opt
-       ;;
-    esac
-done
-
-if [ "x$TRANSPARENT_IS_BROKEN" != "x" ]; then
-       color=
-fi
-
-if [ "x$OUTFILE" = "x" ]; then
-       BASE=`dirname $FILE`/`basename $FILE .ps`
-else
-       BASE=`dirname $OUTFILE`/`basename $OUTFILE .$GIF`
-fi
-
-# urg, pipe breaks
-rm -f $BASE{.ppm,.$GIF} $BASE-page*{.ppm,.$GIF}
-
-# generate the pixmap at twice the size, then rescale (for antialiasing)
-cat $FILE | gs -sDEVICE=ppmraw $SIZE -sOutputFile="$BASE-page%d.ppm" -r180 -dNOPAUSE - -c quit $FILE
-# quant is soo slow
-# cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE
-PPMS=`ls $BASE*ppm`
-for i in $PPMS; do
-    o=`dirname $i`/`basename $i .ppm`.$GIF
-    cat $i | pnmscale 0.5 | $CROP | $PNMTOGIF $color > $o
-    rm $i
-done
-
-if [ "x$OUTFILE" != "x" ]; then
-       mv $BASE-page1.$GIF $BASE.$GIF
-fi
-
diff --git a/bin/ps-to-pngs.sh b/bin/ps-to-pngs.sh
deleted file mode 100644 (file)
index 2a3f363..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# ps-to-pngs, convert PS to multiple pngs
-  
-ps-to-gifs --png $*
diff --git a/bin/run-lilypond.sh b/bin/run-lilypond.sh
deleted file mode 100644 (file)
index 2a69e5a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-LILYTOPDIR=$1
-shift
-export LILYINCLUDE="$LILYTOPDIR/init:$LILYTOPDIR/mf/out:$LILYINCLUDE"
-export TEXINPUTS="$LILYTOPDIR/tex:$TEXINPUTS"
-export MFINPUTS="$LILYTOPDIR/mf:$TEXINPUTS"
-
-$LILYTOPDIR/lily/out/lilypond $*
diff --git a/bin/set-lily.sh b/bin/set-lily.sh
deleted file mode 100644 (file)
index c85a44b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-# zet-lily.sh --- configure LilyPond sourcetree
-# nice in first character unique name
-#
-PACKAGE_NAME=LilyPond
-export PACKAGE_NAME
-prefix=$HOME/usr
-sources=$prefix/src
-#
-#
-. ./stepmake/bin/package-zet.sh
-#
-# The $sources dir looks like this:
-#
-# <SEE PATCHES.txt>
-#
-if [ "x$LILYINCLUDE" = "x" ]; then
-       # we can try...
-       echo you should add the following to your profile script
-       if [ "x$MAILADDRESS" = "x" ]; then
-               MAILADDRESS=$USER@`hostname`
-               export MAILADDRESS
-               echo "        MAILADDRESS=\$USER@`hostname`"
-               echo "        export MAILADDRESS"
-       fi
-       LILYINCLUDE=$LILYPOND_SOURCEDIR/init:$LILYPOND_SOURCEDIR/input:$LILYPOND_SOURCEDIR/mf/out
-       MFINPUTS=$MFINPUTS:$LILYPOND_SOURCEDIR/mf
-       TEXINPUTS=$TEXINPUTS:$LILYPOND_SOURCEDIR/mf/out
-       export LILYINCLUDE MFINPUTS TEXINPUTS
-       cat <<EOF
-       LILYINCLUDE=$LILYPOND_SOURCEDIR/init:$LILYPOND_SOURCEDIR/mf/out
-       MFINPUTS=\$MFINPUTS:\$LILYPOND_SOURCEDIR/mf
-       TEXINPUTS=\$TEXINPUTS:\$LILYPOND_SOURCEDIR/mf/out
-       export LILYINCLUDE MFINPUTS TEXINPUTS
-EOF
-
-fi
-
-ln -sf $LILYPOND_SOURCEDIR/lily/out/lilypond $prefix/bin/lilypond
-ln -sf $LILYPOND_SOURCEDIR/mi2mu/out/mi2mu $prefix/bin/mi2mu
-ln -sf $LILYPOND_SOURCEDIR/bin/ly2dvi.sh $prefix/bin/ly2dvi
-chmod 755 $LILYPOND_SOURCEDIR/bin/ps-to-gifs.sh
-ln -sf $LILYPOND_SOURCEDIR/bin/ps-to-gifs.sh $prefix/bin/ps-to-gifs
-
-if [ -f ../.gdbinit ];
-then
-    ln ../.gdbinit .
-fi
-
-if [ -f ../.dstreamrc ]
-then
-    ln ../.dstreamrc .
-fi
-
-./configure --prefix=$prefix --enable-debugging --enable-printing --enable-checking --disable-optimise --enable-guile
-
diff --git a/bin/show-current.sh b/bin/show-current.sh
deleted file mode 100644 (file)
index 7ae9c3f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# show-current.sh
-
-. $LILYPOND_SOURCEDIR/VERSION 
-VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
-if [ "$MY_PATCH_LEVEL" != "" ]; then
-  VERSION=$VERSION.$MY_PATCH_LEVEL
-fi
-echo $VERSION
diff --git a/bin/template.py b/bin/template.py
deleted file mode 100644 (file)
index f1a45e0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!@PYTHON@
-
-# template.py -- 
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1998 
-
-program_name = 'template'
-version = '0.1'
-
-import os
-import sys
-
-sys.path.append ('@abs-step-bindir@')
-sys.path.append (os.environ['HOME'] + '/usr/src/lilypond/stepmake/bin')
-
-import getopt
-from string import *
-import regex
-import regsub
-import time
-
-def program_id ():
-    return name + ' version ' + version;
-
-def identify ():
-    sys.stdout.write (program_id () + '\n')
-
-def help ():
-    sys.stdout.write ("Usage: %s [options] [files]\n"
-                      "I'm not a program, use me as a template to create one\n\n"
-                      + "Options:\n"
-                      + "  -h, --help             print this help\n"
-                      % (program_name)
-                     )
-    sys.exit (0)
-
-identify ()
-(options, files) = getopt.getopt (
-    sys.argv[1:], 'hp:', ['help', 'package'])
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o== '--help' or o == '-h':
-       help ()
-    elif o == '-p' or o == '--package':
-       topdir = a
-    else:
-       print o
-       raise getopt.error
-
-sys.path.append (topdir + '/stepmake/bin')
-from packagepython import *
-package = Package (topdir)
-packager = Packager ()
-
-from flower import *
-
diff --git a/buildscripts/GNUmakefile b/buildscripts/GNUmakefile
new file mode 100644 (file)
index 0000000..3a24a75
--- /dev/null
@@ -0,0 +1,12 @@
+# bin/Makefile
+
+depth = ..
+STEPMAKE_TEMPLATES=script
+
+include $(depth)/make/stepmake.make 
+
+
+
+
+
+
diff --git a/buildscripts/clean-diaper.sh b/buildscripts/clean-diaper.sh
new file mode 100755 (executable)
index 0000000..47c2a06
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# unclobber current dir.
+rm -vf *.aux *.log *.orig *~  *dvi *.dep
+
+# subdirs
+rm -vf `grep -li "^% Creator: GNU LilyPond" *.out *.tex` 
+rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
+rm -vf `grep -li "%Creator: dvipsk" *.ps`
+rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
+rm -vf `grep -li "Creator: ly2dvi" *.tex`
+rm -vf `find -name 'core'`
+rm -vf `find -name '*.orig'`
+rm -vf `find -name '*.rej'`
+
+
+
+
+    
+# docxx mess
+rm -vf *.class  HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
+    aindex.html index.html
diff --git a/buildscripts/clean-fonts.sh b/buildscripts/clean-fonts.sh
new file mode 100755 (executable)
index 0000000..597efa9
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+case  $# in
+0) 
+    WHAT="" ;;
+1)
+    WHAT=$1;;
+esac
+
+# should use kpsepath 
+
+if [ -d /var/lib/texmf ]; then
+    TEXDIR=/var/lib/texmf
+elif [ -d /var/texfonts ]; then
+    TEXDIR=/var/texfonts
+else
+    TEXDIR=/var/
+fi
+
+# remove possibly stale .pk/.tfm files 
+echo> /tmp/cleaning-font-dummy
+FILES=`find .  $TEXDIR -name "feta*$WHAT*tfm" -or -name "feta*$WHAT*pk"`
+
+echo removing $FILES
+rm  -f $FILES /tmp/cleaning-font-dummy
diff --git a/buildscripts/docxx-lily.sh b/buildscripts/docxx-lily.sh
new file mode 100644 (file)
index 0000000..82407ed
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+cwd=`pwd`
+
+{ cd $LILYPOND_SOURCEDIR; cd ..; 
+export LILYPOND_ROOTDIR=`pwd` }
+
+if [ "$1" = "" ]; then
+  VERSION=`show-current`
+  TARBALL=$LILYPOND_ROOTDIR/releases/lilypond-$VERSION.tar.gz
+  cwd=`pwd`
+else
+  TARBALL=$1
+fi
+
+
+tar-docxx $TARBALL
diff --git a/buildscripts/find-typenames.pl b/buildscripts/find-typenames.pl
new file mode 100644 (file)
index 0000000..890f9ca
--- /dev/null
@@ -0,0 +1,20 @@
+#!@PERL@
+
+open GREP, "egrep -h '^struct|^class' *.hh *.cc|";
+open OUT, "|sort | uniq";
+while (<GREP>) {
+
+       s/^struct/class/;
+       if (! /; *$/) {
+               s/:[^{]+{.*$//;
+               s/ *{.*$/;/;
+       }
+       if (! /; *$/) {
+               chop;
+               $_ .= ";\n";
+               
+       }
+       print OUT;
+}
+close OUT;
+close GREP;
diff --git a/buildscripts/gen-sitemap.sh b/buildscripts/gen-sitemap.sh
new file mode 100644 (file)
index 0000000..7f9bcbc
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+TMPDIR=/tmp/gen-sitemap
+for tarball in $*; do
+    tar -C $TMPDIR -xfz $tarball '*.html'
+done
diff --git a/buildscripts/genheader.py b/buildscripts/genheader.py
new file mode 100644 (file)
index 0000000..4dbb07f
--- /dev/null
@@ -0,0 +1,149 @@
+#!@PYTHON@
+
+# genheader.py -- do headers (like these) 
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+import os
+import sys
+import pwd
+import regex
+import regsub
+import string
+import getopt
+import time
+
+class My_options:
+    def __init__(self):
+       self.commentify = None
+       self.add_hdr_def = 0
+       self.classname = ''
+
+my_options = My_options()
+
+
+def name():
+       return os.environ['USERNAME']
+
+# field 4 of passwd is also used for finger info (phone no.,  office etc)
+#   return pwd.getpwuid(os.getuid())[4]
+
+def c_commentify(str):
+    return  '/* ' + regsub.gsub('^','  ', str) + '\n */';
+
+def sh_commentify(str):
+    return regsub.gsub('^', '# ', str)
+
+def tex_commentify(str):
+    return regsub.gsub('^', '% ', str)
+
+def project_str():
+    cwd = os.getcwd()
+    if regex.search('flower', cwd) <> -1:
+       PROJECT = "the Flower Library"
+    elif regex.search('mf$', cwd) <> -1:
+       PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font"
+    else:
+       PROJECT = "the GNU LilyPond music typesetter"
+    return PROJECT
+
+def head_str(filename):
+    if my_options.add_hdr_def:
+       what = "declare " 
+    else:
+       what=" implement "
+
+       
+    mailaddres = ''
+    try:
+           mailaddres = '<%s>' % os.environ['MAILADDRESS']
+    except KeyError:
+           pass
+    headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \
+             %(filename, what, project_str(),
+               time.localtime (time.time ())[0], name(), mailaddres)
+    return headstr
+
+
+def c_include(filename):
+    startdef= filename;
+    trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__')
+    startdef = string.translate(filename, trans)
+
+   
+    headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef)
+    terminatestr = "#endif /* %s */\n"  % (startdef);
+
+    return headstr+ '\n\n'+ terminatestr;
+
+
+def help ():
+    sys.stdout.write ("Usage: genheader [options] FILENAME\n"
+                + "Generate file with header FILENAME\n\n"
+                + "Options:\n"
+                + "  -h, --header           generate header\n"
+                + "  --help                 print this help\n"
+                + "  -p, --package=DIR      specify package\n"
+                     )
+    
+    sys.exit (0)
+
+
+(options, files) = getopt.getopt(sys.argv[1:], 'tcshp:', ['class', 'package=', 'help']) 
+
+for opt in options:
+    o = opt[0]
+    a = opt[1]
+    if o == '-c':
+       my_options.commentify = c_commentify
+    elif o == '-t':
+       my_options.commentify = tex_commentify
+    elif o == '-s':
+       my_options.commentify = sh_commentify
+    elif o == '-h' or o == '--header':
+       my_options.add_hdr_def = 1
+    elif o == '--class':
+       my_options.classname = a
+    elif o == '--help':
+       help ()
+
+# FIXME:  should create xxx.cc and include/xxx.hh, with implement/declare Xxx
+# in  one run
+if my_options.classname:
+    pass
+       
+def do_file(nm):
+    s = my_options.commentify(head_str(nm)) 
+    if my_options.add_hdr_def:
+       s = s + c_include(nm)
+    return s
+
+
+def extension(ext,nm):
+    ext = '\\.' + ext
+    return regex.search(ext, nm) <> -1
+
+def c_extension(nm):
+    return extension('hh',nm) or extension('cc',nm) \
+          or extension('icc', nm) or extension('tcc',nm)
+
+def select_commentification(nm):
+    if c_extension (nm):
+       return c_commentify
+    elif extension('py',nm) or extension('pl',nm) or extension('sh',nm):
+       return  sh_commentify
+    elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm):
+       return tex_commentify
+    else:
+       sys.stderr.write ('unknown extension for file %s\n' % nm)
+       raise 'help'
+
+for nm in files:
+    if extension('hh', nm) or extension('icc', nm) or  extension('tcc', nm): 
+       my_options.add_hdr_def = 1
+    if my_options.commentify == None:
+       my_options.commentify = select_commentification(nm)
+    print do_file(nm)
+
diff --git a/buildscripts/html-accents.py b/buildscripts/html-accents.py
new file mode 100644 (file)
index 0000000..228ed74
--- /dev/null
@@ -0,0 +1,115 @@
+#!@PYTHON@
+
+# html-accents.py -- convert (some) latin1 chars to html
+# pod2html is so broken...
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+
+name = 'html-accents'
+version = '0.1'
+
+import os
+import sys
+sys.path.append ('@abs-step-bindir@')
+sys.path.append (os.environ['HOME'] + '/usr/src/lilypond/stepmake/bin')
+
+import getopt
+from string import *
+import regex
+import regsub
+import time
+
+def program_id ():
+    return name + ' version ' + version;
+
+def identify ():
+    sys.stdout.write (program_id () + '\n')
+
+def help ():
+    sys.stdout.write ("Usage: " + name + " [options] INFILE OUTFILE\n"
+                + "Convert (some) latin1 chars to html &xxx;\n\n"
+                + "Options:\n"
+                + "  -h, --help             print this help\n"
+                + "  -p, --package=DIR      specify package\n"
+                     )
+    sys.exit (0)
+
+# chars = {'è':'&egrave;', }
+chars = { 
+'á':'&aacute;',
+'â':'&acirc;', 
+'æ':'&aelig;',
+'à':'&agrave;', 
+'Ã¥':'&aring;', 
+'ã':'&atilde;',
+'ä':'&auml;',
+
+'ç':'&ccedil;',
+
+'é':'&eacute;', 
+'ê':'&ecirc;',
+'è':'&egrave;', 
+'ë':'&euml;',
+
+'í':'&iacute;',
+'î':'&icirc;',
+'ì':'&igrave;', 
+'ï':'&iuml;',
+
+'ñ':'&ntilde;',
+
+'ó':'&oacute;',
+'ô':'&ocirc;',
+'ò':'&ograve;', 
+'ø':'&oslash;',
+'õ':'&otilde;',
+'ö':'&ouml;',
+
+'ú':'&uacute;',
+'û':'&ucirc;',
+'ù':'&ugrave;', 
+'ü':'&uuml;' 
+}
+
+def convert_accents (inname, outname):
+    from flower import *
+    text = File (inname)
+    # ugh
+    html = File (outname, 'w')
+
+    while not text.eof ():
+       line = text.readline ()
+       for i in chars.keys ():
+           line = regsub.gsub (i, chars[i], line)
+       html.write (line)
+    text.close ()
+    html.close ()
+
+def main ():
+    identify ()
+    (options, files) = getopt.getopt (
+       sys.argv[1:], 'hp:', ['help', 'package='])
+    for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o== '--help' or o == '-h':
+           help ()
+       elif o == '-p' or o == '--package':
+           topdir = a
+       else:
+           print o
+           raise getopt.error
+
+    sys.path.append (topdir + '/stepmake/bin')
+    from packagepython import *
+    package = Package (topdir)
+    packager = Packager ()
+
+    from flower import *
+
+    convert_accents (files[0], files[1])
+
+main ()
+
diff --git a/buildscripts/lilypond-login.sh b/buildscripts/lilypond-login.sh
new file mode 100644 (file)
index 0000000..d4a482e
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/csh
+
+# env. vars for the C-shell.
+
+# set environment for LilyPond.  To be installed in /etc/profile.d/
+setenv GS_LIB "@datadir@/afm"
+setenv GS_FONTPATH "@datadir@/ps"
+setenv LILYINCLUDE "@datadir@/ly:@datadir@/afm"
+
+# include an empty path component for the system wide includes.
+setenv MFINPUTS "@datadir@/mf:"${MFINPUTS:=":"}
+setenv TEXINPUTS "@datadir@/tex:"${TEXINPUTS:=":"}
+
diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh
new file mode 100644 (file)
index 0000000..176f636
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+
+# set environment for LilyPond.  To be installed in /etc/profile.d/
+GS_LIB="@datadir@/afm"
+GS_FONTPATH="@datadir@/ps"
+LILYINCLUDE="@datadir@/ly:@datadir@/afm"
+
+# include an empty path component for the system wide includes.
+MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"}
+TEXINPUTS="@datadir@/tex:"${TEXINPUTS:=":"}
+
+export LILYINCLUDE MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH
+
+# echo  $LILYINCLUDE $MFINPUTS $TEXINPUTS $GS_LIB $GS_FONTPATH
+
+
diff --git a/buildscripts/localpackage.py b/buildscripts/localpackage.py
new file mode 100644 (file)
index 0000000..f37fc82
--- /dev/null
@@ -0,0 +1,16 @@
+# localpackage.py
+# must be included in package's python bin dir
+
+def localpackage (n):
+    p=lower (n)
+    P=upper (n)
+    if topdir == '':
+       try:
+           topdir = os.environ[P + '_SOURCEDIR']
+       except:
+           topdir = os.environ['HOME'] + '/usr/src/' + p
+    sys.path.append (topdir + '/stepmake/bin')
+    from packagepython import *
+    package = Package (topdir)
+    packager = Packager ()
+
diff --git a/buildscripts/ltmain.sh b/buildscripts/ltmain.sh
new file mode 100644 (file)
index 0000000..e9350b3
--- /dev/null
@@ -0,0 +1,2453 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun ltconfig.
+#
+# Copyright (C) 1996-1998 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# The name of this program.
+progname=`$echo "$0" | sed 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.2
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+
+if test "$LTCONFIG_VERSION" != "$VERSION"; then
+  echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  echo "$modename: not configured to build any kind of library" 1>&2
+  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+
+# Parse our command line options once, thoroughly.
+while test $# -gt 0
+do
+  arg="$1"
+  shift
+
+  case "$arg" in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case "$prev" in
+    execute_dlfiles)
+      eval "$prev=\"\$$prev \$arg\""
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case "$arg" in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
+    exit 0
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+    exit 0
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --quiet | --silent)
+    show=:
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    case "$nonopt" in
+    *cc | *++ | gcc* | *-gcc*)
+      mode=link
+      for arg
+      do
+        case "$arg" in
+        -c)
+           mode=compile
+           break
+           ;;
+        esac
+      done
+      ;;
+    *db | *dbx)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+        if test -n "$nonopt"; then
+          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+        else
+          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+        fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case "$mode" in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    lastarg=
+    srcfile="$nonopt"
+    suppress_output=
+
+    for arg
+    do
+      # Accept any command-line options.
+      case "$arg" in
+      -o)
+       $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
+       $echo "$help" 1>&2
+       exit 1
+       ;;
+
+      -static)
+       build_libtool_libs=no
+       build_old_libs=yes
+       continue
+       ;;
+      esac
+
+      # Accept the current argument as the source file.
+      lastarg="$srcfile"
+      srcfile="$arg"
+
+      # Aesthetically quote the previous argument.
+
+      # Backslashify any backslashes, double quotes, and dollar signs.
+      # These are the only characters that are still specially
+      # interpreted inside of double-quoted scrings.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly in scan
+      # sets, so we specify it separately.
+      case "$lastarg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+       lastarg="\"$lastarg\""
+       ;;
+      esac
+
+      # Add the previous argument to base_compile.
+      if test -z "$base_compile"; then
+       base_compile="$lastarg"
+      else
+       base_compile="$base_compile $lastarg"
+      fi
+    done
+
+    # Get the name of the library object.
+    libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+
+    # Recognize several different file suffixes.
+    xform='[cCFSfms]'
+    case "$libobj" in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case "$libobj" in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      $run $rm $obj $libobj
+      trap "$run $rm $obj $libobj; exit 1" 1 2 15
+    else
+      $run $rm $libobj
+      trap "$run $rm $libobj; exit 1" 1 2 15
+    fi
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      # All platforms use -DPIC, to notify preprocessed assembler code.
+      $show "$base_compile$pic_flag -DPIC $srcfile"
+      if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
+      else
+        test -n "$obj" && $run $rm $obj
+        exit 1
+      fi
+
+      # If we have no pic_flag, then copy the object into place and finish.
+      if test -z "$pic_flag"; then
+        $show "$LN_S $obj $libobj"
+        $run $LN_S $obj $libobj
+        exit $?
+      fi
+
+      # Just move the object, then go on to compile the next one
+      $show "$mv $obj $libobj"
+      $run $mv $obj $libobj || exit 1
+
+      # Allow error messages only from the first compilation.
+      suppress_output=' >/dev/null 2>&1'
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      # Suppress compiler output if we already did a PIC compilation.
+      $show "$base_compile $srcfile$suppress_output"
+      if $run eval "$base_compile \$srcfile$suppress_output"; then :
+      else
+        $run $rm $obj $libobj
+        exit 1
+      fi
+    fi
+
+    # Create an invalid libtool object if no PIC, so that we do not
+    # accidentally link it into a program.
+    if test "$build_libtool_libs" != yes; then
+      $show "echo timestamp > $libobj"
+      $run eval "echo timestamp > \$libobj" || exit $?
+    fi
+
+    exit 0
+    ;;
+
+  # libtool link mode
+  link)
+    modename="$modename: link"
+    CC="$nonopt"
+    allow_undefined=yes
+    compile_command="$CC"
+    finalize_command="$CC"
+
+    compile_shlibpath=
+    finalize_shlibpath=
+    deplibs=
+    dlfiles=
+    dlprefiles=
+    export_dynamic=no
+    hardcode_libdirs=
+    libobjs=
+    link_against_libtool_libs=
+    ltlibs=
+    objs=
+    prev=
+    prevarg=
+    release=
+    rpath=
+    perm_rpath=
+    temp_rpath=
+    vinfo=
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case "$arg" in
+      -all-static | -static)
+        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+           $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+        fi
+        build_libtool_libs=no
+       build_old_libs=yes
+        break
+        ;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    for arg
+    do
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+        case "$prev" in
+        output)
+          compile_command="$compile_command @OUTPUT@"
+          finalize_command="$finalize_command @OUTPUT@"
+          ;;
+        esac
+
+        case "$prev" in
+        dlfiles|dlprefiles)
+          case "$arg" in
+          *.la | *.lo) ;;  # We handle these cases below.
+          *)
+            dlprefiles="$dlprefiles $arg"
+            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
+            prev=
+            ;;
+          esac
+          ;;
+       release)
+         release="-$arg"
+         prev=
+         continue
+         ;;
+        rpath)
+          rpath="$rpath $arg"
+         prev=
+         continue
+         ;;
+        *)
+          eval "$prev=\"\$arg\""
+          prev=
+          continue
+          ;;
+        esac
+      fi
+
+      prevarg="$arg"
+
+      case "$arg" in
+      -all-static)
+       if test -n "$link_static_flag"; then
+          compile_command="$compile_command $link_static_flag"
+         finalize_command="$finalize_command $link_static_flag"
+        fi
+        continue
+       ;;
+
+      -allow-undefined)
+       # FIXME: remove this flag sometime in the future.
+       $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+       continue
+       ;;
+
+      -dlopen)
+        prev=dlfiles
+        continue
+        ;;
+
+      -dlpreopen)
+        prev=dlprefiles
+        continue
+        ;;
+
+      -export-dynamic)
+        if test "$export_dynamic" != yes; then
+          export_dynamic=yes
+         if test -n "$export_dynamic_flag_spec"; then
+           eval arg=\"$export_dynamic_flag_spec\"
+         else
+           arg=
+         fi
+
+          # Add the symbol object into the linking commands.
+         compile_command="$compile_command @SYMFILE@"
+         finalize_command="$finalize_command @SYMFILE@"
+        fi
+        ;;
+
+      -L*)
+        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
+        case "$dir" in
+        /* | [A-Za-z]:\\*)
+         # Add the corresponding hardcode_libdir_flag, if it is not identical.
+          ;;
+        *)
+          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
+          exit 1
+          ;;
+        esac
+        deplibs="$deplibs $arg"
+        ;;
+
+      -l*) deplibs="$deplibs $arg" ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -o) prev=output ;;
+
+      -release)
+       prev=release
+       continue
+       ;;
+
+      -rpath)
+        prev=rpath
+        continue
+        ;;
+
+      -static)
+       # If we have no pic_flag, then this is the same as -all-static.
+       if test -z "$pic_flag" && test -n "$link_static_flag"; then
+          compile_command="$compile_command $link_static_flag"
+         finalize_command="$finalize_command $link_static_flag"
+        fi
+       continue
+       ;;
+
+      -version-info)
+        prev=vinfo
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case "$arg" in
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
+         arg="\"$arg\""
+         ;;
+       esac
+        ;;
+
+      *.o | *.a)
+        # A standard object.
+        objs="$objs $arg"
+        ;;
+
+      *.lo)
+        # A library object.
+       if test "$prev" = dlfiles; then
+         dlfiles="$dlfiles $arg"
+         if test "$build_libtool_libs" = yes; then
+           prev=
+           continue
+         else
+           # If libtool objects are unsupported, then we need to preload.
+           prev=dlprefiles
+         fi
+       fi
+
+       if test "$prev" = dlprefiles; then
+         # Preload the old-style object.
+         dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
+         prev=
+       fi
+       libobjs="$libobjs $arg"
+        ;;
+
+      *.la)
+        # A libtool-controlled library.
+
+        dlname=
+        libdir=
+        library_names=
+        old_library=
+
+        # Check to see that this really is a libtool archive.
+        if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+        else
+          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
+          exit 1
+        fi
+
+        # If there is no directory component, then add one.
+        case "$arg" in
+        */* | *\\*) . $arg ;;
+        *) . ./$arg ;;
+        esac
+
+        if test -z "$libdir"; then
+          $echo "$modename: \`$arg' contains no -rpath information" 1>&2
+          exit 1
+        fi
+
+        # Get the name of the library we link against.
+        linklib=
+        for l in $old_library $library_names; do
+          linklib="$l"
+        done
+
+        if test -z "$linklib"; then
+          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
+          exit 1
+        fi
+
+        # Find the relevant object directory and library name.
+        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+        dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+        if test "X$dir" = "X$arg"; then
+          dir="$objdir"
+        else
+          dir="$dir/$objdir"
+        fi
+
+        # This library was specified with -dlopen.
+        if test "$prev" = dlfiles; then
+          dlfiles="$dlfiles $arg"
+          if test -z "$dlname"; then
+            # If there is no dlname, we need to preload.
+            prev=dlprefiles
+          else
+            # We should not create a dependency on this library, but we
+           # may need any libraries it requires.
+           compile_command="$compile_command$dependency_libs"
+           finalize_command="$finalize_command$dependency_libs"
+            prev=
+            continue
+          fi
+        fi
+
+        # The library was specified with -dlpreopen.
+        if test "$prev" = dlprefiles; then
+          # Prefer using a static library (so that no silly _DYNAMIC symbols
+          # are required to link).
+          if test -n "$old_library"; then
+            dlprefiles="$dlprefiles $dir/$old_library"
+          else
+            dlprefiles="$dlprefiles $dir/$linklib"
+          fi
+          prev=
+        fi
+
+        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
+          link_against_libtool_libs="$link_against_libtool_libs $arg"
+          if test -n "$shlibpath_var"; then
+            # Make sure the rpath contains only unique directories.
+            case "$temp_rpath " in
+            *" $dir "*) ;;
+            *) temp_rpath="$temp_rpath $dir" ;;
+            esac
+          fi
+
+         # This is the magic to use -rpath.
+          if test -n "$hardcode_libdir_flag_spec"; then
+            if test -n "$hardcode_libdir_separator"; then
+              if test -z "$hardcode_libdirs"; then
+                # Put the magic libdir with the hardcode flag.
+                hardcode_libdirs="$libdir"
+                libdir="@HARDCODE_LIBDIRS@"
+              else
+                # Just accumulate the unique libdirs.
+               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                 ;;
+               *)
+                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+                 ;;
+               esac
+                libdir=
+              fi
+            fi
+
+            if test -n "$libdir"; then
+              eval flag=\"$hardcode_libdir_flag_spec\"
+
+              compile_command="$compile_command $flag"
+              finalize_command="$finalize_command $flag"
+            fi
+          elif test -n "$runpath_var"; then
+            # Do the same for the permanent run path.
+            case "$perm_rpath " in
+            *" $libdir "*) ;;
+            *) perm_rpath="$perm_rpath $libdir" ;;
+            esac
+          fi
+
+
+          case "$hardcode_action" in
+          immediate)
+            if test "$hardcode_direct" = no; then
+              compile_command="$compile_command $dir/$linklib"
+            elif test "$hardcode_minus_L" = no; then
+              compile_command="$compile_command -L$dir -l$name"
+            elif test "$hardcode_shlibpath_var" = no; then
+              compile_shlibpath="$compile_shlibpath$dir:"
+              compile_command="$compile_command -l$name"
+            fi
+            ;;
+
+          relink)
+            # We need an absolute path.
+            case "$dir" in
+            /* | [A-Za-z]:\\*) ;;
+            *)
+              absdir=`cd "$dir" && pwd`
+              if test -z "$absdir"; then
+                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+                exit 1
+              fi
+              dir="$absdir"
+              ;;
+            esac
+
+            if test "$hardcode_direct" = yes; then
+              compile_command="$compile_command $dir/$linklib"
+            elif test "$hardcode_minus_L" = yes; then
+              compile_command="$compile_command -L$dir -l$name"
+            elif test "$hardcode_shlibpath_var" = yes; then
+              compile_shlibpath="$compile_shlibpath$dir:"
+              compile_command="$compile_command -l$name"
+            fi
+            ;;
+
+          *)
+            $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
+            exit 1
+            ;;
+          esac
+
+          # Finalize command for both is simple: just hardcode it.
+          if test "$hardcode_direct" = yes; then
+            finalize_command="$finalize_command $libdir/$linklib"
+          elif test "$hardcode_minus_L" = yes; then
+            finalize_command="$finalize_command -L$libdir -l$name"
+          elif test "$hardcode_shlibpath_var" = yes; then
+            finalize_shlibpath="$finalize_shlibpath$libdir:"
+            finalize_command="$finalize_command -l$name"
+          else
+            # We cannot seem to hardcode it, guess we'll fake it.
+            finalize_command="$finalize_command -L$libdir -l$name"
+          fi
+        else
+          # Transform directly to old archives if we don't build new libraries.
+          if test -n "$pic_flag" && test -z "$old_library"; then
+            $echo "$modename: cannot find static library for \`$arg'" 1>&2
+            exit 1
+          fi
+
+         # Here we assume that one of hardcode_direct or hardcode_minus_L
+         # is not unsupported.  This is valid on all known static and
+         # shared platforms.
+         if test "$hardcode_direct" != unsupported; then
+           test -n "$old_library" && linklib="$old_library"
+           compile_command="$compile_command $dir/$linklib"
+           finalize_command="$finalize_command $dir/$linklib"
+         else
+           compile_command="$compile_command -L$dir -l$name"
+           finalize_command="$finalize_command -L$dir -l$name"
+         fi
+        fi
+
+       # Add in any libraries that this one depends upon.
+       compile_command="$compile_command$dependency_libs"
+       finalize_command="$finalize_command$dependency_libs"
+       continue
+        ;;
+
+      # Some other compiler argument.
+      *)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case "$arg" in
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
+         arg="\"$arg\""
+         ;;
+       esac
+        ;;
+      esac
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+      fi
+    done
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$vinfo" && test -n "$release"; then
+      $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    oldlib=
+    oldobjs=
+    case "$output" in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+      ;;
+
+    */* | *\\*)
+      $echo "$modename: output file \`$output' must have no directory components" 1>&2
+      exit 1
+      ;;
+
+    *.a)
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      build_old_libs=yes
+      oldlib="$output"
+      $show "$rm $oldlib"
+      $run $rm $oldlib
+      ;;
+
+    *.la)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case "$output" in
+      lib*) ;;
+      *)
+       $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
+       $echo "$help" 1>&2
+       exit 1
+       ;;
+      esac
+
+      name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+      eval libname=\"$libname_spec\"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+      current=0
+      revision=0
+      age=0
+
+      if test -n "$objs"; then
+        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+        exit 1
+      fi
+
+      # How the heck are we supposed to write a wrapper for a shared library?
+      if test -n "$link_against_libtool_libs"; then
+        $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
+        exit 1
+      fi
+
+      if test -n "$dlfiles$dlprefiles"; then
+        $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
+        # Nullify the symbol file.
+        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test -z "$rpath"; then
+        $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
+       $echo "$help" 1>&2
+        exit 1
+      fi
+
+      set dummy $rpath
+      if test $# -gt 2; then
+       $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      # Parse the version information argument.
+      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=':'
+      set dummy $vinfo
+      IFS="$save_ifs"
+
+      if test -n "$5"; then
+        $echo "$modename: too many parameters to \`-version-info'" 1>&2
+        $echo "$help" 1>&2
+        exit 1
+      fi
+
+      test -n "$2" && current="$2"
+      test -n "$3" && revision="$3"
+      test -n "$4" && age="$4"
+
+      # Check that each of the things are valid numbers.
+      case "$current" in
+      0 | [1-9] | [1-9][0-9]*) ;;
+      *)
+        $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+        exit 1
+        ;;
+      esac
+
+      case "$revision" in
+      0 | [1-9] | [1-9][0-9]*) ;;
+      *)
+        $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+        exit 1
+        ;;
+      esac
+
+      case "$age" in
+      0 | [1-9] | [1-9][0-9]*) ;;
+      *)
+        $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+        exit 1
+        ;;
+      esac
+
+      if test $age -gt $current; then
+        $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+        exit 1
+      fi
+
+      # Calculate the version variables.
+      version_vars="version_type current age revision"
+      case "$version_type" in
+      none) ;;
+
+      linux)
+        version_vars="$version_vars major versuffix"
+        major=`expr $current - $age`
+        versuffix="$major.$age.$revision"
+        ;;
+
+      osf)
+        version_vars="$version_vars versuffix verstring"
+        major=`expr $current - $age`
+        versuffix="$current.$age.$revision"
+        verstring="$versuffix"
+
+        # Add in all the interfaces that we are compatible with.
+        loop=$age
+        while test $loop != 0; do
+          iface=`expr $current - $loop`
+          loop=`expr $loop - 1`
+          verstring="$verstring:${iface}.0"
+        done
+
+        # Make executables depend on our current version.
+        verstring="$verstring:${current}.0"
+        ;;
+
+      sunos)
+        version_vars="$version_vars major versuffix"
+        major="$current"
+        versuffix="$current.$revision"
+        ;;
+
+      *)
+        $echo "$modename: unknown library version type \`$version_type'" 1>&2
+        echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+        exit 1
+        ;;
+      esac
+
+      # Create the output directory, or remove our outputs if we need to.
+      if test -d $objdir; then
+        $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
+        $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
+      else
+        $show "$mkdir $objdir"
+        $run $mkdir $objdir
+       status=$?
+       if test $status -eq 0 || test -d $objdir; then :
+       else
+         exit $status
+       fi
+      fi
+
+      # Check to see if the archive will have undefined symbols.
+      if test "$allow_undefined" = yes; then
+        if test "$allow_undefined_flag" = unsupported; then
+          $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+          build_libtool_libs=no
+         build_old_libs=yes
+        fi
+      else
+        # Don't allow undefined symbols.
+        allow_undefined_flag="$no_undefined_flag"
+      fi
+
+      # Add libc to deplibs on all systems.
+      dependency_libs="$deplibs"
+      deplibs="$deplibs -lc"
+
+      if test "$build_libtool_libs" = yes; then
+        # Get the real and link names of the library.
+        eval library_names=\"$library_names_spec\"
+        set dummy $library_names
+        realname="$2"
+        shift; shift
+
+        if test -n "$soname_spec"; then
+          eval soname=\"$soname_spec\"
+        else
+          soname="$realname"
+        fi
+
+        lib="$objdir/$realname"
+       for link
+       do
+         linknames="$linknames $link"
+       done
+
+        # Use standard objects if they are PIC.
+        test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+        # Do each of the archive commands.
+        eval cmds=\"$archive_cmds\"
+        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
+        for cmd in $cmds; do
+          IFS="$save_ifs"
+          $show "$cmd"
+          $run eval "$cmd" || exit $?
+        done
+        IFS="$save_ifs"
+
+        # Create links to the real library.
+        for linkname in $linknames; do
+          $show "(cd $objdir && $LN_S $realname $linkname)"
+          $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
+        done
+
+        # If -export-dynamic was specified, set the dlname.
+        if test "$export_dynamic" = yes; then
+          # On all known operating systems, these are identical.
+          dlname="$soname"
+        fi
+      fi
+
+      # Now set the variables for building old libraries.
+      oldlib="$objdir/$libname.a"
+      ;;
+
+    *.lo | *.o)
+      if test -n "$link_against_libtool_libs"; then
+        $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
+        exit 1
+      fi
+
+      if test -n "$deplibs"; then
+        $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles"; then
+        $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
+        # Nullify the symbol file.
+        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test -n "$rpath"; then
+        $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+        $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+      fi
+
+      case "$output" in
+      *.lo)
+        if test -n "$objs"; then
+          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+          exit 1
+        fi
+        libobj="$output"
+        obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
+        ;;
+      *)
+        libobj=
+        obj="$output"
+        ;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Create the old-style object.
+      reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+      output="$obj"
+      eval cmds=\"$reload_cmds\"
+      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      for cmd in $cmds; do
+        IFS="$save_ifs"
+        $show "$cmd"
+        $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      test -z "$libobj" && exit 0
+
+      if test "$build_libtool_libs" != yes; then
+        # Create an invalid libtool object if no PIC, so that we don't
+        # accidentally link it into a program.
+        $show "echo timestamp > $libobj"
+        $run eval "echo timestamp > $libobj" || exit $?
+        exit 0
+      fi
+
+      if test -n "$pic_flag"; then
+        # Only do commands if we really have different PIC objects.
+        reload_objs="$libobjs"
+        output="$libobj"
+        eval cmds=\"$reload_cmds\"
+        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
+        for cmd in $cmds; do
+          IFS="$save_ifs"
+          $show "$cmd"
+          $run eval "$cmd" || exit $?
+        done
+        IFS="$save_ifs"
+      else
+        # Just create a symlink.
+        $show "$LN_S $obj $libobj"
+        $run $LN_S $obj $libobj || exit 1
+      fi
+
+      exit 0
+      ;;
+
+    *)
+      if test -n "$vinfo"; then
+        $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+       # If the user specified any rpath flags, then add them.
+       for libdir in $rpath; do
+          if test -n "$hardcode_libdir_flag_spec"; then
+            if test -n "$hardcode_libdir_separator"; then
+              if test -z "$hardcode_libdirs"; then
+                # Put the magic libdir with the hardcode flag.
+                hardcode_libdirs="$libdir"
+                libdir="@HARDCODE_LIBDIRS@"
+              else
+                # Just accumulate the unique libdirs.
+               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                 ;;
+               *)
+                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+                 ;;
+               esac
+                libdir=
+              fi
+            fi
+
+            if test -n "$libdir"; then
+              eval flag=\"$hardcode_libdir_flag_spec\"
+
+              compile_command="$compile_command $flag"
+              finalize_command="$finalize_command $flag"
+            fi
+          elif test -n "$runpath_var"; then
+            case "$perm_rpath " in
+            *" $libdir "*) ;;
+            *) perm_rpath="$perm_rpath $libdir" ;;
+            esac
+          fi
+       done
+      fi
+
+      # Substitute the hardcoded libdirs into the compile commands.
+      if test -n "$hardcode_libdir_separator"; then
+       compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+      fi
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+        # Transform all the library objects into standard objects.
+        compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+        finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+      fi
+
+      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
+        dlsyms="${output}S.c"
+      else
+        dlsyms=
+      fi
+
+      if test -n "$dlsyms"; then
+        # Add our own program objects to the preloaded list.
+        dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+
+       # Discover the nlist of each of the dlfiles.
+        nlist="$objdir/${output}.nm"
+
+       if test -d $objdir; then
+         $show "$rm $nlist ${nlist}T"
+         $run $rm "$nlist" "${nlist}T"
+       else
+         $show "$mkdir $objdir"
+         $run $mkdir $objdir
+         status=$?
+         if test $status -eq 0 || test -d $objdir; then :
+         else
+           exit $status
+         fi
+       fi
+
+        for arg in $dlprefiles; do
+         $show "extracting global C symbols from \`$arg'"
+         $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+        done
+
+        # Parse the name list into a source file.
+        $show "creating $objdir/$dlsyms"
+        if test -z "$run"; then
+         # Make sure we at least have an empty file.
+         test -f "$nlist" || : > "$nlist"
+
+         # Try sorting and uniquifying the output.
+         if sort "$nlist" | uniq > "$nlist"T; then
+           mv -f "$nlist"T "$nlist"
+           wcout=`wc "$nlist" 2>/dev/null`
+           count=`echo "X$wcout" | $Xsed -e 's/^[      ]*\([0-9][0-9]*\).*$/\1/'`
+           (test "$count" -ge 0) 2>/dev/null || count=-1
+         else
+           $rm "$nlist"T
+           count=-1
+         fi
+
+         case "$dlsyms" in
+         "") ;;
+         *.c)
+           $echo > "$objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define dld_preloaded_symbol_count some_other_symbol
+#define dld_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+           if test -f "$nlist"; then
+             sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
+           else
+             echo '/* NONE */' >> "$objdir/$dlsyms"
+           fi
+
+           $echo >> "$objdir/$dlsyms" "\
+
+#undef dld_preloaded_symbol_count
+#undef dld_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define __ptr_t void *
+#else
+# define __ptr_t char *
+#endif
+
+/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
+int dld_preloaded_symbol_count = $count;
+
+/* The mapping between symbol names and symbols. */
+struct {
+  char *name;
+  __ptr_t address;
+}
+dld_preloaded_symbols[] =
+{\
+"
+
+           if test -f "$nlist"; then
+             sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
+           fi
+
+           $echo >> "$objdir/$dlsyms" "\
+  {0, (__ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif\
+"
+           ;;
+
+         *)
+           $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+           exit 1
+           ;;
+         esac
+        fi
+
+        # Now compile the dynamic symbol file.
+        $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
+        $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
+
+        # Transform the symbol file into the correct name.
+        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
+        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
+      elif test "$export_dynamic" != yes; then
+        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
+      else
+        # We keep going just in case the user didn't refer to
+        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
+        # really was required.
+        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+
+        # Nullify the symbol file.
+        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
+        # Replace the output file specification.
+        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+
+        # We have no uninstalled library dependencies, so finalize right now.
+        $show "$compile_command"
+        $run eval "$compile_command"
+        exit $?
+      fi
+
+      # Replace the output file specification.
+      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
+      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
+
+      # Create the binary in the object directory, then wrap it.
+      if test -d $objdir; then :
+      else
+        $show "$mkdir $objdir"
+       $run $mkdir $objdir
+       status=$?
+       if test $status -eq 0 || test -d $objdir; then :
+       else
+         exit $status
+       fi
+      fi
+
+      if test -n "$shlibpath_var"; then
+        # We should set the shlibpath_var
+        rpath=
+        for dir in $temp_rpath; do
+          case "$dir" in
+          /* | [A-Za-z]:\\*)
+            # Absolute path.
+            rpath="$rpath$dir:"
+            ;;
+          *)
+            # Relative path: add a thisdir entry.
+            rpath="$rpath\$thisdir/$dir:"
+            ;;
+          esac
+        done
+        temp_rpath="$rpath"
+      fi
+
+      # Delete the old output file.
+      $run $rm $output
+
+      if test -n "$compile_shlibpath"; then
+        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      if test -n "$runpath_var" && test -n "$perm_rpath"; then
+        # We should set the runpath_var.
+        rpath=
+        for dir in $perm_rpath; do
+          rpath="$rpath$dir:"
+        done
+        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
+        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
+      fi
+
+      case "$hardcode_action" in
+      relink)
+        # AGH! Flame the AIX and HP-UX people for me, will ya?
+        $echo "$modename: warning: using a buggy system linker" 1>&2
+        $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
+        ;;
+      esac
+
+      $show "$compile_command"
+      $run eval "$compile_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the finalize command for shipping.
+      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
+
+      # Quote $echo for shipping.
+      qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+        $rm $output
+        trap "$rm $output; exit 1" 1 2 15
+
+        $echo > $output "\
+#! /bin/sh
+
+# $output - temporary wrapper script for $objdir/$output
+# Generated by ltmain.sh - GNU $PACKAGE $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of \``pwd`'.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  link_against_libtool_libs='$link_against_libtool_libs'
+  finalize_command=\"$finalize_command\"
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" = \"$magic\"; then :
+  else
+    echo=\"$qecho\"
+    file=\"\$0\"
+  fi\
+"
+        $echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+
+  progdir=\"\$thisdir/$objdir\"
+  program='$output'
+
+  if test -f \"\$progdir/\$program\"; then"
+
+        # Export our shlibpath_var if we have one.
+        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+          $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
+
+    export $shlibpath_var
+"
+        fi
+
+        $echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+
+      # Export the path to the program.
+      PATH=\"\$progdir:\$PATH\"
+      export PATH
+
+      exec \$program \${1+\"\$@\"}
+
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+        chmod +x $output
+      fi
+      exit 0
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    if test "$build_old_libs" = "yes"; then
+      # Transform .lo files to .o files.
+      oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       eval cmds=\"$old_archive_from_new_cmds\"
+      else
+       eval cmds=\"$old_archive_cmds\"
+      fi
+      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      for cmd in $cmds; do
+        IFS="$save_ifs"
+        $show "$cmd"
+        $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    fi
+
+    # Now create the libtool archive.
+    case "$output" in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.a"
+
+      $show "creating $output"
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+        $echo > $output "\
+# $output - a libtool library file
+# Generated by ltmain.sh - GNU $PACKAGE $VERSION
+
+# The name that we can dlopen(3).
+dlname='$dlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'\
+"
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $objdir && $LN_S ../$output $output)"
+      $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
+      ;;
+    esac
+    exit 0
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional /bin/sh argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL"; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case "$arg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+       arg="\"$arg\""
+       ;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case "$arg" in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+        files="$files $dest"
+        dest="$arg"
+        continue
+      fi
+
+      case "$arg" in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+        stripme=" -s"
+        continue
+        ;;
+      -*) ;;
+
+      *)
+        # If the previous option needed an argument, then skip it.
+        if test -n "$prev"; then
+          prev=
+        else
+          dest="$arg"
+          continue
+        fi
+        ;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case "$arg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+       arg="\"$arg\""
+       ;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+        $echo "$modename: no file or destination specified" 1>&2
+      else
+        $echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test -n "$isdir"; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test $# -gt 2; then
+        $echo "$modename: \`$dest' is not a directory" 1>&2
+        $echo "$help" 1>&2
+        exit 1
+      fi
+    fi
+    case "$destdir" in
+    /* | [A-Za-z]:\\*) ;;
+    *)
+      for file in $files; do
+        case "$file" in
+        *.lo) ;;
+        *)
+          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+          $echo "$help" 1>&2
+          exit 1
+          ;;
+        esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case "$file" in
+      *.a)
+        # Do the static libraries later.
+        staticlibs="$staticlibs $file"
+        ;;
+
+      *.la)
+        # Check to see that this really is a libtool archive.
+        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+        else
+          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+          $echo "$help" 1>&2
+          exit 1
+        fi
+
+        library_names=
+        old_library=
+        # If there is no directory component, then add one.
+        case "$file" in
+        */* | *\\*) . $file ;;
+        *) . ./$file ;;
+        esac
+
+        # Add the libdir to current_libdirs if it is the destination.
+        if test "X$destdir" = "X$libdir"; then
+          case "$current_libdirs " in
+          *" $libdir "*) ;;
+          *) current_libdirs="$current_libdirs $libdir" ;;
+          esac
+        else
+          # Note the libdir as a future libdir.
+          case "$future_libdirs " in
+          *" $libdir "*) ;;
+          *) future_libdirs="$future_libdirs $libdir" ;;
+          esac
+        fi
+
+        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
+        test "X$dir" = "X$file/" && dir=
+        dir="$dir$objdir"
+
+        # See the names of the shared library.
+        set dummy $library_names
+        if test -n "$2"; then
+          realname="$2"
+          shift
+          shift
+
+          # Install the shared library and build the symlinks.
+          $show "$install_prog $dir/$realname $destdir/$realname"
+          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
+          test "X$dlname" = "X$realname" && dlname=
+
+          if test $# -gt 0; then
+            # Delete the old symlinks.
+            rmcmd="$rm"
+            for linkname
+            do
+              rmcmd="$rmcmd $destdir/$linkname"
+            done
+            $show "$rmcmd"
+            $run $rmcmd
+
+            # ... and create new ones.
+            for linkname
+            do
+              test "X$dlname" = "X$linkname" && dlname=
+              $show "(cd $destdir && $LN_S $realname $linkname)"
+              $run eval "(cd $destdir && $LN_S $realname $linkname)"
+            done
+          fi
+
+          if test -n "$dlname"; then
+            # Install the dynamically-loadable library.
+            $show "$install_prog $dir/$dlname $destdir/$dlname"
+            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
+          fi
+
+          # Do each command in the postinstall commands.
+          lib="$destdir/$realname"
+          eval cmds=\"$postinstall_cmds\"
+          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
+          for cmd in $cmds; do
+            IFS="$save_ifs"
+            $show "$cmd"
+            $run eval "$cmd" || exit $?
+          done
+          IFS="$save_ifs"
+        fi
+
+        # Install the pseudo-library for information purposes.
+        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+        $show "$install_prog $file $destdir/$name"
+        $run eval "$install_prog $file $destdir/$name" || exit $?
+
+        # Maybe install the static library, too.
+        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+        ;;
+
+      *.lo)
+        # Install (i.e. copy) a libtool object.
+
+        # Figure out destination file name, if it wasn't already specified.
+        if test -n "$destname"; then
+          destfile="$destdir/$destname"
+        else
+          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+          destfile="$destdir/$destfile"
+        fi
+
+        # Deduce the name of the destination old-style object file.
+        case "$destfile" in
+        *.lo)
+          staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
+          ;;
+        *.o)
+          staticdest="$destfile"
+          destfile=
+          ;;
+        *)
+          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+          $echo "$help" 1>&2
+          exit 1
+          ;;
+        esac
+
+        # Install the libtool object if requested.
+        if test -n "$destfile"; then
+          $show "$install_prog $file $destfile"
+          $run eval "$install_prog $file $destfile" || exit $?
+        fi
+
+        # Install the old object if enabled.
+        if test "$build_old_libs" = yes; then
+          # Deduce the name of the old-style object file.
+          staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
+
+          $show "$install_prog $staticobj $staticdest"
+          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+        fi
+        exit 0
+        ;;
+
+      *)
+        # Do a test to see if this is really a libtool program.
+        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+          link_against_libtool_libs=
+          finalize_command=
+
+          # If there is no directory component, then add one.
+          case "$file" in
+          */* | *\\*) . $file ;;
+          *) . ./$file ;;
+          esac
+
+          # Check the variables that should have been set.
+          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
+            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+            exit 1
+          fi
+
+          finalize=yes
+          for lib in $link_against_libtool_libs; do
+            # Check to see that each library is installed.
+            libdir=
+            if test -f "$lib"; then
+              # If there is no directory component, then add one.
+              case "$lib" in
+              */* | *\\*) . $lib ;;
+              *) . ./$lib ;;
+              esac
+            fi
+            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
+            if test -z "$libdir"; then
+              $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
+            elif test -f "$libfile"; then :
+            else
+              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+              finalize=no
+            fi
+          done
+
+          if test "$hardcode_action" = relink; then
+            if test "$finalize" = yes; then
+              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
+              $show "$finalize_command"
+              if $run eval "$finalize_command"; then :
+              else
+                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+                continue
+              fi
+              file="$objdir/$file"T
+            else
+              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
+            fi
+          else
+            # Install the binary that we compiled earlier.
+           file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+          fi
+        fi
+
+        $show "$install_prog$stripme $file $dest"
+        $run eval "$install_prog\$stripme \$file \$dest" || exit $?
+        ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      # Do each command in the postinstall commands.
+      eval cmds=\"$old_postinstall_cmds\"
+      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
+      for cmd in $cmds; do
+        IFS="$save_ifs"
+        $show "$cmd"
+        $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec $SHELL $0 --finish$current_libdirs
+      exit 1
+    fi
+
+    exit 0
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+        libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+       if test -n "$finish_cmds"; then
+         # Do each command in the finish commands.
+         eval cmds=\"$finish_cmds\"
+          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
+          for cmd in $cmds; do
+            IFS="$save_ifs"
+            $show "$cmd"
+            $run eval "$cmd"
+          done
+          IFS="$save_ifs"
+       fi
+       if test -n "$finish_eval"; then
+         # Do the single finish_eval.
+         eval cmds=\"$finish_eval\"
+         $run eval "$cmds"
+       fi
+      done
+    fi
+
+    echo "------------------------------------------------------------------------------"
+    echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      echo "   $libdir"
+    done
+    echo
+    echo "To link against installed libraries in a given directory, LIBDIR,"
+    echo "you must use the \`-LLIBDIR' flag during linking."
+    echo
+    echo " You will also need to do one of the following:"
+    if test -n "$shlibpath_var"; then
+      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      echo "   - use the \`$flag' linker flag"
+    fi
+    if test -f /etc/ld.so.conf; then
+      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    echo
+    echo "See any operating system documentation about shared libraries for"
+    echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    echo "------------------------------------------------------------------------------"
+    exit 0
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit 1
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test -f "$file"; then :
+      else
+       $echo "$modename: \`$file' is not a file" 1>&2
+       $echo "$help" 1>&2
+       exit 1
+      fi
+
+      dir=
+      case "$file" in
+      *.la)
+        # Check to see that this really is a libtool archive.
+        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+        else
+          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+          $echo "$help" 1>&2
+          exit 1
+        fi
+
+       # Read the libtool library.
+       dlname=
+       library_names=
+
+        # If there is no directory component, then add one.
+       case "$file" in
+       */* | *\\*) . $file ;;
+        *) . ./$file ;;
+       esac
+
+       # Skip this library if it cannot be dlopened.
+       if test -z "$dlname"; then
+         # Warn if it was a shared library.
+         test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+         continue
+       fi
+
+       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+       test "X$dir" = "X$file" && dir=.
+
+       if test -f "$dir/$objdir/$dlname"; then
+         dir="$dir/$objdir"
+       else
+         $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+         exit 1
+       fi
+       ;;
+
+      *.lo)
+       # Just add the directory containing the .lo file.
+       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+       test "X$dir" = "X$file" && dir=.
+       ;;
+
+      *)
+       $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+        continue
+       ;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+       eval "$shlibpath_var=\"\$dir\""
+      else
+       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case "$file" in
+      -*) ;;
+      *)
+        # Do a test to see if this is really a libtool program.
+        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+         # If there is no directory component, then add one.
+         case "$file" in
+         */* | *\\*) . $file ;;
+         *) . ./$file ;;
+         esac
+
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       fi
+        ;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      # Export the shlibpath_var.
+      eval "export $shlibpath_var"
+
+      # Now actually exec the command.
+      eval "exec \$cmd$args"
+
+      $echo "$modename: cannot exec \$cmd$args"
+      exit 1
+    else
+      # Display what would be done.
+      eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+      $echo "export $shlibpath_var"
+      $echo "$cmd$args"
+      exit 0
+    fi
+    ;;
+
+  # libtool uninstall mode
+  uninstall)
+    modename="$modename: uninstall"
+    rm="$nonopt"
+    files=
+
+    for arg
+    do
+      case "$arg" in
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$dir" = "X$file" && dir=.
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      rmfiles="$file"
+
+      case "$name" in
+      *.la)
+        # Possibly a libtool archive, so verify it.
+        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+          . $dir/$name
+
+          # Delete the libtool libraries and symlinks.
+          for n in $library_names; do
+            rmfiles="$rmfiles $dir/$n"
+            test "X$n" = "X$dlname" && dlname=
+          done
+          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
+          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
+
+         $show "$rm $rmfiles"
+         $run $rm $rmfiles
+
+         if test -n "$library_names"; then
+           # Do each command in the postuninstall commands.
+           eval cmds=\"$postuninstall_cmds\"
+           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
+           for cmd in $cmds; do
+             IFS="$save_ifs"
+             $show "$cmd"
+             $run eval "$cmd"
+           done
+           IFS="$save_ifs"
+         fi
+
+          if test -n "$old_library"; then
+           # Do each command in the old_postuninstall commands.
+           eval cmds=\"$old_postuninstall_cmds\"
+           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
+           for cmd in $cmds; do
+             IFS="$save_ifs"
+             $show "$cmd"
+             $run eval "$cmd"
+           done
+           IFS="$save_ifs"
+         fi
+
+          # FIXME: should reinstall the best remaining shared library.
+        fi
+        ;;
+
+      *.lo)
+        if test "$build_old_libs" = yes; then
+          oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
+          rmfiles="$rmfiles $dir/$oldobj"
+        fi
+       $show "$rm $rmfiles"
+       $run $rm $rmfiles
+        ;;
+
+      *)
+       $show "$rm $rmfiles"
+       $run $rm $rmfiles
+       ;;
+      esac
+    done
+    exit 0
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+    ;;
+  esac
+
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$generic_help" 1>&2
+  exit 1
+fi # test -z "$show_help"
+
+# We need to display help for each of the modes.
+case "$mode" in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+-n, --dry-run         display commands without modifying any files
+    --features        display configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --version         print version information
+
+MODE must be one of the following:
+
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE."
+  exit 0
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
+library objects (\`.lo' files) may be specified, and \`-rpath' is required.
+
+If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
+and \`ranlib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
+created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+  ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/buildscripts/mail-address.sh b/buildscripts/mail-address.sh
new file mode 100644 (file)
index 0000000..37e1141
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# mail-address
+if [ "$MAILADDRESS" != "" ]; then
+       echo $MAILADDRESS
+else
+       echo "mail-address:6: warning: \$MAILADDRESS undefined" > /dev/stderr
+       echo $USER@`hostname`
+fi
diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py
new file mode 100644 (file)
index 0000000..4d4b505
--- /dev/null
@@ -0,0 +1,327 @@
+#!@PYTHON@
+
+# mf-to-table.py -- convert spacing info in  MF logs .ly and .tex
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+import os
+import sys
+import getopt
+from string import *
+import regex
+import regsub
+import time
+
+
+(options, files) = getopt.getopt(
+    sys.argv[1:], 'a:d:hl:o:p:t:', 
+    ['afm=', 'outdir=', 'dep=', 'ly=', 'tex=', 'debug', 'help', 'package='])
+
+for opt in options:
+    o = opt[0]
+    a = opt[1]
+    if o == '-p' or o == '--package':
+       topdir = a
+
+sys.path.append (topdir + '/stepmake/bin')
+from packagepython import *
+package = Package (topdir)
+packager = Packager ()
+
+from packagepython import *
+from flower import *
+
+begin_autometric_re = regex.compile('@{')
+end_autometric_re = regex.compile('@}')
+include_re = regex.compile ('(\([a-zA-Z_0-9-]+\.mf\)')
+autometric_re = regex.compile('@{\(.*\)@}')
+version = '0.7'
+postfixes = ['log', 'dvi', '2602gf', 'tfm']
+
+class Feta_file(File):
+    """Read Feta metrics from a metafont log-file."""
+
+    def include_scan (self, line):
+       include_pos =  include_re.search (line)
+       while include_pos <> -1:
+           self.dependencies.append (include_re.group (1))
+
+           line = line[include_pos + 1:]
+           include_pos =  include_re.search (line)
+
+    def read_autometricline(self):
+       line = ''
+       while end_autometric_re.search(line) == -1 and not self.eof():
+           suf = File.readline(self)
+           self.include_scan (suf)
+           if begin_autometric_re.search(line) == -1:
+               line = ''
+           line = line + regsub.sub('\n','', suf)
+            line = regsub.sub('\r','', line)
+
+       if self.eof():
+          return ''
+
+       return line;
+    def readline(self):
+       """return what is enclosed in one @{ @} pair"""
+       line = '';
+       while autometric_re.search(line) == -1 and not self.eof():
+           line = self.read_autometricline()
+
+       if self.eof():
+           return '';
+
+       return autometric_re.group(1);
+    def __init__(self, nm):
+       File.__init__(self, nm)
+       self.dependencies = []
+    def do_file(infile_nm):
+       infile = readline();
+
+#
+# FIXME: should parse output for {} to do indenting.
+#
+class Indentable_file(File):
+    """Output file with support for indentation"""
+    def __init__(self,nm, mode):
+       File.__init__(self,nm,mode)
+       self.current_indent_ = 0
+       self.delta_indent_ = 4
+    def writeline (self, str):
+       File.write(self, str)
+    def writeeol(self):
+       File.write(self, '\n')
+       File.write(self, ' '* self.current_indent_)
+
+    def indent(self):
+       self.current_indent_ = self.delta_indent_ + self.current_indent_;
+    def dedent(self):
+       self.current_indent_ = self.current_indent_ - self.delta_indent_;
+       if self.current_indent_ < 0:
+           raise 'Nesting!'
+
+    def write(self, str):
+       lines = split(str, '\n')
+       for l in lines[:-1]:
+           self.writeline(l)
+           self.writeeol()
+        self.writeline (lines[-1])
+
+class Afm_file (File):
+    def print_f_dimen(self, f):
+       f = f * 1000
+    
+       dimstr = '%.2f' % f
+
+       # try to mask rounding errors
+       if (dimstr == '-0.00'):
+               dimstr = '0.00'
+       self.write( dimstr  +' ');
+
+    def neg_print_dimen(self, str):
+       self.print_f_dimen(-atof(str))
+    def print_dimen(self, str):
+       self.print_f_dimen(atof(str))
+    def def_symbol (self, code, lily_id, tex_id, xdim, ydim):
+       self.write ('C %s; N %s-%s; B ' % (code, self.groupname, lily_id))
+
+       self.neg_print_dimen(xdim [0])
+       self.neg_print_dimen(ydim [0])
+       self.print_dimen(xdim [1])
+       self.print_dimen(ydim [1])
+
+       self.write (';\n');
+       
+    def start (self,nm):
+       self.write ('Start%s\n' % nm)
+    def end (self,nm):
+       self.write ('End%s\n' % nm)
+
+class Ly_file(Indentable_file):
+    """extra provisions for mozarella quirks"""
+    def print_lit(self, str):
+       self.write('\"%s\"\t' % str)
+
+    def print_f_dimen(self, f):
+       dimstr = '%.2f' % f
+
+       # try to mask rounding errors
+       if (dimstr == '-0.00'):
+               dimstr = '0.00'
+       self.write( dimstr  +'\\pt\t');
+
+    def print_dimen(self, str):
+       self.print_f_dimen(atof(str))
+    
+    def neg_print_dimen(self, str):
+       self.print_f_dimen(-atof(str));
+       
+    def def_symbol(self, code, lily_id, tex_id, xdim, ydim):
+       self.print_lit(lily_id)
+       self.print_lit('\\\\' + tex_id)
+
+       self.neg_print_dimen(xdim [0])
+       self.print_dimen(xdim [1])
+       self.neg_print_dimen(ydim [0])
+       self.print_dimen(ydim [1])
+       self.write('\n')
+       
+       
+class Log_reader:
+    """Read logs, destill info, and put into output files"""
+    def output_label(self, line):
+
+       if not line:
+           return;
+       tags = split(line, '@:')
+       label = tags[0]
+       name = tags[1]
+       ly = self.lyfile
+       afm = self.afmfile
+       if tags[0] == 'font':
+           ly.indent()
+           ly.write("% name=\\symboltables {\n")
+           self.texfile.write("% name\n")
+
+           afm.write ('FontName %s\n' % name)
+           afm.start ('FontMetrics')
+           afm.start ('CharMetrics')       
+           
+       elif label == "group":
+           ly.indent()
+           ly.print_lit(name)
+           ly.write(' = \\table {\n')
+           self.texfile.write("% " + name + "\n")
+           afm.groupname = name
+       elif label == "puorg":
+           ly.dedent()
+           ly.write("}\n")
+           self.texfile.write("\n")
+       elif label == "tnof":
+           ly.dedent()
+           ly.write("%  } % $name\n")
+           afm.end ('CharMetrics')
+           afm.end('FontMetrics');
+       elif label == "char":
+           code = tags[2]
+           id = tags [7]
+           texstr = tags [8]
+           xdim = tags[3:5]
+           ydim = tags[5:7]
+           ly.def_symbol(code, id, texstr, xdim, ydim)
+           
+           self.texfile.write("\\fetdef\\%s{%s}\n" % (texstr, code))
+           afm.def_symbol (code, id, texstr, xdim, ydim)
+       else:
+           raise 'unknown label: ' + label
+
+    def writedeps (self, deps):
+       if not len (deps):
+           sys.stderr.write  ('Huh, no main target??')
+           return
+       filename = deps[0]
+       split = os.path.splitext(filename)      
+       basename=split[0];
+
+       targets =  map (lambda x,y = basename, z = self.outdir: z + '/' + y + '.' + x, postfixes)
+       depstring = reduce(lambda x,y: x + ' ' + y, deps) 
+       dependencies = map (lambda x, y=depstring: x + ': ' + y, targets)
+       for x in dependencies: 
+           self.depfile.write (x + '\n')
+       
+    def do_file(self,filenm):
+       self.lyfile.write ('\n% input from ' + filenm + '\n')
+       self.texfile.write ('\n% input from ' + filenm + '\n')
+       feta = Feta_file(filenm)
+       while not feta.eof():
+           line = feta.readline()
+           self.output_label(line)
+       feta.close()
+       
+       self.writedeps (feta.dependencies)
+
+    def __init__(self, lyfile_nm, texfile_nm, depfile_nm, afmfile_nm):     
+       self.lyfile = Ly_file(lyfile_nm, 'w')
+       self.texfile = Indentable_file(texfile_nm, 'w')
+       self.depfile = File (depfile_nm, 'w')
+       self.afmfile = Afm_file (afmfile_nm, 'w')
+       headerstr = '%% Creator: %s\n%% Automatically generated on\n%% Do not edit' % \
+                  (program_id() )
+
+       self.lyfile.write(headerstr)
+       self.texfile.write(headerstr)
+       self.depfile.write ('# automatically generated by %s\n' % program_id ())
+
+    def close(self):
+       self.lyfile.close()
+       self.texfile.close()
+       self.depfile.close ()
+
+    def __del__(self):
+       self.close()
+
+def today_str():
+    return time.asctime(time.localtime(time.time()))
+       
+def program_id():
+    return 'mf-to-table.py version ' + version;
+
+def identify():
+    sys.stdout.write(program_id() + '\n')
+    
+def help():
+    sys.stdout.write("Usage: mf-to-table [options] LOGFILEs\n"
+                + "Generate mozarella metrics table from preparated feta log\n\n"
+                + "Options:\n"
+                + "  -a, --afm=FILE         .afm file\n"
+                + "  -d, --dep=FILE         print dependency info to FILE\n"
+                + "  -h, --help             print this help\n"
+                + "  -l, --ly=FILE          name output table\n"
+                + "  -o, --outdir=DIR       prefix for dependency info\n"
+                + "  -p, --package=DIR      specify package\n"
+                + "  -t, --tex=FILE         name output tex chardefs\n"
+                    )
+    sys.exit (0)
+
+
+def main():
+    identify()
+
+    lyfile_nm = texfile_nm = '';
+    depfile_nm = ''
+    afmfile_nm = ''
+    outdir_prefix = '.'
+    for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o == '--dep' or o == '-d':
+           depfile_nm = a
+       elif o == '--outdir' or o == '-o':
+           outdir_prefix = a
+       elif o == '--ly' or o == '-l':
+           lyfile_nm = a
+       elif o == '--tex' or o == '-t':
+           texfile_nm = a
+       elif o== '--help' or o == '-h':
+           help()
+       elif o=='--afm' or o == '-a':
+           afmfile_nm = a
+       elif o == '--debug':
+           debug_b = 1
+       elif o == '-p' or o == '--package':
+           topdir = a
+       else:
+           print o
+           raise getopt.error
+
+    log_reader = Log_reader(lyfile_nm, texfile_nm, depfile_nm, afmfile_nm)
+    log_reader.outdir = outdir_prefix
+    for filenm in files:
+       log_reader.do_file(filenm)
+    log_reader.close()
+
+
+main()
diff --git a/buildscripts/mf-to-xpms.sh b/buildscripts/mf-to-xpms.sh
new file mode 100644 (file)
index 0000000..0372989
--- /dev/null
@@ -0,0 +1,60 @@
+#!@SHELL@
+# mf-to-xpms.sh
+
+if [ $# -ne 1 ]; then
+       echo Usage: mf-to-xpms feta20
+       exit 2
+fi
+
+font=`basename $1 .mf`
+mf=$font.mf
+afm=out/$font.afm
+PKTOPBM=pktopbm
+MODE=ibmvga
+RESOLUTION=110
+named=yes
+
+if [ ! -e out/$font.${RESOLUTION}pk ]; then
+       mf "\\mode=${MODE}; \\input $mf"
+       mv $font.${RESOLUTION}gf out
+       rm -f $font.log $font.tfm
+       gftopk out/$font.${RESOLUTION}gf out/$font.${RESOLUTION}pk
+fi
+
+# num=`grep "^C *[0-9]*;" $afm | tail -1 | sed "s!^C *\([^;]*\).*!\\1!"`
+# num=66
+# tex=out/$font.tex
+# cat > $tex <<EOF
+# \font\fetatwenty=feta20
+# \fetatwenty
+# \nopagenumbers
+# \newcount\c\c64
+# \char\c
+# \loop\ifnum\c<$num\advance\c by1
+#      \vfill\eject
+#      \char\c
+# \repeat
+# \vfill\eject
+# \end
+# EOF
+
+# for i in $NUMS; do
+#      $PKTOPBM out/$font.${RESOLUTION}pk -c $i out/$font-$i.pbm
+# done
+
+# numbered files
+if [ "x$named" = "x" ]; then
+       NUMS=`grep "^C *[0-9]*;" $afm | sed "s!^C *\([^;]*\).*!\\1!"`
+       PBMS=`grep "^C *[0-9]*;" $afm | sed "s!^C *\([^;]*\).*!out/$font-\\1.pbm!"`
+else
+       NUMS=`grep "^C *[0-9]*;" $afm | sed "s!^C [^;]*; *N *\([^;]*\).*!\\1!"`
+       PBMS=`grep "^C *[0-9]*;" $afm | sed "s!^C [^;]*; *N *\([^;]*\).*!out/$font-\\1.pbm!"`
+fi
+
+# $PKTOPBM out/$font.${RESOLUTION}pk -x 100 -y 100 $PBMS
+$PKTOPBM out/$font.${RESOLUTION}pk $PBMS
+
+for i in $NUMS; do
+       ppmtoxpm out/$font-$i.pbm > out/$font-$i.xpm
+done
+rm -f $PBMS
diff --git a/buildscripts/mutopia-index.py b/buildscripts/mutopia-index.py
new file mode 100644 (file)
index 0000000..b72042c
--- /dev/null
@@ -0,0 +1,172 @@
+#!@PYTHON@
+# mutopia-index.py
+
+name = 'mutopia-index'
+
+import regex
+import os
+import sys
+import stat
+sys.path.append ('@abs-step-bindir@')
+
+
+
+header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}')
+header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;')
+
+#
+# FIXME breaks on multiple strings.
+#
+def read_mudela_header (fn):
+       s = gulp_file(fn)
+       s = regsub.gsub('%.*$', '', s)
+       s = regsub.gsub('\n', ' ', s)   
+
+       dict = {}
+       if header_regex.search(s) <> -1:
+               h = header_regex.group(1)
+       else:
+               return dict
+
+       while regex.search('=', h) <> -1: 
+
+               if header_entry_regex.search (h) == -1:
+
+                       raise 'format error'
+
+               h = regsub.sub(header_entry_regex, '', h)
+               left = header_entry_regex.group(1)
+               right = header_entry_regex.group(2)
+
+               right = regsub.gsub('\([^\\]\)\"', '\\1', right)
+               right = regsub.gsub('^"', '', right)            
+               left = regsub.gsub('\([^\\]\)\"', '', left)
+               left = regsub.gsub('^"', '', left)
+
+               dict[left] = right
+
+       return dict
+   
+
+
+
+def help ():
+    sys.stdout.write ("Usage: " + name + " [options] INFILE OUTFILE\n"
+                + "Generate index for mutopia\n\n"
+                + "Options:\n"
+                + "  -h, --help             print this help\n"
+                + "  -p, --package=DIR      specify package\n"
+                + "  --prefix=PRE           specify prefix\n"
+                + "  -s, --subdirs=DIR      add subdir\n"
+                + "  --suffix=SUF           specify suffix\n"
+                     )
+    sys.exit (0)
+
+def gen_list(inputs, subdir, filename):
+    (pre, subdirs, post)=subdir
+    print "generating HTML list %s\n" % filename
+    list = open(filename, 'w')
+    list.write ('<html><TITLE>Rendered Examples</TITLE>\n')
+    list.write ('<body bgcolor=white>')
+    if len(subdirs):
+       list.write  ('<h2>subdirectories</h2>')
+       list.write  ('<ul>')    
+        for ex in subdirs:
+           print 'subdir %s ' % ex
+           list.write ('<li><a href=%s/index.html>Subdirectory: %s</a></li>\n' % (pre + ex + post , ex))
+
+       list.write ('</ul>')
+
+    list.write('<h2>Contents of this directory</h2>\n');
+    list.write (
+    'These example files are taken from the LilyPond distribution. '
+    'LilyPond currently only outputs TeX and MIDI.  The pictures and '
+    'PostScript files were generated using TeX, Ghostscript and some '
+    'graphics tools.  The papersize used for these examples is A4. '
+    'As you know, <a href="http://www.gnu.org/philosophy/gif.html">no gifs due to patent problems</a>, '
+    'but the png images should be viewable with any current browser '
+    '(jpeg is inappropriate for music images).'
+    '\n');
+
+
+    for ex in inputs:
+       ex_ext = '.ly'
+       print '%s, ' % ex
+       try:
+           header = read_mudela_header(ex + ex_ext + '.txt')
+       except:
+           ex_ext = '.fly'
+           header = read_mudela_header(ex + ex_ext + '.txt')
+       
+       def read_dict(s, default, h =header):
+               try:
+                   ret = h[s]
+               except KeyError:
+                   ret = default
+               return ret
+       head = read_dict('title', ex)
+       composer = read_dict('composer', '')
+       desc = read_dict('description', '')
+       list.write('<hr>')
+       list.write('<h1>example file: %s</h1>' % head);
+       if composer <> '':
+           list.write('<h2>%s</h2>\n' % composer)
+       if desc <> '':
+           list.write('%s<p>' % desc)
+       list.write ('<ul>')
+       def list_item(filename, desc, type, l = list):
+           if file_exist_b(filename):
+               l.write ('<li><a href=%s>%s</a>' % (filename, desc))
+               size=os.stat(filename)[stat.ST_SIZE]
+               l.write (' (%s %dk)' % (type, (size + 512) / 1024))
+               pictures = ['jpeg', 'png', 'xpm']
+               # silly, no?
+               if 0 and type in pictures:
+                   l.write (' <a href="http://www.gnu.org/philosophy/gif.html">no gifs due to patent problems</a>')
+               l.write ('\n')
+       list_item(ex + ex_ext + '.txt', 'The input', 'ASCII')
+       for pageno in range(1,100):
+           f  = ex + '-page%d.png' % pageno
+           if not file_exist_b (f):
+               break
+           list_item(f, 'The output, page %d' % pageno, 'png')
+       list_item(ex + '.ps.gz', 'The output', 'gzipped PostScript')
+       list_item(ex + '.midi', 'The output', 'MIDI')
+       list.write ("</ul>");
+
+    list.write( "</BODY></HTML>");
+    list.close()
+
+import getopt
+
+(options, files) = getopt.getopt(sys.argv[1:], 
+  'hp:s:', ['help', 'subdirs=', 'suffix=', 'package=', 'prefix='])
+subdir_pre=''
+subdir_suf =''
+
+subdirs =[]
+for opt in options:
+    o = opt[0]
+    a = opt[1]
+    if o == '--subdirs' or o == '-s':
+       subdirs.append (a)
+    elif o == '--prefix':
+       subdir_pre = a
+    elif o == '-p' or o == '--package':
+       topdir = a
+    elif o == '--suffix':
+       subdir_suf = a
+
+    sys.path.append (topdir + '/stepmake/bin')
+    from packagepython import *
+    package = Package (topdir)
+    packager = Packager ()
+
+    from flower import *
+
+       
+# huh?
+allfiles = multiple_find (['*.*ly.txt'], '.')
+
+gen_list (files, (subdir_pre, subdirs, subdir_suf), 'index.html')
+
diff --git a/buildscripts/profile-conf.sh b/buildscripts/profile-conf.sh
new file mode 100644 (file)
index 0000000..79dbd73
--- /dev/null
@@ -0,0 +1,2 @@
+
+configure --prefix=~ --enable-profiling --enable-config=optprof --enable-optimise --disable-checking
diff --git a/buildscripts/ps-to-gifs.sh b/buildscripts/ps-to-gifs.sh
new file mode 100755 (executable)
index 0000000..0f4afe0
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/sh
+# ps-to-gifs, convert PS to multiple gifs or other bitmaps
+
+usage()
+{
+    cat <<EOF
+Convert PS to multiple gifs or other bitmaps
+Usage: ps-to-gifs.sh [OPTION]... [FILE]
+Options:
+  -h, --help         this help
+  -c, --crop         crop output
+  -o, --output=NAME  set output base
+  -p, --png          convert to png
+  -s, --size=SIZE    set papersize
+  -t, --transparent  change white to transparent
+EOF
+}
+
+if [ $# -lt 1 ]; then
+    usage;
+    exit 2;
+fi
+CROP=cat
+GIF=gif
+PNMTOGIF=ppmtogif
+
+while [ $# -gt 0 ]; do
+opt=$1
+shift
+    case $opt in
+    -t|--t*)
+       color='-transparent white'
+       ;;
+    -h|--h*)
+       usage;
+       exit 0
+       ;;
+    -c|--c*)
+       CROP=" pnmcrop "
+       ;;
+    -o) OUTFILE=$2; shift
+        ;;
+    --o*=*) OUTFILE=`echo $opt | sed -e s/"^.*="//`
+        ;;
+    -p|--p*)
+       GIF=png
+       PNMTOGIF=pnmtopng
+       ;;
+    -s) SIZE="-sPAPERSIZE=$2"; shift
+        ;;
+    --s*=*)
+        SIZE="-sPAPERSIZE=`echo $opt | sed -e s/"^.*="//`"
+       ;;
+    -*)
+        echo "ps-to-gifs: unknown option: \`$opt'"
+       exit 1
+       ;;
+    *)
+       FILE=$opt
+       ;;
+    esac
+done
+
+if [ "x$TRANSPARENT_IS_BROKEN" != "x" ]; then
+       color=
+fi
+
+if [ "x$OUTFILE" = "x" ]; then
+       BASE=`dirname $FILE`/`basename $FILE .ps`
+else
+       BASE=`dirname $OUTFILE`/`basename $OUTFILE .$GIF`
+fi
+
+# urg, pipe breaks
+rm -f $BASE{.ppm,.$GIF} $BASE-page*{.ppm,.$GIF}
+
+# generate the pixmap at twice the size, then rescale (for antialiasing)
+cat $FILE | gs -sDEVICE=ppmraw $SIZE -sOutputFile="$BASE-page%d.ppm" -r180 -dNOPAUSE - -c quit $FILE
+# quant is soo slow
+# cat $PPMFILE | ppmquant 2 | pnmscale 0.3333 | pnmcrop | $PNMTOGIF $color > $OUTFILE
+PPMS=`ls $BASE*ppm`
+for i in $PPMS; do
+    o=`dirname $i`/`basename $i .ppm`.$GIF
+    cat $i | pnmscale 0.5 | $CROP | $PNMTOGIF $color > $o
+    rm $i
+done
+
+if [ "x$OUTFILE" != "x" ]; then
+       mv $BASE-page1.$GIF $BASE.$GIF
+fi
+
diff --git a/buildscripts/ps-to-pngs.sh b/buildscripts/ps-to-pngs.sh
new file mode 100755 (executable)
index 0000000..2a3f363
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+# ps-to-pngs, convert PS to multiple pngs
+  
+ps-to-gifs --png $*
diff --git a/buildscripts/run-lilypond.sh b/buildscripts/run-lilypond.sh
new file mode 100644 (file)
index 0000000..2a69e5a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+LILYTOPDIR=$1
+shift
+export LILYINCLUDE="$LILYTOPDIR/init:$LILYTOPDIR/mf/out:$LILYINCLUDE"
+export TEXINPUTS="$LILYTOPDIR/tex:$TEXINPUTS"
+export MFINPUTS="$LILYTOPDIR/mf:$TEXINPUTS"
+
+$LILYTOPDIR/lily/out/lilypond $*
diff --git a/buildscripts/set-lily.sh b/buildscripts/set-lily.sh
new file mode 100755 (executable)
index 0000000..d44317d
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+# zet-lily.sh --- configure LilyPond sourcetree
+# nice in first character unique name
+#
+PACKAGE_NAME=LilyPond
+export PACKAGE_NAME
+prefix=$HOME/usr
+sources=$prefix/src
+#
+#
+. ./stepmake/bin/package-zet.sh
+#
+# The $sources dir looks like this:
+#
+# <SEE PATCHES.txt>
+#
+if [ "x$LILYINCLUDE" = "x" ]; then
+       # we can try...
+       echo you should add the following to your profile script
+       if [ "x$MAILADDRESS" = "x" ]; then
+               MAILADDRESS=$USER@`hostname`
+               export MAILADDRESS
+               echo "        MAILADDRESS=\$USER@`hostname`"
+               echo "        export MAILADDRESS"
+       fi
+       LILYINCLUDE=$LILYPOND_SOURCEDIR/init:$LILYPOND_SOURCEDIR/input:$LILYPOND_SOURCEDIR/mf/out
+       MFINPUTS=$MFINPUTS:$LILYPOND_SOURCEDIR/mf
+       TEXINPUTS=$TEXINPUTS:$LILYPOND_SOURCEDIR/mf/out
+       export LILYINCLUDE MFINPUTS TEXINPUTS
+       cat <<EOF
+       LILYINCLUDE=$LILYPOND_SOURCEDIR/init:$LILYPOND_SOURCEDIR/mf/out
+       MFINPUTS=\$MFINPUTS:\$LILYPOND_SOURCEDIR/mf
+       TEXINPUTS=\$TEXINPUTS:\$LILYPOND_SOURCEDIR/mf/out
+       export LILYINCLUDE MFINPUTS TEXINPUTS
+EOF
+
+fi
+
+ln -sf $LILYPOND_SOURCEDIR/lily/out/lilypond $prefix/bin/lilypond
+ln -sf $LILYPOND_SOURCEDIR/mi2mu/out/mi2mu $prefix/bin/mi2mu
+ln -sf $LILYPOND_SOURCEDIR/scripts/ly2dvi.sh $prefix/bin/ly2dvi
+chmod 755 $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh
+ln -sf $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh $prefix/bin/ps-to-gifs
+
+if [ -f ../.gdbinit ];
+then
+    ln ../.gdbinit .
+fi
+
+if [ -f ../.dstreamrc ]
+then
+    ln ../.dstreamrc .
+fi
+
+./configure --prefix=$prefix --enable-debugging --enable-printing --enable-checking --disable-optimise --enable-guile
+
diff --git a/buildscripts/show-current.sh b/buildscripts/show-current.sh
new file mode 100644 (file)
index 0000000..7ae9c3f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# show-current.sh
+
+. $LILYPOND_SOURCEDIR/VERSION 
+VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
+if [ "$MY_PATCH_LEVEL" != "" ]; then
+  VERSION=$VERSION.$MY_PATCH_LEVEL
+fi
+echo $VERSION
diff --git a/buildscripts/template.py b/buildscripts/template.py
new file mode 100644 (file)
index 0000000..f1a45e0
--- /dev/null
@@ -0,0 +1,59 @@
+#!@PYTHON@
+
+# template.py -- 
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1998 
+
+program_name = 'template'
+version = '0.1'
+
+import os
+import sys
+
+sys.path.append ('@abs-step-bindir@')
+sys.path.append (os.environ['HOME'] + '/usr/src/lilypond/stepmake/bin')
+
+import getopt
+from string import *
+import regex
+import regsub
+import time
+
+def program_id ():
+    return name + ' version ' + version;
+
+def identify ():
+    sys.stdout.write (program_id () + '\n')
+
+def help ():
+    sys.stdout.write ("Usage: %s [options] [files]\n"
+                      "I'm not a program, use me as a template to create one\n\n"
+                      + "Options:\n"
+                      + "  -h, --help             print this help\n"
+                      % (program_name)
+                     )
+    sys.exit (0)
+
+identify ()
+(options, files) = getopt.getopt (
+    sys.argv[1:], 'hp:', ['help', 'package'])
+for opt in options:
+    o = opt[0]
+    a = opt[1]
+    if o== '--help' or o == '-h':
+       help ()
+    elif o == '-p' or o == '--package':
+       topdir = a
+    else:
+       print o
+       raise getopt.error
+
+sys.path.append (topdir + '/stepmake/bin')
+from packagepython import *
+package = Package (topdir)
+packager = Packager ()
+
+from flower import *
+
index 73b8a8ec1a735af8bd147e633f2de9ce56088606..ab80403e025c403c65e59af5e382e5311cc3fe27 100644 (file)
@@ -1,7 +1,7 @@
 /*
   axis.cc -- implement Axis
 
-  source file of the GNU LilyPond music typesetter
+
 
   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
index c40e639817b4b7be9af489898f3bd58d4da4260b..c9c146e9f14b8820d543233faaafe6556e659c27 100644 (file)
@@ -66,12 +66,23 @@ public:
       {setsize_}
   */
   int size() const  
-    { return size_; }
+    {
+      return size_;
+    }
     
   /// POST: size() == 0
-    void clear() 
-    { size_ = 0; }
+  void clear() 
+    {
+      size_ = 0;
+    }
 
+  Array (T *tp, int n)
+    {
+      array_p_ = new T[n];
+      max_ =size_ = n;
+      arrcpy (array_p_, tp, n);      
+    }
+  
   Array() 
     { array_p_ = 0; max_ =0; size_ =0; }
 
index d3c9a7afb331137c8a666a8b999f60141eb07a1a..e1e840b8a102ae23ad9356f82889c166ae7a8820 100644 (file)
@@ -183,7 +183,7 @@ public:
       V retval;
       if (!elem_b (k))
        return retval ;
-      retval ((Dictionary<V> *) this)->elem (k);
+      return ((Dictionary<V> *) this)->elem (k);
     }
 
   V remove (String s)
index 8b4d280cf5e940783692facc1198103b8a1d1e18..b4eeb9759709a32f8aaf4c2599ccdbea7bdad6e1 100644 (file)
@@ -78,6 +78,7 @@ public:
        return sqrt (norm_sq());
     }
     operator Array<Real>() { return dat; }
+  Array<Real> const &to_array()const { return dat; }  
     void print() const;
     /// set to j-th element of unit-base
     void set_unit (int j) ;
index 39795ce1158a86a1f5184885ce7e01506cfa2768..909267165b01ae9d6c801393af0c6f998cef1d83 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef VIRTUAL_METHODS_HH
 #define VIRTUAL_METHODS_HH
 
+#include <typeinfo>
 #include "stdlib.h"            // size_t
 
 /**  Declare the classes name as a static and virtual function.
   s->name() != S::static_name (). Overlapping strings need not be merged in C++
  */
 #define DECLARE_MY_RUNTIME_TYPEINFO    \
-static bool static_is_type_b (const char*s);\
-virtual bool is_type_b (const char *s) const { return static_is_type_b (s); } \
-virtual char const *name() const{ return static_name (); } \
-virtual size_t class_size () const { return static_class_size (); }\
-static size_t static_class_size (); \
+virtual char const *name() const{ return static_name (); }\
 static char const *static_name()
 
-#define IMPLEMENT_STATIC_NAME(c)\
-    char const *c::static_name() { return #c; } \
-    size_t c::static_class_size () { return sizeof (c); }
 
+#if 0
+  /*
+    oops.  before() has nothing to do with inheritance
+   */
+inline bool operator > (type_info const &a1, type_info const &a2)
+{
+  return a2.before (a1);
+}
 
+inline bool operator < (type_info const &a1, type_info const &a2)
+{
+  return a1.before (a2);
+}
 
-#define VIRTUAL_COPY_CONS(T, R)\
-  virtual R *clone() const { return  new T(*this); } \
-  int  yet_another_stupid_function_to_allow_semicolon()
+inline bool operator <= (type_info const &a1, type_info const &a2)
+{
+  return a1 == a2 ||  a1 < a2;
+}
+
+inline bool operator >= (type_info const &a1, type_info const &a2)
+{
+  return a1 == a2 ||  a1 > a2;
+}
+#endif
+
+#define IMPLEMENT_STATIC_NAME(c)\
+    char const *c::static_name() { return #c; }
+
+     /*
+    size_t c::static_class_size () { return sizeof (c); }
+    */
 
+#define VIRTUAL_COPY_CONS(T, R)\
+  virtual R *clone() const { return  new T(*this); } 
 
 #define DECLARE_VIRTUAL_COPY_CONS(T, R)\
       virtual R *clone() const
+
 #define IMPLEMENT_VIRTUAL_COPY_CONS(T, R)\
        R *T::clone() const { return  new T(*this); }\
 
     
 #define IMPLEMENT_IS_TYPE_B(D)\
-  IMPLEMENT_STATIC_NAME(D)\
+  IMPLEMENT_STATIC_NAME(D)
+
+/*
   bool D::static_is_type_b (const char *s)\
 {\
   return s == static_name();\
-}
+}*/
 
 #define IMPLEMENT_IS_TYPE_B1(D, B)\
-  IMPLEMENT_STATIC_NAME(D)\
+  IMPLEMENT_STATIC_NAME(D)
+/*
   bool D::static_is_type_b (const char *s)\
 {\
   return s == static_name() || B::static_is_type_b (s);\
 }
+*/
 
 #define IMPLEMENT_IS_TYPE_B2(D, BA, BB)\
-  IMPLEMENT_STATIC_NAME(D)\
+  IMPLEMENT_STATIC_NAME(D)
+
+/*
+     
   bool D::static_is_type_b (const char *s)\
 {\
   return s == static_name() || BA::static_is_type_b (s) || BB::static_is_type_b (s);\
 }
+*/
 
 #endif 
index cf4db4c84a3a529f325b1a939547f2ca5233fc9d..e04d9f6476111913be48f36e9e91260d76d83a77 100644 (file)
@@ -6,9 +6,15 @@ depth = ..
 NAME = lilypond
 SUBDIRS = include
 
-MODULE_LIBS=$(depth)/lib $(depth)/flower
+MODULE_LIBS=$(depth)/lib $(depth)/flower 
+MODULE_INCLUDES=$(depth)/lib/include $(depth)/flower/include 
 
-STEPMAKE_TEMPLATES= c++ executable 
+STEPMAKE_TEMPLATES= c++ executable
+
+MODULE_LIBES=-lguile 
+
+# for the RedHat GUILE 1.3 RPM 
+MODULE_LIBES+= -lreadline -ldl 
 
 include $(depth)/make/stepmake.make 
 
index eb87945cd775fbac66812fdb3a74982a89f005f3..841f063ca6f739f095043dde8a6bfe2790914d3c 100644 (file)
@@ -129,7 +129,7 @@ void
 Abbreviation::do_substitute_dependent (Score_element*o, Score_element*n)
 {
   if (stem_l_ == o)
-    stem_l_ = n ? dynamic_cast<Stem*> (n) : 0;
+    stem_l_ = dynamic_cast<Stem*> (n);
 }
 
 
index be29437462043ae1f04b27e9318d7dcea687e28c..145ab50bcb786e29cf65f910219878caf4ad9286 100644 (file)
@@ -27,11 +27,7 @@ Abbreviation_beam_engraver::Abbreviation_beam_engraver ()
 bool
 Abbreviation_beam_engraver::do_try_request (Request*r)
 {
-  Musical_req* mus_l = dynamic_cast <Musical_req *> (r);
-  if (!mus_l)
-    return false;
-
-  Abbreviation_beam_req * b = dynamic_cast <Abbreviation_beam_req *> (mus_l);
+  Abbreviation_beam_req * b = dynamic_cast <Abbreviation_beam_req *> (r);
 
   if (!b)
     return false;
@@ -40,7 +36,7 @@ Abbreviation_beam_engraver::do_try_request (Request*r)
     return false;
 
   Direction d = (!abeam_p_) ? LEFT : RIGHT;
-  if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l))
+  if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (b))
     return false;
 
   span_reqs_drul_[d] = b;
@@ -82,11 +78,10 @@ Abbreviation_beam_engraver::do_removal_processing ()
 void
 Abbreviation_beam_engraver::acknowledge_element (Score_element_info i)
 {
-  if (!abeam_p_ || !i.elem_l_->is_type_b (Stem::static_name ()))
+  Stem* s = dynamic_cast<Stem *> (i.elem_l_);
+  if (!abeam_p_ || !s)
     return;
 
-  Stem* s = (Stem*)dynamic_cast <Item *> (i.elem_l_);
-
   int type_i = span_reqs_drul_[LEFT]->type_i_;
   s->flag_i_ = intlog2 (type_i) - 2;
   if (span_reqs_drul_[RIGHT])
index 2d8f11e78e724b9f78d9ef3b053965d9b3a538db..ae6092c165e628f28185ed7bc7c5944cf73dc5fd 100644 (file)
@@ -6,7 +6,6 @@
   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include "atom.hh"
 #include "interval.hh"
 #include "string.hh"
@@ -66,6 +65,7 @@ Atom::extent () const
 }
 
 
+
 Atom::Atom ()
   : dim_ (Interval (0,0),Interval (0,0))
 {
@@ -76,15 +76,15 @@ Atom::Atom ()
     But Atom is used as a simple type *everywhere*,
     and we don't have virtual contructors.
    */
-  lambda_ = 0;
   str_ = "unknown\n";
+  origin_l_ = 0;
 }
 
 Atom::Atom (String s, Box b)
   :  dim_ (b)
 {
-  lambda_ = 0;
   str_ = s;
+  origin_l_ = 0;  
 }
 
 
@@ -101,8 +101,6 @@ Atom::offset () const
   return off_;
 }
 
-
-
 void
 Atom::translate_axis (Real r, Axis a)
 {
index 71757314a7c75e82dd1a8bfd2687dad2f060a5ba..2ec7736a40af93be12411c6e86a9671b6d25e5e5 100644 (file)
@@ -80,6 +80,7 @@ Audio_time_signature::midi_item_p()
 {
   return new Midi_time_signature (this);
 }
+
 IMPLEMENT_IS_TYPE_B1(Audio_time_signature, Audio_item);
 
 Audio_text::Audio_text (Audio_text::Type type, String text_str)
@@ -96,7 +97,6 @@ Audio_text::midi_item_p()
 }
 
 IMPLEMENT_IS_TYPE_B1(Audio_text, Audio_item);
-
 IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element);
 
 void
index 254f029f59a6b5e9e554f2e840bb3880fc5c3026..c97be06723cb3731d13be58362a517f20f549b92 100644 (file)
 bool
 Tuplet_engraver::do_try_request (Request *r)
 {
-  Command_req * c = dynamic_cast <Command_req *> (r);
-  if (!(c &&
-      dynamic_cast <Bracket_req *> (c)))
+  if (Bracket_req * b = dynamic_cast <Bracket_req *> (r))
     {
-      return false;
+      bracket_req_arr_.push (b);
+      return true;
     }
-
-  Bracket_req * b = dynamic_cast <Bracket_req *> (c);
-  bracket_req_arr_.push (b);
-  return true;
+  return false;
 }
 
 void
@@ -59,9 +55,9 @@ Tuplet_engraver::do_process_requests ()
 void
 Tuplet_engraver::acknowledge_element (Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Note_column::static_name ()))
+  if (Note_column *nc = dynamic_cast<Note_column *> (i.elem_l_))
     {
-      Note_column *nc = (Note_column*)dynamic_cast <Item *> (i.elem_l_);
+
       for (int j =0; j  <started_span_p_arr_.size (); j++)
        // started_span_p_arr_[j]->add_column (nc);
        ;
index 928f64de0c6799c4b1ea34e0c72709ee5c0e0874..a19d26c6c310669b43fcc6f2cba668111458159c 100644 (file)
@@ -76,12 +76,5 @@ Axis_group_element::Axis_group_element ()
   transparent_b_ = true;
 }
 
-Axis_group_element*
-Axis_group_element::access_Axis_group_element ()
-{
-  return this;
-}
-
-
 
 IMPLEMENT_IS_TYPE_B2(Axis_group_element, Score_element, Graphical_axis_group);
index 273116d1ea1ef8d8de756902dfb8bca7d66ea537..6eabab3a58ffa44e65f0e3bf14fad0d0ee62831b 100644 (file)
@@ -40,7 +40,7 @@ Axis_group_item::do_breakable_col_processing()
        {
          Item *new_l = 
            it_l->find_prebroken_piece (broken_to_drul_[j]->break_status_dir_);
-         ((Axis_group_item*)broken_to_drul_[j])->add_element (new_l);
+         (dynamic_cast<Axis_group_item*> (broken_to_drul_[j]))->add_element (new_l);
        }
       while (flip(&j)!=LEFT);
     }
index 70c70c297f063bee6db0af7b60a6fd1e89900441..fdd2969b5e359964ec913c6dc76c6fda3b05d250 100644 (file)
@@ -65,39 +65,36 @@ Axis_group_spanner::do_break_processing()
          /* this piece doesn't know where it belongs.
             Find out if it was broken, and use the broken remains
             */
-         if (dynamic_cast <Spanner *> (elt)) 
+         Spanner * sp =dynamic_cast <Spanner *> (elt);
+         Item *it = dynamic_cast <Item *> (elt) ;        
+         if (sp)
            {
-             Spanner * sp = dynamic_cast <Spanner *> (elt);
-               
              for (int j =0; j < broken_into_l_arr_.size(); j++) 
                {
                  Axis_group_spanner * my_broken_l
-                   = (Axis_group_spanner*)broken_into_l_arr_[j];
+                   = dynamic_cast<Axis_group_spanner*>(broken_into_l_arr_[j]);
                    
                  Spanner * broken_span_l 
-                   = sp->find_broken_piece (
-                                            ((Score_element*)my_broken_l)->line_l());
+                   = sp->find_broken_piece (dynamic_cast<Score_element*>(my_broken_l)->line_l());
                    
                  if (broken_span_l) 
                    my_broken_l->add_element (broken_span_l);
                    
                }
            }
-         else if (dynamic_cast <Item *> (elt) 
-                  && dynamic_cast <Item *> (elt)->breakable_b_ 
-                  && dynamic_cast <Item *> (elt)->break_status_dir () == 0) 
+         else if (it && it->breakable_b_ && it->break_status_dir () == 0) 
            {
              // broken items
              Direction  j=LEFT;
              do 
                {
-                 Item * my_item = dynamic_cast <Item *> (elt)->broken_to_drul_[j];
+                 Item * my_item = it->broken_to_drul_[j];
                  Line_of_score * item_line_l = my_item->line_l() ;
                  if (! item_line_l) 
                    continue;
                    
                  Axis_group_spanner * v
-                   = (Axis_group_spanner*)find_broken_piece (item_line_l);
+                   = dynamic_cast<Axis_group_spanner*>(find_broken_piece (item_line_l));
                  if (v)
                    v->add_element (my_item);
                  else
@@ -118,7 +115,7 @@ Axis_group_spanner::do_break_processing()
             Put it in appropriate piece of this spanner
             */
          Axis_group_spanner * my_broken_l
-           = (Axis_group_spanner*)find_broken_piece (elt->line_l());
+           = dynamic_cast<Axis_group_spanner*> (find_broken_piece (elt->line_l()));
          my_broken_l->add_element (elt);
        }
     }
index 0832448a2a0bc8feb9d12ed615de78b8ac5d98eb..230a0f3ea2a39f374bb81ce7ce29ff7732812a31 100644 (file)
@@ -12,6 +12,7 @@
 #include "request.hh"
 #include "script.hh"
 #include "bar.hh"
+#include <typeinfo>
 
 Bar_column_engraver::Bar_column_engraver()
 {
@@ -55,22 +56,24 @@ Bar_column_engraver::acknowledge_element (Score_element_info info)
   Item * it = dynamic_cast <Item *> (info.elem_l_);
   if (!it)
     return;
-
-  if (it->is_type_b (Script::static_name())
+  Script *s = dynamic_cast<Script*> (it);
+  Bar *b = dynamic_cast<Bar*> (it);
+  if (s
       && it->breakable_b_
       && info.origin_grav_l_arr_.size() == 1
       && it->break_priority_i_ == break_priority_i_)
     {
       create_column ();
-      barcol_p_->add_script ((Script*)it);
+      barcol_p_->add_script (s);
     }
   else if (info.origin_grav_l_arr_.size() == 1
           && it->break_priority_i_ == break_priority_i_
-          && it->breakable_b_ 
-          && it->is_type_b (Bar::static_name()))
+          && it->breakable_b_
+          &&b)
+
     {
       create_column ();
-      barcol_p_->set_bar ( (Bar*)it);
+      barcol_p_->set_bar (b);
     }
 }
 
index 74ce5386af7a62bb13f114732051f8edc67bab9a..5f1a40d93f2a61074e3c557df0fc9a6c09eb69a7 100644 (file)
@@ -28,7 +28,7 @@ Bar_column::do_substitute_dependency (Score_element*o,Score_element*n)
   Script_column::do_substitute_dependency (o,n);
   if (o == bar_l_) 
     {
-      bar_l_ = n ? (Bar*)dynamic_cast <Item *> (n) : 0;
+      bar_l_ =  dynamic_cast<Bar *> (n);
     }
 }
 
index 7a2a515cdc7456684173e3bc28c71eb673bba4a5..456a13cf400387bb7dcc3d82481482b75b3128f7 100644 (file)
@@ -23,16 +23,18 @@ Bar_engraver::Bar_engraver()
 bool
 Bar_engraver::do_try_request (Request*r_l)
 {
-  Command_req* c_l = dynamic_cast <Command_req *> (r_l);
-  if (!c_l|| !dynamic_cast <Bar_req *> (c_l)) 
-    return false;
-  Bar_req  * b= dynamic_cast <Bar_req *> (c_l);
-  if (bar_req_l_ && bar_req_l_->equal_b (b))
-    return false;
+  if (Bar_req  * b= dynamic_cast <Bar_req *> (r_l))
+    {
+      if (bar_req_l_ && bar_req_l_->equal_b (b)) // huh?
+       return false;
+      
+      bar_req_l_ = b;
+
+      return true;
+    }
   
-  bar_req_l_ = b;
+  return false;
 
-  return true;
 }
 
 void
index 380cb651458965476d7045920b3e39d4006cb88f..455690e5165a34d02091e871b7fc330bfcf55eb7 100644 (file)
@@ -25,10 +25,8 @@ Bar_number_engraver::Bar_number_engraver()
 void
 Bar_number_engraver::acknowledge_element (Score_element_info i)
 {
-
-  Item *it=dynamic_cast <Item *> (i.elem_l_);
-  if (script_p_
-      || !it || !it->is_type_b (Bar::static_name()))
+  Bar *b =dynamic_cast <Bar *> (i.elem_l_);
+  if (script_p_ || !b)
       return;
 
   /* Only put numbers on bars that are at our own level (don't put
@@ -58,7 +56,7 @@ Bar_number_engraver::acknowledge_element (Score_element_info i)
       script_p_->break_priority_i_ = int (pri);
     }
   else
-    script_p_->break_priority_i_ = it->break_priority_i_;
+    script_p_->break_priority_i_ = b->break_priority_i_;
 
   Scalar padding = get_property ("barScriptPadding");
   if (padding.length_i() && padding.isnum_b ())
index 4ef398b499110aef61d9ee5a319586374c11ed3c..b8eb55903bed161e60dfa3a317a0bae5ecf5ae20 100644 (file)
@@ -25,11 +25,7 @@ Beam_engraver::Beam_engraver()
 bool
 Beam_engraver::do_try_request(Request*r)
 {
-  Musical_req* mus_l = dynamic_cast <Musical_req *> (r);
-  if (!mus_l)
-    return false;
-
-  Beam_req* b = dynamic_cast <Beam_req *> (mus_l);
+  Beam_req* b = dynamic_cast <Beam_req *> (r);
   if (!b)
     return false;
 
@@ -37,7 +33,7 @@ Beam_engraver::do_try_request(Request*r)
     return false;
 
   Direction d = (!beam_p_) ? LEFT : RIGHT;
-  if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (mus_l))
+  if (span_reqs_drul_[d] && !span_reqs_drul_[d]->equal_b (b))
     return false;
 
   span_reqs_drul_[d] = b;
@@ -97,10 +93,10 @@ Beam_engraver::do_removal_processing()
 void
 Beam_engraver::acknowledge_element (Score_element_info i)
 {
-  if (!beam_p_ || !i.elem_l_->is_type_b (Stem::static_name ()))
+  Stem* s = dynamic_cast<Stem *> (i.elem_l_);
+  if (!beam_p_ || !s)
     return;
 
-  Stem* s = (Stem*)dynamic_cast <Item *> (i.elem_l_);
   if (!dynamic_cast <Rhythmic_req *> (i.req_l_))
     {
       ::warning ( _("Stem must have Rhythmic structure."));
index a9dd24bda379306a3309e03769e52b883e604fab..4982dd3937d32c8599a1f9ffd7e008a43e65ed1c 100644 (file)
@@ -125,8 +125,9 @@ Beam::do_post_processing ()
 void
 Beam::do_substitute_dependent (Score_element*o,Score_element*n)
 {
-  if (o->is_type_b (Stem::static_name ()))
-      stems_.substitute ((Stem*)dynamic_cast <Item *> (o),  n? (Stem*) dynamic_cast <Item *> (n):0);
+  if (Stem * os = dynamic_cast<Stem*> (o))
+    stems_.substitute (os,
+                      dynamic_cast<Stem *> (n));
 }
 
 Interval
index 34c91c586c413bad45187422e17d3846bfed157a..8b691619ee15659a880ce8823a050693f45e7351 100644 (file)
@@ -24,7 +24,7 @@ Simultaneous_music_iterator::construct_children()
       if (mi->ok()) 
        {
          if  (simultaneous_music_l ()->translator_type_str_.empty_b ())
-           set_translator (mi->report_to_l()->ancestor_l (simultaneous_music_l ()->multi_level_i_));
+           set_translator (mi->report_to_l()->ancestor_l (0));
          children_p_list_.bottom().add (mi);
        }
       else 
index 462a9c140272e3dc89f91e570545a05707127bc0..83e6eff1e64eca0f498c6aea54ad934fea099a70 100644 (file)
@@ -14,8 +14,6 @@
 #include "debug.hh"
 #include "command-request.hh"
 #include "time-description.hh"
-
-
 #include "note-head.hh"
 #include "key-item.hh"
 #include "local-key-item.hh"
@@ -148,7 +146,7 @@ Clef_engraver::read_req (Clef_change_req*c_l)
 void
 Clef_engraver::acknowledge_element (Score_element_info info)
 {
-  if (info.elem_l_->is_type_b (Bar::static_name ()) 
+  if (dynamic_cast<Bar*>(info.elem_l_)
       && clef_type_str_.length_i())
     {
       create_clef();
@@ -158,24 +156,21 @@ Clef_engraver::acknowledge_element (Score_element_info info)
 
   /* ugh; should make Clef_referenced baseclass */
   Item * it_l =dynamic_cast <Item *> (info.elem_l_);
-if (it_l)
-  {
-  if (it_l->is_type_b (Note_head::static_name ()))
+  if (it_l)
     {
-      Note_head * h = (Note_head*)it_l;
-      h->position_i_ += c0_position_i_;
-    }
-  else if (it_l->is_type_b (Local_key_item::static_name ()))
-    {
-      Local_key_item *i = (Local_key_item*)it_l;
-      i->c0_position_i_ =c0_position_i_;
-    }
-  else if (it_l->is_type_b (Key_item::static_name ()))
-    {
-      Key_item *k = (Key_item*)it_l;
-      k-> set_c_position (c0_position_i_);
-    }
-  } 
+      if (Note_head * h = dynamic_cast<Note_head*>(it_l))
+       {
+         h->position_i_ += c0_position_i_;
+       }
+      else if (Local_key_item *i = dynamic_cast<Local_key_item*> (it_l))
+       {
+         i->c0_position_i_ =c0_position_i_;
+       }
+      else if (Key_item *k = dynamic_cast<Key_item*>(it_l))
+       {
+         k-> set_c_position (c0_position_i_);
+       }
+    } 
 }
 
 void
@@ -195,13 +190,15 @@ Clef_engraver::do_creation_processing()
 bool
 Clef_engraver::do_try_request (Request * r_l)
 {
-  Command_req* creq_l= dynamic_cast <Command_req *> (r_l);
-  if (!creq_l || !dynamic_cast <Clef_change_req *> (creq_l))
+  if (Clef_change_req *cl = dynamic_cast <Clef_change_req *> (r_l))
+    {
+      clef_req_l_ = cl;
+      read_req (clef_req_l_);
+      return true;
+    }
+  else
     return false;
 
-  clef_req_l_ = dynamic_cast <Clef_change_req *> (creq_l);
-  read_req (clef_req_l_);
-  return true;
 }
 
 void
index d7c6a102abbe2a4f79a9965c9f7747b57f1a051b..a0d5dc1006371a131a33630c1a91a75ed1d3ebf9 100644 (file)
@@ -28,9 +28,8 @@ Collision_engraver::process_acknowledged ()
 void
 Collision_engraver::acknowledge_element (Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Note_column::static_name ()))
+  if (Note_column * c = dynamic_cast<Note_column *> (i.elem_l_))
     {
-      Note_column * c = (Note_column*) dynamic_cast <Item *> (i.elem_l_);
       if (c->rest_b ())
        return ;
 
index 3a07ce18e1374f84e9842ca49764973f53fda7bc..a9971951b92c19304a06f1bed1e5c8bfd4ba7cc3 100644 (file)
@@ -18,6 +18,7 @@ Collision::Collision()
 void
 Collision::add_column (Note_column* ncol_l)
 {
+  // ugh.  Fixme.
   clash_l_arr_.push (ncol_l);
   add_element (ncol_l);
   add_dependency (ncol_l);
@@ -165,6 +166,10 @@ IMPLEMENT_IS_TYPE_B1(Collision, Item);
 void
 Collision::do_substitute_dependency (Score_element*o_l,Score_element*n_l)
 {
-  clash_l_arr_.substitute ((Note_column*)dynamic_cast <Item *> (o_l),
-                          (Note_column*)(n_l?dynamic_cast <Item *> (n_l):0));
+  if (o_l)
+    {
+      clash_l_arr_.substitute (dynamic_cast<Note_column *> (o_l),
+                              dynamic_cast <Note_column *> (n_l));
+
+    }
 }
index e407f30661c759d029d3e3b8a56fb9e3dd9fc49e..5a67560e45f16c8fd3ac7935ddbcbe16ed4a64fc 100644 (file)
@@ -33,8 +33,7 @@ bool
 Cadenza_req::do_equal_b (Request*r) const
 {
   Cadenza_req*cad =  dynamic_cast <Cadenza_req *> (r);
-
-  return cad->on_b_ == on_b_;
+  return cad && cad->on_b_ == on_b_;
 }
 
 Cadenza_req::Cadenza_req (bool b)
@@ -48,7 +47,7 @@ bool
 Bar_req::do_equal_b (Request*r) const
 {
   Bar_req * b = dynamic_cast <Bar_req *> (r);
-  return type_str_ == b->type_str_;
+  return b && type_str_ == b->type_str_;
 }
 
 
@@ -83,7 +82,7 @@ Partial_measure_req::do_equal_b (Request* r) const
 {
   Partial_measure_req *p = dynamic_cast <Partial_measure_req *> (r);
 
-  return p->duration_ == duration_;
+  return p&& p->duration_ == duration_;
 }
 
 
@@ -104,9 +103,10 @@ void
 Barcheck_req::do_print() const{}
 
 bool
-Barcheck_req::do_equal_b (Request*) const
+Barcheck_req::do_equal_b (Request*r) const
 {
-  return true;
+  Barcheck_req *b = dynamic_cast<Barcheck_req*> (r);
+  return r;
 }
 
 
@@ -152,7 +152,7 @@ Time_signature_change_req::do_equal_b (Request * r) const
 {
   Time_signature_change_req * m = dynamic_cast <Time_signature_change_req *> (r);
 
-  return m->beats_i_ == beats_i_
+  return m && m->beats_i_ == beats_i_
     && one_beat_i_ == m->one_beat_i_;
 }
 
@@ -181,7 +181,7 @@ Tempo_req::do_equal_b (Request *r) const
 {
   Tempo_req *t = dynamic_cast <Tempo_req *> (r);
 
-  return t->dur_.length()== dur_.length () && metronome_i_ == t->metronome_i_;
+  return t&& t->dur_.length()== dur_.length () && metronome_i_ == t->metronome_i_;
 }
 
 
index ae6259ac4c20517f11b7f00965bac3795aacf6c1..771963e3486929b45d9bb50b9fdf260169ad1d06 100644 (file)
@@ -30,13 +30,10 @@ Dot_column_engraver::do_pre_move_processing ()
 void
 Dot_column_engraver::acknowledge_element (Score_element_info info)
 {
-  Item * i=dynamic_cast <Item *> (info.elem_l_);
-  
-  if (! (i && i->is_type_b (Rhythmic_head::static_name ())))
+  Rhythmic_head * h = dynamic_cast<Rhythmic_head*>(info.elem_l_);
+  if (!h)
       return;
 
-  Rhythmic_head * h = (Rhythmic_head*)i;
-  
   if (!h->dots_l_)
     return;
 
index cee8a3edec21470a64a8d467b31b5d3faae9976b..284b746cc946841ec581cc52cbd3ccdc92f47ddb 100644 (file)
@@ -33,12 +33,13 @@ void
 Dot_column::do_substitute_dependency (Score_element*o,Score_element*n)
 {
   Item *oi =dynamic_cast <Item *> (o);
-  Item *ni = n?dynamic_cast <Item *> (n):0;
   
-  if (oi&&oi->is_type_b (Rhythmic_head::static_name ()))
-    head_l_arr_.substitute ((Rhythmic_head*)oi, (Rhythmic_head*)ni);
-  else if (oi && oi->is_type_b (Dots::static_name ()))
-    dot_l_arr_.substitute ((Dots*) oi, (Dots*) ni);
+  if (oi && dynamic_cast<Rhythmic_head *> (oi))
+    head_l_arr_.substitute (dynamic_cast<Rhythmic_head*> (oi),
+                           dynamic_cast<Rhythmic_head*>(n));
+  else if (oi && dynamic_cast<Dots *> (oi))
+    dot_l_arr_.substitute (dynamic_cast<Dots*> (oi),
+                          dynamic_cast<Dots*> (n));
 }
 
 void
index 2b38c4c08eec52421e1b5bd141a116d7773d0ff4..e0f26807487d36ddc06652a90fcc0090db49bf82 100644 (file)
@@ -34,24 +34,16 @@ Dynamic_engraver::do_post_move_processing()
 bool
 Dynamic_engraver::do_try_request (Request * r)
 {
-  Musical_req * m = dynamic_cast <Musical_req *> (r);
-  if (!m)
-    return false;
-  Dynamic_req * d = dynamic_cast <Dynamic_req *> (m);
-  if (!d)
-    return false;
-
-#if 0
-  if (cresc_p_ && dynamic_cast <Span_dynamic_req *> (d)
-      && dynamic_cast <Span_dynamic_req *> (d)->spantype == Span_req::START)
-    return false;
-#endif
-  for (int i=0; i < dynamic_req_l_arr_.size (); i++)
-    if (d->equal_b (dynamic_req_l_arr_[i]))
+  if(Dynamic_req * d = dynamic_cast <Dynamic_req *> (r))
+    {
+      for (int i=0; i < dynamic_req_l_arr_.size (); i++)
+       if (d->equal_b (dynamic_req_l_arr_[i]))
+         return true;
+      
+      dynamic_req_l_arr_.push (d);
       return true;
-
-  dynamic_req_l_arr_.push (dynamic_cast <Dynamic_req *> (m));
-  return true;
+    }
+  return false;
 }
 void
 Dynamic_engraver::do_process_requests()
@@ -60,7 +52,7 @@ Dynamic_engraver::do_process_requests()
   for (int i=0; i < dynamic_req_l_arr_.size(); i++)
     {
       Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
-      if (dynamic_cast <Absolute_dynamic_req *> (dreq_l))
+      if (Absolute_dynamic_req *absd = dynamic_cast<Absolute_dynamic_req *> (dreq_l))
        {
 
          if (dynamic_p_)
@@ -71,8 +63,8 @@ Dynamic_engraver::do_process_requests()
          
          Text_def * td_p = new Text_def;
          td_p->align_dir_ = CENTER;
-         String loud = dynamic_cast <Absolute_dynamic_req *> (dreq_l)->loudness_str ();
-         td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_;
+         String loud = absd->loudness_str ();
+         td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
          td_p->style_str_ = "dynamic";
 
          
@@ -80,9 +72,8 @@ Dynamic_engraver::do_process_requests()
          dynamic_p_ = new Text_item (td_p);
          announce_element (Score_element_info (dynamic_p_, dreq_l));
        }
-      else if (dynamic_cast <Span_dynamic_req *> (dreq_l))
+      else if (Span_dynamic_req *span_l = dynamic_cast <Span_dynamic_req *> (dreq_l))
        {
-         Span_dynamic_req* span_l = dynamic_cast <Span_dynamic_req *> (dreq_l);
          if (span_l->spantype == Span_req::STOP)
            {
              if (!cresc_p_)
@@ -188,7 +179,7 @@ Dynamic_engraver::do_removal_processing ()
 void
 Dynamic_engraver::acknowledge_element (Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Note_column::static_name ()))
+  if (dynamic_cast<Note_column *> (i.elem_l_))
     {
       if (dynamic_p_)
        dynamic_p_->add_support (i.elem_l_);
index 8a79b6034624437b24ed07b99626e2409683c4e7..8fccb6a84dd7080e875e533e39db5135650458c1 100644 (file)
@@ -57,6 +57,6 @@ Engraver_group_engraver*
 Engraver::daddy_grav_l () const
 {
   return (daddy_trans_l_ )
-       ? (Engraver_group_engraver*) dynamic_cast <Engraver *> (daddy_trans_l_)
+       ? dynamic_cast<Engraver_group_engraver *> (daddy_trans_l_)
        : 0;
 }
index d85437a921f80d3bb7e6147714ca581c18f90b19..16619f83c83f377b38fa446447ec6a1c099bee16 100644 (file)
@@ -24,10 +24,11 @@ Hara_kiri_line_group_engraver::create_line_spanner ()
 void
 Hara_kiri_line_group_engraver::typeset_element(Score_element * e)
 {
-  if (e->is_type_b (Note_head::static_name ()))
-    ((Hara_kiri_vertical_group_spanner*)staffline_p_)->add_note 
-      ((Note_head*)dynamic_cast <Item *> (e));
-
+  if (Note_head *h = dynamic_cast<Note_head *> (e))
+    {
+      dynamic_cast<Hara_kiri_vertical_group_spanner*> (staffline_p_)
+       ->add_note  (h);
+    }
   Line_group_engraver_group::typeset_element (e);
 }
 
index 38468cf91cf8677ad8e3d033e79ebb6500f17d7e..9a31e52bcabf7c5efa98478b53beedeaea3e26e5 100644 (file)
@@ -43,9 +43,9 @@ Hara_kiri_vertical_group_spanner::do_post_processing ()
 void
 Hara_kiri_vertical_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n)
 {
-  if (o->is_type_b (Note_head::static_name ()))
-    head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o), 
-      (n)? (Note_head*)dynamic_cast <Item *> (n) : 0);
+  if (dynamic_cast<Note_head *> (o))
+    head_l_arr_.substitute (dynamic_cast<Note_head *> (o), 
+      (n)? dynamic_cast<Note_head *> (n) : 0);
 }
 
 
index ce4e5dcdf37bbd3439f20c76fc70f5bf3652d3dd..4b0a3b06fd5fa912505e8286d192044d8b02c38e 100644 (file)
@@ -23,11 +23,12 @@ Note_head_engraver::do_try_request (Request *req_l)
   if (note_req_l_)
     return false;
   
-  if (!(dynamic_cast <Note_req *> (req_l)))
-    return false;
-  
-  note_req_l_=dynamic_cast <Rhythmic_req *> (req_l);
-  return true;
+  if (Note_req * nr = dynamic_cast <Note_req *> (req_l))
+    {
+      note_req_l_= nr;
+      return true;
+    }
+  return false;
 }
 
 void
index a8e0aaa46b8e43f9edead8176020730159c64d0a..1fc262710232e13341a034d28f12ee7d3bc1f368 100644 (file)
@@ -18,15 +18,12 @@ Note_heads_engraver::Note_heads_engraver()
 bool
 Note_heads_engraver::do_try_request (Request *req_l) 
 {
-  if (!dynamic_cast <Musical_req *> (req_l)) 
-    return false;
-
-  Note_req * n =dynamic_cast <Note_req *> (req_l);
-  if (!n)
-    return false;
-  
-  note_req_l_arr_.push (n);
-  return true;
+  if (Note_req * n =dynamic_cast <Note_req *> (req_l))
+    {
+      note_req_l_arr_.push (n);
+      return true;
+    }
+  return false;
 }
 
 void
@@ -49,7 +46,7 @@ Note_heads_engraver::do_process_requests()
          dot_p_arr_.push (d);
        }
 
-      note_p->position_i_ = dynamic_cast <Note_req *> (note_req_l)->pitch_.steps ();
+      note_p->position_i_ = note_req_l->pitch_.steps ();
 
   
       Score_element_info itinf (note_p,note_req_l);
index bdd40f69a47a7995dca5204ef33622f4f84f0a80..d09749daedef762321247ae676809ebb572311a6 100644 (file)
@@ -77,7 +77,7 @@ Identifier::do_print () const
 #define DEFAULT_PRINT(Class) \
 void \
 Class ## _identifier::do_print () const { \
-  Class *cl = ((Class ## _identifier *)this)->access_ ## Class(false);\
+  Class *cl = ((Class ## _identifier *)this)->access_content_ ## Class(false);\
   cl->print (); \
 }
 
@@ -143,14 +143,14 @@ DEFAULT_STR(String);
 
 #define DEFAULT_ACCESSOR(Class)\
 Class*\
-Class ## _identifier::access_ ## Class (bool copy_b) const {\
+Class ## _identifier::access_content_ ## Class (bool copy_b) const {\
   ((Class ## _identifier*)this)->accessed_b_ = true;\
   return copy_b ? new Class (*data_p_) : data_p_;\
 }
 
 #define VIRTUAL_ACCESSOR(Class)\
 Class*\
-Class ## _identifier::access_ ## Class (bool copy_b) const{\
+Class ## _identifier::access_content_ ## Class (bool copy_b) const{\
   ((Class ## _identifier*)this)->accessed_b_ = true;\
   return copy_b ? (Class*)data_p_->clone() : data_p_;\
 }
@@ -166,7 +166,7 @@ Class ## _identifier::access_ ## Class (bool copy_b) const{\
 Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \
   : Identifier (s)\
 {\
-   data_p_ = s.access_ ## Class (true);\
+   data_p_ = s.access_content_ ## Class (true);\
 } 
 
 
index f9621382bc3145370371b23ebe53808b1e53244e..1fd7ef262c91113a61c7eab2eaee858f19eebf2c 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef ATOM_HH
 #define ATOM_HH
 
-#include "lily-guile.hh"
+#include "protected-scm.hh"
 #include "string.hh"
 #include "box.hh"
 #include "lily-proto.hh"
 /// a symbol which can be translated, and freely copied
 class Atom {
   Offset off_;
+
+  
 public:
+  Protected_scm lambda_;
+  Score_element * origin_l_;
+
   // urg, only used as a temp buffer
   String str_;
   String font_;
-  SCM lambda_;
   Box dim_;
 
   Offset offset () const;
index f1389deebdb33d28d018f6468f24ffeed92dd208..f753b9015f09cdb30e8bb919ae3b671135a7ff2f 100644 (file)
@@ -24,7 +24,6 @@ protected:
   virtual Link_array<Score_element> get_extra_dependencies() const;
   virtual void do_unlink();
   virtual void do_junk_links();
-  virtual Axis_group_element * access_Axis_group_element ();
 
 public:
   virtual Link_array<Score_element> elem_l_arr() const;
index a0afdc8f5e996765fa9bc54dce9d2fee455e8ea3..96c010322bcd41aad7502fc8415861d733ac6309 100644 (file)
@@ -21,18 +21,6 @@ class Command_req  : public virtual Request  {
 public:
   REQUESTMETHODS(Command_req);
 
-    DEFAULTACCESSOR(Measure_grouping_req)
-    DEFAULTACCESSOR(Clef_change_req)
-    DEFAULTACCESSOR(Key_change_req)
-    DEFAULTACCESSOR(Partial_measure_req)
-    DEFAULTACCESSOR(Time_signature_change_req)
-    DEFAULTACCESSOR(Bar_req)
-    DEFAULTACCESSOR(Cadenza_req)
-    DEFAULTACCESSOR(Timing_req)
-    DEFAULTACCESSOR(Command_script_req)
-    DEFAULTACCESSOR(Break_req)
-    DEFAULTACCESSOR(Mark_req)
-  DEFAULTACCESSOR(Bracket_req)
 };
 
 
@@ -64,7 +52,6 @@ public:
 class Timing_req  : public Command_req  {
 public:
   REQUESTMETHODS(Timing_req);
-  DEFAULTACCESSOR(Tempo_req)
 };
 
 
index 9dc6594c8eaaca34f5d98830806a7f7e850c57cc..1b73406b84653c7e4b0bf5ad51c59a07ede6f18b 100644 (file)
@@ -71,7 +71,6 @@ public:
   Engraver () {}
 
   DECLARE_MY_RUNTIME_TYPEINFO;
-  virtual Engraver * access_Engraver () { return this; }
 };
 
 
index 3a57588a7d3e9162af42a1da6d23df9a4448cff2..d6bd8babe62b225178a9d865b3e6706c1a433c1f 100644 (file)
@@ -32,8 +32,6 @@ class Graphical_element
   bool cached_valid_b_a_[NO_AXES];
 public:
 
-  // suck me plenty
-  virtual Score_element* access_Score_element () { return 0; }
   void set_empty (bool);
 
   bool empty_b () const;
index cb36305966495f2bda9fcc96c0de0475d9ce0034..66644eeef3898a2c93bd3abf5b913f241a7fad67 100644 (file)
@@ -32,8 +32,8 @@ class Duration_identifier;
 
 
 #define IDACCESSOR(Class)\
-virtual Class *  access_ ## Class (bool=true) const { error (#Class  + String ("_identifier")); return 0; }\
-virtual Class ## _identifier * access_ ## Class ## _identifier () { return 0; }
+virtual Class *  access_content_ ## Class (bool) const { error (#Class  + String ("_identifier")); return 0; }\
+
 
 /**
    A declarable data structure in mudela. 
@@ -78,11 +78,7 @@ struct Class ## _identifier : Identifier {\
                             Class ## _identifier (Class ## _identifier const&);\
                             Class ## _identifier (Class*st, int code);\
                             VIRTUAL_COPY_CONS (Class ## _identifier, Identifier);\
-                            virtual Class ## _identifier * access_ ## Class ## _identifier ()\
-    {\
-      return this;\
-    }\
-                            virtual Class* access_ ## Class (bool copy_b) const;\
+                            virtual Class* access_content_ ## Class (bool copy_b) const;\
                             ~Class ## _identifier();\
                             virtual void do_print () const; \
                             virtual String do_str () const; \
index bd38edcc0f1cd54ff968f6f68ef1326a7e500b85..ec0e1ae0988203db3a3ae324d98dc6b14f26cac3 100644 (file)
@@ -40,7 +40,6 @@ public:
   Item * find_prebroken_piece (Direction) const;
   Item * find_prebroken_piece (Line_of_score*) const;    
 
-  virtual Item *access_Item() ;
   Item();
   Real hpos_f() const;
   DECLARE_MY_RUNTIME_TYPEINFO;
index 56ce820c7ee44bb87aebb0ce46ca20b13cafff44..c4479cb5674d50c31baff8c1b4ec36ba9a2e43bf 100644 (file)
@@ -40,4 +40,7 @@ SCM ly_quote ();
 SCM lambda_scm (String str, Array<Real> args_arr);
 SCM lambda_scm (String str, Array<Scalar> args_arr);
 
+
+
+
 #endif // LILY_GUILE_HH
index 29a5f92390160778e235800a20f1dd40dde73cd0..df77b0f02878924915e46b214d9e526a9b3ec5ac 100644 (file)
 class Lyric_performer : public Performer {
 public:
   TRANSLATOR_CLONE(Lyric_performer);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Lyric_performer();
-    ~Lyric_performer();
+  DECLARE_MY_RUNTIME_TYPEINFO;
 
 protected:
-    void do_print() const;
-    virtual bool do_try_request (Request* req_l);
-    virtual void do_process_requests();
+  void do_print() const;
+  virtual bool do_try_request (Request* req_l);
+  virtual void do_process_requests();
 
 private:
-    Array<Lyric_req*> lreq_arr_;
+  Array<Lyric_req*> lreq_arr_;
 };
 
 #endif // LYRIC_PERFOMER_HH
index 6cdda3dc5b816b04cd33a133c100f48d19f0bcd7..477ab2465ffbab164d3c2f89eb246736e342b823 100644 (file)
@@ -30,7 +30,6 @@ public:
 class Music_sequence : public Music
 {
 public:
-  int multi_level_i_;
   Music_list * music_p_list_p_;
 
   Music_sequence (Music_sequence const&);
index 2f3c3f599c57f2f6ca630fc0df26fb60b30adb7c..d280d158acab436876ceee114b4b70db9a8280b8 100644 (file)
 class Musical_req  : public virtual Request  {
 public:
 
-  DEFAULTACCESSOR(Lyric_req)
-  DEFAULTACCESSOR(Note_req )
-  DEFAULTACCESSOR(Stem_req )
-  DEFAULTACCESSOR(Melodic_req )
-  DEFAULTACCESSOR(Slur_req )
-  DEFAULTACCESSOR(Beam_req )
-  DEFAULTACCESSOR(Abbreviation_beam_req)
-  DEFAULTACCESSOR(Rhythmic_req)
-  DEFAULTACCESSOR(Musical_script_req)
-  DEFAULTACCESSOR(Text_req)
-  DEFAULTACCESSOR(Rest_req )
-  DEFAULTACCESSOR(Skip_req)
-  DEFAULTACCESSOR(Dynamic_req)
-  DEFAULTACCESSOR(Absolute_dynamic_req )
-  DEFAULTACCESSOR(Tie_req)
-  DEFAULTACCESSOR(Musical_span_req)
-  DEFAULTACCESSOR(Plet_req)
-  DEFAULTACCESSOR(Span_dynamic_req )
-  DEFAULTACCESSOR(Abbreviation_req)
-  DEFAULTACCESSOR(Multi_measure_rest_req)
+
   REQUESTMETHODS(Musical_req);
 };
 
@@ -131,7 +112,6 @@ public:
   bool forceacc_b_;
   Note_req();
   bool do_equal_b (Request*) const;
-  Rhythmic_req* access_Rhythmic_req () { return Rhythmic_req::access_Rhythmic_req (); }
   REQUESTMETHODS(Note_req);
 };
 
index 61fd1d2aba40890deeb0d39bad10ceb590534192..75fbeccf7eec1ec6107d40a5894d3b82e5b89291 100644 (file)
@@ -27,7 +27,6 @@ public:
 protected:
   virtual int get_tempo_i() const;
   virtual void play (Audio_element * elem_p );
-  Performer * access_Performer () { return this; }
 };
 
 
diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh
new file mode 100644 (file)
index 0000000..e83593a
--- /dev/null
@@ -0,0 +1,30 @@
+/*   
+  protected-scm.hh -- declare Protected_scm
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef PROTECTED_SCM_HH
+#define PROTECTED_SCM_HH
+
+#include "lily-guile.hh"
+
+/*
+  Mix GUILE GC with C++ ctors and dtors. 
+ */
+class Protected_scm
+{
+  SCM object_;
+public:
+  Protected_scm ();
+  Protected_scm (SCM);
+  Protected_scm (Protected_scm const &);
+  ~Protected_scm ();
+  Protected_scm &operator = (Protected_scm const &);
+  operator SCM ();
+};
+
+#endif /* PROTECTED_SCM_HH */
index 7d976a648e5dfe7b015bdb35571ed4ff7481cf6e..4394fce306e9e37fd7ba461f0c78275b63b9d4ab 100644 (file)
@@ -17,8 +17,6 @@
 #include "music.hh"
 #include "direction.hh"
 
-#define DEFAULTACCESSOR(T)  virtual T *access_ ## T () { return 0; }
-
 
 /** An atom of musical information.  This is an abstract class for any
   piece of music that does not contain other Music.
@@ -35,17 +33,6 @@ public:
   DECLARE_MY_RUNTIME_TYPEINFO;
   VIRTUAL_COPY_CONS(Request,Music);
     
-  /*  accessors for children
-      maybe checkout RTTI
-  */
-
-  DEFAULTACCESSOR(Barcheck_req)
-  DEFAULTACCESSOR(Script_req)
-  DEFAULTACCESSOR(Span_req)
-  DEFAULTACCESSOR(Spacing_req)
-  DEFAULTACCESSOR(Musical_req)
-  DEFAULTACCESSOR(Command_req)
-    
   bool equal_b (Request*) const;
 protected:
   virtual bool do_equal_b (Request*) const;
@@ -54,7 +41,6 @@ protected:
 
 
 #define REQUESTMETHODS(T)      \
-virtual T * access_ ## T() { return this;}\
 DECLARE_MY_RUNTIME_TYPEINFO;\
 VIRTUAL_COPY_CONS(T, Request);\
 virtual void do_print() const
index e9ea8aff9910f52a9bfd76e7365ac934474d6e9d..4ad95c73718c13835cbcee0b565e46a59a496e84 100644 (file)
@@ -52,16 +52,6 @@ public:
     */
   void add_dependency (Score_element*);    
 
-  /*
-    virtual accessors
-    */
-
-  virtual Spanner* access_Spanner ()  { return 0; }
-  virtual Span_bar* access_Span_bar ()  { return 0; }
-  virtual Axis_group_element * access_Axis_group_element () { return 0; }
-  virtual Score_element* access_Score_element () { return this; }
-  
-  virtual Item * access_Item () { return 0; }
   virtual Line_of_score * line_l () const;
   virtual bool linked_b () const;
   SCORE_ELEMENT_CLONE (Score_element);
index 1aec5715141053a08e59daa4c2a0afd433b100c7..825d1d8cbe7a810937d8becaed87495a9e12bf3d 100644 (file)
@@ -20,7 +20,6 @@ public:
     Span_bar();
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEMENT_CLONE(Span_bar);
-    virtual Span_bar* access_Span_bar ();
     void add_bar (Bar*);
     void set_align (Align_element *);
 
index 1cad1d8ebb24f97afa1522da6f2f87d567e38148..255b21eaa82a245e10d81b48bceaa0227a3551ae 100644 (file)
@@ -38,7 +38,6 @@ public:
   void set_bounds (Direction d, Item*);
 
   DECLARE_MY_RUNTIME_TYPEINFO;
-  virtual Spanner* access_Spanner ();
   Spanner ();
   Spanner (Spanner const &);
   bool broken_b () const;
index defcd15bc3d8cbfe7bdf61d26bd34a68e0682e8c..33390810ced06f6ccc14a3d4d6facd1edd7ba044 100644 (file)
 
 class Spring_spacer : public Line_spacer {
   friend class Durations_iter;
-  
-    
+
   Pointer_list<Idealspacing *> ideal_p_list_;
   Array<Column_info> cols_;
   Array<Column_info> loose_col_arr_;
-  Array<Spacer_rod> rods_;
+
   
   /// mark column #i# as being loose.
   void loosen_column (int i);
index 18aa404ab57e5e9b2a7e26663a3a13f075c5008b..cc52fa13c0a9684e77859b9f120e96f17671a976 100644 (file)
@@ -19,7 +19,6 @@ class Timing_engraver : public Timing_translator, public Engraver
 {   
 protected:
   virtual void fill_staff_info (Staff_info&);
-  virtual Engraver * access_Engraver () { return Engraver::access_Engraver (); }
 public:
   TRANSLATOR_CLONE(Timing_engraver);
   DECLARE_MY_RUNTIME_TYPEINFO;
index 1b1f05f004c695b3906a96332cc63ef39ef90439..fb1c8e2d23c2fd4aaebcefe0fc90e11396eaf3d9 100644 (file)
@@ -33,8 +33,6 @@ public:
   String id_str_;
 
 
-  
-  
   int iterator_count_;
 
   TRANSLATOR_CLONE(Translator_group);
@@ -72,7 +70,6 @@ public:
   Translator_group*get_default_interpreter();
 protected:
   virtual ~Translator_group ();
-  virtual Translator_group * access_Translator_group () { return this; }
   virtual void do_print () const;
   virtual void do_process_requests ();
   virtual void do_add_processing ();
index 57d45e4d982a5f1d5b933aeb8c5c6399dcbe8759..b0257a4448d6c041aa6e93a076a612e21075b9b0 100644 (file)
@@ -66,9 +66,6 @@ public:
   Music_output_def *output_def_l () const;
   
   virtual Moment now_moment () const;  
-  virtual Engraver *access_Engraver () { return 0; }
-  virtual Performer *access_Performer() { return 0; }
-  virtual Translator_group * access_Translator_group () { return 0; }
 
 protected:
    enum { 
index 53eb7ea04ab6d6cd9240e55101b6c69c6692a883..27bac3d661e49e96302cb27088d6367bc2373bf4 100644 (file)
 #define TYPESWALLOW_GRAV_HH
 
 #include "translator.hh"
+
 /// eat a certain type of request
 class Type_swallow_translator : public virtual Translator
 {
 protected:
-  const char * type_;
+  const type_info * type_;
   bool do_try_request (Request*);
 public:
   DECLARE_MY_RUNTIME_TYPEINFO;
@@ -26,7 +27,7 @@ public:
 #define DECLARE_REQUEST_SWALLOWER(TYPE)  \
 struct TYPE ## _swallow_translator : public Type_swallow_translator {\
   TYPE ## _swallow_translator() { \
-    type_ = TYPE::static_name ();\
+    type_ = &typeid (TYPE);\
   }\
   DECLARE_MY_RUNTIME_TYPEINFO;\
   TRANSLATOR_CLONE(TYPE ## _swallow_translator);\
index e48d576cfd524635a5416901d5c60db695e00527..ad00cb3685660985070b01cc523388db75d4a97e 100644 (file)
@@ -129,10 +129,10 @@ Item::handle_prebroken_dependencies()
 int
 Item::left_right_compare(Item const *l, Item const *r)
 {
-  while (!l->is_type_b (Paper_column::static_name ()))
-    l = dynamic_cast<Item*> (l->axis_group_l_a_[X_AXIS]);
-  while (!r->is_type_b (Paper_column::static_name ()))
-    r = dynamic_cast<Item*> (r->axis_group_l_a_[X_AXIS]);
+  while (!(dynamic_cast<Paper_column const *> (l)))
+    l = dynamic_cast<Item const*> (l->axis_group_l_a_[X_AXIS]);
+  while (!(dynamic_cast<Paper_column const *> (r)))
+    r = dynamic_cast<Item const*> (r->axis_group_l_a_[X_AXIS]);
 
   Paper_column *p1 = (Paper_column*)l;
   Paper_column* p2 = (Paper_column*)r;
@@ -190,8 +190,3 @@ Item::Item (Item const &s)
   break_priority_i_ = s.break_priority_i_;
 }
 
-Item *
-Item::access_Item ()
-{
-  return this; 
-}
index bb66802d8604f6045f07449fe4ea758a8ef9e52f..77a29425f55ea91ea0da7ea0dae7c8e13c548393 100644 (file)
@@ -36,29 +36,27 @@ Key_engraver::create_key ()
 bool
 Key_engraver::do_try_request (Request * req_l)
 {
-  Command_req* creq_l= dynamic_cast <Command_req *> (req_l);
-  if (!creq_l|| !dynamic_cast <Key_change_req *> (creq_l))
-    return false;
-   
-  if (keyreq_l_)
-    return false;              // TODO
-  keyreq_l_ = dynamic_cast <Key_change_req *> (creq_l);
-  read_req (keyreq_l_);
-  return true;
+  if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
+    {
+      if (keyreq_l_)
+       warning ("Fixme: key change merge.");
+      keyreq_l_ = kc;
+      read_req (keyreq_l_);
+      return true;
+    }   
+  return  false;
 }
 
 void
 Key_engraver::acknowledge_element (Score_element_info info)
 {
-  Command_req * r_l = dynamic_cast <Command_req *> (info.req_l_) ;
-
-  if (r_l && dynamic_cast <Clef_change_req *> (r_l)) 
+  if (dynamic_cast <Clef_change_req *> (info.req_l_)) 
     {
       int i= get_property ("createKeyOnClefChange").length_i ();
       if (i)
        create_key ();
     }
-  else if (info.elem_l_->is_type_b (Bar::static_name ())
+  else if (dynamic_cast<Bar *> (info.elem_l_)
           && accidental_idx_arr_.size ()) 
     {
       if (!keyreq_l_)
index 3ccac03e21537a71d0b589984c1624838e53638c..b163e4022fc17d229d967d1e9e6b20ede1d37a4f 100644 (file)
@@ -29,7 +29,7 @@ Key_performer::do_print() const
 {
 #ifndef NPRINT
   if (key_req_l_)
-       key_req_l_->print();
+    key_req_l_->print();
 #endif
 }
 
@@ -37,19 +37,19 @@ void
 Key_performer::do_process_requests()
 {
   if (key_req_l_)
-       play (new Audio_key (key_req_l_));
+    play (new Audio_key (key_req_l_));
   key_req_l_ = 0;
 }
 
 bool
 Key_performer::do_try_request (Request* req_l)
 {
-  if (key_req_l_)
-       return false;
-
-  if (dynamic_cast <Key_change_req *> (req_l))
+  if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
     {
-      key_req_l_ = dynamic_cast <Key_change_req*> (req_l);
+      if (key_req_l_)
+       warning ("FIXME. Key change merge");
+
+      key_req_l_ = kc;
       return true;
     }
 
index 43fffba4849f405b0d1100f55d7055afc2f40fe4..b61c4c197553e7824110a8775b832bb9a9faeee2 100644 (file)
@@ -89,7 +89,6 @@ HORIZONTALWHITE               [ \t]
 BLACK          [^ \n\t\f\r]
 RESTNAME       [rs]
 NOTECOMMAND    \\{A}+
-ANDREWLYRICS           ([^ \n\t\f\\{}<>0-9";.|]|\\[^a-zA-Z\]\[<>])[^0-9 \t\n\f]
 LYRICS         ({AA}|{TEX})[^0-9 \t\n\f]*
 ESCAPED                [nt\\'"]
 PLET           \\\[
@@ -159,10 +158,10 @@ TELP              \\\]
        Identifier * id = lookup_identifier (s);
        if (id) 
          {
-           String* s_p = id->access_String ();
-           DOUT << "#include `" << *s_p << "\'\n";
-           new_input (*s_p, source_global_l);
-           delete s_p;
+           String* s_l = id->access_content_String (false);
+           DOUT << "#include `" << *s_l << "\'\n";
+           new_input (*s_l, source_global_l);
+
            yy_pop_state ();
          }
        else
index daa7588554908930a8eb8376e471f8da18baa993..375ff4635952c945e3eafb18b2441cf1cb3973f7 100644 (file)
@@ -97,3 +97,4 @@ lambda_scm (String str, Array<Real> args_arr)
   return scm;
 }
 
+
index 54df397c45339fde06195a0472f54f8ce255b008..9b0658b6473e7c85a6bfd1e002361ef5a631564b 100644 (file)
@@ -40,7 +40,7 @@ Local_key_engraver::do_creation_processing ()
     }
   else
     {
-      key_C_ = &((Key_engraver*)dynamic_cast <Engraver *> (result))->key_;
+      key_C_ = &(dynamic_cast<Key_engraver *> (result))->key_;
       local_key_ = *key_C_;
     }
 }
@@ -96,23 +96,20 @@ Local_key_engraver::do_pre_move_processing()
 void
 Local_key_engraver::acknowledge_element (Score_element_info info)
 {    
-  Score_element * elem_l = info.elem_l_;
-  Item * item_l = dynamic_cast <Item *> (elem_l);
-
   Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
-
-  if (note_l &&  item_l && item_l->is_type_b (Note_head::static_name ()))
+  Note_head * note_head = dynamic_cast<Note_head *> (info.elem_l_);
+  
+  if (note_l && note_head)
     {
       mel_l_arr_.push (note_l);
-      support_l_arr_.push (item_l);
+      support_l_arr_.push (note_head);
     }
   else if (dynamic_cast <Key_change_req*> (info.req_l_))
     {
       local_key_ = *key_C_;
     }
-  else if (elem_l->is_type_b (Tie::static_name ())) 
+  else if (Tie * tie_l = dynamic_cast<Tie *> (info.elem_l_))
     {
-      Tie * tie_l = (Tie*)dynamic_cast <Spanner *> (elem_l);
       if (tie_l->same_pitch_b_)
        tied_l_arr_.push (tie_l-> head_l_drul_[RIGHT]);
     }
index a8a4af3dd5d35f02efe1b0c5682634f314a0beff..c763bb56e1a97ad8093477232ae0fd5bd2faca02 100644 (file)
@@ -86,7 +86,7 @@ Lookup::afm_find (String s) const
   a.dim_[Y_AXIS] *= 1 / 1000.0;
   Array<Real> arr;
   arr.push (m.code ());
-  a.lambda_ = lambda_scm ("char", arr);
+  a.lambda_ =  (lambda_scm ("char", arr));
   a.font_ = font_;
   return a;
 }
@@ -106,7 +106,7 @@ Lookup::bar (String str, Real h) const
   Array<Real> arr;
   arr.push (h);
   Atom a = (*symtables_p_) ("bars")->lookup (str);
-  a.lambda_ = lambda_scm (a.str_, arr);
+  a.lambda_ =  (lambda_scm (a.str_, arr));
   a.dim_.y () = Interval (-h/2, h/2);
   a.font_ = font_;
   return a;
@@ -125,7 +125,7 @@ Lookup::beam (Real slope, Real width, Real thick) const
   arr.push (thick);
 
   Atom a;
-  a.lambda_ = lambda_scm ("beam", arr);
+  a.lambda_ =  (lambda_scm ("beam", arr));
   a.dim_[X_AXIS] = Interval (0, width);
   a.dim_[Y_AXIS] = Interval (min_y, max_y);
   return a;
@@ -151,7 +151,7 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
   a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
 
   // (lambda (o) (dashed-slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2))))
-  a.lambda_ = 
+  a.lambda_ =  (
     ly_append (ly_lambda_o (), 
     ly_list1 (ly_append (ly_func_o ("dashed-slur"),
     gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash),
@@ -160,7 +160,7 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
     gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
     gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
     gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
-    SCM_EOL)))))))))));
+    SCM_EOL))))))))))));
 
   return a;
 }
@@ -216,7 +216,7 @@ Lookup::rule_symbol (Real height, Real width) const
   Array<Real> args;
   args.push (height);
   args.push (width);
-  bs.lambda_ = lambda_scm (bs.str_, args);
+  bs.lambda_ =  (lambda_scm (bs.str_, args));
   bs.dim_.x () = Interval (0, width);
   bs.dim_.y () = Interval (0, height);
   return bs;
@@ -274,7 +274,7 @@ Lookup::stem (Real y1, Real y2) const
   a.push (y2);
   a.push (-y1);
 
-  s.lambda_ = lambda_scm ("stem", a);
+  s.lambda_ =  (lambda_scm ("stem", a));
   s.font_ = font_;
   return s;
 }
@@ -295,7 +295,7 @@ Lookup::text (String style, String text) const
 
   a.push (text);
   Atom s =  (*symtables_p_) ("style")->lookup (style);
-  s.lambda_ = lambda_scm (s.str_, a);
+  s.lambda_ =  (lambda_scm (s.str_, a));
   s.font_ = font_;
 
   return s;
@@ -305,7 +305,7 @@ Atom
 Lookup::time_signature (Array<Real> a) const
 {
   Atom s ((*symtables_p_) ("param")->lookup ("time_signature"));
-  s.lambda_ = lambda_scm (s.str_, a);
+  s.lambda_ =  (lambda_scm (s.str_, a));
 
   return s;
 }
@@ -340,7 +340,7 @@ Lookup::vbrace (Real &y) const
   
   Array<Real> a;
   a.push (idx);
-  brace.lambda_ = lambda_scm (brace.str_, a);
+  brace.lambda_ =  (lambda_scm (brace.str_, a));
   brace.dim_[Y_AXIS] = Interval (-y/2,y/2);
 
   brace.font_ = font_;
@@ -395,7 +395,7 @@ Lookup::slur (Array<Offset> controls) const
   Atom a;
  
   // (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. )))
-  a.lambda_ = 
+  a.lambda_ =  (
     ly_append (ly_lambda_o (), 
     ly_list1 (ly_append (ly_func_o ("slur"),
     ly_list1 (ly_list2 (ly_quote (),
@@ -407,7 +407,7 @@ Lookup::slur (Array<Offset> controls) const
     gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
     gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
     gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
-    SCM_EOL)))))))))))));
+    SCM_EOL))))))))))))));
 
   a.dim_[X_AXIS] = Interval (0, dx);
   a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
@@ -428,7 +428,7 @@ Lookup::vbracket (Real &y) const
     }
   Array<Real> arr;
   arr.push (y);
-  a.lambda_ = lambda_scm ("bracket", arr);
+  a.lambda_ =  (lambda_scm ("bracket", arr));
   a.dim_[Y_AXIS] = Interval (-y/2,y/2);
   a.dim_[X_AXIS] = Interval (0,4 PT);
   return a;
index da7102b1f7212bfef8c534b2158823c42db4ee96..9555cad7ebbd1182bb65817d23a025ad13085d0f 100644 (file)
@@ -23,12 +23,12 @@ Lyric_engraver::Lyric_engraver()
 bool
 Lyric_engraver::do_try_request (Request*r)
 {
-  Musical_req * m =dynamic_cast <Musical_req *> (r);
-  if (!m || ! dynamic_cast <Lyric_req *> (m)) 
-    return false;
-  lreq_l_ = dynamic_cast <Lyric_req *> (m);
-
-  return true;
+  if (Lyric_req * lr = dynamic_cast <Lyric_req *> (r))
+    {
+      lreq_l_ = lr;
+      return true;
+    }
+  return false;
 }
 
 void
index 43fe0f26342269eff31fd571ec7f23eae27ddd07..e8c8892339c85784b87f93bec8c8cc77ca56676d 100644 (file)
 IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer);
 ADD_THIS_TRANSLATOR(Lyric_performer);
 
-Lyric_performer::Lyric_performer()
-{
-}
-
-Lyric_performer::~Lyric_performer()
-{
-}
-
 void 
 Lyric_performer::do_print() const
 {
 #ifndef NPRINT
   if (lreq_arr_.size())
-    lreq_arr_[ 0 ]->print();
+    lreq_arr_[0]->print();
 #endif
 }
 
@@ -37,18 +29,18 @@ void
 Lyric_performer::do_process_requests()
 {
   if (lreq_arr_.size() && lreq_arr_[0]->text_str_.length_i())
-    play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->text_str_));
+    play (new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_));
   lreq_arr_.clear();
 }
 
 bool
 Lyric_performer::do_try_request (Request* req_l)
 {
-  Musical_req* m_l = dynamic_cast <Musical_req *> (req_l);
-  if (!m_l || ! dynamic_cast <Lyric_req *> (m_l)) 
-    return false;
-  lreq_arr_.push (dynamic_cast <Lyric_req *> (m_l));
-
-  return true;
+  if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
+    {
+      lreq_arr_.push (lr);
+      return true;
+    }
+  return false;
 }
 
index d9a7a0afc007447eb02a59f6cf431612be01dcf0..9adf5a59419f5e97679217da4bc9ad58829ffd0f 100644 (file)
@@ -224,15 +224,18 @@ setup_paths ()
 
   if (!prefix_directory.empty_b())
     {
-      global_path.add (prefix_directory + "/share/lilypond/init/");
-      global_path.add (prefix_directory + "/share/lilypond");
+      global_path.add (prefix_directory + "/share/lilypond/ly/");
+      global_path.add (prefix_directory + "/share/lilypond/afm/");
+    }
+  else
+    {
+      global_path.add (String (DIR_DATADIR) + "/ly/");
+      global_path.add (String (DIR_DATADIR) + "/afm/");  
     }
-
-  global_path.add (String (DIR_DATADIR) + "/ly/");
-  global_path.add (String (DIR_DATADIR) + "/afm/");  
 }
 
 
+
 void
 main_prog (int argc, char **argv)
 {
@@ -341,6 +344,7 @@ main_prog (int argc, char **argv)
        default_outname_base_global = outname_str;
       do_one_file (i, default_outname_base_global);
     }
+  exit( exit_status_i_);
 }
 
 int
@@ -355,12 +359,12 @@ main (int argc, char **argv)
 #endif
 }
 
-/*
-  urg: make input file name: 
+/**
+  make input file name from command arg.
 
-  input: file name
+  @input file name
 
-  output: file name with added default extension. "" is stdin.
+  @output file name with added default extension. "" is stdin.
           in reference argument: the extension. ".ly" if none
  */
 String
@@ -375,6 +379,7 @@ distill_inname_str (String name_str, String& ext_r)
          split_path (str,a,b,c,ext_r);
 
          // add extension if not present.
+         // UGH. Should parametrise in list of default extensions.
          if (ext_r.empty_b ())
            {
              ext_r = ".fly";
index 71119e4eb63a05e0f967f5a6070d366c7eacc7c4..3c25f1aeae76f3122eb686f288635720fed80370 100644 (file)
@@ -26,13 +26,12 @@ Mark_engraver::Mark_engraver ()
 bool
 Mark_engraver::do_try_request (Request* r_l)
 {
-  Command_req* c_l = dynamic_cast <Command_req *> (r_l);
-  if (!c_l || !dynamic_cast <Mark_req *> (c_l) || mark_req_l_) 
-    return false;
-
-  mark_req_l_ = dynamic_cast <Mark_req *> (c_l);
-
-  return true;
+  if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
+    {
+      mark_req_l_ = mr;
+      return true;
+    }
+  return false;
 }
 
 void
index 362508ee647c51c1b034c3583d7cbe47692cdd26..7ae9551f7d91f21d39533425af072f3d32f6849e 100644 (file)
@@ -399,6 +399,7 @@ Midi_note::Midi_note (Audio_item* audio_item_l)
   : Midi_item (audio_item_l)
 {
   dynamic_byte_ = 0x7f;
+  assert (dynamic_cast<Audio_note*> (audio_item_l));
 }
 
 Moment
index 81489c2ad0cfc7fe8045bce9a107c7e18eb21206..90477a3009ac19e3702807b5e1ede691f4275d72 100644 (file)
@@ -48,10 +48,10 @@ Midi_walker::do_start_note (Midi_note* note_p)
   Moment stop_mom = note_p->duration() + ptr ()->audio_column_l_->at_mom ();
   for (int i=0; i < stop_note_queue.size(); i++) 
     {
-      if (stop_note_queue[ i ].val->pitch_i() == note_p->pitch_i ()) 
+      if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) 
        {
-         if (stop_note_queue[ i ].key < stop_mom)
-           stop_note_queue[ i ].ignore_b_ = true;
+         if (stop_note_queue[i].key < stop_mom)
+           stop_note_queue[i].ignore_b_ = true;
          else {
            // skip the stopnote
            delete note_p;
@@ -111,9 +111,9 @@ Midi_walker::process()
     return;
   p->channel_i_ = track_l_->number_i_;
   
-  if (p->name() != Midi_note::static_name ())
-    output_event (ptr()->audio_column_l_->at_mom (), p);
+  if (Midi_item *mi = dynamic_cast<Midi_note*>(p))
+    do_start_note (mi);
   else
-    do_start_note ((Midi_note*)p);
+    output_event (ptr()->audio_column_l_->at_mom (), p);
 }
 
index 03578a58153053d8da994bf152d9acc0acea0bc3..d72da1d4f0e545863f2bb217a95893583c893c09 100644 (file)
@@ -26,20 +26,20 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
 bool
 Multi_measure_rest_engraver::do_try_request (Request* req_l)
 {
- if (!dynamic_cast<Multi_measure_rest_req *> (req_l))
-    return false;
-
-  if (multi_measure_req_l_)
-    if (!multi_measure_req_l_->equal_b (req_l)
-       || req_start_mom_ != now_moment ())
-      return false;
-  
-  multi_measure_req_l_ = dynamic_cast<Multi_measure_rest_req *> (req_l);
-  req_start_mom_ = now_moment ();
+ if (Multi_measure_rest_req *mr = dynamic_cast<Multi_measure_rest_req *> (req_l))
+   {
+     if (multi_measure_req_l_)
+       if (!multi_measure_req_l_->equal_b (req_l)
+          || req_start_mom_ != now_moment ())
+        return false;
   
-  rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length ();
-
-  return true;
+     multi_measure_req_l_ = mr;
+     req_start_mom_ = now_moment ();
+     
+     rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length ();
+     return true;
+   }
+ return false;
 }
 
 void
index 2b329815d6596e4ee5ddc89f89f165cffc2cce7a..5505c145a7436154c5d49ffc409b39a343948047 100644 (file)
@@ -136,19 +136,19 @@ Music_iterator*
 Music_iterator::static_get_iterator_p (Music const *m, Translator_group *report_l)
 {
   Music_iterator * p =0;
-  if (m->is_type_b (Request_chord::static_name()))
+  if (dynamic_cast<Request_chord  const *> (m))
     p = new Request_chord_iterator;
-  else if (m->is_type_b (Simultaneous_music::static_name())) 
+  else if (dynamic_cast<Simultaneous_music  const *> (m)) 
     p =  new Simultaneous_music_iterator;
-  else if (m->is_type_b (Sequential_music::static_name())) 
+  else if (dynamic_cast<Sequential_music  const *> (m)) 
     p =  new Sequential_music_iterator;
-  else if (m->is_type_b (Translation_property::static_name ()))
+  else if (dynamic_cast<Translation_property  const *> (m))
     p = new Property_iterator;
-  else if (m->is_type_b (Change_translator::static_name ()))
+  else if (dynamic_cast<Change_translator  const *> (m))
     p = new Change_iterator;
-  else if (m->is_type_b (Compressed_music::static_name ()))
+  else if (dynamic_cast<Compressed_music  const *> (m))
     p = new Compressed_music_iterator;
-  else if (m->is_type_b (Music_wrapper::static_name ()))
+  else if (dynamic_cast<Music_wrapper  const *> (m))
     p = new Music_wrapper_iterator;
 
   p->music_l_ = m;
index 7c47ded02722de0c675d8a534f2b8b57704609ac..b712f3e2554d57924e80b26521ae6bd8a3efe59c 100644 (file)
@@ -109,7 +109,6 @@ IMPLEMENT_IS_TYPE_B1(Request_chord, Simultaneous_music);
 Request_chord::Request_chord()
   : Simultaneous_music (new Music_list)
 {
-  multi_level_i_ =0;
 }
 
 
@@ -118,10 +117,9 @@ Request_chord::to_relative_octave (Musical_pitch last)
 {
   for (iter (music_p_list_p_->top(),i); i.ok (); i++)
     {
-      Musical_req *m = dynamic_cast<Musical_req*> (i.ptr ());
-      if (m && dynamic_cast <Melodic_req *> (m))
+      if (Melodic_req *m= dynamic_cast <Melodic_req *> (i.ptr ()))
        {
-         Musical_pitch &pit = dynamic_cast <Melodic_req *> (m)->pitch_;
+         Musical_pitch &pit = m->pitch_;
          pit.to_relative_octave (last);
          return pit;
        }
index 8e28cdf4bb49caf176fa3d02b86f80428f14c836..cdd7af56a8810f8d717e4add2dd835a1177cf5e8 100644 (file)
@@ -40,7 +40,7 @@ Music_output_def::Music_output_def (Music_output_def const &s)
   
   for (Dictionary_iter<Identifier*> i (*translator_p_dict_p_);  i.ok (); i++)
     {
-      Translator * t = i.val ()->access_Translator (false);
+      Translator * t = i.val ()->access_content_Translator (false);
       t-> output_def_l_ = this;
     }
 }
@@ -60,7 +60,7 @@ Translator*
 Music_output_def::find_translator_l (String name) const
 {
   if (translator_p_dict_p_->elem_b (name))
-    return  (*translator_p_dict_p_)[name]->access_Translator ();
+    return  (*translator_p_dict_p_)[name]->access_content_Translator (false);
 
   if (global_translator_dict_p->elem_b (name))
     return (*global_translator_dict_p)[name];
@@ -76,7 +76,7 @@ Music_output_def::get_global_translator_p ()
   if (!t)
     error (_("Can't find Score context"));
   t = t->clone ();
-  Global_translator *g = dynamic_cast <Translator_group *> (t)->global_l ();
+  Global_translator *g = dynamic_cast <Global_translator *> (t);
   t->add_processing ();
   
   return g;
@@ -98,6 +98,6 @@ Music_output_def::get_default_output () const
     return "";  
   Identifier * id = (*scope_p_) ["output"];
 
-  String *p = dynamic_cast <String *> (id);
+  String *p = id->access_content_String (false);
   return p ? *p : String ("");
 }
index fd00a120e840442cbbad33069ee7fc9eae687cc7..8d8299a510df7309b7643522e5f8409aa3f99e61 100644 (file)
@@ -13,7 +13,6 @@
 Music_sequence::Music_sequence (Music_sequence const&s)
   : Music (s)
 {
-  multi_level_i_ = s.multi_level_i_;
   music_p_list_p_ = new Music_list (*s.music_p_list_p_);
 }
 
@@ -21,7 +20,6 @@ IMPLEMENT_IS_TYPE_B1(Music_sequence, Music);
 
 Music_sequence::Music_sequence(Music_list *mlist_p)
 {
-  multi_level_i_ = 0;
   music_p_list_p_ = mlist_p;
 }
 
index 6c72cb538ada9bff71a691b52f1d3454d72d7105..c12cd16c29ab476e27dd9c02a4c5f93daf8aa701 100644 (file)
@@ -105,7 +105,7 @@ bool
 Melodic_req::do_equal_b (Request*r) const
 {
   Melodic_req* m= dynamic_cast <Melodic_req *> (r);
-  return !compare (*m, *this);
+  return m&& !compare (*m, *this);
 }
 
 int
@@ -131,7 +131,7 @@ Rhythmic_req::do_equal_b (Request*r) const
 {
   Rhythmic_req* rh = dynamic_cast <Rhythmic_req *> (r);
 
-  return !compare (*this, *rh);
+  return rh&& !compare (*this, *rh);
 }
 
 
@@ -178,7 +178,8 @@ Lyric_req::do_print () const
 bool
 Note_req::do_equal_b (Request*r) const
 {
-  return Rhythmic_req::do_equal_b (r) && Melodic_req::do_equal_b (r);
+  Note_req *n = dynamic_cast<Note_req*> (r);
+  return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n);
 }
 
 
@@ -270,7 +271,7 @@ bool
 Span_req:: do_equal_b (Request*r) const
 {
   Span_req * s = dynamic_cast <Span_req *> (r);
-  return spantype == s->spantype;
+  return s&& spantype == s->spantype;
 }
 
 Span_req::Span_req ()
@@ -294,7 +295,7 @@ Script_req::do_equal_b (Request*r) const
 {
   Script_req * s = dynamic_cast <Script_req *> (r);
 
-  return  scriptdef_p_->equal_b (*s->scriptdef_p_);
+  return s&&  scriptdef_p_->equal_b (*s->scriptdef_p_);
 }
 
 Script_req::Script_req ()
@@ -401,7 +402,7 @@ bool
 Absolute_dynamic_req::do_equal_b (Request *r) const
 {
   Absolute_dynamic_req *a = dynamic_cast <Absolute_dynamic_req *> (r);
-  return loudness_ == a->loudness_;
+  return a&& loudness_ == a->loudness_;
 }
 
 String
@@ -451,7 +452,7 @@ Span_dynamic_req::do_equal_b (Request *req) const
 {
   Span_dynamic_req * s = dynamic_cast <Span_dynamic_req *> (req);
 
-  return Span_req::do_equal_b (req) && s->dynamic_dir_ == dynamic_dir_;
+  return s&& Span_req::do_equal_b (req) && s->dynamic_dir_ == dynamic_dir_;
 }
 
 Span_dynamic_req::Span_dynamic_req ()
index 4c7d05a9a22ca8b6b561a2eb8965319592e72f29..df3634bce5b5f832217ac1f283148c786783d790 100644 (file)
@@ -109,7 +109,7 @@ My_lily_lexer::start_main_input ()
 }
 
 void
-My_lily_lexer::set_identifier (String name_str, Identifier* i, bool unique_b)
+My_lily_lexer::set_identifier (String name_str, Identifier* i, bool )
 {
   Identifier *old =0;
   if (scope_l_arr_.top ()->elem_b (name_str))
@@ -140,7 +140,7 @@ My_lily_lexer::~My_lily_lexer()
 }
 
 void
-My_lily_lexer::print_declarations (bool init_b) const
+My_lily_lexer::print_declarations (bool ) const
 {
   for (int i=scope_l_arr_.size (); i--; )
     {
index f3cdf87abaaa5ab9183586980a0e509094a2fc3b..a024f0dd681f58d2dba7c83d3adb8d8c4d9f4ba7 100644 (file)
@@ -177,6 +177,10 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
   return v;
 }
 
+
+/*
+  UGH.
+ */
 Array<Request*>*
 My_lily_parser::get_parens_request (int t)
 {
@@ -314,13 +318,13 @@ Paper_def*
 My_lily_parser::default_paper_p ()
 {
   Identifier *id = lexer_p_->lookup_identifier ("$defaultpaper");
-  return id ? id->access_Paper_def () : new Paper_def ;
+  return id ? id->access_content_Paper_def (true) : new Paper_def ;
 }
 
 Midi_def*
 My_lily_parser::default_midi_p ()
 {
   Identifier *id = lexer_p_->lookup_identifier ("$defaultmidi");
-  return id ? id->access_Midi_def () : new Midi_def ;
+  return id ? id->access_content_Midi_def (true) : new Midi_def ;
 }
 
index b00cb5ea0aa7c5fbead811724d1bd26e8d6283ec..ef0c81e380d32d24a23eec70c33045f3e0c417ed 100644 (file)
@@ -102,30 +102,30 @@ Note_column::do_substitute_dependency (Score_element*o, Score_element*n)
 {
   if (stem_l_ == o) 
     {
-      stem_l_ = n ? (Stem*)dynamic_cast <Item *> (n):0;
+      stem_l_ = n ? dynamic_cast<Stem *> (n):0;
     }
-  if (o->is_type_b (Note_head::static_name ()))
+  if (dynamic_cast<Note_head *> (o))
     {
-      head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o), 
-                             (n)? (Note_head*)dynamic_cast <Item *> (n) : 0);
+      head_l_arr_.substitute (dynamic_cast<Note_head *> (o), 
+                             (n)? dynamic_cast<Note_head *> (n) : 0);
     }
   Script_column::do_substitute_dependency (o,n);
-  if (o->is_type_b (Rest::static_name ())) 
+  if (dynamic_cast<Rest *> (o)) 
     {
-      rest_l_arr_.substitute ((Rest*)dynamic_cast <Item *> (o), 
-                             (n)? (Rest*)dynamic_cast <Item *> (n) : 0);
+      rest_l_arr_.substitute (dynamic_cast<Rest *> (o), 
+                             (n)? dynamic_cast<Rest *> (n) : 0);
     }
 }
 
 void
 Note_column::add_head (Rhythmic_head *h)
 {
-  if (h->is_type_b (Rest::static_name ()))
+  if (dynamic_cast<Rest *> (h))
     {
       rest_l_arr_.push ((Rest*)h);
       add_support (h);  
     }
-  if (h->is_type_b (Note_head::static_name ()))
+  if (dynamic_cast<Note_head *> (h))
     {
       head_l_arr_.push ((Note_head*) h);
       add_support (h);
index 5f8923c284e48a70f38547b1aa1d1f0942c6b0c3..d63b433a4fe7b0fdf8cccbd2c328104f5caf042c 100644 (file)
@@ -24,27 +24,26 @@ Note_performer::do_print () const
 {
 #ifndef NPRINT
   if (note_req_l_) 
-      note_req_l_->print ();
+    note_req_l_->print ();
 #endif
 }
 
 void 
 Note_performer::do_process_requests () 
 {
-  // this is _really_ braindead, but it generates some output
-  if (!note_req_l_ || !dynamic_cast <Melodic_req *> (note_req_l_)  || !dynamic_cast <Rhythmic_req *> (note_req_l_))
-    return;
-
-  int transposing_i = 0;
-  //urg
-  Scalar prop = get_property ("transposing");
-  if (!prop.empty_b () && prop.isnum_b ()) 
-    transposing_i = prop;
+  if (note_req_l_)
+    {
+      int transposing_i = 0;
+      //urg
+      Scalar prop = get_property ("transposing");
+      if (!prop.empty_b () && prop.isnum_b ()) 
+       transposing_i = prop;
 
 
-  play (new Audio_note (note_req_l_, transposing_i));
+      play (new Audio_note (note_req_l_, transposing_i));
 
-  note_req_l_ = 0;
+      note_req_l_ = 0;
+    }
 }
 
 bool 
index be107cd929467a8b64e2c3cb35222caa53fde825..6b68f7f0fd97b1aa8096167ffabaadb8da9a124c 100644 (file)
 #include "file-results.hh"
 #include "misc.hh"
 
+#if 0                          // has w32 advanced?
 // sucking Cygnus egcs - w32
 #include "list.tcc"
 #include "cursor.tcc"
+#endif
 
 Paper_score::Paper_score ()
 {
@@ -319,10 +321,11 @@ Paper_score::broken_col_range (Item const*l_item_l, Item const*r_item_l) const
   Item const*l=l_item_l;
   Item const*r=r_item_l;
 
-  while (! l->is_type_b(Paper_column::static_name ()))
+  // huh? see Item::left_right_compare ()
+  while (! (dynamic_cast<Paper_column const *> (l)))
     l = dynamic_cast<Item*> (l->axis_group_l_a_[X_AXIS]);
 
-  while (! r->is_type_b(Paper_column::static_name ()))
+  while (! (dynamic_cast<Paper_column const *> (r)))
     r = dynamic_cast<Item*>(r->axis_group_l_a_[X_AXIS]);
 
   PCursor<Paper_column*> start (l ? find_col ((Paper_column*)l)+1 : col_p_list_.top ());
index 5ce8b04cd9da58278e23d4ddeca6d13df577af04..85abdd931b075e7b7dc7a0c7036bc86106ed9437 100644 (file)
@@ -57,7 +57,7 @@ Paper_def::get_var (String s) const
 {
   if (!scope_p_->elem_b (s))
     error (_f ("unknown paper variable: `%s\'", s));
-  Real * p = scope_p_->elem (s)->access_Real (false);
+  Real * p = scope_p_->elem (s)->access_content_Real (false);
   if (!p)
     {
       error (_ ("not a real variable"));
@@ -247,10 +247,10 @@ output_header (Paper_outputter* p, Scope *head)
   
   for (Dictionary_iter<Identifier*> i (*head); i.ok (); i++)
     {
-      if (!i.val ()->access_String_identifier ())
+      if (!i.val ()->access_content_String (false))
        continue;
       
-      String val = *i.val()->access_String_identifier ()->data_p_;
+      String val = *i.val()->access_content_String (false);
       output_def (p, i.key (), val);
     }
 }
@@ -260,7 +260,7 @@ Paper_def::output_settings (Paper_outputter* p) const
 {
   for (Dictionary_iter<Identifier*> i (*scope_p_); i.ok (); i++)
     output_def (p, String ("mudelapaper") + i.key (), i.val ()->str ());
-  p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_String ());
+  p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false));
 }
 
 Paper_outputter*
index ade5ef13fc8464819d496cbe0fcadc0d2f792a04..033fbf3f06dcc24cbdebbeca0bdf21856958e0f0 100644 (file)
@@ -85,8 +85,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
       if (!i->lambda_)
         {
          // urg
-         i->lambda_ = 
-           ly_append (ly_lambda_o (), 
+         i->lambda_ = ly_append (ly_lambda_o (), 
            ly_list1 (ly_func_o ("empty")));
        }
 
index ccca7e4942bdf4b8df5be9d991ac4b47eb1939a6..bc0680a3010ba5927cf7b260accd248bd1c67bcd 100644 (file)
@@ -358,7 +358,7 @@ notenames_body:
                $$ = new Notename_table;
        }
        | NOTENAME_TABLE_IDENTIFIER     {
-               $$ = $1-> access_Notename_table(true);
+               $$ = $1-> access_content_Notename_table(true);
        }
        | notenames_body STRING '=' explicit_musical_pitch {
                (*$$)[*$2] = *$4;
@@ -461,12 +461,12 @@ translator_spec:
 
 translator_spec_body:
        TRANS_IDENTIFIER        {
-               $$ = $1->access_Translator (true);
+               $$ = $1->access_content_Translator (true);
                $$-> set_spot (THIS->here_input ());
        }
        | TYPE STRING ';'       {
                Translator* t = get_translator_l (*$2);
-               Translator_group * tg = t->access_Translator_group ();
+               Translator_group * tg = dynamic_cast<Translator_group*> (t);
 
                if (!tg)
                        THIS->parser_error (_("Need a translator group for a context"));
@@ -478,14 +478,14 @@ translator_spec_body:
        }
        | translator_spec_body STRING '=' simple_identifier_init ';'    { 
                Identifier* id = $4;
-               String_identifier *s = id->access_String_identifier ();
-               Real_identifier *r= id->access_Real_identifier ();
-               int_identifier *i = id->access_int_identifier ();
+               String_identifier *s = dynamic_cast<String_identifier*> (id);
+               Real_identifier *r= dynamic_cast<Real_identifier*>(id);
+               int_identifier *i = dynamic_cast<int_identifier*> (id);
        
                String str;
-               if (s) str = *s->access_String (false); 
-               if (i) str = to_str (*i->access_int (false));
-               if (r) str = to_str (*r->access_Real (false));
+               if (s) str = *s->access_content_String (false); 
+               if (i) str = to_str (*i->access_content_int (false));
+               if (r) str = to_str (*r->access_content_Real (false));
                if (!s && !i && !r)
                        THIS->parser_error (_("Wrong type for property value"));
 
@@ -497,15 +497,15 @@ translator_spec_body:
                delete $3;
        }
        | translator_spec_body CONSISTS STRING ';' {
-               $$->access_Translator_group ()-> set_element (*$3, true);
+               dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
                delete $3;
        }
        | translator_spec_body ACCEPTS STRING ';' {
-               $$->access_Translator_group ()-> set_acceptor (*$3, true);
+               dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
                delete $3;
        }
        | translator_spec_body REMOVE STRING ';' {
-               $$->access_Translator_group ()-> set_element (*$3, false);
+               dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
                delete $3;
        }
        ;
@@ -533,7 +533,7 @@ score_body:         {
                $$ = new Score;
        }
        | SCORE_IDENTIFIER {
-               $$ = $1->access_Score (true);
+               $$ = $1->access_content_Score (true);
        }
        | score_body mudela_header      {
                $$->header_p_ = $2;
@@ -593,7 +593,7 @@ paper_def_body:
                $$ = p;
        }
        | PAPER_IDENTIFIER optional_semicolon   {
-               Paper_def *p = $1->access_Paper_def (true);
+               Paper_def *p = $1->access_content_Paper_def (true);
                THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
                $$ = p;
        }
@@ -643,7 +643,7 @@ real_expression:
        }
        | dimension
        | REAL_IDENTIFIER               {
-               $$= *$1->access_Real (false);
+               $$= *$1->access_content_Real (false);
        }
        | '-'  real_expression %prec UNARY_MINUS {
                $$ = -$2;
@@ -687,7 +687,7 @@ midi_body: /* empty */              {
                $$ = THIS->default_midi_p ();
        }
        | MIDI_IDENTIFIER       {
-               $$ = $1-> access_Midi_def (true);
+               $$ = $1-> access_content_Midi_def (true);
        }
        | midi_body translator_spec     {
                $$-> assign_translator ($2);
@@ -738,7 +738,7 @@ Simultaneous_music: '<' Music_list '>'      {
 
 Simple_music:
        request_chord           { $$ = $1; }
-       | MUSIC_IDENTIFIER { $$ = $1->access_Music (true); }
+       | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
        | property_def
        | translator_change
        ;
@@ -851,7 +851,7 @@ abbrev_command_req:
                $$ = new Barcheck_req;
        }
        | COMMAND_IDENTIFIER    {
-               $$ = $1->access_Request (true);
+               $$ = $1->access_content_Request (true);
        }
 /*
        | '['           {
@@ -958,7 +958,7 @@ structured_post_request:
 
 post_request:
        POST_REQUEST_IDENTIFIER {
-               $$ = (Request*)$1->access_Request (true);
+               $$ = (Request*)$1->access_content_Request (true);
        }
        | dynamic_req {
                $$ = $1;
@@ -1226,10 +1226,10 @@ script_abbreviation:
        ;
 
 mudela_script:
-       SCRIPT_IDENTIFIER               { $$ = $1->access_General_script_def (true); }
+       SCRIPT_IDENTIFIER               { $$ = $1->access_content_General_script_def (true); }
        | script_definition             { $$ = $1; }
        | script_abbreviation           {
-               $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_General_script_def (true);
+               $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
                delete $1;
        }
        ;
@@ -1299,7 +1299,7 @@ steno_duration:
                     }
        }
        | DURATION_IDENTIFIER   {
-               $$ = $1->access_Duration (true);
+               $$ = $1->access_content_Duration (true);
        }
        | steno_duration '.'    {
                $$->dots_i_ ++;
@@ -1396,7 +1396,7 @@ int:
                $$ = -$2;
        }
        | INT_IDENTIFIER        {
-               $$ = *$1->access_int (false);
+               $$ = *$1->access_content_int (false);
        }
        ;
 
@@ -1406,7 +1406,7 @@ string:
                $$ = $1;
        }
        | STRING_IDENTIFIER     {
-               $$ = $1->access_String (true);
+               $$ = $1->access_content_String (true);
        }
        | string '+' string {
                *$$ += *$3;
@@ -1428,7 +1428,7 @@ symtables_body:
                $$ = new Symtables;
        }
        | IDENTIFIER            {
-               $$ = $1->access_Symtables (true);
+               $$ = $1->access_content_Symtables (true);
        }
        | symtables_body FONT STRING            {
                $$->font_ = *$3;
index 7c5e541f82ecc3d2e42c4de10bbb28d601851601..449caf22bb486cc2de1c436eafbd99a6fb2f01f9 100644 (file)
@@ -30,6 +30,6 @@ Performer_group_performer*
 Performer::daddy_perf_l () const
 {
   return (daddy_trans_l_) 
-    ?(Performer_group_performer*) dynamic_cast <Performer *> (daddy_trans_l_)
+    ?dynamic_cast<Performer_group_performer *> (daddy_trans_l_)
     : 0;
 }
index 4851cee02cfdbd1faa72b28f081e62e4174b90e8..8c3273cd7c9228c78a153e1bf4b0d8ae6b4f3769 100644 (file)
 void
 Pitch_squash_engraver::acknowledge_element (Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Note_head::static_name ()))
+  if (Note_head *nh = dynamic_cast<Note_head *> (i.elem_l_))
     {
-      Note_head * nl = (Note_head*)dynamic_cast <Item *> (i.elem_l_);
-      nl->position_i_  =0;
+      nh->position_i_  =0;
     }
 }
 
index ed85c58bfddeeafab1061a3e96a31167c34ed7b3..172a4912000e853001649497c97cfa9922219a59 100644 (file)
@@ -27,7 +27,9 @@ Plet_engraver::Plet_engraver ()
 void
 Plet_engraver::acknowledge_element (Score_element_info i)
 {
-  if (!i.elem_l_->is_type_b (Stem::static_name ()))
+
+  Stem * st = (dynamic_cast<Stem *> (i.elem_l_));
+  if (!st)
     return;
   if (!plet_spanner_p_)
     return;
@@ -35,10 +37,10 @@ Plet_engraver::acknowledge_element (Score_element_info i)
     return;
 
   if (!plet_spanner_p_->stem_l_drul_[LEFT])
-    plet_spanner_p_->set_stem (LEFT, (Stem*)dynamic_cast <Item *> (i.elem_l_));
+    plet_spanner_p_->set_stem (LEFT, st);
   else
     if (span_reqs_drul_[RIGHT] && !plet_spanner_p_->stem_l_drul_[RIGHT]) 
-      plet_spanner_p_->set_stem (RIGHT, (Stem*)dynamic_cast <Item *> (i.elem_l_));
+      plet_spanner_p_->set_stem (RIGHT, st);
 }
 
 bool
index 4a032ffc72354c5b418b4541b830d7467e456dad..57f6ca30cf0ac58153e17be59d7782a9d2514293 100644 (file)
@@ -130,7 +130,7 @@ Plet_spanner::do_post_processing ()
 void
 Plet_spanner::do_substitute_dependency (Score_element* o, Score_element* n)
 {
-  Stem* new_l = n ? (Stem*)dynamic_cast <Item *> (n) : 0;
+  Stem* new_l = n ? dynamic_cast<Stem *> (n) : 0;
   if (dynamic_cast <Item *> (o) == stem_l_drul_[LEFT])
     stem_l_drul_[LEFT] = new_l;
   else if (dynamic_cast <Item *> (o) == stem_l_drul_[RIGHT])
index 47da034354f9f714569e89005797e8842e0f2cdf..994a84003b610abcc3ce4e2be53439485ec6821d 100644 (file)
@@ -15,5 +15,5 @@ ADD_THIS_TRANSLATOR(Plet_swallow_engraver);
 bool
 Plet_swallow_engraver::do_try_request (Request* req_l)
 {
-  return  dynamic_cast <Plet_req *> (req_l);
+  return dynamic_cast<Plet_req *> (req_l);
 }
index 2aa56cb7cf17a6705d2ede2d59c922d328b1cd11..6a9d8d15ddf2be381eaefbc55d0147d343880c0a 100644 (file)
@@ -30,7 +30,7 @@ void
 Priority_horizontal_align_engraver::acknowledge_element (Score_element_info i)
 {
   Engraver* reg = i.origin_grav_l_arr_[0];
-  if (reg->is_type_b (Score_priority_engraver::static_name()))
+  if (dynamic_cast<Score_priority_engraver *> (reg))
     {
       if (!halign_p_) 
        {
diff --git a/lily/protected-scm.cc b/lily/protected-scm.cc
new file mode 100644 (file)
index 0000000..0304d91
--- /dev/null
@@ -0,0 +1,52 @@
+/*   
+  protected-scm.cc --  implement Protected_scm
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+#include "protected-scm.hh"
+extern "C"
+{
+#include <libguile/gc.h>
+};
+
+
+Protected_scm::Protected_scm ()
+{
+  object_ = 0;
+}
+
+Protected_scm::Protected_scm (SCM s)
+{
+  object_ = s  ? scm_protect_object (s): 0;
+}
+
+Protected_scm::Protected_scm (Protected_scm const &s)
+{
+  object_ = s.object_ ? scm_protect_object (s.object_) : 0;
+}
+
+Protected_scm & 
+Protected_scm::operator =(Protected_scm const &s)
+{
+  if (this == &s)
+    return *this;
+  if (object_)
+    scm_unprotect_object(object_);
+
+  object_ = (s.object_) ? scm_protect_object (s.object_): 0;
+  return *this;
+}
+
+Protected_scm::~Protected_scm ()
+{
+  if  (object_)
+    scm_unprotect_object (object_);
+}
+
+Protected_scm::operator SCM ()
+{
+  return object_;
+}
index 56764298f5900e2552044c9715af355e00002c65..5ed0f311556015b890cc3724c78e0184263a5a08 100644 (file)
@@ -65,11 +65,14 @@ Request_chord_iterator::do_process_and_next (Moment mom)
     {
       for (PCursor<Music*> i (elt_l ()->music_p_list_p_->top ()); i.ok(); i++)
        {
-         assert (i->is_type_b (Request::static_name()));
-         Request * req_l = (Request*)i.ptr();
-         bool gotcha = report_to_l()->try_request (req_l);
-         if (!gotcha)
-           req_l->warning (_f ("junking request: `%s\'", req_l->name()));
+         if (Request * req_l = dynamic_cast<Request*> (i.ptr()))
+           {
+             bool gotcha = report_to_l()->try_request (req_l);
+             if (!gotcha)
+               req_l->warning (_f ("junking request: `%s\'", req_l->name()));
+           }
+         else
+           i.ptr ()->warning (_f ("Huh? Not a Request: `%s\'", i.ptr()->name ()));
        }
       first_b_ = false;
     }
index 858d5c44d52956cf75991fcd16f1b024ddc52ead..aadbe80aef67c7a4b9cc385664196de46066a581 100644 (file)
@@ -23,17 +23,12 @@ Request::do_print() const
 bool
 Request::equal_b (Request *r) const
 {
-  if (is_type_b (r->name()))
-    return r->do_equal_b ((Request*)this);
-  if (r->is_type_b (name()))
-    return do_equal_b (r);
-        
-  return false;
+  return r->do_equal_b (this) || this->do_equal_b (r) ;
 }
 
 bool
 Request::do_equal_b (Request*) const
 {
-  return false;
+  return true;
 }
   
index 2c52168807a3f3a02764970b5194573dc4b745f4..89ac8e65316395df4975487433789f46984dc553 100644 (file)
@@ -36,8 +36,8 @@ Rest_collision_engraver::process_acknowledged ()
 void
 Rest_collision_engraver::acknowledge_element (Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Note_column::static_name()))
-    note_column_l_arr_.push ((Note_column*)dynamic_cast <Item *> (i.elem_l_));
+  if (dynamic_cast<Note_column *> (i.elem_l_))
+    note_column_l_arr_.push (dynamic_cast<Note_column *> (i.elem_l_));
 }
 
 void
index 54cfe814c1458152123cef4c40f81416c84092e8..095c6ac4695620804dfd895388847bf459a68c27 100644 (file)
@@ -133,14 +133,11 @@ Rest_collision::do_print() const
 void
 Rest_collision::do_substitute_dependency (Score_element*o,Score_element*n)
 {
-  Item*o_l = dynamic_cast <Item *> (o);
-  
-
-  if (o_l&&o_l->is_type_b (Note_column::static_name ()))
+  if (Note_column *onl = dynamic_cast<Note_column *> (o))
     {
-      Note_column *n_l = n?(Note_column*)dynamic_cast <Item *> (n):0;
-      rest_l_arr_.substitute ((Note_column*)o_l, n_l);
-      ncol_l_arr_.substitute ((Note_column*)o_l, n_l);
+      Note_column *n_l = n?dynamic_cast<Note_column *> (n):0;
+      rest_l_arr_.substitute (onl, n_l);
+      ncol_l_arr_.substitute (onl, n_l);
     }
 }
 
index f4f2e6efbe8b2085aa17284593aa0c1d6e9c28f5..2170886e550e7684cc0467acf1f607e21b481de0 100644 (file)
@@ -60,14 +60,14 @@ Rest_engraver::do_process_requests ()
 }
 
 bool
-Rest_engraver::do_try_request (Request *r)
+Rest_engraver::do_try_request (Request *req)
 {
-  Musical_req *m = dynamic_cast <Musical_req *> (r);
-  if (!m || !dynamic_cast <Rest_req *> (m))
-    return false;
-
-  rest_req_l_ = dynamic_cast <Rest_req *> (m); // ugh
-  return true;
+  if (Rest_req *r = dynamic_cast <Rest_req *> (req))
+    {
+      rest_req_l_ = r;
+      return true;
+    }  
+  return false;
 }
 
 IMPLEMENT_IS_TYPE_B1(Rest_engraver, Engraver);
index 8c1cacfdf5689884f7929b558682494fe9884137..8bccc1eec63e24f2ea876dac1bacd1028c627d9d 100644 (file)
@@ -70,21 +70,21 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
   Item * item =  dynamic_cast <Item *> (i.elem_l_);
   if (!item)
     return;
-  if (item->is_type_b (Script::static_name ())
+  if (dynamic_cast<Script *> (item)
       && i.req_l_
       && dynamic_cast <Musical_req *> (i.req_l_)) 
     {
       script_l_arr_.push ((Script*)item);
     }
-  else if (item->is_type_b (Stem::static_name()))
+  else if (dynamic_cast<Stem *> (item))
     {
       stem_l_ = (Stem*) item;
     }
-  else if (item->is_type_b (Rhythmic_head::static_name ()))
+  else if (dynamic_cast<Rhythmic_head *> (item))
     {
       rhead_l_arr_.push ((Rhythmic_head*)item);
     }
-  else if (item->is_type_b (Dot_column::static_name ()))
+  else if (dynamic_cast<Dot_column *> (item))
     {
       dotcol_l_ = (Dot_column*) item;
     }
index d4625e7c2b979d3a1461693d9a8aadea6061985c..b25b5ac950e20775e1862b507210e8298e74b58f 100644 (file)
@@ -52,7 +52,7 @@ void
 Rhythmic_head::do_substitute_dependent (Score_element*o,Score_element*n)
 {
   if (o == dots_l_)
-    dots_l_ = n ? (Dots*)dynamic_cast <Item *> (n) :0;
+    dots_l_ = n ? dynamic_cast<Dots *> (n) :0;
 }
 
 IMPLEMENT_IS_TYPE_B1(Rhythmic_head, Item);
index cbaadfc4f4b880c7c3e43090003c3f42c7b6479d..a82e50adeea0ce88e5fc2ca749b33bb8c0f46c4e 100644 (file)
@@ -176,6 +176,11 @@ Score_element::do_brew_molecule ()
   if (transparent_b_)
     return;
   Molecule *output= brew_molecule_p ();
+  for (PCursor<Atom*> i(output->atoms_); i.ok(); i++)
+    {
+      i->origin_l_ = this;
+    }
+  
   pscore_l_->outputter_l_->output_molecule (output, absolute_offset (), name());
   delete output;
 }
@@ -291,17 +296,16 @@ Score_element::handle_broken_dependencies()
       Score_element * elt = dependency (i);
       if (elt->line_l() != line)
        {
-         if (dynamic_cast <Spanner *> (elt)) 
+         if (Spanner *sp = dynamic_cast<Spanner *> (elt)) 
            {
-             Spanner * sp = dynamic_cast <Spanner *> (elt);
              Spanner * broken = sp->find_broken_piece (line);
              substitute_dependency (sp, broken);
 
              add_dependency (broken);
            }
-         else if (dynamic_cast <Item *> (elt))
+         else if (Item *original = dynamic_cast <Item *> (elt))
            {
-             Item * my_item = dynamic_cast <Item *> (elt)->find_prebroken_piece (line);
+             Item * my_item = original->find_prebroken_piece (line);
                
              substitute_dependency (elt, my_item);
              if (my_item)
index 30a38f5360cf12c182909ddee006cb08ec623a68..37a73b00c19646b93af9baaa3d00693f05b963a9 100644 (file)
@@ -104,10 +104,9 @@ Score_engraver::do_announces()
          */
        if (announce_info_arr_[i].req_l_) 
          {
-           Musical_req *m =dynamic_cast <Musical_req *> ( announce_info_arr_[i].req_l_);
-           if (m && dynamic_cast <Rhythmic_req *> (m)) 
+           if (Rhythmic_req *rq = dynamic_cast <Rhythmic_req *> (announce_info_arr_[i].req_l_))
              {
-               musical_column_l_->add_duration (m->duration());
+               musical_column_l_->add_duration (rq->duration());
              }
          }
       Engraver_group_engraver::do_announces();
@@ -128,9 +127,8 @@ Score_engraver::typeset_all()
   for  (int i =0; i < elem_p_arr_.size(); i++) 
     {
       Score_element * elem_p = elem_p_arr_[i];
-      if (dynamic_cast <Spanner *> (elem_p)) 
+      if (Spanner *s = dynamic_cast <Spanner *> (elem_p))
        {
-         Spanner *s = dynamic_cast <Spanner *> (elem_p);
          pscore_p_->typeset_unbroken_spanner (s);
 
            /*
@@ -241,22 +239,21 @@ Score_engraver::do_try_request (Request*r)
 {
   bool gotcha = Engraver_group_engraver::do_try_request (r);  
 
-  if (gotcha || !dynamic_cast <Command_req *> (r))
-    return gotcha;
-
-  Command_req * c = dynamic_cast <Command_req *> (r);
-  if (dynamic_cast <Break_req *> (c))
+  if (!gotcha)
     {
-      Break_req* b = (Break_req*)dynamic_cast <Break_req *> (c);
-      if (b->penalty_i_ <= Break_req::DISALLOW)
-       break_penalty_i_ = b->penalty_i_;
-      else if (b->penalty_i_ >= Break_req::FORCE)
+      if (Break_req* b = dynamic_cast<Break_req *> (r))
        {
-         command_column_l_->break_penalty_i_ = b->penalty_i_;
-         gotcha = true;
+         if (b->penalty_i_ <= Break_req::DISALLOW)
+           break_penalty_i_ = b->penalty_i_;
+         else if (b->penalty_i_ >= Break_req::FORCE)
+           {
+             command_column_l_->break_penalty_i_ = b->penalty_i_;
+             gotcha = true;
+           }
        }
     }
-  return gotcha;
+   return gotcha;
+
 }
 
 IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
@@ -266,7 +263,7 @@ void
 Score_engraver::do_add_processing ()
 {
   Translator_group::do_add_processing ();
-  assert (output_def_l_->is_type_b (Paper_def::static_name ()));
+  assert (dynamic_cast<Paper_def *> (output_def_l_));
   assert (!daddy_trans_l_);
   pscore_p_ = new Paper_score;
   pscore_p_->paper_l_ = (Paper_def*)output_def_l_;
index 9e91c14b24993ff96dbac317f71f7dc22068a60e..48822afc4c3dbdbb627cc8e91aa931d67106a05b 100644 (file)
@@ -35,11 +35,11 @@ Score_performer::~Score_performer()
 void
 Score_performer::play (Audio_element * p)
 {
-  if  (p->is_type_b (Audio_item::static_name())) 
+  if  (dynamic_cast<Audio_item *> (p)) 
     {
       audio_column_l_->add_audio_item ((Audio_item*)p);
     }
-  else if (p->is_type_b (Audio_staff::static_name())) 
+  else if (dynamic_cast<Audio_staff *> (p)) 
     {
       performance_p_->add_staff ((Audio_staff*)p);
     }
@@ -95,7 +95,7 @@ void
 Score_performer::do_add_processing ()
 {
   Translator_group::do_add_processing ();
-  assert (output_def_l_->is_type_b (Midi_def::static_name ()));
+  assert (dynamic_cast<Midi_def *> (output_def_l_));
   performance_p_ = new Performance;
   performance_p_->midi_l_ = (Midi_def*) output_def_l_;  
 }
index 3de5ea9f00128d9dce9f91b62bc6d810ee48229a..bb9f75513c8e44c953898448fe173c779f4cee99 100644 (file)
@@ -42,7 +42,7 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf)
        Don't try to eat up our (probable) parent.
       */
       if (inf.origin_grav_l_arr_.size () <= 1 &&
-         item_l->is_type_b (Break_align_item::static_name ()))
+         dynamic_cast<Break_align_item *> (item_l))
        return; 
 
       
index 8600a6a1818e20f2d1063d486916f38e0eb3d101..291616b8822d81c84fa1228a7f713aa5b5f87859 100644 (file)
@@ -129,7 +129,7 @@ Score::process()
   for (int i=0; i < def_p_arr_.size (); i++)
     {
       if (no_paper_global_b 
-         && def_p_arr_[i]->is_type_b (Paper_def::static_name ()))
+         && dynamic_cast<Paper_def*>(def_p_arr_[i]))
        continue;
       run_translator (def_p_arr_[i]);
     }
index d85e1a6e0bdde1e21d2067a6c46fba7200a4b7d3..e00f9f04a6c860b661c392beba41df763f506c1d 100644 (file)
@@ -107,7 +107,9 @@ Script_column::do_substitute_dependency (Score_element*o,Score_element*n)
 {
   if (dynamic_cast <Item *> (o)) 
     {
-      script_l_arr_.substitute ((Script*)dynamic_cast <Item *> (o),(Script*) (n?dynamic_cast <Item *> (n):0));
-      support_l_arr_.substitute (dynamic_cast <Item *> (o), (n?dynamic_cast <Item *> (n):0));
+      script_l_arr_.substitute (dynamic_cast<Script *> (o),
+                               dynamic_cast <Script *> (n));
+      support_l_arr_.substitute (dynamic_cast <Item *> (o),
+                                dynamic_cast <Item *> (n));
     }
 }
index 05074c7107993dd4e4663d4f5aa2cb4e19c2995c..daf721f0416ac8327228cd3d98e07a0356839e31 100644 (file)
@@ -46,8 +46,8 @@ Script_def::do_print() const
 bool
 Script_def::do_equal_b (General_script_def const *g) const 
 {
-  Script_def const * c = (Script_def const*) g;
-  return (symidx_str_ == c->symidx_str_ &&
+  Script_def const * c = dynamic_cast<Script_def const*> (g);
+  return c&& (symidx_str_ == c->symidx_str_ &&
          rel_stem_dir_ == c->rel_stem_dir_&&
          staff_dir_ == c->staff_dir_&&
          invertsym_b_ == c->invertsym_b_);
index f27577e44b17e5228dfb110f148fb5a48021240c..c68a165d11eaaa64e775fa4ad3fe5fb8559de99f 100644 (file)
@@ -61,7 +61,7 @@ Script_engraver::do_pre_move_processing()
       if (!script_p->specs_p_->inside_b())
        script_p->add_support (s_l);
 
-      if (script_p->specs_p_->is_type_b (Text_def::static_name ()))
+      if (dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH
        {
          Text_def * td_l = (Text_def*)script_p->specs_p_;
          Scalar style = get_property ("textstyle");
index ee525907ae929e1fb27a75f18d3c95244219be0f..c7e5d4177050a6481fcfc3882adb8b2dc06687b3 100644 (file)
@@ -27,7 +27,7 @@ Script::do_substitute_dependency (Score_element*o,Score_element*n)
   Staff_side::do_substitute_dependency (o,n);
   if (o == stem_l_)
     {
-      stem_l_ = n ? (Stem*)dynamic_cast <Item *> (n) : 0;
+      stem_l_ = dynamic_cast<Stem *> (n);
     }
 }
 
index 059afad994521fe15d33079eaf802d79ec5c9be0..2b31c9eee741ef566c7174af59dc4ff4137e86e1 100644 (file)
@@ -62,11 +62,10 @@ IMPLEMENT_IS_TYPE_B1(Separating_group_spanner, Spanner);
 void
 Separating_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n)
 {
-  if (o->is_type_b (Single_malt_grouping_item::static_name ()))
+  if (dynamic_cast<Single_malt_grouping_item *> (o))
     {
-      Single_malt_grouping_item*ns = n ?
-       (Single_malt_grouping_item*)dynamic_cast <Item *> (n) : 0;
-      spacing_unit_l_arr_.substitute ((Single_malt_grouping_item*)dynamic_cast <Item *> (o), ns);
+      Single_malt_grouping_item*ns = dynamic_cast<Single_malt_grouping_item *> (n);
+      spacing_unit_l_arr_.substitute (dynamic_cast<Single_malt_grouping_item *> (o), ns);
     }
 }
 
index f43b99a3c30a498e10557aac67424f505ce6b3f4..bf046b82acedfc40b8647152e31dc1d9e11df270 100644 (file)
@@ -41,8 +41,8 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i)
   Item * it = dynamic_cast <Item *> (i.elem_l_);
   if (it && !it->axis_group_l_a_[X_AXIS])
     {
-      Single_malt_grouping_item *&p_ref_ (it->breakable_b_ ?
-                                         break_malt_p_ : nobreak_malt_p_);
+      Single_malt_grouping_item *&p_ref_ (it->breakable_b_
+                                         break_malt_p_ : nobreak_malt_p_);
 
       if (!p_ref_)
        {
index 56541540f127874be31888dd2898af73092de6a7..0b1af3f676623b533331b3781e8f02aabc96edf6 100644 (file)
@@ -48,7 +48,8 @@ Single_malt_grouping_item::do_substitute_dependency (Score_element*o, Score_elem
 {
   if (dynamic_cast <Item *> (o))
     {
-      item_l_arr_.unordered_substitute (dynamic_cast <Item *> (o),  n ? dynamic_cast <Item *> (n) : 0);
+      item_l_arr_.unordered_substitute (dynamic_cast <Item *> (o),
+                                       dynamic_cast <Item *> (n));
     }
 }
 
index e7447b74320e71ba59d6c1c93d3ea2d0316eb746..33e2b24c2391138feda8e1ca3e8d2061542e83a9 100644 (file)
@@ -16,19 +16,20 @@ bool
 Slur_engraver::do_try_request (Request *req_l)
 {
   Musical_req *mus_l = dynamic_cast <Musical_req *> (req_l);
-  if (!mus_l || !dynamic_cast <Slur_req *> (mus_l))
-    return false;
-
-  new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l));
-  return true;
+  if (Slur_req *sl = dynamic_cast <Slur_req *> (mus_l))
+    {
+      new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l));
+      return true;
+    }
+  return false;
 }
 
 void
 Slur_engraver::acknowledge_element (Score_element_info info)
 {
-  if (info.elem_l_->is_type_b (Note_column::static_name ()))
+  if (dynamic_cast<Note_column *> (info.elem_l_))
     {
-      Note_column *col_l =(Note_column*) dynamic_cast <Item *> (info.elem_l_) ;// ugh
+      Note_column *col_l =dynamic_cast<Note_column *> (info.elem_l_) ;// ugh
       for (int i = 0; i < slur_l_stack_.size(); i++)
        slur_l_stack_[i]->add_column (col_l);
       for (int i = 0; i < end_slur_l_arr_.size(); i++)
index 41769d8e0c6d7b2f3188d4722b542eb2c7dd356e..73c8cb98fbb40f9590ae160a8c5d503942965b5d 100644 (file)
@@ -76,10 +76,10 @@ void
 Slur::do_substitute_dependency (Score_element*o, Score_element*n)
 {
   int i;
-  while ((i = encompass_arr_.find_i ((Note_column*)dynamic_cast <Item *> (o))) >=0) 
+  while ((i = encompass_arr_.find_i (dynamic_cast<Note_column *> (o))) >=0) 
     {
       if (n)
-       encompass_arr_[i] = (Note_column*)dynamic_cast <Item *> (n);
+       encompass_arr_[i] = dynamic_cast<Note_column *> (n);
       else
        encompass_arr_.del (i);
     }
index 4d3dc1f6f46c18f60767f5a93f37d7d359c8a842..acf9c4fb06a21ada1a4c1b7c277099c71e641d11 100644 (file)
@@ -38,9 +38,9 @@ Span_bar_engraver::acknowledge_element (Score_element_info i)
 {
   int depth = i.origin_grav_l_arr_.size();
   if (depth > 1
-      && i.elem_l_->is_type_b (Bar::static_name())) 
+      && dynamic_cast<Bar *> (i.elem_l_)) 
     {
-      bar_l_arr_.push ((Bar*)dynamic_cast <Item *> (i.elem_l_));
+      bar_l_arr_.push (dynamic_cast<Bar *> (i.elem_l_));
        
       if (bar_l_arr_.size() >= 2 && !spanbar_p_) 
        /*
@@ -62,10 +62,10 @@ Span_bar_engraver::acknowledge_element (Score_element_info i)
          spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_;
        }
     }
-  else if  (i.elem_l_->is_type_b (Vertical_align_spanner::static_name()
+  else if  (dynamic_cast<Vertical_align_spanner *> (i.elem_l_
            && i.origin_grav_l_arr_.size() <= 2) 
     {
-      valign_l_ = (Vertical_align_spanner*)dynamic_cast <Spanner *> (i.elem_l_);
+      valign_l_ = dynamic_cast<Vertical_align_spanner *> (i.elem_l_);
     }
 }
 
index 331201d4d0871304e20e588d4b3a531fe311955e..c44900e6093226a996f25fc7380f076c20a1d518 100644 (file)
@@ -116,9 +116,3 @@ Span_bar::Span_bar ()
 {
   type_str_ = "";
 }
-
-Span_bar*
-Span_bar::access_Span_bar ()
-{
-  return this;
-}
index d3cff445e5fe397baabad9a2632d7e0096989066..0aa5e9852ad1e151b33c932d84499a276ba57747 100644 (file)
@@ -48,7 +48,7 @@ void
 Staff_group_bar_engraver::acknowledge_element (Score_element_info i)
 {
   Span_bar_engraver::acknowledge_element (i);
-  if (i.elem_l_->is_type_b (Piano_brace::static_name ()))
+  if (dynamic_cast<Piano_brace *> (i.elem_l_))
     {
       Span_bar* b =  dynamic_cast <Span_bar *> (i.elem_l_);
       Piano_brace * piano_l = (Piano_brace*) b;
index 83ad5f2091d9548584496f5488e239225fe553ce..25b9855f23d4e11bf5c494cdec7214a70f830e40 100644 (file)
@@ -118,12 +118,6 @@ Spanner::do_break_processing()
     }
 }
 
-Spanner* 
-Spanner::access_Spanner ()
-{
-  return this;
-}
-
 Spanner::Spanner ()
 {
   unbroken_original_l_ =0;
index 99939fcd6b55900401845a3e83ca78550723c234..b10b0ba8bf8caca3bb6a687c3d6d995abc593866 100644 (file)
@@ -20,6 +20,7 @@
 #include "score-column.hh"
 #include "paper-def.hh"
 #include "colhpos.hh"
+#include "main.hh"
 
 Vector
 Spring_spacer::default_solution() const
@@ -324,10 +325,10 @@ Spring_spacer::Spring_spacer ()
 void
 Spring_spacer::solve (Column_x_positions*positions) const
 {
-
   DOUT << "Spring_spacer::solve ()...";
-  Vector solution_try;
 
+  Vector solution_try;
+    
   bool constraint_satisfaction = try_initial_solution_and_tell (solution_try); 
   if  (constraint_satisfaction)
     {
@@ -335,9 +336,9 @@ Spring_spacer::solve (Column_x_positions*positions) const
       make_matrices (lp.quad_,lp.lin_, lp.const_term_);
       make_constraints (lp);
       set_fixed_cols (lp);
-
+       
       Vector solution_vec (lp.solve (solution_try));
-
+       
       positions->satisfies_constraints_b_ = check_constraints (solution_vec);
       if (!positions->satisfies_constraints_b_)
        {
@@ -352,6 +353,7 @@ Spring_spacer::solve (Column_x_positions*positions) const
     {
       positions->set_stupid_solution (solution_try);
     }
+
   DOUT << "Finished Spring_spacer::solve ()...";
 }
 
index a80d36bd0a8bdbb844e8ae1b5194073491ea62cd..92c5cdd139867fd430618473fbfe478e9e21e5dd 100644 (file)
@@ -44,7 +44,7 @@ Staff_margin_engraver::acknowledge_element (Score_element_info i)
 
   if (!it
       || script_p_ 
-      || !it->is_type_b (Bar::static_name())
+      || !(dynamic_cast<Bar *> (it))
       || (i.origin_grav_l_arr_.size() != 1))
     return;
 
index ac2cfa3aab92b99bd22df23683d1974a8b87afa6..90f2c63ebcf086b4b6f0e83d5413e94cfa981aaa 100644 (file)
@@ -97,7 +97,7 @@ Staff_performer::new_instrument_str ()
 void 
 Staff_performer::play (Audio_element* p)
 {
-  if (p->is_type_b (Audio_item::static_name ())) 
+  if (dynamic_cast<Audio_item *> (p)) 
     {
       audio_staff_p_->add_audio_item ( (Audio_item*)p);
     }
index e21c8c901234ad7525f1562925f10900852ba323..65351c29a7dec1fc27502879a0a8fcf493589c33 100644 (file)
@@ -36,9 +36,9 @@ Stem_engraver::do_creation_processing ()
 void
 Stem_engraver::acknowledge_element(Score_element_info i)
 {
-  if (i.elem_l_->is_type_b (Rhythmic_head::static_name()))
+  if (dynamic_cast<Rhythmic_head *> (i.elem_l_))
     {
-      Rhythmic_head *h  = (Rhythmic_head*) dynamic_cast <Item *> (i.elem_l_);
+      Rhythmic_head *h  = dynamic_cast<Rhythmic_head *> (i.elem_l_);
       if (!stem_p_) 
        {
          Rhythmic_req * r = dynamic_cast <Rhythmic_req *> (i.req_l_);
index 423b40b397e8fa220bfedf0c2c97c5b89d25e2e5..09193e06471d17d6488f5b52ccae5c01f70f27b2 100644 (file)
@@ -115,11 +115,11 @@ void
 Stem::add_head (Rhythmic_head *n)
 {
   n->add_dependency (this);    // ?
-  if (n->is_type_b (Note_head::static_name ()))
+  if (dynamic_cast<Note_head *> (n))
     {
       head_l_arr_.push ((Note_head*)n);
     }
-  else if (n->is_type_b (Rest::static_name ()))
+  else if (dynamic_cast<Rest *> (n))
     {
       rest_l_arr_.push ((Rest*)n);
     }
index cc3cecff23140339de16c96438dcf0fd18466a37..dd9cb2f732107caa62b335fc45e9f3465fef5fb4 100644 (file)
@@ -31,7 +31,7 @@ Symtables::Symtables (Symtables const &s)
 
 Symtables::~Symtables()
 {
-  for (Dictionary_iter< Symtable*>  i (*this); i.ok(); i++)
+  for (Dictionary_iter<Symtable*>  i (*this); i.ok(); i++)
     {
       delete i.val();
     }
@@ -60,12 +60,12 @@ Symtables::operator()(String s)
     {
       error (_f ("Symtable `%s\' unknown", s));
       /* 
-        We can 't return, because we'll dump core anyway.
+        We can 't return, because we would dump core anyway.
        */
       return 0;
     }
   else
-    return Dictionary<Symtable*>::operator[](s);
+    return elem(s);
 }
 void
 Symtables::print() const
index 3597f30e5e93219cfa46b49c611168bb8a96d5ac..06eccd3fe6d120ede73d8110c88cf864b71ba329 100644 (file)
@@ -65,8 +65,8 @@ Text_def::Text_def()
 bool
 Text_def::do_equal_b (General_script_def const *gdef) const
 {
-  Text_def const *def= (Text_def*)gdef;
-  return align_dir_ == def->align_dir_ && text_str_ == def->text_str_
+  Text_def const *def= dynamic_cast<Text_def const*>(gdef);
+  return def&& align_dir_ == def->align_dir_ && text_str_ == def->text_str_
        && style_str_ == def->style_str_;
 }
 
index c23b63c9a575b69921a157f3beda7351e1ea01de..35dcbdb49f927adb4bd7bb092dabfbd7ae3bcffa 100644 (file)
@@ -38,9 +38,11 @@ Real
 Text_item::get_position_f () const
 {
   // uhuh, tdef/gdef?
-  if ( (tdef_p_->name () != Text_def::static_name ()) 
-    || ( ( (Text_def*)tdef_p_)->style_str_ != "finger"))
-    return Staff_side::get_position_f ();
+  if (Text_def *tdl = dynamic_cast<Text_def*>(tdef_p_))
+    {
+      if (tdl->style_str_ != "finger") // HUHH?
+       return Staff_side::get_position_f ();
+    }
 
   if (!dir_)
     {
index 002c5e969478b3a621020b89d283840d4b2e1709..1bf3a9640e42e7e82b2420935d4bb3137d0e3577 100644 (file)
@@ -151,7 +151,7 @@ Tie::do_post_processing()
 void
 Tie::do_substitute_dependency (Score_element*o, Score_element*n)
 {
-  Note_head *new_l =n?(Note_head*)dynamic_cast <Item *> (n):0;
+  Note_head *new_l =n?dynamic_cast<Note_head *> (n):0;
   if (dynamic_cast <Item *> (o) == head_l_drul_[LEFT])
     head_l_drul_[LEFT] = new_l;
   else if (dynamic_cast <Item *> (o) == head_l_drul_[RIGHT])
index f79dab5ac9384c89fc7394ca3d2635b314b7ff89..3f5a3c5d6dab291e565f3ea8ad58ae208c52394e 100644 (file)
@@ -28,10 +28,7 @@ Ties_engraver::do_post_move_processing()
 bool
 Ties_engraver::do_try_request (Request*req)
 {
-  if (! dynamic_cast <Musical_req *> (req))
-      return false;
-
-  if(Tie_req * r=  dynamic_cast <Tie_req *> (req))
+  if (Tie_req * r = dynamic_cast <Tie_req *> (req))
     {  
       req_l_ = r;
       return true;
@@ -45,9 +42,8 @@ Ties_engraver::acknowledge_element (Score_element_info i)
 {
   if (!req_l_ && ! end_req_l_)
     return;
-  if (i.elem_l_->is_type_b (Note_head::static_name ()))
+  if (Note_head * h = dynamic_cast <Note_head *> (i.elem_l_))
     {
-      Note_head * h = dynamic_cast <Note_head *> (i.elem_l_);
       Melodic_req *m = dynamic_cast <Melodic_req *> (i.req_l_);
       
       head_mel_tuple_arr_.push (Head_melodic_tuple (h, m));
index 739bae67121116643e6856e509d63bb9a695847a..35743ad24f253c9bcd48f5ed55fffae61897d625 100644 (file)
@@ -21,7 +21,7 @@ void
 Time_signature_engraver::do_process_requests()
 {
   Translator * result =
-    daddy_grav_l()->get_simple_translator (Timing_engraver::static_name());
+    daddy_grav_l()->get_simple_translator (Timing_engraver::static_name ());   // ugh
 
   if (!result)
     {
@@ -30,7 +30,7 @@ Time_signature_engraver::do_process_requests()
       return ;
     }
   
-  Timing_engraver * timing_grav_l= (Timing_engraver*) dynamic_cast <Engraver *> (result);
+  Timing_engraver * timing_grav_l= dynamic_cast<Timing_engraver *> (result);
   
   Time_signature_change_req *req = timing_grav_l->time_signature_req_l();
   if (req)
index 316f31d52363d3a00fac0cd6df8a1e0511a00aa7..856525785b8b65cbc8dd8331ee864462dc6f0895 100644 (file)
@@ -20,24 +20,27 @@ Timing_translator::Timing_translator ()
 bool
 Timing_translator::do_try_request(Request*r)
 {
-  Command_req * c = dynamic_cast <Command_req *> (r);
-  if (!(c && dynamic_cast <Timing_req *> (c)))
-    return false;
-  for (int i=0; i < timing_req_l_arr_.size (); i++)
+  if (Timing_req *t =  dynamic_cast <Timing_req *> (r))
     {
-      if (timing_req_l_arr_[i]->equal_b(r))
-       return true;
-      if (timing_req_l_arr_[i]->name() == r->name())
+      for (int i=0; i < timing_req_l_arr_.size (); i++)
        {
-         r->warning (_ ("conflicting timing request"));
-         return false;
+         if (timing_req_l_arr_[i]->equal_b(t))
+           return true;
+         if (timing_req_l_arr_[i]->name() == r->name())
+           {
+             r->warning (_ ("conflicting timing request"));
+             return false;
+           }
        }
+    
+      timing_req_l_arr_.push(t);
+      return true;
     }
-
-  timing_req_l_arr_.push(dynamic_cast <Timing_req *> (c));
-  return true;
+  return false;
 }
 
+/*ugh.
+ */
 Time_signature_change_req*
 Timing_translator::time_signature_req_l() const
 {
@@ -55,8 +58,8 @@ Timing_translator::do_process_requests()
   for (int i=0; i < timing_req_l_arr_.size (); i++)
     {
       Timing_req * tr_l = timing_req_l_arr_[i];
-      Time_signature_change_req *m_l = dynamic_cast <Time_signature_change_req *> (tr_l);
-      if (m_l)
+
+      if (Time_signature_change_req *m_l = dynamic_cast <Time_signature_change_req *> (tr_l))
        {
          int b_i= m_l->beats_i_;
          int o_i = m_l->one_beat_i_;
@@ -69,9 +72,9 @@ Timing_translator::do_process_requests()
                Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i);
            }
        }
-      else if (dynamic_cast <Partial_measure_req *> (tr_l))
+      else if (Partial_measure_req *pm = dynamic_cast <Partial_measure_req *> (tr_l))
        {
-         Moment m = dynamic_cast <Partial_measure_req *> (tr_l)->duration_;
+         Moment m = pm->duration_;
          String error = time_.try_set_partial_str (m);
          if (error.length_i ())
            {
@@ -92,15 +95,15 @@ Timing_translator::do_process_requests()
            }
 
        }
-      else if (dynamic_cast <Cadenza_req *> (tr_l))
+      else if (Cadenza_req *cr = dynamic_cast <Cadenza_req *> (tr_l))
        {
-         time_.set_cadenza (dynamic_cast <Cadenza_req *> (tr_l)->on_b_);
+         time_.set_cadenza (cr->on_b_);
        }
-      else if (dynamic_cast <Measure_grouping_req *> (tr_l))
+      else if (Measure_grouping_req *mg=dynamic_cast <Measure_grouping_req *> (tr_l))
        {
          default_grouping_ =
-           parse_grouping (dynamic_cast <Measure_grouping_req *> (tr_l)->beat_i_arr_,
-                           dynamic_cast <Measure_grouping_req *> (tr_l)->elt_length_arr_);
+           parse_grouping (mg->beat_i_arr_,
+                           mg->elt_length_arr_);
 
        }
     }
@@ -112,7 +115,7 @@ Timing_translator::do_pre_move_processing()
 {
   timing_req_l_arr_.set_size (0);
   Global_translator *global_l =
-    daddy_trans_l_->ancestor_l (100)->global_l (); // ugh 100.
+    dynamic_cast<Global_translator*> (daddy_trans_l_->ancestor_l (100)); // ugh 100.
 
 
   /* allbars == ! skipbars */
index 58dceb1b1d554068569e33b6b4772b8c5f0cb36f..3ef7567af594db22b9e7fa4d01d36f0c3071c918 100644 (file)
@@ -17,9 +17,9 @@ Type_swallow_translator::Type_swallow_translator ()
 bool
 Type_swallow_translator::do_try_request (Request*r)
 {
-  if (type_&&r->is_type_b (type_))
-      return true;
-  return false;
+  //  if (type_ && type_->before (typeid( *r))) // 
+  //  return true;
+  return false;                        // ugh. FIXME.
 }
 
 IMPLEMENT_IS_TYPE_B1(Type_swallow_translator, Translator);
index 2f56e3b7b3e013f9f3d07dba16b87f0a03e0acb0..a270ad7a9f7b248045a483baf937ad3fa89ff471 100644 (file)
@@ -48,7 +48,7 @@ void
 Vertical_align_engraver::acknowledge_element (Score_element_info i)
 {
   if (i.origin_grav_l_arr_.size() == 1 && 
-      i.elem_l_->is_type_b (Vertical_group_spanner::static_name()) &&
+      dynamic_cast<Vertical_group_spanner *> (i.elem_l_) &&
       !i.elem_l_->axis_group_l_a_[Y_AXIS]) 
     {
       assert (!valign_p_->contains_b (i.elem_l_));
index fcde1cfd52387c938f4135d04933ff37c1fc2fe2..a8cc0afc3a8cc72d4a307cb74c7512e0b80a55bd 100644 (file)
@@ -8,9 +8,8 @@
 # you do make dist 
 #
 
-# urg, ambiguous and thus error prone; hardcode all $(*scripts) to bin?
-buildscripts = $(depth)/bin
-scripts = $(depth)/bin
+buildscripts = $(depth)/buildscripts
+
 
 flower-dir = $(depth)/flower
 lib-dir = $(depth)/lib
@@ -22,7 +21,7 @@ include-flower = $(depth)/flower/include
 
 
 
-LILYPOND_INCLUDES = $(include-lib) $(depth)/lib/$(outdir) $(include-flower) $(depth)/flower/$(outdir) 
+LILYPOND_INCLUDES = -Istinho $(include-lib) $(depth)/lib/$(outdir) $(include-flower) $(depth)/flower/$(outdir) 
 
 
 # should use to create .spec ?
index a5f9487ed2fd75530fcbfe736a93d42cfb9bee59..f912908583963d3ed46219244c41fbd39245a2e6 100644 (file)
@@ -1,5 +1,5 @@
 
-export PATH:=$(topdir)/lily/out:$(topdir)/$(buildscripts)/out:$(PATH)
+export PATH:=$(topdir)/lily/out:$(topdir)/buildscripts/out:$(PATH)
 export MFINPUTS:=$(topdir)/mf/$(PATHSEP)$(MFINPUTS)$(PATHSEP)$(PATHSEP)
 export TEXINPUTS:=$(topdir)/tex/$(PATHSEP)$(TEXINPUTS)$(PATHSEP)$(PATHSEP)
 export LILYINCLUDE:=$(topdir)/init$(PATHSEP)$(topdir)/mf/out$(PATHSEP)$(LILYINCLUDE)
index ed8060fcfa5f73e6f67a094f2f9c1a8f9d523c87..244a80801f44ad24d36de04121a273d77ec7079e 100644 (file)
@@ -31,8 +31,8 @@ strip lily/out/lilypond mi2mu/out/mi2mu
 make prefix="$RPM_BUILD_ROOT/usr" install
 
 mkdir -p $RPM_BUILD_ROOT/etc/profile.d
-cp bin/out/lilypond-profile $RPM_BUILD_ROOT/etc/profile.d/lilypond.sh
-cp bin/out/lilypond-login $RPM_BUILD_ROOT/etc/profile.d/lilypond.csh
+cp buildscripts/out/lilypond-profile $RPM_BUILD_ROOT/etc/profile.d/lilypond.sh
+cp buildscripts/out/lilypond-login $RPM_BUILD_ROOT/etc/profile.d/lilypond.csh
 
 %files
 
index f2e39d714fa6ee8aee05e95decc80c12f7c6011c..5a7d8ef6709223d53c64b14086f59679f6294b1b 100644 (file)
@@ -7,5 +7,5 @@ $(outdir)/%.dvi: $(outdir)/%.mudtex
        mv $(notdir $@) $(outdir)
 
 $(outdir)/%.mudtex: %.doc
-       $(PYTHON) $(depth)/$(scripts)/mudela-book.py --outdir=$(outdir)/ --outname=$(notdir $@) $<
+       $(PYTHON) $(depth)/scripts/mudela-book.py --outdir=$(outdir)/ --outname=$(notdir $@) $<
 
index 22d9e63c676bf8727d760b40ed554ffd71ef1cc9..74072fb462448c171732fa518b5593137ef11b88 100644 (file)
@@ -23,9 +23,9 @@ $(outdir)/%.fly.txt: %.fly
 .PRECIOUS: $(outdir)/%.dvi
 
 $(outdir)/%.dvi: %.ly
-       $(PYTHON) $(depth)/$(scripts)/ly2dvi.py -o $(outdir)  $< 
+       $(PYTHON) $(depth)/scripts/ly2dvi.py -o $(outdir)  $< 
        -mv $(basename $<).midi $(outdir)
 
 $(outdir)/%.dvi: %.fly
-       $(PYTHON) $(depth)/$(scripts)/ly2dvi.py -o $(outdir)  $< 
+       $(PYTHON) $(depth)/scripts/ly2dvi.py -o $(outdir)  $< 
        -mv $(basename $<).midi $(outdir)
index be5aa37fde82c131295de83982862d5d64aa6f0b..11b4a35299335c16fabe98790a729b4b760d13c8 100644 (file)
@@ -12,4 +12,4 @@ convert-mudela: local-convert-mudela
        $(LOOP)
 
 local-convert-mudela:
-       $(PYTHON) $(depth)/$(scripts)/convert-mudela.py -e *ly
+       $(PYTHON) $(depth)/scripts/convert-mudela.py -e *ly
index 0979341e1aa1fbfb2ea6a3b46cbe0fc249ef4208..c13526cc6c2af56e055b8fd84643cf205c8b1787 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Titel: LilyPond
-Versie: 1.1.0
-Inschrijf datum: 23OCT98
+Versie: 1.1.1
+Inschrijf datum: 02NOV98
 Beschrijving: @FLAPTEKST@
 Trefwoorden: muziek typezetten midi notatie
 Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys)
 Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
-       770k lilypond-1.1.0.tar.gz 
+       770k lilypond-1.1.1.tar.gz 
 Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       770k lilypond-1.1.0.tar.gz 
+       770k lilypond-1.1.1.tar.gz 
 Copi-eer voorwaarden: GPL
 End
index 2d97b83a712ed534f4b7f230d6adf9031703d75d..a569d897c208f3635bc15cd88329f0f8220e98c5 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title: LilyPond
-Version: 1.1.0
-Entered-date: 23OCT98
+Version: 1.1.1
+Entered-date: 02NOV98
 Description: 
 LilyPond is the GNU Project music typesetter.  This program can print
 beautiful sheet music from a music definition file.  It can also play
@@ -14,8 +14,8 @@ Author: hanwen@cs.ruu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       770k lilypond-1.1.0.tar.gz 
+       770k lilypond-1.1.1.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       770k lilypond-1.1.0.tar.gz 
+       770k lilypond-1.1.1.tar.gz 
 Copying-policy: GPL
 End
index 34f96602435d65729ff15484cb1062ff9e8b0ed2..2eff8ff87e6abbeff03648e8c173252d05cf6783 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.1.0
+Version: 1.1.1
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.0.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.1.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
index e60960ffcbf390f0224dd1cba484fe5fc257053a..ae6073e89cbd18abe6595e4d291b69846a5dce09 100644 (file)
@@ -8,9 +8,9 @@ depth = .
 
 # descent order into subdirectories:
 #
-SUBDIRS = bin flower lib lily mf mi2mu po debian \
+SUBDIRS = scripts buildscripts  flower lib lily mf mi2mu po debian \
        Documentation init input tex make mutopia test intl stepmake\
-       ps
+       ps 
 #
 
 SCRIPTS = configure aclocal.m4
diff --git a/scripts/GNUmakefile b/scripts/GNUmakefile
new file mode 100644 (file)
index 0000000..b954530
--- /dev/null
@@ -0,0 +1,12 @@
+# bin/Makefile
+
+depth = ..
+SEXECUTABLES=convert-mudela mudela-book ly2dvi 
+STEPMAKE_TEMPLATES=script
+
+
+include $(depth)/make/stepmake.make 
+
+include $(stepdir)/executable-targets.make
+
+
diff --git a/scripts/convert-mudela.py b/scripts/convert-mudela.py
new file mode 100644 (file)
index 0000000..f8b10a9
--- /dev/null
@@ -0,0 +1,366 @@
+#!@PYTHON@
+
+# convert-mudela.py -- convertor for mudela versions
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1998 
+
+# TODO
+#   use -f and -t for -s output
+
+# NEWS
+# 0.2
+#  - rewrite in python
+
+program_name = 'convert-mudela'
+version = '0.4'
+
+
+import os
+import sys
+import __main__
+import getopt
+from string import *
+import re
+
+import time
+mudela_version_re_str = '\\\\version *\"(.*)\"'
+mudela_version_re = re.compile(mudela_version_re_str)
+
+def program_id ():
+       return '%s version %s' %(program_name,  version);
+
+def identify ():
+       sys.stderr.write (program_id () + '\n')
+
+def gulp_file(f):
+       try:
+               i = open(f)
+               i.seek (0, 2)
+               n = i.tell ()
+               i.seek (0,0)
+       except:
+               print 'can\'t open file: ' + f + '\n'
+               return ''
+       s = i.read (n)
+       if len (s) <= 0:
+               print 'gulped empty file: ' + f + '\n'
+       i.close ()
+       return s
+
+
+def str_to_tuple (s):
+       return tuple (map (atoi, split (s,'.')))
+
+def tup_to_str (t):
+       return join (map (lambda x: '%s' % x, list (t)), '.')
+
+def version_cmp (t1, t2):
+       for x in [0,1,2]:
+               if t1[x] - t2[x]:
+                       return t1[x] - t2[x]
+       return 0
+               
+
+def guess_mudela_version(filename):
+       s = gulp_file (filename)
+       m = mudela_version_re.search (s)
+       if m:
+               return m.group(1)
+       else:
+               return ''
+
+def help ():
+       sys.stdout.write (
+               ("Usage: %s [OPTION]... [FILE]...\n" 
+               + "Try to convert to newer mudela-versions\n"
+               + "Options:\n"
+               + "  -h, --help             print this help\n"
+               + '  -e, --edit             in place edit\n'
+               + '  -f, --from=VERSION     start from version\n'
+               + '  -s, --show-rules       print out all rules.\n'
+               + '  -t, --to=VERSION       target version\n') % program_name)
+       sys.exit (0)
+
+class FatalConversionError:
+       pass
+
+conversions = []
+
+def show_rules (file):
+       for x in conversions:
+               file.write  ('%s: %s\n' % (tup_to_str (x[0]), x[2]))
+
+############################
+               
+if 1:                                  # need new a namespace
+       def conv (lines):
+               found =0
+               for x in lines:
+                       if re.search ('\\\\octave', x):
+                               found = 1
+                               break
+               if found:
+                       sys.stderr.write ('\nNot smart enough to convert \\octave')
+                       raise FatalConversionError()
+               return lines
+               
+
+       conversions.append (
+               ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically'))
+
+
+if 1:                                  # need new a namespace
+       def conv (lines):
+               newlines = []
+               for x in lines:
+                       x = re.sub ('\\\\textstyle([^;]+);',
+                                        '\\\\property Lyrics . textstyle = \\1', x)
+                       x = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', x)
+                       newlines.append (x)
+               return newlines
+               
+
+       conversions.append (
+               ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax'))
+
+
+if 1:                                  # need new a namespace
+       def conv (lines):
+               newlines = []
+               for x in lines:
+                       x = re.sub ('\\\\musical_pitch',
+                                        '\\\\musicalpitch',x)
+                       x = re.sub ('\\\\meter',
+                                        '\\\\time',x)
+                       newlines.append (x)
+               return newlines
+               
+
+       conversions.append (
+               ((0,1,21), conv, '\\musical_pitch -> \\musicalpitch, '+
+                '\\meter -> \\time'))
+
+if 1:                                  # need new a namespace
+       def conv (lines):
+               return lines
+
+       conversions.append (
+               ((1,0,0), conv, '0.1.21 -> 1.0.0 '))
+
+
+if 1:                                  # need new a namespace
+       def conv (lines):
+               newlines = []
+               for x in lines:
+                       x = re.sub ('\\\\accidentals',
+                                   '\\\\keysignature',x)
+                       x = re.sub ('specialaccidentals *= *1',
+                                        'keyoctaviation = 0',x)
+                       x = re.sub ('specialaccidentals *= *0',
+                                        'keyoctaviation = 1',x)
+                       newlines.append (x)
+               return newlines
+               
+
+       conversions.append (
+               ((1,0,1), conv, '\\accidentals -> \\keysignature, ' +
+                'specialaccidentals -> keyoctaviation'))
+
+if 1:
+       def conv(lines):
+               found = 0
+               for x in lines:
+                       if re.search ('\\\\header', x):
+                               found = 1
+                               break
+               if found:
+                       sys.stderr.write ('\nNot smart enough to convert to new \\header format')
+               return lines
+       
+       conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }')
+
+if 1:
+       def conv(lines):
+               newlines =[]
+               for x in lines:
+                       x =  re.sub ('\\\\melodic', '\\\\notes',x)
+                       newlines.append (x)
+               return newlines
+       
+       conversions.append ((1,0,3), conv, '\\melodic -> \\notes')
+
+if 1:
+       def conv(lines):
+               newlines =[]
+               for x in lines:
+                       x =  re.sub ('default_paper *=', '',x)
+                       x =  re.sub ('default_midi *=', '',x)                   
+                       newlines.append (x)
+               return newlines
+       
+       conversions.append ((1,0,4), conv, 'default_{paper,midi}')
+
+if 1:
+       def conv(lines):
+               newlines =[]
+               for x in lines:
+                       x =  re.sub ('ChoireStaff', 'ChoirStaff',x)
+                       x =  re.sub ('\\output', 'output = ',x)
+                       newlines.append (x)
+               return newlines
+       
+       conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff')
+
+if 1:
+       def conv(lines):
+               newlines =[]
+               found = None
+               for x in lines:
+                       found = re.search ('[a-zA-Z]+ = *\\translator',x)
+                       newlines.append (x)
+                       if found: break
+               if found:
+                       sys.stderr.write ('\nNot smart enough to \\translator syntax')
+                       raise FatalConversionError()
+               return newlines
+       
+       conversions.append ((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }')
+
+
+if 1:
+       def conv(lines):
+               newlines =[]
+               for x in lines:
+                       x =  re.sub ('\\\\lyric', '\\\\lyrics',x)
+                       newlines.append (x)
+               return newlines
+       
+       conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics')
+
+
+############################
+       
+
+def get_conversions (from_version, to_version):
+       def version_b (v, f = from_version, t = to_version):
+               return version_cmp (v[0], f) > 0 and version_cmp (v[0], t) <= 0
+       return filter (version_b, conversions)
+
+
+def latest_version ():
+       return conversions[-1][0]
+
+def do_conversion (infile, from_version, outfile, to_version):
+       
+       conv_list = get_conversions (from_version, to_version)
+
+       sys.stderr.write ('Applying conversions: ')
+       lines = infile.readlines();
+       last_conversion = ()
+       try:
+               for x in conv_list:
+                       sys.stderr.write (tup_to_str (x[0])  + ', ')
+                       lines = x[1] (lines)
+                       last_conversion = x[0]
+                       
+
+       except FatalConversionError:
+               sys.stderr.write ('Error while converting; I won\'t convert any further')
+
+       for x in lines:
+               if last_conversion:
+                       x = re.sub (mudela_version_re_str, '\\\\version \"%s\"' % tup_to_str (last_conversion), x)
+               outfile.write(x)
+
+class UnknownVersion:
+       pass
+
+def do_one_file (infile_name):
+       sys.stderr.write ('Processing `%s\' ... '% infile_name)
+       outfile_name = ''
+       if __main__.edit:
+               outfile_name = infile_name + '.NEW'
+       elif __main__.outfile_name:
+               outfile_name = __main__.outfile_name
+
+       if __main__.from_version:
+               from_version = __main__.from_version
+       else:
+               guess = guess_mudela_version (infile_name)
+               if not guess:
+                       raise UnknownVersion()
+               from_version = str_to_tuple (guess)
+
+       if __main__.to_version:
+               to_version = __main__.to_version
+       else:
+               to_version = latest_version ()
+
+
+       if infile_name:
+               infile = open (infile_name,'r')
+       else:
+               infile = sys.stdin
+
+       if outfile_name:
+               outfile =  open (outfile_name, 'w')
+       else:
+               outfile = sys.stdout
+
+       
+       do_conversion (infile, from_version, outfile, to_version)
+
+       if infile_name:
+               infile.close ()
+
+       if outfile_name:
+               outfile.close ()
+
+       if __main__.edit:
+               try:
+                       os.remove(infile_name + '~')
+               except:
+                       pass
+               os.rename (infile_name, infile_name + '~')
+               os.rename (infile_name + '.NEW', infile_name)
+
+       sys.stderr.write ('\n')
+       sys.stderr.flush ()
+
+edit = 0
+to_version = ()
+from_version = ()
+outfile_name = ''
+
+identify ()
+(options, files) = getopt.getopt (
+       sys.argv[1:], 'f:t:seh', ['show-rules', 'help', 'edit', 'from', 'to'])
+
+for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o== '--help' or o == '-h':
+               help ()
+       elif o== '--from' or o=='-f':
+               from_version = str_to_tuple (a)
+       elif o== '--to' or o=='-t':
+               to_version = str_to_tuple (a)
+       elif o== '--edit' or o == '-e':
+               edit = 1
+       elif o== '--show-rules' or o == '-s':
+               show_rules (sys.stdout)
+               sys.exit(0)
+       else:
+               print o
+               raise getopt.error
+
+
+for f in files:
+       if f == '-':
+               f = ''
+       try:
+               do_one_file (f)
+       except UnknownVersion:
+               pass
diff --git a/scripts/ly2dvi-old.sh b/scripts/ly2dvi-old.sh
new file mode 100644 (file)
index 0000000..b2e0330
--- /dev/null
@@ -0,0 +1,1005 @@
+#!/bin/sh
+#
+# Script to make a LaTeX file for Lilypond
+#
+# Written by Jan Arne Fagertun <Jan.A.Fagertun@energy.sintef.no>
+#  Sat Nov 22 22:26:43 CET 1997
+#
+# $Id: ly2dvi.sh,v 1.16 1998/05/08 21:18:34 janaf Exp $
+#
+#  Original LaTeX file made by Mats Bengtsson, 17/8 1997
+#
+
+VERSION="0.12.jcn1"
+NAME=ly2dvi.sh
+IDENTIFICATION="$NAME $VERSION" 
+NOW=`date`
+echo "$IDENTIFICATION" 1>&2
+
+# TODO:
+#  prevent orphaned "Lily is here" strings
+
+# NEWS
+
+# 0.12.jcn1
+#  - mudelaDefs really fixed (sorry, PC)
+
+# 0.12
+#  - -S/--sourcedir switch
+
+#
+#0.11.jcn3
+# - mudelaDefs fixes, (thanks PC)
+#0.11.jcn2
+# - pass -I, --include to Lily
+# - bf: split $LILYINCLUDE and try all dirs
+# - bf: geometry left/top
+#
+#0.11.pc
+# - fix backslash gobbling, reduce number of separate processes used
+# - require readable rc files, allow rc file in /usr/local/share/lilypond/lilyrc
+# - use latex path, not tex path
+# - Don't override if kpsepath returns non-NULL
+# - Don't clobber x.tex if it wasn't created by ly2dvi
+#
+#
+#0.11.jcn1
+# - find .fly files too
+#
+#0.11.hwn1
+# - height vs heigth
+# - robustification: give \nonstopmode as LaTeX arg; no hanging if no TeX file.
+# - robustification: notice failed cp.
+
+#0.11
+#      - more papersizes (thanks Han-Wen) - don't expect LaTeX to accept all...
+#      - -W,--Width=       : set paper width  (points)
+#       - -H,--Height=      : set paper height (points)
+#      - -H and -W is used only when an unknown papersize is to be specified,
+#        and has to be combined with a papersize option known to LaTeX
+#NB!   - -F,--headers=     : name of additional LaTeX headers input file.
+#NB!      Changed from -H to -F
+#      - -d,--dependencies : passed to lilypond
+
+
+#0.10.jcn1
+#      - HEIGHT -> HEIGHT
+#      - vertical margins (for a4), same on both sides
+#      - textheight from lilypond output file (mudelapapertextheight)
+#      - piece titling
+#      - mudelapiece, mudelaopus
+#
+#0.10
+#      - -K,--keeplilypond : Keep lilypond output files (default delete)
+#      - -k,--keeply2dvi   : Keep ly2dvi   output files (default delete)
+#      - -L,--landscape    : Set landscape orientation
+#      - -N,--nonumber     : Turn off page numbering (\pagestyle{empty})
+#      - Could not reinsert "\usepackage[T1]{fontenc}" because
+#        "los-toros" won't work with it
+#      - Ekstra LaTeX headers from input file
+#0.9.hwn1
+#       - option to remove output of lily
+# 0.9
+#      - Trap Lilypond abort
+#      - Replaced "\usepackage[T1]{fontenc}" with
+#        \usepackage[latin1]{inputenc} (takk, Mats)
+#      - Removed "()" around "\LilyIdString" (Janne didn't want it)
+# 0.8  - Trap Lilypond segmentation fault
+#      - Function for cleanup
+#      - Trap line
+#      - More human-readable variables
+#      - Some logics concerning rc-files
+# 0.7
+#      - Improved Lilypond error checking
+#      - Output orientation (landscape...). Overrides mudela file
+#        variable orientation="landscape";
+#      - Paper width and height put into variables (only A4!)
+#      - Adjusted top margin to default.....
+#
+#TODO
+#      - Include more papersizes.
+#      - Manual page.......
+# 0.6.jaf2
+#      - LILYINCLUDE update
+#
+# 0.6.hwn1
+#      - handle LILYINCLUDE
+#       - --output
+#
+# 0.6
+#      - Source rc-files, if present. Files are:
+#        /usr/local/share/lilyrc /etc/lilyrc $HOME/.lilyrc ./.lilyrc
+#      - tee output from Lilypond
+#      - Handles margins for A4 paper (equal on both sides)
+#      - new option -s (--separate) for one LaTeX run per file,
+#        else all files are run together
+#
+# 0.5
+#      - More useful ("two-level") debug.
+#      - The Q&D hack to find file names and not handling \include
+#        is replaced by grabbing output file names from Lilypond.
+#      = Detects multiple output files - adds them when running
+#        LaTeX.
+#      - Works with multiple input files - no matter if they are
+#        (a mix of) input to or output from Lilypond.
+#
+#TODO
+#      - Still no margins handling.
+#      - We have to discuss how to handle multiple output files
+#        from Lilypond - 'ly2dvi standchen' gives a rather odd
+#        result....
+
+# 0.4.1
+#      - Always exit after printing help info
+# 0.4
+#      - Changes to ensure for more strict grep'ing of parameters
+#        Thanks to from G.B.Stott@bolton.ac.uk
+#      - More efficient use of sed -e 's///' -e 's///'
+#        Thanks to Johan Vromans <jvromans@squirrel.nl> and GBS
+#      - Ask tex for location of titledefs.tex (Thanks to JV)
+#      - Accept only exact match of "\def\mudelacomposer{"
+#        (or whatever mudela* defined in titledefs.tex)
+#      - Even more efficient use of sed (Thanks to JV)
+#      - Default file name for single output file implemented.
+#      - Moved help into function - finally included from 0.1.jcn1
+#
+#TODO
+#      - Still doesn't handle \include
+#      - The Q&D for finding output file name from the sequence of
+#        \paper \output \midi \output really needs to be looked at.
+#        I have improved it a lot, but it's only capable of finding
+#        one (the last) file name.
+#        Well, I have to rewrite this entirely to handle \include,
+#        then I can fix it.
+#      - Still no margins handling.
+#
+#WARNING
+#      - Some lines of output from lilypond do NOT start
+#        at first character position, therefore I have removed "^"
+#        in sed'ing and grep'ing.
+
+# 0.3.hwn1
+#      - add "Creator: " line to output
+#
+# 0.3
+#      - multiple input files to make score from several files
+#        (extra files assumed to be Lilypond output)
+#      - cp dvi-file instead of mv, to allow for xdvi reload
+#      - check for illegal long options
+#      - put in pt in text width, if not given
+#      - put in \nonstopmode in LaTeX file
+#      - restored LaTeX exit value check
+# 0.2.1
+#      - temporarily omit LaTeX exit value check
+#      - remove ALL temporary files
+
+# 0.2
+#      - fix for solaris          - included from 0.1.jcn1
+#      - long option hack         - included from 0.1.jcn1 - modified
+#      - moved help into function - NOT included from 0.1.jcn1 yet
+#      - various improvements     - included from 0.1.jcn1
+#      - find mudela definitions from titledefs.tex
+#      - find papersize from lilypond output file (mudelapapersize),
+#        overridden by option '-p size' or '--papersize=size'
+#      - option -l lang or --language=lang overrides
+#        lilypond output file definition (mudelalanguage)
+#      - textwidth from lilypond output file (mudelapaperlinewidth)
+
+# 0.1.jcn1
+#      - fix for solaris
+#      - long option hack
+#      - moved help into function
+
+#
+# Clean up
+#
+cleanup() {
+  if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
+  then
+    [ -n "$LatF" -a -f "$LatF" ]       && rm -f $LatF
+    [ -n "$LOGFILE" -a -f "$LOGFILE" ] && rm -f $LOGFILE
+    [ -n "$FN" ]                       && rm -f $FN.*
+    for F in *$$* $TMP/*$$*
+    do
+      rm -f $F
+    done
+  fi
+  if [ "$KEEP_LILY_OUTPUT" != "Y" ]
+  then
+    for F in $LILY_OUTPUT_FILES
+    do
+      [ -f $F ] && rm -f $F
+    done
+  fi
+}
+
+#
+# print usage
+#
+help() {
+  cat << EOF
+Generate dvi file from mudela or lilypond output
+Usage: $0 [OPTION]... [FILE]...
+
+Options:
+  -D,--debug           increase verbosity
+  -F,--headers=        name of additional LaTeX headers file
+  -H,--Height=         set paper height (points) (see manual page)
+  -I,--include=DIR     add DIR to search path of LilyPond
+  -K,--keeplilypond    keep lilypond output files
+  -L,--landscape       set landscape orientation
+  -N,--nonumber        switch off page numbering
+  -O,--orientation=    set orientation (obsolete - use -L instead) 
+  -W,--Width=          set paper width (points) (see manual page)
+  -d,--dependencies    tell lilypond make a dependencies file
+  -h,--help            this help text
+  -k,--keeply2dvi      keep ly2dvi output files
+  -l,--language=       give LaTeX language (babel)
+  -o,--output=         set output directory
+  -p,--papersize=      give LaTeX papersize (eg. a4)
+  -s,--separate        run all files separately through LaTeX
+  -S,--sourcedir       set sourcedir 
+
+  files may be (a mix of) input to or output from lilypond(1)
+EOF
+}
+
+
+#
+# SVr4 echo swallows backslashes, and there's no way to turn it off.
+# Therefore use Echo whenever backslashes may be important.
+# printf is in the posix.2 standard -- which means it's in 
+# all modern shells.
+#
+Echo() {
+       printf "%s\n" "$@"
+}
+
+#
+setPaperZize() {
+case "$PAPERSIZE" in
+  a0*)
+    PWIDTH=2389
+    PHEIGHT=3381
+    PAPERSIZE=a0paper
+    ;;
+  a1|a1p*)
+    PWIDTH=1690
+    PHEIGHT=2389
+    PAPERSIZE=a1paper
+    ;;
+  a2*)
+    PWIDTH=1194
+    PHEIGHT=1690
+    PAPERSIZE=a2paper
+    ;;
+  a3*)
+    PWIDTH=845
+    PHEIGHT=1194
+    PAPERSIZE=a3paper
+    ;;
+  a4*)
+    PWIDTH=597
+    PHEIGHT=845
+    PAPERSIZE=a4paper
+    ;;
+  a5*)
+    PWIDTH=423
+    PHEIGHT=597
+    PAPERSIZE=a5paper
+    ;;
+  a6*)
+    PWIDTH=298
+    PHEIGHT=423
+    PAPERSIZE=a6paper
+    ;;
+  a7*)
+    PWIDTH=211
+    PHEIGHT=298
+    PAPERSIZE=a7paper
+    ;;
+  a8*)
+    PWIDTH=305
+    PHEIGHT=211
+    PAPERSIZE=a8paper
+    ;;
+  a9*)
+    PWIDTH=105
+    PHEIGHT=305
+    PAPERSIZE=a9paper
+    ;;
+  a10*)
+    PWIDTH=74
+    PHEIGHT=105
+    PAPERSIZE=a10paper
+    ;;
+  b0*)
+    PWIDTH=2847
+    PHEIGHT=4023
+    PAPERSIZE=b0paper
+    ;;
+  b1*)
+    PWIDTH=2012
+    PHEIGHT=2847
+    PAPERSIZE=b1paper
+    ;;
+  b2*)
+    PWIDTH=1423
+    PHEIGHT=2012
+    PAPERSIZE=b2paper
+    ;;
+  b3*)
+    PWIDTH=1006
+    PHEIGHT=1423
+    PAPERSIZE=b3paper
+    ;;
+  b4*)
+    PWIDTH=712
+    PHEIGHT=1006
+    PAPERSIZE=b4paper
+    ;;
+  b5*)
+    PWIDTH=503
+    PHEIGHT=712
+    PAPERSIZE=b5paper
+    ;;
+  archA)
+    PWIDTH=650
+    PHEIGHT=867
+    ;;
+  archB)
+    PWIDTH=867
+    PHEIGHT=1301
+    ;;
+  archC)
+    PWIDTH=1301
+    PHEIGHT=1734
+    ;;
+  archD)
+    PWIDTH=1734
+    PHEIGHT=2602
+    ;;
+  archE)
+    PWIDTH=2602
+    PHEIGHT=3469
+    ;;
+  flsa|flse)
+    PWIDTH=614
+    PHEIGHT=940
+    ;;
+  halfletter)
+    PWIDTH=397
+    PHEIGHT=614
+    ;;
+  ledger)
+    PWIDTH=1229
+    PHEIGHT=795
+    ;;
+  legal)
+    PWIDTH=614
+    PHEIGHT=1012
+    ;;
+  letter)
+    PWIDTH=614
+    PHEIGHT=795
+    ;;
+  note)
+    PWIDTH=542
+    PHEIGHT=723
+    ;;
+  *)
+    echo ""
+    echo $0": unknown papersize -- "$PAPERSIZE
+    echo ""
+    ;;
+esac
+}
+
+doRcFiles()
+{
+#
+# RC-files ?
+#
+for D in /usr/local/share/ /usr/local/share/lilypond/ /etc/ $HOME/. ./.
+do
+  RCfile=$D"lilyrc"
+  [ -r $RCfile ] && . $RCfile
+done
+fORI=$ORIENTATION
+fLNG=$LANGUAGE
+fPSZ=$PAPERSIZE
+fLHF=$LATEXHF
+unset ORIENTATION LANGUAGE PAPERSIZE LATEXHF
+}
+
+
+
+#
+# Trap function (cleanup)
+#
+
+
+
+trap cleanup 0 9 15
+
+
+
+#
+# Various defaults
+#
+[ -z "$TMP" ] && TMP=/tmp
+if [ ! -d $TMP ]
+then
+  $debug_echo $IDENTIFICATION": temporary directory "$TMP" not found, set to /tmp"
+  TMP=/tmp
+fi
+LOGFILE=$TMP/lilylog.$$                        # Logfile for lilypond
+PAPERSIZE=a4                            # Default papersize name
+PWIDTH=597                              # Default paperwidth
+PHEIGHT=845                             # Default paperheight
+PNUM="%"                                # Page numbering on
+LILYOPTS=""                             # Options to lilypond
+SOURCEDIR=""
+LILYPOND_EXECUTABLE=lilypond
+doRcFiles
+
+
+
+# Keywords defined in titledefs.tex
+#
+TF="`kpsewhich -n latex tex titledefs.tex`"
+MU_DEF=""
+if [ -r "${TF:=/usr/local/share/texmf/tex/lilypond/titledefs.tex}" ]
+then
+  MU_DEF=`sed -n -e 's/.*newcommand\*{.\(mudela[^}]*\)}.*$/\1/p' "$TF"`
+fi
+
+: "${MU_DEF:=mudelatitle mudelasubtitle mudelacomposer \
+          mudelameter mudelaopus mudelaarranger mudelapiece \
+         mudelapoet mudelainstrument \
+         }"
+
+#
+# debugging
+#
+debug_echo=:
+#
+# All files in one LaTeX run
+#
+SEPFILE=N
+#
+# Find command line options and switches
+#
+# "x:" x takes argument
+#
+switches="DF:H:I:KLNO:W:dhkl:o:p:S:s\?"
+options=""
+#
+# ugh, "\-" is a hack to support long options
+# while getopts \-:$options$switches O
+# must be in double quotes for bash-2.0
+while getopts "\-:$options$switches" O
+do
+  $debug_echo "O: \`$O'"
+  $debug_echo "arg: \`$OPTARG'"
+  case $O in
+    D  )
+      [ $debug_echo = echo ] && set -x
+      debug_echo=echo
+      ;;
+    F  )
+      LATEXHF=$OPTARG
+      ;;
+    H  )
+      PHEIGHT=$OPTARG
+      ;;
+    I  )
+      LILYOPTS="$LILYOPTS -I $OPTARG"
+      LILYINCLUDE="$LILYINCLUDE:$OPTARG"
+      ;;
+    K  )
+      KEEP_LILY_OUTPUT=Y
+      ;;
+    L  )
+      ORIENTATION=landscape
+      ;;
+    O  )
+      ORIENTATION=$OPTARG
+      ;;
+    N  )
+      PNUM="\pagestyle{empty}"
+      ;;
+    W  )
+      PWIDTH=$OPTARG
+      ;;
+    d  )
+      LILYOPTS=$LILYOPTS" -d"
+      ;;
+    h  )
+      help;
+      exit 0
+      ;;
+    k  )
+      KEEP_LY2DVI_OUTPUT=Y
+      ;;
+    l  )
+      LANGUAGE=$OPTARG
+      ;;
+    o  )
+      OUTPUTDIR=$OPTARG
+      ;;
+    p  )
+      PAPERSIZE=$OPTARG
+      ;;
+    s  )
+      SEPFILE=Y
+      ;;
+    S  )
+      SOURCEDIR=$OPTARG
+      ;;
+    \? )
+      help;
+      exit -1
+      ;;
+    # a long option!
+    -)
+      $debug_echo "long option: \`$OPTARG'"
+      case "$OPTARG" in
+        He*|-He*)
+          PHEIGHT"`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"=
+          ;;
+        W*|-W*)
+          PWIDTH="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+          ;;
+        dep*|-dep*)
+          LILYOPTS="$LILYOPTS -d"
+          ;;
+        d*|-d*)
+          [ $debug_echo = echo ] && set -x
+          debug_echo=echo
+          ;;
+        hea*|-hea*)
+          LATEXHF="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+          ;;
+        h*|-h*)
+          help;
+         exit 0
+          ;;
+        i*|-i*)
+          dir="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+         LILYOPTS="$LILYOPTS --include=$dir"
+         LILYINCLUDE="$LILYINCLUDE:$dir"
+         ;;
+        keepli*|-keepli*)
+          KEEP_LILY_OUTPUT=Y
+          ;;
+        k*|-k*)
+          KEEP_LY2DVI_OUTPUT=Y
+          ;;
+        land*|-land*)
+          ORIENTATION=landscape
+          ;;
+        lang*|-lang*)
+          LANGUAGE="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+          ;;
+       n*|-n*)
+         PNUM="\pagestyle{empty}"
+         ;;
+       or*|-or*)
+         ORIENTATION="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+         ;;
+       ou*|-ou*)
+         OUTPUTDIR="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+         ;;
+        p*|-p*)
+          PAPERSIZE="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
+          ;;
+        separa*|-sep*)
+         SEPFILE=Y
+          ;;
+       sourcedir*|-sourcedir*)
+         SOURCEDIR=$OPTARG
+         ;;
+        *|-*)
+          echo "$0: illegal option -- \"$OPTARG\""
+          help;
+          exit -1
+          ;;
+      esac
+  esac
+done
+shift `expr $OPTIND - 1`
+
+if [ "$SOURCEDIR" != "" ]; then
+# apparently MakeTeXTFM can't handle relative dirs
+       SOURCEDIR=`cd $SOURCEDIR; pwd`
+       LILYINCLUDE="$SOURCEDIR/init:$SOURCEDIR/mf/out:$LILYINCLUDE"
+       TEXINPUTS="$SOURCEDIR/tex:$TEXINPUTS:"
+       MFINPUTS="$SOURCEDIR/mf:$MFINPUTS:"
+       LILYPOND_EXECUTABLE="$SOURCEDIR/lily/out/lilypond"
+       export MFINPUTS LILYPOND_EXECUTABLE TEXINPUTS SOURCEDIR 
+fi
+
+#
+# Input file name
+#
+if [ "$1" = "" ]
+then
+  help
+  $debug_echo "$IDENTIFICATION: No input file name given"
+  exit 1
+fi
+# regexp_quote -- quote a string as a regular expression for egrep or sed
+regexp_quote(){
+       Echo "$@" | sed 's/\([]\[\.*?+^$]\)/\\\1/g'
+}
+#
+#
+mudelaDefs(){
+# Include \def\mudela-definitions
+# The aim here is to pick up the definition for the 
+# current file, then any other file.
+#
+mudelatmp=$TMP/mudelaDefs$$
+# Use `cat' to prevent filenames being prepended
+# 
+cat "$File" $OF | fgrep "$MU_DEF" > $mudelatmp
+for L in $MU_DEF
+do
+    # This converts \def\mudelatitle{fred}
+    # to \mudelatitle{fred} or to
+    # \def\mudelatitle{fred}
+    # and stops after the first one found.
+    sed -n '/\\def\\'"$L"'{\([^}]*\)}.*$/{
+       s//'"`regexp_quote \"$1\"`"'\\'"$L"'{\1}%/p
+       q
+    }'  $mudelatmp  >> $LatF
+done
+rm -f $mudelatmp
+}
+#
+#
+startFile(){
+#
+# LaTeX file name
+#
+BN=`basename "$File" .tex`
+FN="$BN.$$"
+if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
+then
+  LatF="$TMP/$FN.tex"
+else
+  LatF="$FN.tex"
+fi
+#
+# Find:
+#   paper size        (PAPERSIZE, overridden by command line option -p)
+#   paper orientation (ORIENTATION, overridden by option -o)
+#   language          (LANGUAGE, overridden by option -l)
+#   textwidth
+#
+eval `sed -n \\
+  -e 's/\\\\def\\\\mudelalanguage{\([^}]*\).*$/fLNG=\1;/p' \\
+  -e 's/\\\\def\\\\mudelalatexheaders{\([^}]*\).*$/fLHF=\1;/p' \\
+  -e 's/\\\\def\\\\mudelaorientation{\([^}]*\).*$/fORI=\1;/p' \\
+  -e 's/\\\\def\\\\mudelapaperlinewidth{\([^}]*\).*$/TWN=\1;/p' \\
+  -e 's/\\\\def\\\\mudelapapertextheight{\([^}]*\).*$/THN=\1;/p' \\
+  -e 's/\\\\def\\\\mudelapapersize{\([^}]*\).*$/fPSZ=\1;/p' \\
+    "$File"`
+#
+if [ -z "$LATEXHF" ]
+then
+  LATEXHF="$fLHF"
+fi
+LLHF="%"
+if [ -n "$LATEXHF" ]
+then
+  [ -f         "$LATEXHF" ] && LLHF="\input{$LATEXHF}"
+fi
+#
+if [ -z "$PAPERSIZE" ]
+then
+  PAPERSIZE="$fPSZ"
+fi
+if [ -n "$PAPERSIZE" ]
+then
+  setPaperZize
+  PAPEROPT="$PAPERSIZE"
+fi
+#
+if [ -z "$ORIENTATION" ]
+then
+  ORIENTATION="$fORI"
+fi
+if [ -n "$ORIENTATION" ]
+then
+  if [ -z "$PAPEROPT" ]
+  then
+    PAPEROPT="$ORIENTATION"
+  else
+    PAPEROPT="$PAPEROPT,$ORIENTATION"
+  fi
+fi
+#
+if [ -n "$PAPEROPT" ]
+then
+  PAPER="[$PAPEROPT]"
+fi
+#
+if [ -z "$LANGUAGE" ]
+then
+  LANGUAGE="$fLNG"
+fi
+if [ -n "$LANGUAGE" ]
+then
+  LLNG="\usepackage[$LANGUAGE]{babel}"
+else
+  LLNG="%"
+fi
+
+#
+# Find textwidth
+#
+if [ -n "$TWN" ]
+then
+  TW="$TWN"
+  case "$TW" in
+    *mm)
+      ;;
+    *cm)
+      ;;
+    *pt)
+      ;;
+    *)
+      TW="${TW}pt"
+      ;;
+  esac
+  $debug_echo "Text width = $TW"
+fi
+TWp=`Echo $TW | sed -e 's/\..*$//'`
+PWp="$PWIDTH"
+#
+# Find textheight
+#
+if [ -n "$THN" ]
+then
+  TH=$THN
+  case $TH in
+    *mm)
+      ;;
+    *cm)
+      ;;
+    *pt)
+      ;;
+    *)
+      TH="${TH}pt"
+      ;;
+  esac
+  $debug_echo "Text height = $TH"
+fi
+THp="`echo $TH | sed -e 's/\..*$//'`"
+PHp="$PHEIGHT"
+if [ "$ORIENTATION" = "landscape" ]
+then
+  PWp="$PHEIGHT"
+  PHp="$PWIDTH"
+fi
+HMARG="`expr '(' $PWp - $TWp ')' / 2`"pt
+$debug_echo "Text left = $HMARG"
+VMARG="`expr '(' $PHp - $THp ')' / 2`"pt
+$debug_echo "Text top = $VMARG"
+#
+# Geometry: /var/lib/texmf/latex/geometry/geometry.dvi
+#
+#
+# Write LaTeX file
+#
+cat << EOF > $LatF
+% Creator: $IDENTIFICATION
+% Automatically generated from  $IF, $NOW
+
+\documentclass$PAPER{article}
+
+$LLNG
+\usepackage{geometry}
+\usepackage[latin1]{inputenc}
+%\usepackage[T1]{fontenc}
+$PNUM
+%\addtolength{\oddsidemargin}{-1cm}
+%\addtolength{\topmargin}{-1cm}
+%\setlength{\textwidth}{$TW}
+%\setlength{\textheight}{$TH}
+\geometry{width=$TW, left=$HMARG, height=$TH, top=$VMARG}
+\input lilyponddefs
+\input titledefs
+$LLHF
+\begin{document}
+EOF
+mudelaDefs
+cat << EOF >> $LatF
+\cmrtwenty% ugh
+\makelilytitle
+EOF
+}
+nextFile(){
+cat << EOF >> $LatF
+\def\theopus{}%
+\def\thepiece{}%
+\def\mudelaopus{}%
+\def\mudelapiece{}%
+EOF
+mudelaDefs "\\def"
+cat << EOF >> $LatF
+\def\theopus{\mudelaopus}% ugh
+\def\thepiece{\mudelapiece}%
+\makelilypiecetitle
+EOF
+}
+#
+# Conclusion
+#
+endFile(){
+cat << EOF >> $LatF
+\vfill\hfill{\LilyIdString}
+\end{document}
+EOF
+#
+# Run LaTeX
+#
+latex '\nonstopmode \input '$LatF || exit 5
+#
+# Rename dvi file
+#
+if [ -f $FN.dvi ]
+then
+    RESULT="$BN.dvi"
+    [ -n "$OUTPUTDIR" ] && RESULT="$OUTPUTDIR/$RESULT"
+    
+    cp "$FN.dvi" "$RESULT" || exit 5
+fi
+#
+# Output some info
+#
+cat << EOF
+
+$IDENTIFICATION: dvi file name is $RESULT
+
+EOF
+}
+
+# ugh. GF is side-effect.
+findInput() {
+# should check for LILYINCLUDE
+  OIFS="$IFS"
+  IFS=':'
+  x=`echo $LILYINCLUDE | sed "s!:! !g"`
+  IFS="$OIFS"
+  for lypath in . $x
+  do
+    if [ -f "$lypath/$1" ]
+    then
+      GF="$lypath/$1"
+      return
+    fi
+
+    if [ -f "$lypath/$1.ly" ]
+    then
+      GF="$lypath/$1.ly"
+      return
+    fi
+    if [ -f "$lypath/$1.fly" ]
+    then
+       GF="$lypath/$1.fly"
+       return
+    fi
+  done
+  $debug_echo "$IDENTIFICATION: Input file \"$GF\" not found"
+  echo "$NAME: Input file \"$GF\" not found"                       1>&2
+  exit 2
+}
+#
+# Loop through all files
+#
+
+LILY_OUTPUT_FILES=
+
+for GF 
+do
+    findInput $GF
+
+  #
+  # Check whether the file is input to or output from lilypond
+  #
+  L1=`head -1 $GF` 
+  OP=`echo $L1 | grep "^% Creator: GNU LilyPond"`
+  if [ -n "$OP" ]
+  then
+    #
+    # OK - it's the output from lilypond.
+    #
+    # Get lilypond source file name
+    #
+    OF=$GF
+    IFL=`grep mudelafilename $OF`
+    if [ "$IFL" != "" ]
+    then
+      IF=`echo $IFL | sed -e 's/.*{//' -e 's/}*.$//'`
+      #
+      # Check if source file exists
+      #
+      if [ ! -f $IF ]
+      then
+        $debug_echo $IDENTIFICATION": Mudela file not found."
+        TW=15.5cm
+        TH=25.0cm
+      fi
+    else
+      $debug_echo $IDENTIFICATION": Mudela file name not found."
+      TW=15.5cm
+      TH=25.0cm
+    fi
+  else
+    #
+    # I have to assume this is the lilypond input file
+    # Find output file name, if defined
+    #
+    IF=$GF
+    #
+    # Run lilypond
+    # Grab output file names
+    #
+    $debug_echo "lilypond "$LILYOPTS $IF
+
+    $LILYPOND_EXECUTABLE $LILYOPTS $IF 2>&1  | tee $LOGFILE
+    OF="`sed -n -e 's/TeX output to \([^\.]*\.tex\)\.\.\.$/\1/p' $LOGFILE`"
+    $debug_echo "==> $OF"
+    LILY_OUTPUT_FILES="$LILY_OUTPUT_FILES $OF"
+    STATUS=`egrep -i "error|segmentation|abort" $LOGFILE`
+    echo $STATUS
+    if [ ! -z "$STATUS" ]
+    then
+      exit 10
+    fi
+  fi
+  #
+  # "Spin through" all the files
+  #
+  for File in $OF
+  do
+    $debug_echo "--- "$File
+    #
+    # Check if output file is generated
+    #
+    if [ ! -f "$File" ]
+    then
+      $debug_echo "$IDENTIFICATION: hmm, I could not find the output file $File"
+      exit 4
+    fi
+    #
+    # Is this the first file?
+    #
+    if [ -z "$FFile" ]
+    then
+      FFile="$File"
+      startFile
+    else
+      nextFile
+    fi
+    cat << EOF >> $LatF
+\input{$File}
+EOF
+    if [ $SEPFILE = Y ]
+    then
+      FFile=""
+      endFile
+    fi
+  done
+done
+if [ $SEPFILE = N ]
+then
+  endFile
+fi
+#
+# OK - finished
+#
diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py
new file mode 100644 (file)
index 0000000..287fa5a
--- /dev/null
@@ -0,0 +1,1117 @@
+#!@PYTHON@
+
+"""
+=======================================================================
+LilyPond to dvi converter
+
+Features include Title information, paper size specification, and image
+orientation.  
+
+Usage: ly2dvi.py [OPTION]... [FILE]...
+Input: LilyPond source or LilyPond generated TeX files
+Output: DVI file
+=======================================================================
+"""
+
+name = 'ly2dvi'
+version = '0.0.6'
+errorlog = ''
+
+import sys
+import os
+import getopt
+import re
+import string
+import time
+import glob
+
+
+class Input:
+    """
+    This class handles all ly2dvi.py input file methods
+
+    Public methods:
+    
+    __init__()  Constructor
+    open(file)  Open a .ly file or .tex file using lilyinclude path
+    close()     Close current file
+    type()      Determine file type .ly (input) or .tex (output)
+    setVars()   Set title definitions found in .tex (output) file
+    """
+
+    #
+    # Constructors
+    #
+
+    def __init__(this):
+       this.__fd = None 
+
+    #
+    # open
+    #
+    def open(this,file):
+        """
+        open file and set private class variable __fd.  The search
+        sequence is: current directory followed by the directories
+        found in include property list.  Each directory is searched
+        for file, file.ly, and file.fly.
+        
+        input:  file   filename
+        output: void
+        error:  ExitNotFound Exception
+        """
+
+        for i in [''] + Props.get('include')[0:]:
+            ifile = os.path.join(i,file)
+            for j in ['','.ly','.fly']:
+                jfile = ifile+j
+                try:
+                    this.__fd = open( jfile, 'r' )
+                    return
+                except:
+                    pass
+        sys.exit('ExitNotFound', file)
+
+
+    #
+    # close
+    #
+    def close(this):
+        """
+        close file object __fd
+        
+        input:  void
+        output: void
+        error:  None
+        """
+        this.__fd.close()
+
+
+    #
+    # type
+    #
+    def type(this):
+        """
+        Determine input file type.  LilyPond source is 'input' type
+        and LilyPond generated TeX file is 'output' type
+
+        input:  void
+        output: 'input' | 'output'
+        error:  None
+        """
+
+        firstline = this.__fd.readline()
+        this.__fd.seek(0)
+        if  re.match('% Creator: GNU LilyPond [0-9]+[.0-9]+',firstline ):
+            return 'output'
+        else:
+            return 'source'
+
+
+    #
+    # setVars
+    #
+    def setVars(this): 
+        """
+        Search for properties in the current input file and set the
+        appropriate values.  The supported properties names are in
+        local variable varTable along with the property list
+        titledefs.
+
+        input:  void
+        output: None
+        error:  None
+        """
+
+        varTable = [
+            #   regexp              set method
+            #   ------              ----------
+            ( 'language',        Props.setLanguage ),
+            ( 'latexheaders',    Props.setHeader ),
+            ( 'orientation',     Props.setOrientation ),
+            ( 'paperpapersize',  Props.setPaperZize ),
+            ( 'papertextheight', Props.setTextHeight ),
+            ( 'paperlinewidth',  Props.setLineWidth ),
+            ( 'filename',        Props.setFilename ),
+            ]
+
+        titles={}
+        for line in this.__fd.readlines():
+            m=re.match('\\\\def\\\\mudela([\w]+){(.*)}',line)
+            if m:
+                for var in varTable:
+                    if m.group(1) == var[0]:
+                        var[1](m.group(2),'file')
+                        break
+                for var in Props.get('titledefs'):
+                    if m.group(1) == var:
+                        titles[var]=m.group(2)
+                        break
+        Props.setTitles(titles,'file')
+        this.__fd.seek(0)
+
+\f
+
+class TeXOutput:
+    """
+    This class handles all ly2dvi.py output file methods
+
+    private methods:
+     __mudelaDefs(opt)  Send title info to output file
+
+    Public methods:
+    __init__()  Constructor
+    write(str)  Write a string to output file 
+    start(file) Start the latex file
+    next()      Process next output file
+    end()       Finish latex file and run latex 
+    """
+
+    #
+    # constructor
+    #
+    def __init__(this):
+       this.__fd = None 
+       this.__base = ''
+       this.__outfile = ''
+
+    #
+    # __medelaDefs
+    #
+    def __mudelaDefs(this,opt):
+        """
+        Write titles to output
+
+        input:  opt   Supports header and subheader output
+        output: None
+        error:  None
+        """
+
+        titles = Props.get('titles')
+        for key in titles.keys():
+            this.write('%s\\mudela%s{%s}%%\n' % (opt,key,titles[key]))
+
+    #
+    # write
+    #
+    def write(this,str):
+        """
+        Write str to current output file
+
+        input:  str  String to write
+        output: None
+        error:  None
+        """
+        
+        this.__fd.write(str)
+
+    #
+    # start
+    #
+    def start(this,file):
+        """
+        Start LaTeX file.  Calculates the horizontal and vertical
+        margin using pagewidth, pageheight, linewidth, and textheight.
+        Creates temporary output filename and opens it for write.
+        Sends the LaTeX header information to output.  Lastly sends
+        the title information to output.
+
+        input:  file  output file name 
+        output: None
+        error:  None
+        """
+
+        now=time.asctime(time.localtime(time.time()))
+        linewidth = Props.get('linewidth')
+        textheight = Props.get('textheight')
+
+        if Props.get('orientation') == 'landscape':
+            pagewidth = Props.get('pageheight')
+            pageheight = Props.get('pagewidth')
+        else:
+            pageheight = Props.get('pageheight')
+            pagewidth = Props.get('pagewidth')
+                             
+        horizontalMarginArg =  ( (pagewidth - linewidth)/2 )   
+        verticalMarginArg =  ( (pageheight - textheight)/2  )
+
+        top="""\
+%% Creator: %s
+%% Automatically generated from  %s, %s
+
+\\documentclass[%s]{article}
+
+%s 
+\\usepackage{geometry}
+\\usepackage[latin1]{inputenc} 
+%%\\usepackage[T1]{fontenc} 
+%s 
+%%\\addtolength{\\oddsidemargin}{-1cm} 
+%%\\addtolength{\\topmargin}{-1cm} 
+%%\\setlength{\\textwidth}{%s} 
+%%\\setlength{\\textheight}{%s} 
+\\geometry{width=%spt, left=%spt, height=%spt, top=%spt} 
+\\input lilyponddefs 
+\\input titledefs 
+%s 
+\\begin{document}
+""" % ( program_id(), Props.get('filename'), now, Props.get('papersize'),
+        Props.get('language'), Props.get('pagenumber'), linewidth, textheight,
+        linewidth, horizontalMarginArg, textheight, verticalMarginArg,
+        Props.get('header') )
+        
+        pathcomp = os.path.splitext(file)
+        this.__base = pathcomp[0]
+        this.__outfile = '%s.%d%s' % (pathcomp[0], os.getpid(), pathcomp[1])
+        try:
+            this.__fd = open(this.__outfile,"w")
+        except:
+            sys.exit('ExitNoWrite', this.__outfile)
+        this.write(top)
+        this.__mudelaDefs('')
+        this.write("""\
+\\cmrtwenty% ugh
+\\makelilytitle
+""") 
+
+    #
+    # next
+    #
+    def next(this):
+        """
+        Write LaTeX subheader information to support more than one
+        score in a document.  Lastly send current title information to
+        output.
+
+        input:  None
+        output: None
+        error:  None
+        """
+
+        this.write("""\
+\\def\\theopus{}%
+\\def\\thepiece{}%
+\\def\\mudelaopus{}%
+\\def\\mudelapiece{}%
+""")
+        this.__mudelaDefs("\\def")
+        this.write("""\
+\\def\\theopus{\\mudelaopus}% ugh
+\\def\\thepiece{\\mudelapiece}%
+\\makelilypiecetitle
+""")
+
+
+    #
+    # end
+    #
+    def end(this):
+        """
+        Close output file and run latex on it.
+
+        input:  None
+        output: None
+        error:  ExitBadLatex Exception
+        """
+
+        outfile=this.__base + '.dvi'
+        if Props.get('output') != '':
+            outfile = os.path.join(Props.get('output'), outfile )
+            
+        this.write("""\
+\\vfill\\hfill{\\LilyIdString}
+\\end{document}
+""")
+        this.__fd.close()
+        if ( os.name == 'posix' ):
+            stat = os.system('latex \'\\nonstopmode \\input %s\'' %
+                             (this.__outfile))
+        else: # Windows shells don't eat the single quotes
+            stat = os.system('latex \\nonstopmode \\input %s' %
+                             (this.__outfile))
+        if stat:
+            sys.exit('ExitBadLatex')
+        if os.path.isfile(outfile):
+            os.remove(outfile)
+        os.rename(this.__base + '.' + str(os.getpid()) + '.dvi', outfile)
+        sys.stderr.write( '\n' + program_id() + ': dvi file name is %s\n\n'
+                   % (outfile))
+
+        if Props.get('postscript'):
+            psoutfile=this.__base + '.ps'
+            if Props.get('output') != '':
+                psoutfile = os.path.join(Props.get('output'), psoutfile )
+            stat = os.system('dvips -o %s %s 2>&1' % (psoutfile,outfile))
+            if stat:
+                sys.exit('ExitBadPostscript')
+            
+
+\f
+
+class Properties:
+    """
+    This class handles all ly2dvi.py property manipulation
+
+    Public methods:
+    
+    __init__()  Constructor
+    set<property> methods
+    """
+
+    def __init__(this):
+
+        #
+        # Following is the order of priority for property assignment.  The
+        # list is organized from lowest to highest priority.  Each
+        # assignment is overridden by the next requester in the list.
+        #
+        # Requester     Description
+        # ---------     -----------
+        # init          Initial default values
+        # file          The values found in the lilypond generated TeX files
+        # environment   Envrionment variables LILYINCLUDE, LILYPONDPREFIX
+        # rcfile        $LILYPONDPREFIX/share/lilypond/.lilyrc
+        # rcfile        $HOME/.lilyrc
+        # rcfile        ./.lilyrc
+        # commandline   command line arguments
+        # 
+        this.__overrideTable = {
+            'init'        : 0,
+            'file'        : 1,
+            'environment' : 2,
+            'rcfile'      : 3,
+            'commandline' : 4,
+            'program'     : 5
+            }
+
+        this.__roverrideTable = {} # reverse lookup used for debug
+        for i in this.__overrideTable.items():
+            this.__roverrideTable[i[1]]=i[0]
+        
+        this.__data = {
+            'pagewidth'    :  [597, this.__overrideTable['init']],
+            'pageheight'   :  [845, this.__overrideTable['init']],
+            'papersize'    :  ['a4paper', this.__overrideTable['init']],
+            'textheight'   :  [0, this.__overrideTable['init']],
+            'linewidth'    :  [0, this.__overrideTable['init']],
+            'orientation'  :  ['portrait', this.__overrideTable['init']],
+            'language'     :  ['%', this.__overrideTable['init']],
+            'include'      :  [[], this.__overrideTable['init']],
+            'debug'        :  [0, this.__overrideTable['init']],
+            'keeplilypond' :  [0, this.__overrideTable['init']],
+            'keeply2dvi'   :  [0, this.__overrideTable['init']],
+            'pagenumber'   :  ['%', this.__overrideTable['init']],
+            'separate'     :  [0, this.__overrideTable['init']],
+            'output'       :  ['', this.__overrideTable['init']],
+            'header'       :  ['%', this.__overrideTable['init']],
+            'dependencies' :  [0, this.__overrideTable['init']],
+            'root'         :  ['', this.__overrideTable['init']],
+            'tmp'          :  ['d:\tmp', this.__overrideTable['init']],
+            'filename'     :  ['', this.__overrideTable['init']],
+            'titledefs'    :  [[], this.__overrideTable['init']],
+            'titles'       :  [{}, this.__overrideTable['init']],
+            'lilyOutputFiles' :  [[], this.__overrideTable['init']],
+            'postscript'   :  [0, this.__overrideTable['init']],
+            }
+
+        #
+        # Try to set root and HOME first before calling rcfile
+        #
+        if os.environ.has_key('LILYPONDPREFIX'):
+            this.setRoot(os.environ['LILYPONDPREFIX'], 'environment')
+        else:
+            p=os.path.split(sys.argv[0])
+            p=os.path.split(p[0])
+            this.setRoot(p[0],'init')
+
+        if not os.environ.has_key('HOME'):
+            if os.environ.has_key('HOMEDRIVE') and \
+                 os.environ.has_key('HOMEPATH'):
+                os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
+                                     os.environ['HOMEPATH']
+            else:
+                os.environ['HOME'] = os.curdir
+
+        this.rcfile() # Read initialization file(s)
+
+        if os.environ.has_key('LILYINCLUDE'):
+            tmp=this.get('include')
+            for s in string.split(os.environ['LILYINCLUDE'],os.pathsep):
+                tmp.append(s)
+            this.__set('include', tmp, 'environment')    
+
+
+        t=''
+       if os.environ.has_key ('TEXINPUTS'):
+               t = os.pathsep + os.environ['TEXINPUTS']
+        os.environ['TEXINPUTS'] = os.path.join(this.get('root'), 'share',
+                                              'lilypond', 'tex' ) + t
+
+        t=''
+       if os.environ.has_key ('MFINPUTS'):
+               t = os.pathsep + os.environ['MFINPUTS']
+        os.environ['MFINPUTS'] = os.path.join(this.get('root'), 'share',
+                                              'lilypond', 'mf' ) + t
+
+        if os.environ.has_key('TMP'):
+            this.__set('tmp',os.environ['TMP'],'environment')
+
+        
+       fd=this.get_texfile_path ('titledefs.tex')
+        mudefs=[]    
+
+        for line in fd.readlines():
+            m=re.match('\\\\newcommand\*{\\\\mudela([\w]+)}',line)
+            if m:
+                mudefs.append(m.group(1))
+       fd.close
+        this.__set('titledefs', mudefs, 'init')
+
+    #
+    # __set
+    #
+    def __set(this,var,value,requester):
+        """
+        All of the set methods call this to set a property.  If the value
+        was last set by a requestor of lesser priority the new value is
+        assigned, else the old value has priority and is unchanged.
+        """
+
+        if this.__overrideTable[requester] < this.__data[var][1]:
+            return 0
+        else:
+            this.__data[var] = [value, this.__overrideTable[requester]]
+
+    #
+    # get
+    #
+    def get(this,var):
+        """
+        All of the get methods call this to get a property value.  List
+        variable types are return by value to facilitate an append operation.
+        """
+
+        if var == 'include' or var == 'lilyOutputFiles':
+            return this.__data[var][0][0:]  # return a copy not a ref
+        else:
+            return this.__data[var][0]
+
+    #
+    # get_texfile_path
+    #
+    def get_texfile_path (this, var):
+        """
+        locate and open titledefs.tex file
+        """
+
+        if os.name == 'nt':
+            path = os.path.join(this.get('root'), 'share', 'lilypond',
+                                'tex', var)
+        else:
+            path =''
+            cmd =('kpsewhich tex %s %s' % (var,errorlog))
+            pipe = os.popen (cmd, 'r')
+            path = pipe.readline ()[:-1] # chop off \n
+            return_status =  pipe.close()
+            if return_status and not path:
+                path = os.path.join(this.get('root'), 'share', 'lilypond',
+                                    'tex', var)
+       fd = open(path, 'r')
+        return fd
+
+
+    #
+    # Read rc file
+    #
+    def rcfile(this):
+       """
+        Read initialization file(s)
+        """
+        varTable = [
+            #   name              set method
+            #   ----              ----------
+            ( 'DEBUG',          this.setDebug ),
+            ( 'DEPENDENCIES',   this.setDependencies ),
+            ( 'KEEPLILYPOND',   this.setKeeplilypond ),
+            ( 'KEEPLY2DVI',     this.setKeeply2dvi ),
+            ( 'LANGUAGE',       this.setLanguage ),
+            ( 'LATEXHF',        this.setHeader ),
+            ( 'LILYINCLUDE',    this.setInclude ),
+            ( 'LILYPONDPREFIX', this.setRoot ),
+            ( 'NONUMBER',       this.setNonumber ),
+            ( 'ORIENTATION',    this.setOrientation ),
+            ( 'OUTPUTDIR',      this.setOutput ),
+            ( 'PAPERSIZE',      this.setPaperZize ),
+            ( 'PHEIGHT',        this.setTextHeight ),
+            ( 'POSTSCRIPT',     this.setPostscript ),
+            ( 'PWIDTH',         this.setLineWidth ),
+            ( 'SEPARATE',       this.setSeparate ),
+            ( 'TMP',            this.setTmp ),
+            ]
+
+        if ( os.name == 'posix' ):
+            dotFilename='.lilyrc'
+        else: # Windows apps like edit choke on .lilyrc
+            dotFilename='_lilyrc'
+
+       for d in [os.path.join(this.get('root'),'share','lilypond','ly'), \
+                  os.environ['HOME'], os.curdir ]:
+           file=os.path.join(d,dotFilename)
+           try:
+               fd = open( file, 'r' )
+           except:
+               continue
+           
+            for line in fd.readlines():
+               if re.match('#.*',line):
+                   continue
+               m=re.search('([\w]+)=(.*)',line)
+               if m:
+                    for var in varTable:
+                        if m.group(1) == var[0]:
+                            var[1](m.group(2),'rcfile')
+                            break
+           fd.close
+
+    #
+    # setPaperZize
+    #
+    def setPaperZize(this,size,requester):
+        """
+        Set paper size properties
+        """
+
+        paperTable = [
+            # regex          width    height      name
+            # -----          -----    ------      ----
+            ( 'a0.*',        2389,    3381,    'a0paper' ),
+            ( 'a1$|a1p.*',   1690,    2389,    'a1paper' ),
+            ( 'a2.*',        1194,    1690,    'a2paper' ),
+            ( 'a3.*',        845,     1194,    'a3paper' ),
+            ( 'a4.*',        597,     845,     'a4paper' ),
+           ( 'a5.*',        423,     597,     'a5paper' ),
+            ( 'a6.*',        298,     423,     'a6paper' ),
+            ( 'a7.*',        211,     298,     'a7paper' ),
+            ( 'a8.*',        305,     211,     'a8paper' ),
+            ( 'a9.*',        105,     305,     'a9paper' ),
+            ( 'a10.*',       74,      105,     'a10paper' ),
+            ( 'b0.*',        2847,    4023,    'b0paper' ),
+            ( 'b1.*',        2012,    2847,    'b1paper' ),
+            ( 'b2.*',        1423,    2012,    'b2paper' ),
+            ( 'b3.*',        1006,    1423,    'b3paper' ),
+            ( 'b4.*',        712,     1006,    'b4paper' ),
+            ( 'b5.*',        503,     712,     'b5paper' ),
+            ( 'archA$',      650,     867,     'archApaper' ),
+            ( 'archB$',      867,     1301,    'archBpaper' ),
+            ( 'archC$',      1301,    1734,    'archCpaper' ),
+            ( 'archD$',      1734,    2602,    'archDpaper' ),
+            ( 'archE$',      2602,    3469,    'archEpaper' ),
+            ( 'flsa$|flse$', 614,     940,     'flsapaper' ),
+            ( 'halfletter$', 397,     614,     'halfletterpaper' ),
+            ( 'ledger$',     1229,    795,     'ledgerpaper' ),
+            ( 'legal$',      614,     1012,    'legalpaper' ),
+            ( 'letter$',     614,     795,     'letterpaper' ),
+            ( 'note$',       542,     723,     'notepaper' )
+            ]
+
+        found=0
+        for paper in paperTable:
+            if re.match(paper[0],size):
+                found=1
+                this.__set('pagewidth',paper[1],requester)
+                this.__set('pageheight',paper[2],requester)
+                this.__set('papersize',paper[3],requester)
+                break
+
+        if not found:
+            sys.exit('ExitBadPaper',size)
+
+    #
+    # setTextHeight
+    #
+    def setTextHeight(this,size,requester):
+        """
+        Set textheight property
+        """
+
+       m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
+       if m:
+           if m.group(2) == 'cm':
+               this.__set('textheight',\
+                           float(m.group(1)) * 72.27/2.54, requester )
+           elif m.group(2) == 'mm':
+               this.__set('textheight',\
+                           float(m.group(1)) * 72.27/25.4, requester )
+           elif m.group(2) == 'pt':
+               this.__set('textheight', float(m.group(1)), requester )
+           elif m.group(2) == '':
+               this.__set('textheight', float(m.group(1)), requester )
+           else:
+               sys.exit('ExitBadHeight', m.group(2))
+       else:           
+           sys.exit('ExitBadHeight', size)
+
+    #
+    # setLineWidth
+    #
+    def setLineWidth(this,size,requester):
+        """
+        Set linewidth propery
+        """
+
+       m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
+       if m:
+           if m.group(2) == 'cm':
+               this.__set('linewidth', \
+               float(m.group(1)) * 72.27/2.54, requester )
+           elif m.group(2) == 'mm':
+               this.__set('linewidth', \
+               float(m.group(1)) * 72.27/25.4, requester )
+           elif m.group(2) == 'pt':
+               this.__set('linewidth', float(m.group(1)), requester )
+           elif m.group(2) == '':
+               this.__set('linewidth', float(m.group(1)), requester )
+           else:
+               sys.exit('ExitBadWidth', m.group(2))
+       else:           
+           sys.exit('ExitBadWidth', size)
+
+    #
+    # setOrientation
+    #
+    def setOrientation(this,orient,requester):
+        """
+        Set orientation property
+        """
+
+       if orient == 'landscape' or orient == 'portrait':
+           this.__set('orientation', orient, requester )
+       else:
+           sys.exit('ExitBadOrient', orient)
+
+    #
+    # setLanguage
+    #
+    def setLanguage(this,lang,requester):
+        """
+        Set language property
+        """
+
+       this.__set('language', '\\usepackage[%s]{babel}' % (lang), requester )
+
+    #
+    # setInclude
+    #
+    def setInclude(this,inc, requester):
+        """
+        Append an include path
+        """
+
+        tmp = this.get('include')
+        tmp.append(inc)
+        this.__set('include', tmp, requester )
+
+    #
+    # setDebug
+    #
+    def setDebug(this,value,requester):
+        """
+        Set or Clear debug flag
+        """
+
+        if int(value) == 1:
+            this.__set('debug',1,requester)
+        else:
+            this.__set('debug',0,requester)
+
+    #
+    # setKeeplilypond
+    #
+    def setKeeplilypond(this, value, requester):       
+        """
+        Set or Clear keeplilypond flag
+        """
+
+        if int(value) == 1:
+            this.__set('keeplilypond',1,requester)
+        else:
+            this.__set('keeplilypond',0,requester)
+
+    #
+    # setKeeply2dvi
+    #
+    def setKeeply2dvi(this, value, requester): 
+        """
+        Set or Clear keeply2dvi flag
+        """
+
+        if int(value) == 1:
+            this.__set('keeply2dvi',1,requester)
+        else:
+            this.__set('keeply2dvi',0,requester)
+
+    #
+    # setNonumber 
+    #
+    def setNonumber(this, value, requester):   
+        """
+        Set nonumber flag
+        """
+
+        if int(value) == 1:
+            this.__set('pagenumber',1,requester)
+        else:
+            this.__set('pagenumber',0,requester)
+
+    #
+    # setSeparate
+    #
+    def setSeparate(this, value, requester):   
+        """
+        Set or Clear separate flag
+        """
+
+        if int(value) == 1:
+            this.__set('separate',1,requester)
+        else:
+            this.__set('separate',0,requester)
+
+    #
+    # Set output directory name
+    #
+    def setOutput(this,out,requester):
+       this.__set('output',out,requester)
+
+    #
+    # Set latex header name
+    #
+    def setHeader(this,head, requester):
+       this.__set('header',head,requester)
+
+    #
+    # Set or Clear Dependencies flag to generate makefile dependencies
+    #
+    def setDependencies(this, requester):      
+        """
+        Set or Clear dependencies flag
+        """
+
+        if int(value) == 1:
+            this.__set('dependencies',1,requester)
+        else:
+            this.__set('dependencies',0,requester)
+
+    #
+    # Set tmp directory
+    #
+    def setTmp(this,dir, requester):   
+       this.__set('tmp',dir,requester)
+
+    #
+    # Set mudela source file name
+    #
+    def setFilename(this,file, requester):     
+       this.__set('filename',file,requester)
+
+    #
+    # Set title commands
+    #
+    def setTitles(this,titles, requester):     
+       this.__set('titles',titles,requester)
+
+    #
+    # Set title commands
+    #
+    def addLilyOutputFiles(this,filelist,requester):
+        """
+        Add a to the lily output list
+        """
+
+        tmp = this.get('lilyOutputFiles')
+        tmp = tmp + filelist
+        this.__set('lilyOutputFiles',tmp,requester)
+
+    #
+    # Set/Clear postscript flag
+    #
+    def setPostscript(this,value,requester):
+        """
+        Set postscript flag
+        """
+
+        if int(value) == 1:
+            this.__set('postscript',1,requester)
+        else:
+            this.__set('postscript',0,requester)
+
+    #
+    # Set root
+    #
+    def setRoot(this,path, requester): 
+        """
+        Set lilypond root directory
+        """
+
+        os.environ['LILYPONDPREFIX'] = path
+       this.__set('root',path,requester)
+
+    #
+    # printProps
+    #
+    def printProps(this):
+        """
+        Print properties
+        """
+        
+        for key in this.__data.keys():
+            print "%s <%s>:<%s>" % (key,this.get(key),
+                                    this.__roverrideTable[this.__data[key][1]])
+
+\f
+
+#
+# Misc functions
+#
+
+def getLilyopts():
+    inc = ''   
+    if len(Props.get('include')) > 0: 
+        inc = '-I ' + string.join(Props.get('include'),os.pathsep)
+    else:
+
+        if Props.get('dependencies'):
+            dep=' -d'
+        else:
+            dep=''
+       return inc + dep
+    return inc
+
+def writeLilylog(contents):
+    if Props.get('keeplilypond'):
+        file='lilylog.' + str(os.getpid())
+        output = Props.get('output')
+        if output != '':
+            file = os.path.join( output, file )
+        try:
+            fd = open( file, 'w' )
+        except:
+            sys.exit('ExitNoWrite', file)
+        fd.write(contents)
+        fd.close()
+
+def getTeXFile(contents):
+    texfiles=[]
+    for line in string.split(contents,'\n'):
+        m = re.search('^Paper output to (.+)\.\.\.', line)
+        if m:
+            texfiles.append(m.group(1))
+
+    if texfiles == []:
+        sys.exit('ExitNoTeXName')
+    else:
+        return texfiles
+
+def program_id ():
+    return name + ' ' + version;
+
+
+def mailaddress():
+    try:
+       return os.environ['MAILADDRESS']
+    except KeyError:
+       return '(address unknown)'
+
+
+def identify ():
+    sys.stderr.write (program_id () + '\n')
+
+def help ():
+    sys.stderr.write (
+        'Generate dvi file from mudela or lilypond output\n'
+        'Usage: ' + name + ' [OPTION]... [FILE]...\n'
+        '\n'
+        'Options:\n'
+        '  -D,--debug           increase verbosity\n'
+        '  -F,--headers=        name of additional LaTeX headers file\n'
+        '  -H,--Height=         set paper height (points) (see manual page)\n'
+        '  -I,--include=DIR     add DIR to LilyPond\'s search path\n'
+        '  -K,--keeplilypond    keep lilypond output files\n'
+        '  -L,--landscape       set landscape orientation\n'
+        '  -N,--nonumber        switch off page numbering\n'
+        '  -O,--orientation=    set orientation (obsolete - use -L instead)\n'
+        '  -P,--postscript      generate postscript file\n'
+        '  -W,--Width=          set paper width (points) (see manual page)\n'
+        '  -d,--dependencies    tell lilypond make a dependencies file\n'
+        '  -h,--help            this help text\n'
+        '  -k,--keeply2dvi      keep ly2dvi output files\n'
+        '  -l,--language=       give LaTeX language (babel)\n'
+        '  -o,--output=         set output directory\n'
+        '  -p,--papersize=      give LaTeX papersize (eg. a4)\n'
+        '  -s,--separate        run all files separately through LaTeX\n'
+        '\n'
+        'files may be (a mix of) input to or output from lilypond(1)\n'
+        )
+
+\f
+
+#
+# main
+#
+
+def main():
+    """Generate dvi files from lilypond source/output"""
+
+    infile = Input()
+    outfile = TeXOutput()
+    texInputFiles=[]
+
+    (options, files) = getopt.getopt (sys.argv[1:],
+                                      'DF:H:I:KLNPW:dhkl:o:p:s',
+                                      ['debug', 'headers=', 'Height=',
+                                       'include=', 'keeplilypond', 'landscape',
+                                       'nonumber', 'Width=', 'dependencies',
+                                       'help', 'keeply2dvi', 'language=',
+                                       'output=', 'papersize=', 'separate',
+                                       'postscript'])
+    for opt in options:
+        o = opt[0]
+        a = opt[1]
+        if o == '--debug' or o == '-D':
+           Props.setDebug(1,'commandline')
+        elif o == '--headers' or o == '-F':
+           Props.setHeader(a,'commandline')
+        elif o == '--include' or o == '-I':
+           Props.setInclude(a,'commandline')
+        elif o == '--Height' or o == '-H':
+           Props.setTextHeight(a,'commandline')
+        elif o == '--keeplilypond' or o == '-K':
+           Props.setKeeplilypond(1,'commandline')
+        elif o == '--landscape' or o == '-L':
+           Props.setOrientation('landscape','commandline')
+        elif o == '--nonumber' or o == '-N':
+           Props.setNonumber('commandline')
+        elif o == '--Width' or o == '-W':
+           Props.setLineWidth(a,'commandline')
+        elif o == '--dependencies' or o == '-d':
+           Props.setDependencies(1,'commandline')
+        elif o == '--help' or o == '-h':
+            help()
+            return 0
+        elif o == '--keeply2dvi' or o == '-k':
+           Props.setKeeply2dvi(1,'commandline')
+        elif o == '--language' or o == '-l':
+           Props.setLanguage(a,'commandline')
+        elif o == '--output' or o == '-o':
+           Props.setOutput(a,'commandline')
+        elif o == '--papersize' or o == '-p':
+           Props.setPaperZize(a,'commandline')
+        elif o == '--separate' or o == '-s':
+           Props.setSeparate(1,'commandline')
+        elif o == '--postscript' or o == '-P':
+           Props.setPostscript(1,'commandline')
+
+    if len(files):
+        for file in files:
+            infile.open(file)
+            type = infile.type()
+            infile.close()
+            if type == 'source':
+                cmd = 'lilypond %s %s 2>&1' % (getLilyopts(), file)
+                fd = os.popen( cmd , 'r' )
+                log = ''
+                line=fd.readline()
+                while line:
+                    log = log + line
+                    sys.stderr.write( line )
+                    line=fd.readline()
+                stat = fd.close()
+                if stat:
+                    sys.exit('ExitBadLily', cmd )
+                texFiles=getTeXFile(log)
+                writeLilylog(log)
+                Props.addLilyOutputFiles(texFiles,'program')
+                texInputFiles = texInputFiles + texFiles
+            else:
+                texInputFiles.append(file)
+
+        firstfile=1
+        for file in texInputFiles:
+            infile.open(file)
+            infile.setVars() # first pass set variables
+            infile.close()
+            if Props.get('debug'):
+                Props.printProps()
+            if firstfile:
+                outfile.start(file)
+            else:
+                outfile.next()
+            outfile.write("""\
+\\input{%s}
+""" % (file))
+            if Props.get('separate'):
+                outfile.end()
+            else:
+                firstfile=0
+        if not Props.get('separate'):
+            outfile.end()
+    else:
+        help()
+        sys.exit('ExitBadArgs','No files specified')
+
+#
+# Exit values
+#
+ExitTable = {
+    'ExitInterupt'         : ['Ouch!', 1 ],
+    'ExitBadArgs'          : ['Wrong number of arguments', 2 ],
+    'ExitNotFound'         : ['File not found', 3 ],
+    'ExitBadPaper'         : ['Unknown papersize', 4 ],
+    'ExitBadHeight'        : ['Invalid Height specification', 5 ],
+    'ExitBadWidth'         : ['Invalid Width specification', 6 ],
+    'ExitBadOrient'        : ['Invalid Orientation specification', 7 ],
+    'ExitNoWrite'          : ['Permission denied', 8 ],
+    'ExitNoTeXName'        : ['hmm, I could not find an output file name', 9 ],
+    'ExitBadLily'          : ['Lilypond failed', 10 ],
+    'ExitBadLatex'         : ['Latex failed', 11 ],
+    'ExitBadPostscript'    : ['Postscript failed', 12 ],
+    'ExitUnknown'          : ['Unknown Exit Code', 20 ],
+    }
+
+def cleanup():
+    lilyfiles = []
+    tmpfiles = []
+    if not Props.get('keeplilypond'):
+        lilyfiles = Props.get('lilyOutputFiles')
+    if not Props.get('keeply2dvi'):
+        tmpfiles = glob.glob('*.' + str(os.getpid()) + '.*' )
+    for file in lilyfiles + tmpfiles:
+        if os.path.isfile(file):
+            os.remove(file)
+
+
+identify()
+Props = Properties()
+
+try:
+    main()
+
+except KeyboardInterrupt:
+    print ExitTable['ExitInterupt'][0]
+    cleanup()
+    sys.exit(ExitTable['ExitInterupt'][1])
+
+except SystemExit, errno:
+    if ExitTable.has_key(errno.args[0]):
+        msg = ExitTable[errno.args[0]]
+    else:
+        msg = ExitTable['ExitUnknown']
+    if len(errno.args) > 1:  
+        sys.stderr.write( '%s: %s: %s\n' % (name, msg[0], errno.args[1]))
+    else:
+        sys.stderr.write( '%s %s\n' % (name, msg[0]))
+    if Props.get('debug'):
+        Props.printProps()
+    cleanup()
+    sys.exit(msg[1])
+else:
+    cleanup()
diff --git a/scripts/mudela-book.py b/scripts/mudela-book.py
new file mode 100644 (file)
index 0000000..3faa60d
--- /dev/null
@@ -0,0 +1,448 @@
+#!@PYTHON@
+# All non-english comments are NOT in swedish, they are norwegian!
+
+#  TODO:  center option (??)
+# * clean up handling of filename of inputfile
+# * steal Props class from ly2dvi?
+# * \onecolumn, \twocolumn
+# * fontsize change with commandline parameters
+# * the   verbatim  option should not be visible in the created latex file
+# * what the h.. does castingalgorithm do/mean???
+# * compile all regular expressions
+# * the following fails because mudelabook doesn't care that the
+#   last } after \end{mudela} finishes the marginpar:
+#     \marginpar{
+#     \begin{mudela}[fragment]
+#        c d e f g
+#     \end{mudela}}
+# * Command line parameter that force all inline mudela to be verbatim, and
+#   one that forces all to be printed
+# log:
+
+# 0.3:
+#   rewrite in Python.
+# 0.4:
+#   much rewritten by new author. I think the work has been split more
+#   logical between different classes.
+#   
+
+import os
+import string
+import re
+import getopt
+import sys
+import regsub
+
+outdir = 'out'
+program_version = '0.4'
+default_paper_size_global = 'a4'
+default_mudela_fontsize = '16pt'
+force_mudela_fontsize_b = 0
+
+fontsize_i2a = {11:'eleven', 13:'thirteen', 16:'sixteen', 20:'twenty', 26:'twentysix'}
+fontsize_pt2i = {'11pt':11, '13pt':13, '16pt':16, '20pt':20, '26pt':26}
+
+def file_exist_b(name):
+    try: 
+       f = open(name)
+    except IOError:
+       return 0
+    f.close ()
+    return 1
+
+def ps_dimention(fname):
+    fd = open(fname)
+    lines = fd.readlines()
+    reg = re.compile('%%BoundingBox: ([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)')
+    for line in lines:
+        s = reg.search(line)
+        if s:
+            break
+    return (int(s.groups()[2])-int(s.groups()[0]), 
+            int(s.groups()[3])-int(s.groups()[1]))
+
+
+class CompileStatus:
+    pass
+
+def file_mtime (name):
+    return os.stat (name)[8] #mod time
+#
+# executes os.system(command) if infile is newer than
+# outfile or outfile don't exist
+#
+def compile (command, workingdir, infile, outfile):
+    indate = file_mtime (workingdir+infile)
+    try:
+        outdate = file_mtime (outfile)
+        recompile = indate > outdate
+
+    except os.error:
+        recompile = 1
+
+    if recompile:
+        sys.stderr.write ('invoking `%s\'\n' % command)
+        if workingdir == '':
+            status = os.system (command)
+        else:
+            status = os.system ('cd %s; %s' %(workingdir, command))
+        if status:
+            raise CompileStatus
+
+
+class PaperDef:
+    __onecolumn_linewidth = {
+        'a4':{'10pt': 345, '11pt': 360, '12pt':390},
+        'a5':{'10pt': 276, '11pt': 276, '12pt':276},
+        'b5':{'10pt': 345, '11pt': 356, '12pt':356},
+        'letter':{'10pt': 345, '11pt': 360, '12pt':390},
+        'legal':{'10pt': 345, '11pt': 360, '12pt':390},
+        'executive':{'10pt': 345, '11pt': 360, '12pt':379}
+        }
+    __twocolumn_linewidth = {
+         'a4':{'10pt': 167, '11pt': 175, '12pt':190},
+        'a5':{'10pt': 133, '11pt': 133, '12pt':133},
+        'b5':{'10pt': 167, '11pt': 173, '12pt':173},
+        'letter':{'10pt': 167, '11pt': 175, '12pt':190},
+        'legal':{'10pt': 167, '11pt': 175, '12pt':190},
+        'executive':{'10pt': 167, '11pt': 175, '12pt':184}
+        }
+    __numcolumn = 1
+    __fontsize = '11pt'
+    #
+    # init
+    #
+    def __init__(self):
+        self.__papersize = default_paper_size_global
+    def set_papersize (self, p):
+        if not self.__onecolumn_linewidth.has_key(p):
+            print "warning:unsupported papersize", p, \
+                  "will use", default_paper_size_global
+            self.__papersize = default_paper_size_global
+        else:
+            self.__papersize = p
+    def set_fontsize(self, pt):
+        self.__fontsize = pt
+    def get_linewidth (self):
+        if self.__numcolumn == 1:
+            return self.__onecolumn_linewidth[self.__papersize][self.__fontsize]
+        else:
+            return self.__twocolumn_linewidth[self.__papersize][self.__fontsize]
+    def onecolumn (slef):
+        self.__numcolumn = 1
+    def twocolumn (self):
+        self.__numcolumn = 2
+
+
+class Mudela_output:
+    def __init__ (self, basename):
+        self.basename = basename
+        # it's an integer!
+        self.feta_pt_size = fontsize_pt2i[default_mudela_fontsize]
+        self.temp_filename = "%s/%s" %(outdir, 'mudela-temp.ly')
+        self.file = open (self.temp_filename, 'w')
+        # 'tex' or 'eps'
+        self.graphic_type = 'tex'
+        self.fragment = 0
+    def write (self, line):
+        # match only if there is nothing but whitespace before \begin
+        if re.search('^\s*\\\\begin{mudela}', line):
+            self.scan_begin_statement(line)
+            self.write_red_tape()
+        else:
+            self.file.write (line)
+    def scan_begin_statement(self, line):
+        r  = begin_mudela_opts_re.search(line)
+        if r:
+            o = r.group()[1:][:-1]
+            optlist =  re.compile('[ ,]*').split(o)
+        else:
+            optlist = []
+        if 'floating' in optlist:
+            self.graphic_type = 'eps'
+        else:
+            self.graphic_type = 'tex'
+        if 'fragment' in optlist:
+            self.fragment = 1
+        else:
+            self.fragment = 0
+        for pt in fontsize_pt2i.keys():
+            if pt in optlist:
+                self.feta_pt_size = fontsize_pt2i[pt]
+    def write_red_tape(self):
+        self.file.write ('\\include \"paper%d.ly\"\n' % self.feta_pt_size)
+        s = fontsize_i2a[self.feta_pt_size]
+        if self.fragment:
+            self.file.write("default_paper = \\paper {"
+                            + "\\paper_%s\n linewidth = -1.\\pt;" % s
+                            + "castingalgorithm = \Wordwrap; indent = 2.\cm; \n}")
+            self.file.write("\\score{\n\\notes") #HACK
+        else:
+            self.file.write ("default_paper = \\paper {"
+                             + "\\paper_%s\n linewidth = %i.\\pt;" % \
+                             (s, Paper.get_linewidth()) \
+                             + "castingalgorithm = \Wordwrap; indent = 2.\cm;\n}")
+    def close (self):
+        if self.fragment:
+            self.file.write ('\\paper { \\default_paper; } }\n')
+        self.file.close ()
+
+        inf = self.basename + '.ly'
+        outf = self.basename + '.tex'          
+        if not file_exist_b (inf):
+            status = 1
+        else:
+            status = os.system ('diff -q %s %s' % (self.temp_filename, inf))
+
+        if status:
+            os.rename (self.temp_filename, inf)
+        compile ('lilypond  -o %s %s;'%  (self.basename, inf), '', inf, outf)
+        if self.graphic_type == 'eps':
+            bname = self.basename[string.rfind(self.basename, '/')+1:]
+            tex_name = bname+'.tex'
+            dvi_name = bname+'.dvi'
+            eps_name = bname+'.eps'
+            compile ('tex %s' % tex_name, outdir, tex_name, dvi_name)
+            compile ('dvips -E -o %s %s' % (eps_name, dvi_name), outdir, dvi_name, eps_name)
+    def insert_me_string(self):
+        "Returns a string that can be used directly in latex."
+        if self.graphic_type == 'tex':
+            return '\\preMudelaExample\\input %s\n\postMudelaExample\n' % self.basename
+        elif self.graphic_type == 'eps':
+            ps_dim = ps_dimention('%s.eps' % self.basename)
+            return '\\parbox{%ipt}{\includegraphics{%s.eps}}' % (ps_dim[0], self.basename)
+        else:
+            print "Unsupported graphic type '%s'" % self.graphic_type
+            sys.exit(1)
+
+class Tex_output:
+    def __init__ (self, name):
+        self.output_fn = '%s/%s' % (outdir, name)
+        self.file = open (self.output_fn , 'w')
+    def open_mudela (self, basename):
+        self.mudela_basename = basename
+    def open_verbatim (self):
+        self.file.write ('\\begin{verbatim}\n')
+    def close_verbatim (self):
+        self.file.write ('\\end{verbatim}\n')
+    def write (self, s):
+        self.file.write (s)
+
+begin_mudela_re = re.compile ('^ *\\\\begin{mudela}')
+begin_mudela_opts_re = re.compile('\[[^\]]*\]')
+end_mudela_re = re.compile ('^ *\\\\end{mudela}')
+section_re = re.compile ('\\\\section')
+chapter_re = re.compile ('\\\\chapter')
+input_re = re.compile ('^\\\\input{([^}]*)')
+include_re = re.compile ('^\\\\include{([^}]*)')
+begin_document_re = re.compile ('^ *\\\\begin{document}')
+documentclass_re = re.compile('\\\\documentclass')
+twocolumn_re = re.compile('\\\\twocolumn')
+onecolumn_re = re.compile('\\\\onecolumn')
+
+class Tex_input:
+    def __init__ (self,name):
+        # HACK
+        if (name[-4:] != '.tex') and (name[-4:] != '.doc'):
+            name = name + '.tex'
+        self.filename = name
+        self.infile = open (name)
+               
+    def get_lines (self):
+        lines = self.infile.readlines ()
+        (retlines, retdeps) = ([],[self.filename])
+        for line in lines:
+            r = input_re.search (line)
+            ri = include_re.search (line)
+            if r:
+                t = Tex_input (r.groups()[0])
+                ls =t.get_lines ()
+                retlines = retlines + ls[0]
+                retdeps = retdeps + ls[1]
+            elif ri:
+                t = Tex_input (ri.groups()[0])
+                ls =t.get_lines ()
+                ls[0].insert(0, '\\newpage')
+                ls[0].append('\\newpage')
+                retlines = retlines + ls[0]
+                retdeps = retdeps + ls[1]                
+            else:
+                retlines.append (line)
+        return (retlines, retdeps)
+
+
+class Main_tex_input(Tex_input):
+    def __init__ (self, name, outname):
+               
+        Tex_input.__init__ (self, name) # ugh
+
+        self.outname = outname
+        self.chapter = 0
+        self.section = 0
+        self.fine_count =0
+        self.mudtex = Tex_output (self.outname)
+        self.mudela = None
+        self.deps = []
+        self.verbatim = 0
+        # set to 'mudela' when we are processing mudela code,
+        # both verbatim and graphic-to-be
+        self.mode = 'latex'
+    def set_sections (self, l):
+        if section_re.search (l):
+            self.section = self.section + 1
+        if chapter_re.search (l):
+            self.section = 0
+            self.chapter = self.chapter + 1
+
+    def gen_basename (self):
+        return '%s/%s-%d.%d.%d' % (outdir, self.outname,self.chapter,self.section,self.fine_count)
+
+    def extract_papersize_from_documentclass(self, line):
+        pre = re.search('\\\\documentclass[\[, ]*(\w*)paper[\w ,]*\]\{\w*\}', line)
+        if not pre:
+            return default_paper_size_global
+        return pre.groups()[0]
+    def extract_fontsize_from_documentclass(self, line):
+        if re.search('\\\\documentclass\[[^\]]*\]\{[^\}]*\}', line):
+            r = re.search('[ ,\[]*([0-9]*pt)', line)
+            if r:
+                return r.groups()[0]
+        return '10pt'
+    def do_it(self):
+        (lines, self.deps) = self.get_lines ()
+        for line in lines:
+            if documentclass_re.search (line):
+                Paper.set_papersize (self.extract_papersize_from_documentclass (line) )
+                Paper.set_fontsize (self.extract_fontsize_from_documentclass (line) )
+            elif twocolumn_re.search (line):
+                Paper.twocolumn ()
+            elif onecolumn_re.search (line):
+                Paper.onecolumn ()
+            elif begin_document_re.search (line):
+                self.mudtex.write ('\\def\\preMudelaExample{}\n')
+                self.mudtex.write ('\\def\\postMudelaExample{}\n')
+            elif begin_mudela_re.search (line):
+                if __debug__:
+                    if self.mode == 'mudela':
+                        raise AssertionError
+                self.mode = 'mudela'
+                r  = begin_mudela_opts_re.search (line)
+                if r:
+                    o = r.group()[1:][:-1]
+                    optlist =  re.compile('[ ,]*').split(o)
+                else:
+                    optlist = []
+                if 'verbatim' in optlist:
+                    self.verbatim = 1
+                    self.mudtex.open_verbatim ()
+                else:
+                    self.verbatim = 0
+                    self.mudela = Mudela_output (self.gen_basename ())
+
+            elif end_mudela_re.search (line):
+                if __debug__:
+                    if self.mode != 'mudela':
+                        raise AssertionError
+                if self.mudela:
+                    self.mudela.close ()
+                    self.mudtex.write (self.mudela.insert_me_string())
+                    del self.mudela
+                    self.mudela = None
+                    self.fine_count = self.fine_count + 1
+                else:                    
+                    self.mudtex.write (line)
+                    self.mudtex.close_verbatim ()
+                self.mode = 'latex'
+                continue
+
+            if self.mode == 'mudela' and not self.verbatim:
+                self.mudela.write (line)
+            else:
+                self.mudtex.write (line)
+                self.set_sections(line)
+        del self.mudtex
+               
+
+def help():
+    sys.stdout.write("Usage: mudela-book [options] FILE\n"
+                + "Generate hybrid LaTeX input from Latex + mudela"
+                + "Options:\n"
+                + "  -h, --help             print this help\n"
+                + "  -d, --outdir=DIR       directory to put generated files\n" 
+                + "  -o, --outname=FILE     prefix for filenames\n"
+                 + "  --mudela-fontsize=??pt default fontsize when no parameter for \\begin{mudela}\n"
+                 + "  --force-mudela-fontsize=??pt force fontsize for all inline mudela\n"
+                    )
+    sys.exit (0)
+
+
+def write_deps (fn, out,  deps):
+       out_fn = outdir + '/' + fn
+       print '\`writing \`%s\'\n\'' % out_fn
+       
+       f = open (out_fn, 'w')
+       f.write ('%s: %s\n'% (outdir + '/' + out + '.dvi',
+                             reduce (lambda x,y: x + ' '+ y, deps)))
+       f.close ()
+
+def identify():
+    sys.stderr.write('*** Lokal versjon av mudela-book ***\n')
+    sys.stderr.write ('This is %s version %s\n' % ('mudela-book', program_version))
+
+def main():
+    global default_mudela_fontsize, outdir
+    outname = ''
+    try:
+        (options, files) = getopt.getopt(
+            sys.argv[1:], 'hd:o:', ['outdir=', 'outname=', 'mudela-fontsize=',
+                                    'force-mudela-fontsize=', 'help', 'dependencies'])
+    except getopt.error, msg:
+        print "error:", msg
+        sys.exit(1)
+        
+    do_deps = 0
+    for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o == '--outname' or o == '-o':
+            outname = a
+        if o == '--outdir' or o == '-d':
+            outdir = a
+        if o == '--help' or o == '-h':
+            help ()
+       if o == '--dependencies':
+            do_deps = 1
+        if o == '--mudela-fontsize':
+            default_mudela_fontsize = a
+       if o == '--force-mudela-fontsize':
+            default_mudela_fontsize = a
+            force_mudela_fontsize_b = 1
+
+    if outdir[-1:] != '/':
+        outdir = outdir + '/'
+
+    if not file_exist_b(outdir):
+        os.system('mkdir %s' % outdir)
+
+    if not fontsize_pt2i.has_key(default_mudela_fontsize):
+        print "warning: fontsize %s is not supported using 16pt" % default_mudela_fontsize
+        default_mudela_fontsize = '16pt'
+    
+    for f in files:
+        my_outname = outname
+        if not my_outname:
+            my_outname = regsub.sub ('\\(.*\\)\\.doc', '\\1', f)
+
+        my_depname = my_outname + '.dep'
+        
+        inp = Main_tex_input (f, my_outname)
+        inp.do_it ()
+
+    if do_deps:
+               write_deps (my_depname, my_outname, inp.deps)
+
+
+
+identify()
+Paper = PaperDef()
+main()
index 7e0a1e72bfc94d251a307dd1076a96bee58257ee..61039414f64b2540cae74a12cd297d00c895ee64 100644 (file)
@@ -1,3 +1,6 @@
+pl 60
+       - small fixes.
+
 pl 59
        - bf: package-diff (remove missing automatic)
        - install templates, (urg) INSTALL*1,2 INSTALL_OUT*1,2
index e299418333564ca14e209b4f5120352eb43bf919..45574a1824884ab04386b845ee18f98a380d1c81 100644 (file)
@@ -40,10 +40,7 @@ distdir=/tmp/${name}
 
 rm -f ${srcdir}/config.cache
 PYTHON=${PYTHON:-python} ${srcdir}/configure --prefix=${distdir} \
-    --srcdir=${srcdir} \
-    --enable-tex-prefix=${distdir}/texmf \
-    --enable-tex-dir=${distdir}/texmf/tex \
-    --enable-mf-dir=${distdir}/texmf/mf
+    --srcdir=${srcdir}
 
 if ! make ; then
     echo "make failed"
@@ -80,7 +77,7 @@ cp $CYGWIN_LIB $distdir/bin
 #
 # Rename python files to <filename>.py
 #
-mv $distdir/bin/ly2dvi32 $distdir/bin/ly2dvi.py
+mv $distdir/bin/ly2dvi $distdir/bin/ly2dvi.py
 mv $distdir/bin/convert-mudela $distdir/bin/convert-mudela.py
 mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py
 
@@ -89,7 +86,7 @@ mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py
 #
 mkdir $distdir/doc
 cp Documentation/man/out/*.txt $distdir/doc
-mv $distdir/doc/ly2dvi32.txt $distdir/doc/ly2dvi_py.txt
+mv $distdir/doc/ly2dvi32.txt $distdir/doc/ly2dvi.txt
 cd $distdir/..
 $ZIP_CMD $ZIP_FILE $name
 echo "Wrote $ZIP_FILE"
index d4b8c470d997660bc94f75de2509de8915abfcd2..70b59f7e5bfe396e9af2ab3445140109b621c7a9 100644 (file)
@@ -19,8 +19,8 @@ INL_FILES := $(wildcard *.icc)
 YY_FILES := $(wildcard *.yy)
 LL_FILES := $(wildcard *.ll)
 
-SOURCE_FILES+=$(YY_FILES) $(CC_FILES) $(INL_FILES) $(TCC_FILES) $(HH_FILES) $(LL_FILES)
-O_FILES+=$(addprefix $(outdir)/, $(YY_FILES:.yy=.o) $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o))
+SOURCE_FILES+= $(CC_FILES) $(YY_FILES) $(INL_FILES) $(TCC_FILES) $(HH_FILES) $(LL_FILES)
+O_FILES+=$(addprefix $(outdir)/, $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o) $(YY_FILES:.yy=.o))
 
 TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES)
 
index 0448ee8fc63866a6d6d0853720a24c2c85a7e9ff..1c1209d3a544a3d8cb430db4ccaa04dbb94d0d62 100644 (file)
@@ -1,5 +1,5 @@
 # empty
 LDFLAGS = $(ILDFLAGS) $(USER_LDFLAGS) $(EXTRA_LDFLAGS) $(MODULE_LDFLAGS) $($(PACKAGE)_LDFLAGS)
 
-MODULE_LIBES=$(addsuffix /$(outdir)/library.a, $(MODULE_LIBS))
+MODULE_LIBES := $(addsuffix /$(outdir)/library.a, $(MODULE_LIBS)) $(MODULE_LIBES)
 LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES)
index 811dd0d3a29fa916fc2b0a104ec86e50126e1d74..5f8b78d86e93e1e862cba0a26c2574c609c08c40 100644 (file)
@@ -84,7 +84,7 @@ date := $(shell date +%x)     #duplicated?
 #
 ARFLAGS = ru
 
-INCLUDES =  include $(outdir) $($(PACKAGE)_INCLUDES)
+INCLUDES =  include $(outdir) $($(PACKAGE)_INCLUDES) $(MODULE_INCLUDES)
 
 # urg: for windows ?
 # LOADLIBES = $(MODULE_LIBES) $($(PACKAGE)_LIBES) $(EXTRA_LIBES) -lstdc++
index bb2cad423c278a9bfd151dd3ede380a671fd134f..5f142738b9172fa4fb6117253c1a175808169b90 100644 (file)
@@ -7,4 +7,4 @@ dvi: $(DVI_FILES)
 pks: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.$(XPM_RESOLUTION)pk))
 
 xpms: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.afm)) pks
-       $(SHELL) $(depth)/$(buildscripts)/mf-to-xpms.sh $(XPM_FONTS)
+       $(SHELL) $(depth)/buildscripts/mf-to-xpms.sh $(XPM_FONTS)
index f72cb62963c4d9ad7af46cc119b50ba73a6b2c31..a33b8cdd5203d89580973ba7baa3cede7139be95 100644 (file)
@@ -6,7 +6,7 @@ $(outdir)/%.pfa: %.mf
 # to the metapost mfplain guru, really does 200dpi, iso 600dpi (minimun)
        -$(METAPOST) "&mfplain \mode=lowres; \mag=100.0; batchmode; input $<"
 #      -$(METAPOST) "&mfmp \mode=ljfour; \mag=100.0; batchmode; input $<"
-       $(PYTHON) $(depth)/$(buildscripts)/ps-to-pfa.py $<
+       $(PYTHON) $(depth)/buildscripts/ps-to-pfa.py $<
        rm -f $(basename $(@F)).[0-9]*
        rm -f $(basename $<).log $(basename $<).tfm