From da4d630e8a9d01c71da68c26912d650949f189ab Mon Sep 17 00:00:00 2001 From: janneke Date: Wed, 24 Jul 2002 13:28:12 +0000 Subject: [PATCH] * aclocal.m4: Regenerate. * config.hh.in: * config.make.in: * stepmake/aclocal.m4: Cleanups and more conventional naming for datadir ($prefix/share), package_datadir ($prefix/$package), and local_package_datadir ($prefix/$package/$version). * make/lilypond-vars.make: * scripts/ly2dvi.py: * scripts/lilypond-book.py: * scripts/mup2ly.py: * scripts/midi2ly.py: use local_package_datadir iso datadir. * GNUmakefile.in: build_datadir without version. * lily/main.cc: Datadir cleanup. * lily/text-item.cc (lookup_text): * lily/music-output-def.cc (print_smob): * lily/mensural-ligature.cc (brew_molecule): * lily/beam-quanting.cc (score_slopes_dy, score_forbidden_quants): Fix warnings. --- ChangeLog | 26 +++++ GNUmakefile.in | 33 +++--- aclocal.m4 | 41 ++++---- buildscripts/lilypond-profile.sh | 8 +- config.hh.in | 15 ++- config.make.in | 3 + lily/beam-quanting.cc | 13 +-- lily/include/beam.hh | 7 +- lily/include/lily-guile.hh | 2 +- lily/lily-guile.cc | 20 +--- lily/main.cc | 173 +++++++++++++++++-------------- lily/mensural-ligature.cc | 2 +- lily/music-output-def.cc | 6 +- lily/text-item.cc | 2 +- make/lilypond-vars.make | 2 +- scm/lily.scm | 12 +-- scripts/lilypond-book.py | 4 +- scripts/ly2dvi.py | 4 +- scripts/midi2ly.py | 4 +- scripts/mup2ly.py | 6 +- stepmake/aclocal.m4 | 39 ++++--- stepmake/config.hh.in | 4 +- 22 files changed, 222 insertions(+), 204 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04f5f0a3f7..2bafb7d99e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2002-07-24 Jan Nieuwenhuizen + + * aclocal.m4: Regenerate. + + * config.hh.in: + * config.make.in: + * stepmake/aclocal.m4: Cleanups and more conventional naming for + datadir ($prefix/share), package_datadir ($prefix/$package), and + local_package_datadir ($prefix/$package/$version). + + * make/lilypond-vars.make: + * scripts/ly2dvi.py: + * scripts/lilypond-book.py: + * scripts/mup2ly.py: + * scripts/midi2ly.py: use local_package_datadir iso datadir. + + * GNUmakefile.in: build_datadir without version. + + * lily/main.cc: Datadir cleanup. + + * lily/text-item.cc (lookup_text): + * lily/music-output-def.cc (print_smob): + * lily/mensural-ligature.cc (brew_molecule): + * lily/beam-quanting.cc (score_slopes_dy, score_forbidden_quants): + Fix warnings. + 2002-07-23 Jan Nieuwenhuizen * input/mutopia/J.S.Bach/baerenreiter-sarabande.ly: Warn when not diff --git a/GNUmakefile.in b/GNUmakefile.in index fd8539abdb..7a24b325a4 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -112,34 +112,31 @@ WWW: default: builddir-setup -builddir-setup: $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force +builddir-setup: $(builddir)/share/lilypond-force -$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force: +$(builddir)/share/lilypond-force: # Preparing LilyPond tree for builddir exec @echo Making $(builddir)/share @cd $(builddir) && rm -rf share - @cd $(builddir) && mkdir -p share/lilypond - @cd $(builddir)/share/lilypond && mkdir -p $(TOPLEVEL_VERSION) - @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \ + @mkdir -p $(builddir)/share/lilypond + @mkdir -p $(builddir)/share/lilypond/fonts + @mkdir -p $(builddir)/share/lilypond/tex + @cd $(builddir)/share/lilypond && \ ln -s $(abs-srcdir)/ly ly && \ - ln -s ../../../mf/$(outconfbase) dvips && \ - ln -s ../../../mf/$(outconfbase) afm && \ - ln -s ../../../mf/$(outconfbase) tfm && \ + ln -s ../../mf/$(outconfbase) dvips && \ + ln -s ../../mf/$(outconfbase) afm && \ + ln -s ../../mf/$(outconfbase) tfm && \ 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 && \ + @cd $(builddir)/share/lilypond/tex && \ 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 ../../../mf/$(outconfbase) generate + @cd $(builddir)/share/lilypond/fonts && \ ln -s $(abs-srcdir)/mf source && \ - ln -s ../../../../mf/$(outconfbase) afm && \ - ln -s ../../../../mf/$(outconfbase) tfm && \ - ln -s ../../../../mf/$(outconfbase) type1 + ln -s ../../../mf/$(outconfbase) afm && \ + ln -s ../../../mf/$(outconfbase) tfm && \ + ln -s ../../../mf/$(outconfbase) type1 local-clean: builddir-setup-clean builddir-setup-clean: diff --git a/aclocal.m4 b/aclocal.m4 index 4190b61018..d647407ce4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ dnl aclocal.m4 -*-shell-script-*- dnl WARNING WARNING WARNING -dnl do not edit! this is aclocal.m4, generated from /users/hanwen/usr/src/lilypond/stepmake/aclocal.m4 +dnl do not edit! this is aclocal.m4, generated from /home/fred/cvs/savannah/lilypond/stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in @@ -238,23 +238,24 @@ AC_DEFUN(STEPMAKE_CXXTEMPLATE, [ AC_DEFUN(STEPMAKE_DATADIR, [ - if test "$datadir" = "\${prefix}/share"; then - datadir='${prefix}/share/'$package/$FULL_VERSION - fi - DIR_DATADIR=${datadir} presome=${prefix} if test "$prefix" = "NONE"; then - presome=${ac_default_prefix} + presome=${ac_default_prefix} fi - DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"` - - AC_SUBST(datadir) - AC_SUBST(DIR_DATADIR) - - # we used to set DIR_SHAREDSTATEDIR here, - # but apparently that broke something + datadir=$(echo ${datadir} | sed "s!\\\${prefix}!$presome!") - AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}") + package_datadir=$datadir/$package + local_package_datadir=$package_datadir/$FULL_VERSION + build_package_datadir=$builddir/share/$package + + AC_SUBST(datadir) + AC_SUBST(package_datadir) + AC_SUBST(local_package_datadir) + AC_SUBST(build_package_datadir) + AC_DEFINE_UNQUOTED(DATADIR, "${datadir}") + AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "${package_datadir}") + AC_DEFINE_UNQUOTED(LOCAL_PACKAGE_DATADIR, "${local_package_datadir}") + AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, "${build_package_datadir}") ]) @@ -332,16 +333,14 @@ AC_DEFUN(STEPMAKE_GCC, [ AC_DEFUN(STEPMAKE_GETTEXT, [ - DIR_LOCALEDIR=${localedir} presome=${prefix} if test "$prefix" = "NONE"; then presome=${ac_default_prefix} fi - DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"` + localedir=$(echo ${localedir} | sed "s!\\\${prefix}!$presome!") + AC_SUBST(localedir) - AC_SUBST(DIR_LOCALEDIR) - AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}") - + AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}") AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNCS(gettext) ]) @@ -467,7 +466,7 @@ AC_DEFUN(STEPMAKE_INIT, [ fi AC_MSG_CHECKING(Package) - if test "x$PACKAGE" = "xSTEPMAKE"; then + if test "$PACKAGE" = "STEPMAKE"; then AC_MSG_RESULT(Stepmake package!) AC_MSG_CHECKING(builddir) @@ -528,7 +527,7 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}") AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}") - if test "$package_depth" = "" ; then + if test -z "$package_depth"; then package_depth="." else package_depth="../$package_depth" diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index effee3ff5f..60502ebf53 100644 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -8,11 +8,10 @@ # . lilypond-profile - -if [ "$LILYPONDPREFIX" == "" ] ; then +if [ -z "$LILYPONDPREFIX" ]; then datadir=`echo "@datadir@" | sed 's!//!/!g'` else - if [ -d "$LILYPONDPREFIX/fonts" ] ; then + if [ -d "$LILYPONDPREFIX/fonts" ]; then datadir=$LILYPONDPREFIX else eval `cat $LILYPONDPREFIX/VERSION` @@ -35,9 +34,6 @@ export TEXMF GS_LIB="$datadir/ps:"${GS_LIB:=""} export GS_LIB - - - # For direct ps output fonts. Add all available TeX Type1 fonts GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""} export GS_FONTPATH diff --git a/config.hh.in b/config.hh.in index 1c16bed76b..d1eea7facd 100644 --- a/config.hh.in +++ b/config.hh.in @@ -1,13 +1,20 @@ /* @AUTOGENERATE@ */ -/* Hmm */ #define PACKAGE "@package@" -/* default lilypond init and input dir */ -#define DIR_DATADIR "@DIR_DATADIR@" +/* datadir */ +#define DATADIR "@DATADIR@" + +/* LilyPond init and input base directory */ +#define PACKAGE_DATADIR "@PACKAGE_DATADIR@" +#define LILYPOND_DATADIR PACKAGE_DATADIR + +/* LilyPond specific init and input directory */ +#define LOCAL_PACKAGE_DATADIR "@local_package_datadir@" +#define LOCAL_LILYPOND_DATADIR LOCAL_PACKAGE_DATADIR /* default lilypond locale dir */ -#define DIR_LOCALEDIR "@DIR_LOCALEDIR@" +#define LOCALEDIR "@LOCALEDIR@" /* define if you have memmem */ #define HAVE_MEMMEM 0 diff --git a/config.make.in b/config.make.in index e976cfe25f..d49a208e07 100644 --- a/config.make.in +++ b/config.make.in @@ -20,11 +20,14 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ builddir = @builddir@ +build_lilypond_datadir = @build_package_datadir@ bindir = @bindir@ datadir = @datadir@ includedir = @includedir@ infodir = @infodir@ libdir = @libdir@ +lilypond_datadir = @package_datadir@ +local_lilypond_datadir = @local_package_datadir@ localedir = @localedir@ mandir = @mandir@ program_prefix = @program_prefix@ diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index dc5afce364..890e7abe1f 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -191,7 +191,7 @@ Beam::quanting (SCM smob) for (int i = qscores.size (); i--;) { qscores[i].demerits - += score_slopes_dy (me, qscores[i].yl, qscores[i].yr, + += score_slopes_dy (qscores[i].yl, qscores[i].yr, dy_mus, yr- yl, xstaff); } @@ -206,7 +206,7 @@ Beam::quanting (SCM smob) if (qscores[i].demerits < reasonable_score) { qscores[i].demerits - += score_forbidden_quants (me, qscores[i].yl, qscores[i].yr, + += score_forbidden_quants (qscores[i].yl, qscores[i].yr, rad, slt, thickness, beam_translation, beam_count, ldir, rdir); } @@ -220,7 +220,7 @@ Beam::quanting (SCM smob) base_lengths, stem_xposns, xl, xr, knee_b, - me, qscores[i].yl, qscores[i].yr); + qscores[i].yl, qscores[i].yr); } @@ -248,7 +248,6 @@ Beam::score_stem_lengths (Link_arraystems, Array stem_xs, Real xl, Real xr, bool knee, - Grob*me, Real yl, Real yr) { Real pen = STEM_LENGTH_LIMIT_PENALTY; @@ -297,8 +296,7 @@ Beam::score_stem_lengths (Link_arraystems, } Real -Beam::score_slopes_dy (Grob *me, - Real yl, Real yr, +Beam::score_slopes_dy (Real yl, Real yr, Real dy_mus, Real dy_damp, bool xstaff) { @@ -333,8 +331,7 @@ my_modf (Real x) } Real -Beam::score_forbidden_quants (Grob*me, - Real yl, Real yr, +Beam::score_forbidden_quants (Real yl, Real yr, Real rad, Real slt, Real thickness, Real beam_translation, diff --git a/lily/include/beam.hh b/lily/include/beam.hh index a582c62555..b9d74d91ab 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -39,13 +39,12 @@ public: DECLARE_SCHEME_CALLBACK (slope_damping, (SCM)); DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM)); DECLARE_SCHEME_CALLBACK (quanting, (SCM)); - static Real score_slopes_dy (Grob*, Real,Real,Real,Real, bool); + static Real score_slopes_dy (Real, Real, Real, Real, bool); static Real score_stem_lengths (Link_array, Array, Array, Array, - Real, Real, - bool,Grob*,Real , Real); - static Real score_forbidden_quants (Grob*, Real, Real, + Real, Real, bool, Real, Real); + static Real score_forbidden_quants (Real, Real, Real, Real, Real, Real, int, Direction, Direction); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 53328a23d7..1d2b3839c2 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -202,7 +202,7 @@ void ly_display_scm (SCM s); #include "array.hh" void read_lily_scm_file (String); -void init_lily_guile (String dir); +void ly_init_guile (); bool ly_dir_p (SCM s); bool ly_number_pair_p (SCM); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 02bfeef901..e67cc0fbc5 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -273,26 +273,12 @@ void add_scm_init_func (void (*f) ()) scm_init_funcs_->push (f); } -extern void init_cxx_function_smobs (); +extern void init_cxx_function_smobs (); -void -prepend_load_path (String p ) -{ - char s[1024]; - sprintf (s, - "(set! %%load-path (cons \"%s\" %%load-path))", p.ch_C()); - - scm_c_eval_string (s); -} void -init_lily_guile (String p ) +ly_init_guile () { - prepend_load_path (p); - - // todo: junk this. We should make real modules iso. just loading files. - prepend_load_path (p + "/scm/"); - SCM last_mod = scm_current_module (); scm_set_current_module (scm_c_resolve_module ("guile")); @@ -773,7 +759,7 @@ ly_split_list (SCM s, SCM list) void -taint (SCM * foo) +taint (SCM *) { /* nop. diff --git a/lily/main.cc b/lily/main.cc index 6e2435142b..8f9f34a1ba 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -131,48 +131,48 @@ static Long_option_init options_static[] = { }; void -identify (FILE* os) +identify (FILE *out) { - fputs(gnu_lilypond_version_str ().ch_C(), os); + fputs (gnu_lilypond_version_str ().ch_C (), out); +} + +void +dirinfo (FILE *out) +{ + fputs ("\n", out); + fprintf (out, "lilypond_datadir: `%s'\n", LILYPOND_DATADIR); + fprintf (out, "local_lilypond_datadir: `%s'\n", LOCAL_LILYPOND_DATADIR); + fprintf (out, "localedir: `%s'\n", LOCALEDIR); + + char *lilypond_prefix = getenv ("LILYPONDPREFIX"); + fprintf (out, "LILYPONDPREFIX: `%s'\n", + (lilypond_prefix ? lilypond_prefix : "")); } void usage () { - - /* - No version number or newline here. It confuses help2man - */ - std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").ch_C(); + std::cout << "\n"; + /* No version number or newline here. It confuses help2man. */ + std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").ch_C (); std::cout << "\n\n"; - std::cout << _ ("Typeset music and or play MIDI from FILE").ch_C(); + std::cout << _ ("Typeset music and or play MIDI from FILE").ch_C (); std::cout << "\n\n"; std::cout << _ ( "LilyPond is a music typesetter. It produces beautiful sheet music\n" "using a high level description file as input. LilyPond is part of \n" "the GNU Project.\n" -).ch_C(); +).ch_C (); std::cout << '\n'; - std::cout << _ ("Options:").ch_C(); + std::cout << _ ("Options:").ch_C (); std::cout << '\n'; - std::cout << Long_option_init::table_str (options_static).ch_C(); + std::cout << Long_option_init::table_str (options_static).ch_C (); std::cout << '\n'; - std::cout << _ ("This binary was compiled with the following options:") .ch_C() - << " " << -#ifdef NDEBUG - "NDEBUG " -#endif - "\n" - "datadir: `" DIR_DATADIR "'\n" - "localedir: `" DIR_LOCALEDIR "'\n" - "\n"; - - std::cout << std::endl; - std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").ch_C() << std::endl; + std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").ch_C () << std::endl; } void @@ -184,10 +184,10 @@ version () "This is free software. It is covered by the GNU General Public License,\n" "and you are welcome to change it and/or distribute copies of it under\n" "certain conditions. Invoke as `%s --warranty' for more information.\n", - "lilypond").ch_C(); + "lilypond").ch_C (); std::cout << std::endl; - std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C(); + std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C (); std::cout << '\n'; std::cout << " Han-Wen Nienhuys \n"; std::cout << " Jan Nieuwenhuizen \n"; @@ -197,9 +197,9 @@ void notice () { std::cout << '\n'; - std::cout << _ ("GNU LilyPond -- The music typesetter").ch_C(); + std::cout << _ ("GNU LilyPond -- The music typesetter").ch_C (); std::cout << '\n'; - std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C(); + std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C (); std::cout << '\n'; std::cout << " Han-Wen Nienhuys \n"; std::cout << " Jan Nieuwenhuizen \n"; @@ -217,19 +217,20 @@ notice () " You should have received a copy (refer to the file COPYING) of the\n" "GNU General Public License along with this program; if not, write to\n" "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n" - "USA.\n").ch_C(); + "USA.\n").ch_C (); } -String prefix_directory; + +/* Where LilyPond's init files live. Typically: + LILYPOND_DATADIR = /usr/local/share/lilypond + LOCAL_LILYPOND_DATADIR = /usr/local/share/lilypond/1.5.68 */ +char const *prefix_directory[2] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR}; void setup_paths () { - // facilitate binary distributions - char const *env_lily = getenv ("LILYPONDPREFIX"); - - if (env_lily) - prefix_directory = env_lily; + if (char const *lilypond_prefix = getenv ("LILYPONDPREFIX")) + prefix_directory[1] = lilypond_prefix; #if HAVE_GETTEXT setlocale (LC_ALL, ""); /* enable locales */ @@ -242,13 +243,13 @@ setup_paths () urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share handy for multiple source-dir runs, though... */ - if (!prefix_directory.empty_b ()) + if (!String (prefix_directory[0]).empty_b ()) { - lily_locale_dir = prefix_directory + "/share/locale"; + lily_locale_dir = String (prefix_directory[0]) + "/share/locale"; bindtextdomain (name.ch_C (), lily_locale_dir.ch_C ()); } else - bindtextdomain (name.ch_C (), DIR_LOCALEDIR); + bindtextdomain (name.ch_C (), LOCALEDIR); textdomain (name.ch_C ()); #endif @@ -259,22 +260,22 @@ setup_paths () LILYPONDPREFIX to lilypond-x.y.z */ char *suffixes[] = {"ly", "afm", "mf/out", "scm", "tfm", "ps", 0}; - if (prefix_directory.empty_b ()) - prefix_directory = DIR_DATADIR; - for (char **s = suffixes; *s; s++) - { - String p = prefix_directory + to_str ('/') + String (*s); - global_path.add (p); - + for (unsigned i = 0; i < sizeof (prefix_directory) + / sizeof (*prefix_directory); i++) + for (char **s = suffixes; *s; s++) + { + String p = prefix_directory[i] + to_str ('/') + String (*s); + global_path.add (p); + #if !KPATHSEA - /* Urg: GNU make's $ (word) index starts at 1 */ - int i = 1; - while (global_path.try_add (p + to_str (".") + to_str (i))) - i++; + /* Urg: GNU make's $ (word) index starts at 1 */ + int i = 1; + while (global_path.try_add (p + to_str (".") + to_str (i))) + i++; #endif - } -} - + } + } + /** Make input file name from command argument. @@ -316,26 +317,40 @@ format_to_ext (String format) } void -main_prog (void * , int, char**) +prepend_load_path (String dir) { - /* - need to do this first. Engravers use lily.scm contents. - */ - - /* - prepend onto GUILE loadpath. - - Very ugh. - */ + String s = "(set! %load-path (cons \"" + + dir + + "\" %load-path))"; + scm_c_eval_string (s.ch_C ()); +} - init_lily_guile (prefix_directory); +void +main_prog (void *, int, char **) +{ + /* Engravers use lily.scm contents, need to make Guile find it. + Prepend onto GUILE %load-path, very ugh. */ + + for (unsigned i = 0; i < sizeof (prefix_directory) + / sizeof (*prefix_directory); i++) + { + prepend_load_path (prefix_directory[i]); + /* Junk this. We should make real modules iso. just loading files. */ + prepend_load_path (String (prefix_directory[i]) + "/scm"); + } + + if (verbose_global_b) + dirinfo (stderr); + + ly_init_guile (); + std::cout << std::endl; call_constructors (); all_fonts_global_p = new All_font_metrics (global_path.str ()); init_scheme_code_string += ")"; - gh_eval_str ((char *)init_scheme_code_string.ch_C()); + gh_eval_str ((char *)init_scheme_code_string.ch_C ()); int p=0; const char *arg = oparser_p_static->get_next_arg (); @@ -346,22 +361,12 @@ main_prog (void * , int, char**) /* No FILE arguments is now a usage error */ exit (2); } - else - do + + do { String infile (arg); - - /* What/when was this supposed to do? - It looks like it reset the outname_str_global for every new - file, but only if user didn't specify a outname? Huh? - - // if (outname_str_global == "") - - */ - { - Midi_def::reset_score_count (); - Paper_def::reset_score_count (); - } + Midi_def::reset_score_count (); + Paper_def::reset_score_count (); Path inpath = distill_inname (infile); @@ -428,7 +433,8 @@ main (int argc, char **argv) sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608", false); ly_init_kpath (argv[0]); - + + bool help_b = false; oparser_p_static = new Getopt_long (argc, argv, options_static); while (Long_option_init const * opt = (*oparser_p_static) ()) { @@ -471,8 +477,7 @@ main (int argc, char **argv) init_name_global = oparser_p_static->optional_argument_ch_C_; break; case 'h': - usage (); - exit (0); + help_b = true; break; case 'V': verbose_global_b = true; @@ -493,6 +498,14 @@ main (int argc, char **argv) } identify (stderr); + if (help_b) + { + usage (); + if (verbose_global_b) + dirinfo (stdout); + exit (0); + } + #ifdef WINNT scm_boot_guile (argc, argv, main_prog, 0); #else diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 3d6a4d144e..9581e56724 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -248,7 +248,7 @@ Mensural_ligature::brew_ligature_primitive (SCM smob) MAKE_SCHEME_CALLBACK (Mensural_ligature, brew_molecule, 1); SCM -Mensural_ligature::brew_molecule (SCM smob) +Mensural_ligature::brew_molecule (SCM) { return SCM_EOL; } diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 399feeccd7..96f86c2659 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -124,7 +124,11 @@ Music_output_def::print_smob (SCM s, SCM p, scm_print_state *) { Music_output_def * def = unsmob_music_output_def (s); scm_puts ("#type_name_, p); +#if 0 + scm_write (def->type_name_, p); +#else + (void) def; +#endif scm_puts (">", p); return 1; } diff --git a/lily/text-item.cc b/lily/text-item.cc index 7ed5d1ed8d..fc2671925f 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -89,7 +89,7 @@ Text_item::lookup_character (Grob *, Font_metric*fm, SCM char_name) Molecule -Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text) +Text_item::lookup_text (Grob *, Font_metric*fm, SCM text) { SCM list = scm_list_n (ly_symbol2scm ("text"), text, SCM_UNDEFINED); list = fontify_atom (fm, list); diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index e82fe7ebc4..516f519719 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -6,7 +6,7 @@ export PATH:=$(builddir)/lily/$(outconfbase):$(builddir)/buildscripts/$(outconfb # LilyPond is often run from within $(outdir), making a relative # PREFIX incorrect. -export LILYPONDPREFIX:=$(shell cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION); pwd) +export LILYPONDPREFIX:=$(build_lilypond_datadir) export PYTHONPATH:=$(topdir)/python:$(PYTHONPATH) diff --git a/scm/lily.scm b/scm/lily.scm index e7dc6a3d69..6e24cd8108 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -111,19 +111,11 @@ (stringstring (car x)) (symbol->string (car y)))) - (define (ly-load x) - (let* - ( - (fn (%search-load-path x)) - ) + (let* ((fn (%search-load-path x))) (if (ly-verbose) (format (current-error-port) "[~A]" fn)) - (primitive-load fn) - - )) - - + (primitive-load fn))) (use-modules (scm tex) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 0e1bd4e47d..2604ba32fe 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -92,12 +92,12 @@ if program_version == '@' + 'TOPLEVEL_VERSION' + '@': # if set, LILYPONDPREFIX must take prevalence # if datadir is not set, we're doing a build and LILYPONDPREFIX -datadir = '@datadir@' +datadir = '@local_package_datadir@' if os.environ.has_key ('LILYPONDPREFIX') : datadir = os.environ['LILYPONDPREFIX'] else: - datadir = '@datadir@' + datadir = '@local_package_datadir@' while datadir[-1] == os.sep: datadir= datadir[:-1] diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index a810bb7a52..cbf2c31831 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -296,12 +296,12 @@ def mkdir_p (dir, mode=0777): # if set, LILYPONDPREFIX must take prevalence # if datadir is not set, we're doing a build and LILYPONDPREFIX -datadir = '@datadir@' +datadir = '@local_package_datadir@' if os.environ.has_key ('LILYPONDPREFIX') : datadir = os.environ['LILYPONDPREFIX'] else: - datadir = '@datadir@' + datadir = '@local_package_datadir@' while datadir[-1] == os.sep: diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index fbd9596eba..ff3df9cace 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -30,11 +30,11 @@ import string # do fuddling: we must load the midi module from the right directory. -datadir = '@datadir@' +datadir = '@local_package_datadir@' if os.environ.has_key ('LILYPONDPREFIX'): datadir = os.environ['LILYPONDPREFIX'] else: - datadir = '@datadir@' + datadir = '@local_package_datadir@' sys.path.append (os.path.join (datadir, 'python')) sys.path.append (os.path.join (datadir, 'python/out')) diff --git a/scripts/mup2ly.py b/scripts/mup2ly.py index e24f38ac18..6db68dd8ff 100644 --- a/scripts/mup2ly.py +++ b/scripts/mup2ly.py @@ -37,12 +37,12 @@ import tempfile # if set, LILYPONDPREFIX must take prevalence # if datadir is not set, we're doing a build and LILYPONDPREFIX -datadir = '@datadir@' +datadir = '@local_package_datadir@' if os.environ.has_key ('LILYPONDPREFIX') \ - or '@datadir@' == '@' + 'datadir' + '@': + or '@local_package_datadir@' == '@' + 'local_package_datadir' + '@': datadir = os.environ['LILYPONDPREFIX'] else: - datadir = '@datadir@' + datadir = '@local_package_datadir@' sys.path.append (os.path.join (datadir, 'python')) sys.path.append (os.path.join (datadir, 'python/out')) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index d18bec5c54..dc1a5adf02 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -235,23 +235,24 @@ AC_DEFUN(STEPMAKE_CXXTEMPLATE, [ AC_DEFUN(STEPMAKE_DATADIR, [ - if test "$datadir" = "\${prefix}/share"; then - datadir='${prefix}/share/'$package/$FULL_VERSION - fi - DIR_DATADIR=${datadir} presome=${prefix} if test "$prefix" = "NONE"; then - presome=${ac_default_prefix} + presome=${ac_default_prefix} fi - DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"` - - AC_SUBST(datadir) - AC_SUBST(DIR_DATADIR) - - # we used to set DIR_SHAREDSTATEDIR here, - # but apparently that broke something + datadir=$(echo ${datadir} | sed "s!\\\${prefix}!$presome!") - AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}") + package_datadir=$datadir/$package + local_package_datadir=$package_datadir/$FULL_VERSION + build_package_datadir=$builddir/share/$package + + AC_SUBST(datadir) + AC_SUBST(package_datadir) + AC_SUBST(local_package_datadir) + AC_SUBST(build_package_datadir) + AC_DEFINE_UNQUOTED(DATADIR, "${datadir}") + AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "${package_datadir}") + AC_DEFINE_UNQUOTED(LOCAL_PACKAGE_DATADIR, "${local_package_datadir}") + AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, "${build_package_datadir}") ]) @@ -329,16 +330,14 @@ AC_DEFUN(STEPMAKE_GCC, [ AC_DEFUN(STEPMAKE_GETTEXT, [ - DIR_LOCALEDIR=${localedir} presome=${prefix} if test "$prefix" = "NONE"; then presome=${ac_default_prefix} fi - DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"` + localedir=$(echo ${localedir} | sed "s!\\\${prefix}!$presome!") + AC_SUBST(localedir) - AC_SUBST(DIR_LOCALEDIR) - AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}") - + AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}") AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNCS(gettext) ]) @@ -464,7 +463,7 @@ AC_DEFUN(STEPMAKE_INIT, [ fi AC_MSG_CHECKING(Package) - if test "x$PACKAGE" = "xSTEPMAKE"; then + if test "$PACKAGE" = "STEPMAKE"; then AC_MSG_RESULT(Stepmake package!) AC_MSG_CHECKING(builddir) @@ -525,7 +524,7 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}") AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}") - if test "$package_depth" = "" ; then + if test -z "$package_depth"; then package_depth="." else package_depth="../$package_depth" diff --git a/stepmake/config.hh.in b/stepmake/config.hh.in index 1efa897fc2..58f6d8b230 100644 --- a/stepmake/config.hh.in +++ b/stepmake/config.hh.in @@ -7,8 +7,8 @@ #define TOPLEVEL_VERSION "@TOPLEVEL_VERSION@" /* default init and input dir */ -#define DIR_DATADIR "@DIR_DATADIR@" +#define DATADIR "@DATADIR@" /* default locale dir */ -#define DIR_LOCALEDIR "@DIR_LOCALEDIR@" +#define LOCALEDIR "@LOCALEDIR@" -- 2.39.5