From: fred Date: Sun, 24 Mar 2002 20:06:57 +0000 (+0000) Subject: lilypond-0.1.49 X-Git-Tag: release/1.5.59~3369 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=74c04249ba1e52f0a1e9ea1fd7655ac318a1ea3a;p=lilypond.git lilypond-0.1.49 --- diff --git a/bin/convert-mudela.in b/bin/convert-mudela.in new file mode 100644 index 0000000000..3be80d97da --- /dev/null +++ b/bin/convert-mudela.in @@ -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 \&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 () { + 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 () { + 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 index 0000000000..9d9d19a2d8 --- /dev/null +++ b/flower/AUTHORS @@ -0,0 +1 @@ +see ../AUTHORS diff --git a/flower/COPYING b/flower/COPYING new file mode 100644 index 0000000000..a2a0122637 --- /dev/null +++ b/flower/COPYING @@ -0,0 +1 @@ +see ../COPYING diff --git a/flower/ChangeLog b/flower/ChangeLog new file mode 100644 index 0000000000..e1b28ead74 --- /dev/null +++ b/flower/ChangeLog @@ -0,0 +1 @@ +oeps: no more details than NEWS diff --git a/flower/INSTALL b/flower/INSTALL new file mode 100644 index 0000000000..28d72f900e --- /dev/null +++ b/flower/INSTALL @@ -0,0 +1 @@ +see ../INSTALL diff --git a/flower/Makefile.am.wild b/flower/Makefile.am.wild new file mode 100644 index 0000000000..f19c6ab501 --- /dev/null +++ b/flower/Makefile.am.wild @@ -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 +# Han-Wen Nienhuys +# ...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 + diff --git a/flower/config.hh.in b/flower/config.hh.in index 9f3b982114..80c688b06b 100644 --- a/flower/config.hh.in +++ b/flower/config.hh.in @@ -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" + diff --git a/flower/configure.in b/flower/configure.in index d0bd09bbc2..4c28402072 100644 --- a/flower/configure.in +++ b/flower/configure.in @@ -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) diff --git a/flower/flower-version.cc b/flower/flower-version.cc index 6372f50277..6216111d27 100644 --- a/flower/flower-version.cc +++ b/flower/flower-version.cc @@ -1,10 +1,13 @@ -#include "version.hh" // urg #include -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 * diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 975950d4bb..270d07aefb 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -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); diff --git a/lib/config.hh.in b/lib/config.hh.in index 1e7112e2c9..b10c27a7c1 100644 --- a/lib/config.hh.in +++ b/lib/config.hh.in @@ -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 index 0000000000..bb3dc4bd36 --- /dev/null +++ b/mi2mu/Makefile.am.wild @@ -0,0 +1,22 @@ +# project LilyPond -- the musical typesetter +# title makefile for mi2mu +# file mi2mu/Makefile.am.wild +# +# Copyright (c) 1997 by +# Jan Nieuwenhuizen +# Han-Wen Nienhuys + +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 + diff --git a/mi2mu/mi2mu-version.cc b/mi2mu/mi2mu-version.cc index 9b3532e449..e008ad3e7b 100644 --- a/mi2mu/mi2mu-version.cc +++ b/mi2mu/mi2mu-version.cc @@ -4,13 +4,16 @@ // copyright 1997 Jan Nieuwenhuizen #include -#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 *