]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.0.uu2.jcn1: fixjes
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 30 Oct 1998 16:10:28 +0000 (17:10 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 30 Oct 1998 16:10:28 +0000 (17:10 +0100)
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
---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.0.uu2, To = lilypond-1.1.0.uu2.jcn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.0.uu2.jcn1.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.0.uu2
1.1.0.uu2.jcn1
++state

72 files changed:
Documentation/faq.yo
Documentation/topdocs/INSTALL.yo
Documentation/topdocs/PATCHES.yo
Documentation/topdocs/index.yo
NEWS
VERSION
bin/GNUmakefile [new file with mode: 0644]
bin/clean-diaper.sh [new file with mode: 0644]
bin/clean-fonts.sh [new file with mode: 0644]
bin/convert-mudela.py [new file with mode: 0644]
bin/docxx-lily.sh [new file with mode: 0644]
bin/find-typenames.pl [new file with mode: 0644]
bin/gen-sitemap.sh [new file with mode: 0644]
bin/genheader.py [new file with mode: 0644]
bin/html-accents.py [new file with mode: 0644]
bin/lilypond-login.sh [new file with mode: 0644]
bin/lilypond-profile.sh [new file with mode: 0644]
bin/localpackage.py [new file with mode: 0644]
bin/ltmain.sh [new file with mode: 0644]
bin/ly2dvi-old.sh [new file with mode: 0644]
bin/ly2dvi.py [new file with mode: 0644]
bin/mail-address.sh [new file with mode: 0644]
bin/mf-to-table.py [new file with mode: 0644]
bin/mf-to-xpms.sh [new file with mode: 0644]
bin/mudela-book.py [new file with mode: 0644]
bin/mutopia-index.py [new file with mode: 0644]
bin/profile-conf.sh [new file with mode: 0644]
bin/ps-to-gifs.sh [new file with mode: 0644]
bin/ps-to-pfa.py [new file with mode: 0644]
bin/ps-to-pngs.sh [new file with mode: 0644]
bin/run-lilypond.sh [new file with mode: 0644]
bin/set-lily.sh [new file with mode: 0644]
bin/show-current.sh [new file with mode: 0644]
bin/template.py [new file with mode: 0644]
buildscripts/GNUmakefile [deleted file]
buildscripts/clean-diaper.sh [deleted file]
buildscripts/clean-fonts.sh [deleted file]
buildscripts/docxx-lily.sh [deleted file]
buildscripts/find-typenames.pl [deleted file]
buildscripts/gen-sitemap.sh [deleted file]
buildscripts/genheader.py [deleted file]
buildscripts/html-accents.py [deleted file]
buildscripts/lilypond-login.sh [deleted file]
buildscripts/lilypond-profile.sh [deleted file]
buildscripts/localpackage.py [deleted file]
buildscripts/ltmain.sh [deleted file]
buildscripts/mail-address.sh [deleted file]
buildscripts/mf-to-table.py [deleted file]
buildscripts/mf-to-xpms.sh [deleted file]
buildscripts/mutopia-index.py [deleted file]
buildscripts/profile-conf.sh [deleted file]
buildscripts/ps-to-gifs.sh [deleted file]
buildscripts/ps-to-pfa.py [deleted file]
buildscripts/ps-to-pngs.sh [deleted file]
buildscripts/run-lilypond.sh [deleted file]
buildscripts/set-lily.sh [deleted file]
buildscripts/show-current.sh [deleted file]
buildscripts/template.py [deleted file]
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/toplevel.make.in
scripts/GNUmakefile [deleted file]
scripts/convert-mudela.py [deleted file]
scripts/ly2dvi-old.sh [deleted file]
scripts/ly2dvi.py [deleted file]
scripts/mudela-book.py [deleted file]
stepmake/stepmake/metafont-targets.make
stepmake/stepmake/metapost-rules.make

index 059cc78381be1b3e8d4c03d99e56548ae15d6240..327a83eb5ca7eaf9f264b8e22f34ae137582e990 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(buildscripts/clean-fonts.sh).
+file(bin/clean-fonts.sh).
 
 
 question(The beams and slurs are gone if use the XDvi magnifying glass!?)
index 75bc165155203c59ffb02057ddfa7974c6925017..9a7251676467dcd5ec66128b3b5fa381940c2966 100644 (file)
@@ -4,13 +4,13 @@ sect(ABSTRACT)
 
 You do something which looks remotely like
 verb(
-       configure    # Check out the buildscripts/set-lily.sh script
+       configure    # Check out the bin/set-lily.sh script
        make
        make install
 )
 
 The detailed instructions follow here.  The
-file(buildscripts/set-lily.sh) script sets some environment variables
+file(bin/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.
@@ -60,8 +60,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(buildscripts/out/lilypond-profile) and
-file(buildscripts/out/lilypond-login) during compilation.
+file(bin/out/lilypond-profile) and
+file(bin/out/lilypond-login) during compilation.
 
 
 sect(RECOMMENDED)
index 1b20b7c37aa114a5cb1e3a54fb7127939d2df964..b08b7ea4287dce23799d54188addcca15bfcf9fa 100644 (file)
@@ -47,7 +47,7 @@ verb(
 which rolls the tarball file(../releases/lilypond-0.1.73.tar.gz)
 and leaves your patch as file(./lilypond-0.1.73.jcn1.diff).
 footnote('Make diff' generates a patch between two tarballs.  For 
-more info type 'make diff help=='.  We assume that there is a tarball 
+more info type 'make diff help=='.)  We assume that there is a tarball 
 file(lilypond-0.1.73.tar.gz) in the directory file(../releases).
 
 
index 1307c60e3bc888c29ac3c615e2c30e74cd3baf72..fc1675b1329680014e3618a842c5589229fec9dd 100644 (file)
@@ -39,6 +39,7 @@ 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 147d1a9977d7fc1472d4924be139eb1b88a69416..773427906bb4cf36b1f78709f631b6ca0dfb305d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,14 @@
-pl 0.jcn1
+--- ../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 17.jcn7
        - added: set*text, timesig, beam
        - guile-1.3 is fine; my egcs-1.0.2's -O2 is broken
diff --git a/VERSION b/VERSION
index c427fb2b3253c4ad767f8899a8003dc328534e7a..0629b515d5c67b437338dd3ed0fa7cbed4bcd355 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=0
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=uu2.jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/bin/GNUmakefile b/bin/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/bin/clean-diaper.sh b/bin/clean-diaper.sh
new file mode 100644 (file)
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/bin/clean-fonts.sh b/bin/clean-fonts.sh
new file mode 100644 (file)
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/bin/convert-mudela.py b/bin/convert-mudela.py
new file mode 100644 (file)
index 0000000..ee6d05a
--- /dev/null
@@ -0,0 +1,362 @@
+#!@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
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/bin/find-typenames.pl b/bin/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/bin/gen-sitemap.sh b/bin/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/bin/genheader.py b/bin/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/bin/html-accents.py b/bin/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/bin/lilypond-login.sh b/bin/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/bin/lilypond-profile.sh b/bin/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/bin/localpackage.py b/bin/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/bin/ltmain.sh b/bin/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/bin/ly2dvi-old.sh b/bin/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/bin/ly2dvi.py b/bin/ly2dvi.py
new file mode 100644 (file)
index 0000000..943aef7
--- /dev/null
@@ -0,0 +1,1118 @@
+#!@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
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/bin/mf-to-table.py b/bin/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/bin/mf-to-xpms.sh b/bin/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/bin/mudela-book.py b/bin/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()
diff --git a/bin/mutopia-index.py b/bin/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/bin/profile-conf.sh b/bin/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/bin/ps-to-gifs.sh b/bin/ps-to-gifs.sh
new file mode 100644 (file)
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/bin/ps-to-pfa.py b/bin/ps-to-pfa.py
new file mode 100644 (file)
index 0000000..33ee75d
--- /dev/null
@@ -0,0 +1,165 @@
+#!@PYTHON@
+
+# ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+
+name = 'ps-to-pfa'
+version = '0.2'
+
+outdir = 'out/'
+datadir = ''
+
+import os
+import sys
+
+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"
+                     "ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files\n\n"
+                      + "Options:\n"
+                      + "  -d, --datadir=DIR      use DIR for ps header/footer\n"
+                      + "  -h, --help             print this help\n"
+                      % (program_name)
+                     )
+    sys.exit (0)
+
+identify ()
+(options, files) = getopt.getopt (
+    sys.argv[1:], 'd:', ['help', 'package'])
+for opt in options:
+    o = opt[0]
+    a = opt[1]
+    if o== '--help' or o == '-h':
+       help ()
+    elif o == '-d' or o == '--datadir':
+       datadir = a
+    else:
+       print o
+       raise getopt.error
+
+
+def gulp_file (f):
+       sys.stderr.write ('[%s' % f)
+       try:
+               i = open (f)
+               i.seek (0, 2)
+               n = i.tell ()
+               i.seek (0,0)
+       except:
+               sys.stderr.write ('can\'t open file %s\n ' % f)
+               return ''
+       s = i.read (n)
+       sys.stderr.write (']')
+       if len (s) <= 0:
+               sys.stderr.write ('gulped empty file: %s\n'% f)
+       return s
+
+mf = files[0]
+# urg ?
+font = os.path.basename (os.path.splitext (mf)[0])
+sys.stderr.write ('Font: %s\n'% font)
+
+def header (f):
+       f.write ('%!PS-AdobeFont-3.0: ' + font + '\n')
+       f.write ('%%%%Creator: %s-%s\n' % (name, version))
+       f.write ('\n')
+       f.write ('/setgray { 1 add } bind def\n'
+               '\n'
+'8 dict begin\n'
+'/FontType 3 def                             %% Required elements of font\n'
+'/FontName /%s def\n'
+'/FontMatrix [.001 0 0 .001 0 0] def\n'
+'%%/FontMatrix [.01 0 0 .01 0 0] def\n'
+'%%/FontMatrix [0.1 0 0 0.1 0 0] def\n'
+'%% /FontBBox [-1000 -1000 1000 1000] def\n'
+' /FontBBox [-3000 -3000 3000 3000] def\n'
+'%% /FontBBox [-300 -300 300 300] def\n'
+'%%/FontBBox [-30 -30 30 30] def\n'
+'\n'
+'/Encoding 256 array def                     %% Trivial encoding vector\n'
+'0 1 255 {Encoding exch /.notdef put} for\n' % (font))
+
+def footer (f):
+       f.write ('\n'
+'/BuildGlyph {                               % Stack contains: font charname\n'
+'%  1000 0                                   % Width\n'
+'%  -750 -750 750 750                        % Bounding Box\n'
+'  3000 0                                    % Width\n'
+'  -3000 -3000 3000 3000                     % Bounding Box\n'
+'%  300 0                                    % Width\n'
+'%  -300 -300 300 300                        % Bounding Box\n'
+'%  30 0                                     % Width\n'
+'%  -30 -30 30 30                            % Bounding Box\n'
+'  setcachedevice\n'
+'  exch /CharProcs get exch                  % Get CharProcs dictionary\n'
+'  2 copy known not {pop /.notdef} if        % See if charname is known\n'
+'  get exec                                  % Execute character procedure\n'
+'} bind def\n'
+'\n'
+'/BuildChar {                                % Level 1 compatibility\n'
+'  1 index /Encoding get exch get\n'
+'  1 index /BuildGlyph get exec\n'
+'} bind def\n'
+'\n'
+'currentdict\n'
+'end                                         % of font dictionary\n')
+       f.write ('\n')
+       f.write ('/%s\n' % font)
+       f.write (''
+'exch definefont pop                         % Define the font\n')
+
+def characters (f):
+       #urg
+       # chars = os.listdir ()
+       # chars.sort ()
+       sys.stderr.write ('[')
+       pipe = os.popen ('/bin/ls -1 ' + font + '.[0-9] ' + font + '.[0-9][0-9] ' + font + '.[0-9][0-9][0-9] 2> /dev/null')
+       chars = []
+       i = pipe.readline ()
+       while i:
+               chars.append (i[0:len (i)-1])
+               i = pipe.readline ()
+       f.write ('\n'
+'/CharProcs 3 dict def                       % Subsidiary dictiorary for\n'
+'CharProcs begin                             % individual character definitions\n')
+       charprocs = '  /.notdef {} def\n'
+       encoding = ''
+       for i in chars: 
+               s = gulp_file (i)
+               s = regsub.gsub ('^%.*\n', '', s)
+               s = regsub.gsub ('^showpage\n', '', s)
+               s = regsub.gsub ('^', '    ', s)
+               n = atoi (regsub.gsub ('.*\.', '', i))
+               s = '\n  /%s-%d{\n%s} bind def\n' % (font, n, s)
+               encoding = encoding + 'Encoding %d /%s-%d put\n' % (n, font, n)
+               charprocs = charprocs + s
+       f.write (charprocs)
+       f.write ('\n')
+       f.write ('end                                         % of CharProcs\n')
+       f.write (encoding)
+       f.write ('\n')
+       sys.stderr.write (']')
+
+ps = outdir + font + '.pfa'
+ps_file = open (ps, 'w')
+header (ps_file)
+characters (ps_file)
+footer (ps_file)
+sys.stderr.write ('\n')
+ps_file.close ()
+sys.stderr.write ('Wrote PostScript font: %s\n'% ps)
+
diff --git a/bin/ps-to-pngs.sh b/bin/ps-to-pngs.sh
new file mode 100644 (file)
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/bin/run-lilypond.sh b/bin/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/bin/set-lily.sh b/bin/set-lily.sh
new file mode 100644 (file)
index 0000000..c85a44b
--- /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/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
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/bin/template.py b/bin/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 *
+
diff --git a/buildscripts/GNUmakefile b/buildscripts/GNUmakefile
deleted file mode 100644 (file)
index 3a24a75..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# bin/Makefile
-
-depth = ..
-STEPMAKE_TEMPLATES=script
-
-include $(depth)/make/stepmake.make 
-
-
-
-
-
-
diff --git a/buildscripts/clean-diaper.sh b/buildscripts/clean-diaper.sh
deleted file mode 100755 (executable)
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/buildscripts/clean-fonts.sh b/buildscripts/clean-fonts.sh
deleted file mode 100755 (executable)
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/buildscripts/docxx-lily.sh b/buildscripts/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/buildscripts/find-typenames.pl b/buildscripts/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/buildscripts/gen-sitemap.sh b/buildscripts/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/buildscripts/genheader.py b/buildscripts/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/buildscripts/html-accents.py b/buildscripts/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/buildscripts/lilypond-login.sh b/buildscripts/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/buildscripts/lilypond-profile.sh b/buildscripts/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/buildscripts/localpackage.py b/buildscripts/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/buildscripts/ltmain.sh b/buildscripts/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/buildscripts/mail-address.sh b/buildscripts/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/buildscripts/mf-to-table.py b/buildscripts/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/buildscripts/mf-to-xpms.sh b/buildscripts/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/buildscripts/mutopia-index.py b/buildscripts/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/buildscripts/profile-conf.sh b/buildscripts/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/buildscripts/ps-to-gifs.sh b/buildscripts/ps-to-gifs.sh
deleted file mode 100755 (executable)
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/buildscripts/ps-to-pfa.py b/buildscripts/ps-to-pfa.py
deleted file mode 100644 (file)
index 33ee75d..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-#!@PYTHON@
-
-# ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
-
-name = 'ps-to-pfa'
-version = '0.2'
-
-outdir = 'out/'
-datadir = ''
-
-import os
-import sys
-
-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"
-                     "ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files\n\n"
-                      + "Options:\n"
-                      + "  -d, --datadir=DIR      use DIR for ps header/footer\n"
-                      + "  -h, --help             print this help\n"
-                      % (program_name)
-                     )
-    sys.exit (0)
-
-identify ()
-(options, files) = getopt.getopt (
-    sys.argv[1:], 'd:', ['help', 'package'])
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o== '--help' or o == '-h':
-       help ()
-    elif o == '-d' or o == '--datadir':
-       datadir = a
-    else:
-       print o
-       raise getopt.error
-
-
-def gulp_file (f):
-       sys.stderr.write ('[%s' % f)
-       try:
-               i = open (f)
-               i.seek (0, 2)
-               n = i.tell ()
-               i.seek (0,0)
-       except:
-               sys.stderr.write ('can\'t open file %s\n ' % f)
-               return ''
-       s = i.read (n)
-       sys.stderr.write (']')
-       if len (s) <= 0:
-               sys.stderr.write ('gulped empty file: %s\n'% f)
-       return s
-
-mf = files[0]
-# urg ?
-font = os.path.basename (os.path.splitext (mf)[0])
-sys.stderr.write ('Font: %s\n'% font)
-
-def header (f):
-       f.write ('%!PS-AdobeFont-3.0: ' + font + '\n')
-       f.write ('%%%%Creator: %s-%s\n' % (name, version))
-       f.write ('\n')
-       f.write ('/setgray { 1 add } bind def\n'
-               '\n'
-'8 dict begin\n'
-'/FontType 3 def                             %% Required elements of font\n'
-'/FontName /%s def\n'
-'/FontMatrix [.001 0 0 .001 0 0] def\n'
-'%%/FontMatrix [.01 0 0 .01 0 0] def\n'
-'%%/FontMatrix [0.1 0 0 0.1 0 0] def\n'
-'%% /FontBBox [-1000 -1000 1000 1000] def\n'
-' /FontBBox [-3000 -3000 3000 3000] def\n'
-'%% /FontBBox [-300 -300 300 300] def\n'
-'%%/FontBBox [-30 -30 30 30] def\n'
-'\n'
-'/Encoding 256 array def                     %% Trivial encoding vector\n'
-'0 1 255 {Encoding exch /.notdef put} for\n' % (font))
-
-def footer (f):
-       f.write ('\n'
-'/BuildGlyph {                               % Stack contains: font charname\n'
-'%  1000 0                                   % Width\n'
-'%  -750 -750 750 750                        % Bounding Box\n'
-'  3000 0                                    % Width\n'
-'  -3000 -3000 3000 3000                     % Bounding Box\n'
-'%  300 0                                    % Width\n'
-'%  -300 -300 300 300                        % Bounding Box\n'
-'%  30 0                                     % Width\n'
-'%  -30 -30 30 30                            % Bounding Box\n'
-'  setcachedevice\n'
-'  exch /CharProcs get exch                  % Get CharProcs dictionary\n'
-'  2 copy known not {pop /.notdef} if        % See if charname is known\n'
-'  get exec                                  % Execute character procedure\n'
-'} bind def\n'
-'\n'
-'/BuildChar {                                % Level 1 compatibility\n'
-'  1 index /Encoding get exch get\n'
-'  1 index /BuildGlyph get exec\n'
-'} bind def\n'
-'\n'
-'currentdict\n'
-'end                                         % of font dictionary\n')
-       f.write ('\n')
-       f.write ('/%s\n' % font)
-       f.write (''
-'exch definefont pop                         % Define the font\n')
-
-def characters (f):
-       #urg
-       # chars = os.listdir ()
-       # chars.sort ()
-       sys.stderr.write ('[')
-       pipe = os.popen ('/bin/ls -1 ' + font + '.[0-9] ' + font + '.[0-9][0-9] ' + font + '.[0-9][0-9][0-9] 2> /dev/null')
-       chars = []
-       i = pipe.readline ()
-       while i:
-               chars.append (i[0:len (i)-1])
-               i = pipe.readline ()
-       f.write ('\n'
-'/CharProcs 3 dict def                       % Subsidiary dictiorary for\n'
-'CharProcs begin                             % individual character definitions\n')
-       charprocs = '  /.notdef {} def\n'
-       encoding = ''
-       for i in chars: 
-               s = gulp_file (i)
-               s = regsub.gsub ('^%.*\n', '', s)
-               s = regsub.gsub ('^showpage\n', '', s)
-               s = regsub.gsub ('^', '    ', s)
-               n = atoi (regsub.gsub ('.*\.', '', i))
-               s = '\n  /%s-%d{\n%s} bind def\n' % (font, n, s)
-               encoding = encoding + 'Encoding %d /%s-%d put\n' % (n, font, n)
-               charprocs = charprocs + s
-       f.write (charprocs)
-       f.write ('\n')
-       f.write ('end                                         % of CharProcs\n')
-       f.write (encoding)
-       f.write ('\n')
-       sys.stderr.write (']')
-
-ps = outdir + font + '.pfa'
-ps_file = open (ps, 'w')
-header (ps_file)
-characters (ps_file)
-footer (ps_file)
-sys.stderr.write ('\n')
-ps_file.close ()
-sys.stderr.write ('Wrote PostScript font: %s\n'% ps)
-
diff --git a/buildscripts/ps-to-pngs.sh b/buildscripts/ps-to-pngs.sh
deleted file mode 100755 (executable)
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/buildscripts/run-lilypond.sh b/buildscripts/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/buildscripts/set-lily.sh b/buildscripts/set-lily.sh
deleted file mode 100755 (executable)
index d44317d..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/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
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/buildscripts/template.py b/buildscripts/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 *
-
index 8c90d01de8ae2936c3f29f967cff677d31c7772b..fcde1cfd52387c938f4135d04933ff37c1fc2fe2 100644 (file)
@@ -8,8 +8,9 @@
 # you do make dist 
 #
 
-buildscripts = $(depth)/buildscripts
-
+# urg, ambiguous and thus error prone; hardcode all $(*scripts) to bin?
+buildscripts = $(depth)/bin
+scripts = $(depth)/bin
 
 flower-dir = $(depth)/flower
 lib-dir = $(depth)/lib
index f912908583963d3ed46219244c41fbd39245a2e6..a5f9487ed2fd75530fcbfe736a93d42cfb9bee59 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 244a80801f44ad24d36de04121a273d77ec7079e..ed8060fcfa5f73e6f67a094f2f9c1a8f9d523c87 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 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
+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
 
 %files
 
index 5a7d8ef6709223d53c64b14086f59679f6294b1b..f2e39d714fa6ee8aee05e95decc80c12f7c6011c 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 74072fb462448c171732fa518b5593137ef11b88..22d9e63c676bf8727d760b40ed554ffd71ef1cc9 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 11b4a35299335c16fabe98790a729b4b760d13c8..be5aa37fde82c131295de83982862d5d64aa6f0b 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 628a2a9f78165a10a6482871fc61a68f91dff099..e60960ffcbf390f0224dd1cba484fe5fc257053a 100644 (file)
@@ -8,7 +8,7 @@ depth = .
 
 # descent order into subdirectories:
 #
-SUBDIRS = scripts buildscripts  flower lib lily mf mi2mu po debian \
+SUBDIRS = bin flower lib lily mf mi2mu po debian \
        Documentation init input tex make mutopia test intl stepmake\
        ps
 #
diff --git a/scripts/GNUmakefile b/scripts/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/scripts/convert-mudela.py b/scripts/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/scripts/ly2dvi-old.sh b/scripts/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/scripts/ly2dvi.py b/scripts/ly2dvi.py
deleted file mode 100644 (file)
index 74c5495..0000000
+++ /dev/null
@@ -1,1117 +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.5'
-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)
-    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/scripts/mudela-book.py b/scripts/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()
index 5f142738b9172fa4fb6117253c1a175808169b90..bb2cad423c278a9bfd151dd3ede380a671fd134f 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 a33b8cdd5203d89580973ba7baa3cede7139be95..f72cb62963c4d9ad7af46cc119b50ba73a6b2c31 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