]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/mup2ly.py: Cut-n-paste include missing lilylib.
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 18 Jul 2002 01:33:56 +0000 (01:33 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 18 Jul 2002 01:33:56 +0000 (01:33 +0000)
misc fixes

ChangeLog
Documentation/user/GNUmakefile
GNUmakefile.in
cygwin/mknetrel
make/stepmake.make
scripts/mup2ly.py
stepmake/stepmake/generic-vars.make

index 516d56e8fc7fbd3860e4637b2e07ff9c879504ec..a8528d145274f184fea970dd816dea71f49e608c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2002-07-18  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * scripts/mup2ly.py: Cut-n-paste include missing lilylib.
+
        * stepmake/stepmake/compile-vars.make: 
        * stepmake/stepmake/executable-rules.make: 
        * stepmake/stepmake/python-module-rules.make:
index 2c5a6df23ff54dc0a461e16b74ee320194e61e61..120d24d2a541fc31ab385c5c870c3c1022edfb89 100644 (file)
@@ -120,13 +120,13 @@ ifneq ($(CROSS),yes)
 # however, this triggers compilation during install, which  is a bad thing (tm).
 
 $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond
-       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose ../$(src-depth)/ly/generate-documentation
+       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation
        -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
 
 
 ## unused
 $(outdir)/interfaces.itexi: dummy
-       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond ../$(src-depth)/ly/generate-interface-doc
+       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc
 
 else
 
index 8cb953d60e29fad3460c7a635012e2fafbe8fd42..fd8539abdb92420bad538a239e7356c0ce4ad6b3 100644 (file)
@@ -121,22 +121,22 @@ $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force:
        @cd $(builddir) && mkdir -p share/lilypond
        @cd $(builddir)/share/lilypond && mkdir -p $(TOPLEVEL_VERSION)
        @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
-               ln -s ../../../$(srcdir)/ly ly && \
+               ln -s $(abs-srcdir)/ly ly && \
                ln -s ../../../mf/$(outconfbase) dvips && \
                ln -s ../../../mf/$(outconfbase) afm && \
                ln -s ../../../mf/$(outconfbase) tfm && \
-               ln -s ../../../$(srcdir)/mf && \
-               ln -s ../../../$(srcdir)/ps && \
-               ln -s ../../../$(srcdir)/scm
+               ln -s $(abs-srcdir)/mf && \
+               ln -s $(abs-srcdir)/ps && \
+               ln -s $(abs-srcdir)/scm
        @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
                mkdir tex
        @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/tex && \
-               ln -s ../../../../$(srcdir)/tex source && \
+               ln -s $(abs-srcdir)/tex source && \
                ln -s ../../../../mf/$(outconfbase) generate
        @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
                mkdir fonts
        @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/fonts && \
-               ln -s ../../../../$(srcdir)/mf source && \
+               ln -s $(abs-srcdir)/mf source && \
                ln -s ../../../../mf/$(outconfbase) afm && \
                ln -s ../../../../mf/$(outconfbase) tfm && \
                ln -s ../../../../mf/$(outconfbase) type1
index 2f4ba12b66bd5ad23dd5405164167446fe649ae6..9c55cdd930932af8fba4c0323efb7040e5e32a59 100644 (file)
@@ -29,6 +29,7 @@ patch=$mknetrel_root/patch
 iscygwin || (uploads=$here/uploads/$base && mkdir -p $uploads)
 
 sub_packages="doc"
+old_path=$PATH
 
 
 
@@ -256,16 +257,16 @@ exit 0
 EOF
 
     chmod 755 guile-config
-    old_path=$PATH
     PATH=$(pwd):$PATH
     
-    LDFLAGS="$PREFIX/bin/libpython2.2.dll"
+    ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll"
 }
 
 postconfig () {
     # Configure for build, for generating doc
     rm -f config.cache
     (PATH="$old_path" \
+       PATH="$HOME/usr/pkg/guile-1.5.6/bin:$PATH" \
        CFLAGS="-O2 -g" \
        $src/configure --prefix=/usr --enable-config=for-build)
 }
@@ -282,11 +283,13 @@ prebuild () {
     for i in $(find . -path "out-for-build/*.1"); do
        cp -pv $i $(dirname $(dirname $i))/$(basename $i)
     done
+
+    addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll"
 }
 
 postinstall () {
     mkdir -p $inst-doc/$prefix
-    cd $src || exit 1
+    cd $build || exit 1
     make conf=for-build prefix=$inst-doc/$prefix install-html-doc
 
 
index e860f1fb83ec392b72838130672eaa391ee27504..5377d10533d4d8fb9273bc16dfc98f3dbac225c8 100644 (file)
@@ -1,15 +1,7 @@
 # make/Stepmake.make
 
-
-all: foe
-
-foe:
-       @echo one=.$(shell cd $(builddir); pwd).
-       @echo two=.$(shell cd $(depth); pwd).
-
 include $(depth)/make/toplevel-version.make
 
-
 # Use alternate configurations alongside eachother:
 #
 #     ./configure --enable-config=debug
index 81279de3f8e694871949a55cf3f102913ae924f3..e24f38ac183730236f823ef026d3cb6c7e3808c5 100644 (file)
@@ -80,8 +80,254 @@ option_definitions = [
        ]
 
 
-from lilylib import *
+################################################################
+# lilylib.py -- options and stuff
+# 
+# source file of the GNU LilyPond music typesetter
+
+# Handle bug in Python 1.6-2.1
+#
+# there are recursion limits for some patterns in Python 1.6 til 2.1. 
+# fix this by importing pre instead. Fix by Mats.
+
+# todo: should check Python version first.
+try:
+       import pre
+       re = pre
+       del pre
+except ImportError:
+       import re
+
+# Attempt to fix problems with limited stack size set by Python!
+# Sets unlimited stack size. Note that the resource module only
+# is available on UNIX.
+try:
+       import resource
+       resource.setrlimit (resource.RLIMIT_STACK, (-1, -1))
+except:
+       pass
+
+try:
+       import gettext
+       gettext.bindtextdomain ('lilypond', localedir)
+       gettext.textdomain ('lilypond')
+       _ = gettext.gettext
+except:
+       def _ (s):
+               return s
+
+program_version = '@TOPLEVEL_VERSION@'
+if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
+       program_version = '1.5.54'
+
+def identify ():
+       sys.stdout.write ('%s (GNU LilyPond) %s\n' % (program_name, program_version))
+
+def warranty ():
+       identify ()
+       sys.stdout.write ('\n')
+       sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002'))
+       sys.stdout.write ('\n')
+       sys.stdout.write ('  Han-Wen Nienhuys')
+       sys.stdout.write ('  Jan Nieuwenhuizen')
+       sys.stdout.write ('\n')
+       sys.stdout.write (_ (r'''
+Distributed under terms of the GNU General Public License. It comes with
+NO WARRANTY.'''))
+       sys.stdout.write ('\n')
+
+def progress (s):
+       errorport.write (s + '\n')
+
+def warning (s):
+       progress (_ ("warning: ") + s)
+
+def user_error (s, e=1):
+       errorport.write (program_name + ":" + _ ("error: ") + s + '\n')
+       sys.exit (e)
+       
+def error (s):
+       '''Report the error S.  Exit by raising an exception. Please
+       do not abuse by trying to catch this error. If you do not want
+       a stack trace, write to the output directly.
+
+       RETURN VALUE
+
+       None
+       
+       '''
+       
+       progress (_ ("error: ") + s)
+       raise _ ("Exiting ... ")
+
+def getopt_args (opts):
+       '''Construct arguments (LONG, SHORT) for getopt from  list of options.'''
+       short = ''
+       long = []
+       for o in opts:
+               if o[1]:
+                       short = short + o[1]
+                       if o[0]:
+                               short = short + ':'
+               if o[2]:
+                       l = o[2]
+                       if o[0]:
+                               l = l + '='
+                       long.append (l)
+       return (short, long)
+
+def option_help_str (o):
+       '''Transform one option description (4-tuple ) into neatly formatted string'''
+       sh = '  '       
+       if o[1]:
+               sh = '-%s' % o[1]
+
+       sep = ' '
+       if o[1] and o[2]:
+               sep = ','
+               
+       long = ''
+       if o[2]:
+               long= '--%s' % o[2]
+
+       arg = ''
+       if o[0]:
+               if o[2]:
+                       arg = '='
+               arg = arg + o[0]
+       return '  ' + sh + sep + long + arg
+
+
+def options_help_str (opts):
+       '''Convert a list of options into a neatly formatted string'''
+       w = 0
+       strs =[]
+       helps = []
+
+       for o in opts:
+               s = option_help_str (o)
+               strs.append ((s, o[3]))
+               if len (s) > w:
+                       w = len (s)
+
+       str = ''
+       for s in strs:
+               str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0])  + 3), s[1])
+       return str
+
+def help ():
+       ls = [(_ ("Usage: %s [OPTION]... FILE") % program_name),
+               ('\n\n'),
+               (help_summary),
+               ('\n\n'),
+               (_ ("Options:")),
+               ('\n'),
+               (options_help_str (option_definitions)),
+               ('\n\n'),
+               (_ ("Report bugs to %s") % 'bug-lilypond@gnu.org'),
+               ('\n')]
+       map (sys.stdout.write, ls)
+       
+def setup_temp ():
+       """
+       Create a temporary directory, and return its name. 
+       """
+       global temp_dir
+       if not keep_temp_dir_p:
+               temp_dir = tempfile.mktemp (program_name)
+       try:
+               os.mkdir (temp_dir, 0777)
+       except OSError:
+               pass
+
+       return temp_dir
+
+
+def system (cmd, ignore_error = 0, quiet =0):
+       """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero.
+
+       RETURN VALUE
+
+       Exit status of CMD
+       """
+       
+       if verbose_p:
+               progress (_ ("Invoking `%s\'") % cmd)
+
+       st = os.system (cmd)
+       if st:
+               name = re.match ('[ \t]*([^ \t]*)', cmd).group (1)
+               msg = name + ': ' + _ ("command exited with value %d") % st
+               if ignore_error:
+                       if not quiet:
+                               warning (msg + ' ' + _ ("(ignored)") + ' ')
+               else:
+                       error (msg)
+
+       return st
+
+
+def cleanup_temp ():
+       if not keep_temp_dir_p:
+               if verbose_p:
+                       progress (_ ("Cleaning %s...") % temp_dir)
+               shutil.rmtree (temp_dir)
+
+
+def strip_extension (f, ext):
+       (p, e) = os.path.splitext (f)
+       if e == ext:
+               e = ''
+       return p + e
+
+
+def cp_to_dir (pattern, dir):
+       "Copy files matching re PATTERN from cwd to DIR"
+       # Duh.  Python style portable: cp *.EXT OUTDIR
+       # system ('cp *.%s %s' % (ext, outdir), 1)
+       files = filter (lambda x, p=pattern: re.match (p, x), os.listdir ('.'))
+       map (lambda x, d=dir: shutil.copy2 (x, os.path.join (d, x)), files)
+
+
+# Python < 1.5.2 compatibility
+#
+# On most platforms, this is equivalent to
+#`normpath(join(os.getcwd()), PATH)'.  *Added in Python version 1.5.2*
+if os.path.__dict__.has_key ('abspath'):
+       abspath = os.path.abspath
+else:
+       def abspath (path):
+               return os.path.normpath (os.path.join (os.getcwd (), path))
+
+if os.__dict__.has_key ('makedirs'):
+       makedirs = os.makedirs
+else:
+       def makedirs (dir, mode=0777):
+               system ('mkdir -p %s' % dir)
+
+
+def mkdir_p (dir, mode=0777):
+       if not os.path.isdir (dir):
+               makedirs (dir, mode)
+
+
+# if set, LILYPONDPREFIX must take prevalence
+# if datadir is not set, we're doing a build and LILYPONDPREFIX 
+datadir = '@datadir@'
+
+if os.environ.has_key ('LILYPONDPREFIX') :
+       datadir = os.environ['LILYPONDPREFIX']
+else:
+       datadir = '@datadir@'
+
+
+while datadir[-1] == os.sep:
+       datadir= datadir[:-1]
+
+sys.path.insert (0, os.path.join (datadir, 'python'))
 
+################################################################
+# END Library
 
 
 output = 0
index c47a444f336735aeb45679b48b62f8a2abf9bdc5..5a0302d9a091bd0c6a5b753a339842851d8dc367 100644 (file)
@@ -4,11 +4,11 @@
 # internal, not normally used
 DEPTH = $(depth)/$(package-depth)
 
-ifeq ($(topdir),)
-abs-srcdir := $(shell cd $(depth); pwd)
-#deprecated
-topdir := $(abs-srcdir)
-endif
+#ifeq ($(topdir),)
+#abs-srcdir := $(shell cd $(depth); pwd)
+##deprecated
+#topdir := $(abs-srcdir)
+#endif
 pwd := $(shell pwd)
 
 ifeq ($(srcdir),.)
@@ -17,6 +17,11 @@ else
 src-depth = $(srcdir)
 endif
 
+ifeq ($(topdir),)
+abs-srcdir := $(shell cd $(src-depth); pwd)
+topdir := $(abs-srcdir)
+endif
+
 # derived names
 ifeq ($(distdir),)
   distdir = $(topdir)/$(outdir)/$(DIST_NAME)