]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.49
authorfred <fred>
Sun, 24 Mar 2002 20:06:57 +0000 (20:06 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:06:57 +0000 (20:06 +0000)
13 files changed:
bin/convert-mudela.in [new file with mode: 0644]
flower/AUTHORS [new file with mode: 0644]
flower/COPYING [new file with mode: 0644]
flower/ChangeLog [new file with mode: 0644]
flower/INSTALL [new file with mode: 0644]
flower/Makefile.am.wild [new file with mode: 0644]
flower/config.hh.in
flower/configure.in
flower/flower-version.cc
flower/include/libc-extension.hh
lib/config.hh.in
mi2mu/Makefile.am.wild [new file with mode: 0644]
mi2mu/mi2mu-version.cc

diff --git a/bin/convert-mudela.in b/bin/convert-mudela.in
new file mode 100644 (file)
index 0000000..3be80d9
--- /dev/null
@@ -0,0 +1,363 @@
+#!@PERL@ -w
+# -*-perl-*-
+
+=head1 TODO
+
+    detect \lyrics and \melodic, and do substitution accordingly.
+    count <> and {} ?
+
+Ugh . Perl sux. Anybody for Python?
+    
+=cut    
+
+
+
+#
+# version of "supporting" engine, not mudela conversions.
+# 
+
+
+
+
+$convert_mudela_version = "0.1.2";
+
+use Getopt::Long;
+
+
+sub version_compare
+{
+    local ($a,$b)=@_;
+    return &cmpver;
+}
+    
+
+sub  cmpver 
+{      
+       my(@a)= split /\./,$a;
+       my(@b)= split /\./,$b;
+
+       for $i (0,1,2) {
+           return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
+       }
+       return $a cmp $b;
+}
+
+sub version_string_conv
+{
+    my ($from_version, $to_version) = @_;
+    s/\version \"$from_version\"/\version \"$to_version\"/g;
+}
+
+################################################################
+
+sub no_conv
+{
+}
+sub convert_0_0_52_to_0_0_53
+{
+
+    s/include \"/$1\\include \"/g;
+}
+
+  
+sub convert_0_0_54_to_0_0_55
+{
+    s/%{/% {/g;
+}
+
+  
+sub convert_0_0_53_to_0_0_54
+{
+    print STDERR "Not smart enough to convert \\transpose\n"    if (/\\transpose/) ;
+}
+
+# we-re not at 58 yet, but this is at least one of the rules
+sub convert_0_0_55_to_0_0_56
+{
+    s/\"\|\|\"/\"|.\"/g;
+}
+
+sub convert_0_0_56_to_0_0_57
+{
+    s/\(([ \]\[|\t-\.>]|\\[<!>a-z]+)*\)/\~ $1/g;
+}
+
+sub convert_0_0_57_to_0_0_58
+{
+    s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g;
+}
+
+sub convert_0_0_58_to_0_0_59
+{
+    die "Not smart enough to convert 0.0.58 to 0.0.59\n";
+}
+
+sub convert_0_0_59_to_0_0_60
+{
+    s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g;
+    s/(\\output \"[^\"]+\")/$1;/;
+    s/(\\tempo  [0-9: ]+)/$1;/;
+}
+
+sub convert_0_0_60_to_0_0_61
+{
+    s/(\\unitspace|\\geometric|\\width)/$1=/g;
+   
+}
+
+sub convert_0_1_0_to_0_1_1
+{
+    s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g
+}
+
+sub convert_0_1_2_to_0_1_3
+{
+    s/\\stem *(\\up|1) *;/\\stemup/g;
+    s/\\stem *(\\down|-1) *;/\\stemdown/g;
+    s/\\stem *0 *;/\\stemboth/g;
+    s/\\hshift ([^;]+) *;/\\property Voice.hshift = $1/g;
+}
+
+my $header_b = 0;
+
+sub generic_conversion_scan
+{
+    if (/\\header *\{/)
+    {
+       $header_b = 1;
+    }
+    if ($header_b && /^ *\}/)
+    {
+       $header_b = 0;
+    }
+}
+sub convert_0_1_4_to_0_1_5
+{
+    s/([<{]) *\\id "Piano" (.+);/\\type Grandstaff = $3 $1/;    
+    s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/;
+}
+
+       
+sub convert_0_1_5_to_0_1_6
+{
+    s/< *\\multi (.*);/\\multi $1 </;
+}
+
+sub convert_0_1_6_to_0_1_7
+{
+    if ($header_b) 
+    {
+       s/^([a-zA-z]+)[ \t]+(.*)$/$1 =\t \"$2\";/;
+       s/^([ \t])+(.*)$/$1 \"$2\";/;
+    }
+}  
+
+sub convert_0_1_7_to_0_1_8
+{
+    s/\\plet *1 *\/ *1 *;/\\]/;    
+    s/\\plet *([1-9][0-9]*) *\/ *([2-9][0-9]*) *;/\\[$1\/$2/;    
+}  
+
+sub convert_0_1_8_to_0_1_9
+{
+# sticky plet shorthand...
+#  print "introduced plet and finger shorthands...\n";
+}
+
+###############################################################
+
+sub    last_conversion
+{
+    my @v = &versions;
+    return pop @v;
+}
+sub identify
+{
+    
+    print STDERR "This is convert-mudela " . $convert_mudela_version . 
+       " (up to mudela version ", last_conversion,     ")\n";
+}
+  
+  
+ sub usage
+  {
+     print STDERR "Usage: convert-mudela [options] [mudela-file]...\n"
+     . "Convert old mudela source from mudela-file or stdin\n\n"
+     . "Options:\n"
+     . "  -e, --edit             perform in-place conversion\n"
+     . "  -f, --from=PATHLEVEL   use source version 0.0.PATCHLEVEL\n"
+     . "  -h, --help             print this help\n"
+     . "  -o, --output=FILE      name output file\n"
+     . "  -s, --show-rules       print all known conversion rules\n"
+     . "  -t, --to=VERSION       convert to version VERSION\n"
+  }
+      
+
+my %minor_conversions = ("0.0.50" => \&no_conv,
+                        "0.0.52" => \&convert_0_0_50_to_0_0_52,
+                        "0.0.53" => \&convert_0_0_52_to_0_0_53,
+                        "0.0.54" => \&convert_0_0_53_to_0_0_54,
+                        "0.0.55" => \&convert_0_0_54_to_0_0_55,
+                        "0.0.56" => \&convert_0_0_55_to_0_0_56,
+                        "0.0.57" => \&convert_0_0_56_to_0_0_57,
+                        "0.0.58" => \&convert_0_0_57_to_0_0_58,
+                        "0.0.59" => \&convert_0_0_58_to_0_0_59,
+                        "0.0.60" => \&convert_0_0_59_to_0_0_60,
+                        "0.0.61" => \&convert_0_0_60_to_0_0_61,
+                        "0.1.1" => \&convert_0_1_0_to_0_1_1,
+                        "0.1.2" => \&no_conv,
+                        "0.1.3" => \&convert_0_1_2_to_0_1_3,
+                        "0.1.4" => \&no_conv,
+                        "0.1.5" => \&convert_0_1_4_to_0_1_5,
+                        "0.1.6" => \&convert_0_1_5_to_0_1_6
+                        ,"0.1.7" => \&convert_0_1_6_to_0_1_7
+                        ,"0.1.8" => \&convert_0_1_7_to_0_1_8
+                        ,"0.1.9" => \&convert_0_1_8_to_0_1_9
+                        );
+
+
+sub versions 
+{
+    return (sort { cmpver; } (keys %minor_conversions));
+}
+
+
+sub show_rules
+{
+    my (@v) = versions;
+
+    print "Rules: ", join(", ", @v), "\n";
+    
+}
+
+sub do_conversion
+{
+    my ($from,$to) = @_;
+
+    my @applicable_conversion;
+    my @mudela_levels;
+    
+    my @v = versions;
+    foreach $ver (@v) {
+       if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ 
+           push @applicable_conversion, $minor_conversions{$ver};
+           push @mudela_levels, $ver;
+       }
+    }
+    
+    print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n";
+
+    while (<INLY>) {
+       generic_conversion_scan;
+       foreach $subroutine (@applicable_conversion) {
+       
+           &$subroutine;
+           
+       }
+       version_string_conv $from, $to;
+       print OUTLY;
+    }
+}
+
+sub get_auto_from
+{
+    my ($fn)=@_;
+    my ($ver);
+    open INLY, $fn || die "Can't open";
+
+    while (<INLY>) {
+       s/^.*\\version \"([^\"]*)\".*$//;
+       if (defined ($1)) {
+           print STDERR "Guessing version: ", $1, ".. ";
+           $ver = $1;
+           last;
+       }
+    }
+    if (!defined($ver)){
+       print STDERR "can't determine mudela version in $fn.\n";
+       my $u;
+       return $u;
+    }
+    close INLY;
+    return $ver;
+}   
+
+sub  set_files 
+{
+    $infile = "-";
+    $outfile = "-";
+    $outfile = $opt_output if (defined($opt_output));
+
+    if ($ARGV [0])  {
+       $infile = $ARGV[0];
+    } 
+    if (!(-f $infile) && !($infile =~ /\.ly$/s)) {
+       $infile .= ".ly";
+    }
+    if ($opt_edit && $infile ne "-") {
+       $opt_edit = 1;
+       $outfile = "$infile.NEW";
+       $infile = "$infile";
+    }
+    print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. ";
+
+}
+
+sub do_one_arg
+{
+    set_files;
+
+    local ($from_version, $to_version);
+    $from_version = $opt_from;
+    $to_version = $opt_to;
+    
+    ($from_version = get_auto_from $infile) unless defined($opt_from);
+    return if (!defined($from_version));
+    
+    ($to_version =  last_conversion) unless (defined($opt_to));
+
+    die "can't open \`$infile\'" unless open INLY,$infile ;
+    die "can't open \`$outfile\'" unless open OUTLY, ">$outfile";
+    
+    do_conversion $from_version, $to_version;
+    close INLY;
+    close OUTLY;
+
+    if ($opt_edit) {
+       rename $infile, "$infile~";
+       rename $outfile, "$infile";
+    }
+}
+
+## "main"
+
+identify;
+
+
+GetOptions ("help", "output=s", "from=s", "to=s", "minor=i", "edit", "show-rules");
+
+if ($opt_help) {
+    usage();
+    $opt_help = 0;     # to extinguish typo check.
+    exit 0;
+}
+
+if ($opt_show_rules) { 
+    show_rules ;
+    $opt_show_rules = 0;       # to extinguish typo check.
+    exit 0;
+}
+
+local ( $infile,$outfile);
+my $processed_one=0;
+
+while (defined($ARGV[0])) {
+    do_one_arg;
+    shift @ARGV;
+    $processed_one = 1;
+}
+do_one_arg unless ($processed_one);
+
+    
diff --git a/flower/AUTHORS b/flower/AUTHORS
new file mode 100644 (file)
index 0000000..9d9d19a
--- /dev/null
@@ -0,0 +1 @@
+see ../AUTHORS
diff --git a/flower/COPYING b/flower/COPYING
new file mode 100644 (file)
index 0000000..a2a0122
--- /dev/null
@@ -0,0 +1 @@
+see ../COPYING
diff --git a/flower/ChangeLog b/flower/ChangeLog
new file mode 100644 (file)
index 0000000..e1b28ea
--- /dev/null
@@ -0,0 +1 @@
+oeps: no more details than NEWS
diff --git a/flower/INSTALL b/flower/INSTALL
new file mode 100644 (file)
index 0000000..28d72f9
--- /dev/null
@@ -0,0 +1 @@
+see ../INSTALL
diff --git a/flower/Makefile.am.wild b/flower/Makefile.am.wild
new file mode 100644 (file)
index 0000000..f19c6ab
--- /dev/null
@@ -0,0 +1,21 @@
+# project  FlowerSoft C++ library
+# title           top level makefile for FlowerLib
+# file    flower/Makefile.am.wild
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#              ...your sort order here, or how to comment-out a comment
+
+SUBDIRS = include test 
+
+lib_LIBRARIES = libflower.a
+# lib_LIBRARIES = libflower.la
+
+README_FILES = ONEWS NEWS README TODO VERSION
+EXTRA_DIST = Makefile.am.wild aclocal.m4 configure config.hh.in configure.in $(README_FILES)
+
+libflower_a_SOURCES = $(wildcard *.cc)
+
+INCLUDES = -Iinclude
+
index 9f3b9821143763c3d13e4f192d2cfa6442dafb5c..80c688b06b227ed7bbf4c0fdfd4fcfc5880c18b5 100644 (file)
@@ -3,3 +3,7 @@
 
 /* define if you have snprintf */
 #define HAVE_SNPRINTF 0
+
+/* the version string of the flower lib */
+#define MODULE_VERSION "0.0.0"
+
index d0bd09bbc2fc8f4e89a5eb6123b28e4ca6313fdf..4c28402072db1c76d508aa9336e01bffb9870744 100644 (file)
@@ -1,6 +1,29 @@
 dnl -*-shell-script-*-
 dnl Process this file with autoconf to produce a configure script.-
+
 AC_INIT(choleski.cc)
+
+. ./VERSION
+FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
+if test x$MY_PATCH_LEVEL != x; then
+       FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
+fi
+AM_INIT_AUTOMAKE(flower, $FULL_VERSION)
+
+AC_PROG_CC
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_RANLIB
+
+missing_dir=`cd $ac_aux_dir && pwd`
+
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+# AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+
 AC_LANG_CPLUSPLUS
 
 optimise_b=yes
@@ -8,19 +31,6 @@ shared_b=no
 LIB_SUFFIX=.a
 MODULE_CXXFLAGS="$MODULE_CXXFLAGS -D_REENTRANT"
 
-if test x$host = xNONE; then
-    OUTDIR_NAME=${OUTDIR_NAME-"out"}
-else
-    OUTDIR_NAME=${OUTDIR_NAME-"out-$host"}
-fi
-
-for a in `find -type d -and -not -name 'out'`; do
-       if test ! -d  $a/$OUTDIR_NAME; then
-               mkdir $a/$OUTDIR_NAME;
-       fi
-done
-
-    
 AC_ARG_ENABLE(shared,
     [  enable-shared       shared flower library],
     [shared_b=$enableval])
@@ -29,11 +39,6 @@ AC_ARG_ENABLE(optimise,
     [  disable-optimise    optimisations off],
     [optimise_b=$enableval])
 
-AC_ARG_ENABLE(out-dir,
-    [  out-dir                 set the directory for machine generated files. Default out or out-HOST],
-    [OUTDIR_NAME=$enableval]
-    [])
-
 if test $shared_b = yes; then
        MODULE_CXXFLAGS="$MODULE_CXXFLAGS -fPIC -DPIC"
        MODULE_LDFLAGS="-shared -Wl,-soname,libflower.so.\$(VERSION) "
@@ -53,10 +58,9 @@ AC_FUNC_MEMCMP
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(memmem snprintf )
 
-if test ! -d $OUTDIR_NAME ; then
-    mkdir $OUTDIR_NAME
-fi
+AC_DEFINE_UNQUOTED(MODULE_VERSION, "${FULL_VERSION}")
 
-AC_CONFIG_HEADER($OUTDIR_NAME/config.hh:config.hh.in)
-AC_OUTPUT($OUTDIR_NAME/Flower-flags.make:Flower-flags.make.in)
+touch stamp-h.in
+AM_CONFIG_HEADER(config.hh:config.hh.in)
+AC_OUTPUT(Makefile include/Makefile test/Makefile)
 
index 6372f502779c76ed5661ff81c20d41d126791fd1..6216111d27ea453e337066bf2a4097aed1ac9074 100644 (file)
@@ -1,10 +1,13 @@
-#include "version.hh"  // urg
 #include <stdio.h>
 
-static char *s = "FlowerLib " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
+#include "config.hh"
+
+// static char *s = "FlowerLib " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
+static char *s = "FlowerLib " MODULE_VERSION " #%d";
 
 static const int build=
-#include ".build"
+//#include ".build"
+0
 ;
 
 char const * 
index 975950d4bb659216367e7544b30d5684831c1c9e..270d07aefb8164da08640be3dea06d0898386fc1 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef LIBC_EXTENSION_HH
 #define LIBC_EXTENSION_HH
 #include "fproto.hh"
+
 #include "config.hh"
 
 char* strnlwr (char* start_l ,int n);
index 1e7112e2c9fbfee2a0403455e452d27663b351d9..b10c27a7c123d27464e8adb1b04bc4810876134e 100644 (file)
@@ -1,6 +1,11 @@
 /* @configure_input@ */
 #ifndef CONFIG_HH
 #define CONFIG_HH
+
+/* default lilypond init and input dir */
 #define  DIR_DATADIR "@datadir@/lilypond"
 
+/* the toplevel version string */
+#define TOPLEVEL_VERSION "0"
+
 #endif
diff --git a/mi2mu/Makefile.am.wild b/mi2mu/Makefile.am.wild
new file mode 100644 (file)
index 0000000..bb3dc4b
--- /dev/null
@@ -0,0 +1,22 @@
+# project  LilyPond -- the musical typesetter
+# title           makefile for mi2mu
+# file    mi2mu/Makefile.am.wild
+#
+# Copyright (c) 1997 by
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
+SUBDIRS = include
+
+bin_PROGRAMS = mi2mu
+
+mi2mu_SOURCES = $(wildcard *.cc)
+
+mi2mu_LDADD = -llily -lflower
+
+mi2mu_LDFLAGS = -L../lib -L../flower
+
+INCLUDES = -Iinclude -I../lib/include -I../flower/include
+
+EXTRA_DIST = Makefile.am.wild VERSION TODO
+
index 9b3532e4492c48110c1507231eaddad6ab98094f..e008ad3e7b56fd6a1cd99c4b283194c33131f315 100644 (file)
@@ -4,13 +4,16 @@
 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
 #include <stdio.h>
-#include "version.hh"
+#include "config.hh"
 
 
-static char *s = "mi2mu " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
+// static char *s = "mi2mu " MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL MY_PATCH_LEVEL " #%d";
+//urg
+static char *s = "mi2mu " TOPLEVEL_VERSION " #%d";
 
 static const int build=
-#include ".build"
+//#include ".build"
+0
 ;
 
 const char *