]> git.donarmstrong.com Git - lilypond.git/commitdiff
* aclocal.m4: Regenerate.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 24 Jul 2002 13:28:12 +0000 (13:28 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 24 Jul 2002 13:28:12 +0000 (13:28 +0000)
* 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.

22 files changed:
ChangeLog
GNUmakefile.in
aclocal.m4
buildscripts/lilypond-profile.sh
config.hh.in
config.make.in
lily/beam-quanting.cc
lily/include/beam.hh
lily/include/lily-guile.hh
lily/lily-guile.cc
lily/main.cc
lily/mensural-ligature.cc
lily/music-output-def.cc
lily/text-item.cc
make/lilypond-vars.make
scm/lily.scm
scripts/lilypond-book.py
scripts/ly2dvi.py
scripts/midi2ly.py
scripts/mup2ly.py
stepmake/aclocal.m4
stepmake/config.hh.in

index 04f5f0a3f743c1d672f241c9b4407d577926ab86..2bafb7d99e6ee262de8f61143d8aa6a46f5562d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2002-07-24  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * 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  <janneke@gnu.org>
 
        * input/mutopia/J.S.Bach/baerenreiter-sarabande.ly: Warn when not
index fd8539abdb92420bad538a239e7356c0ce4ad6b3..7a24b325a45600a560c9cf32e4bbdc91e57d4399 100644 (file)
@@ -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:
index 4190b61018acf962790f6269f394d48f90fabb27..d647407ce409ad0ef5f25070cb579d29b507fc9f 100644 (file)
@@ -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"
index effee3ff5f435e83dd24f68916fd5a9b2c33a44c..60502ebf536e343cd3935dbdbb4e54802c080482 100644 (file)
@@ -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
index 1c16bed76b6f7c10c7b162884a1fe66dbf93def6..d1eea7facd1eee3cbcae1940556392c4861bd27a 100644 (file)
@@ -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
index e976cfe25f5501039d6875757fdc973e3ca0478e..d49a208e07a31acfc2898184863142f90d332de5 100644 (file)
@@ -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@
index dc5afce3643e5594539c3d65c4d2fb987b9c2a24..890e7abe1fff2e181169693e408a67789fd07130 100644 (file)
@@ -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_array<Grob>stems,
                          Array<Real> 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_array<Grob>stems,
 }
 
 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,
index a582c62555c53c0cf916d14811ae314c9d07b918..b9d74d91ab3f201418fab05258da67d49f5817c0 100644 (file)
@@ -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<Grob>,
                                  Array<Stem_info>,
                                  Array<Real>, Array<Real>,
-                                 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);
   
index 53328a23d715f14884f07532417eea7965e6dd04..1d2b3839c2aa9a086e8ea37e2ecd540b9663a7fd 100644 (file)
@@ -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);
index 02bfeef901e6e42d7924f5684872243571819c64..e67cc0fbc5c7daf19450464ceaffbd2492530a19 100644 (file)
@@ -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.
index 6e2435142b58c1c14f7a4dd1842829cce2d1e2a2..8f9f34a1baae9692363e43796fcf6616fa5d9260 100644 (file)
@@ -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 <hanwen@cs.uu.nl>\n";
   std::cout << "  Jan Nieuwenhuizen <janneke@gnu.org>\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 <hanwen@cs.uu.nl>\n";
   std::cout << "  Jan Nieuwenhuizen <janneke@gnu.org>\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
index 3d6a4d144e49d1a81d30aef311cbc39817c5fd0a..9581e567248ac76287e63977217c5a5c27697931 100644 (file)
@@ -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;
 }
index 399feeccd7418a45372cefd61706c4252fdead77..96f86c2659acb73b247e81f501630780749a8438 100644 (file)
@@ -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 ("#<Music_output_def ", p);
-  //scm_write (def->type_name_, p);
+#if 0  
+  scm_write (def->type_name_, p);
+#else  
+  (void) def;
+#endif  
   scm_puts (">", p);
   return 1;
 }
index 7ed5d1ed8d665534ebfe338110cf189779100f4c..fc2671925f890ef809069e8aa090aef8340a91cd 100644 (file)
@@ -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);
index e82fe7ebc491714d2c824a1232d4374855c8eac9..516f519719e86875aa285eb3e97053bf530db47b 100644 (file)
@@ -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)
 
index e7dc6a3d69861f6777c93f54f8493cddd83e3e50..6e24cd81086dd95be0843181c94b223a4c19b482 100644 (file)
   (string<? (symbol->string (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)
index 0e1bd4e47d0b794ff28b27338c6d29f0750d3f74..2604ba32fee8bbc3d33caa38c7e17acb673a57ef 100644 (file)
@@ -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]
index a810bb7a52ddbc15e0123a0538cd86fec02fb625..cbf2c31831cbfdef5b3dd6134a732914fbe834b7 100644 (file)
@@ -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:
index fbd9596eba41bf05366e74ad89b9d973f78338fb..ff3df9caced4b5d45dbc2d7ff75f908423b0f6d5 100644 (file)
@@ -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'))
index e24f38ac183730236f823ef026d3cb6c7e3808c5..6db68dd8fffb7c67b595e61255d0f9373683080f 100644 (file)
@@ -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'))
index d18bec5c54011e8866e1ceffd42df2af87caedf5..dc1a5adf022556c9193396c0e71b770abe8adfde 100644 (file)
@@ -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"
index 1efa897fc2584e249873c958815b68ac6f61448b..58f6d8b230830e99926ed08c2a32402964e6922a 100644 (file)
@@ -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@"