]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 26 Apr 2006 14:25:49 +0000 (14:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 26 Apr 2006 14:25:49 +0000 (14:25 +0000)
ChangeLog
lily/main.cc
lily/relocate.cc

index 1988b27df55e74664d0d006b24ca96c12ae23a0b..983302db67c24cfd7dededaa43eb15d782423c1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-24  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/relocate.cc (read_relocation_dir): new function.
+
 2006-04-26  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/instrument-notation.itely: a few more fixes
index 481d4542a69ca7a0d1e4c1edf9da03b7a8efd87a..ea5a29c7bc65e999aaf1f4601d4bccc10b4e7bea 100644 (file)
@@ -604,15 +604,15 @@ setup_guile_env ()
   sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite);
 }
 
-void read_relocation_file(string);
+void
+read_relocation_dir (string);
+
 int
 main (int argc, char **argv)
 {
   if (getenv ("LILYPOND_VERBOSE"))
     be_verbose_global = true;
 
-  read_relocation_file ("test.reloc");
-
   setup_localisation ();
   parse_argv (argc, argv);
   if (isatty (STDIN_FILENO))
index 65e4bc29a74973b9b915ab4e384259a66145e572..512e9902b5c5e5aabde59785b443880cac6e94dd 100644 (file)
 
 #include "config.hh"
 
+
+/* TODO: autoconf support */
+
+#include <sys/types.h>
+#include <dirent.h>
+
 #if HAVE_GETTEXT
 #include <libintl.h>
 #endif
@@ -114,6 +120,8 @@ framework_relocation (string prefix)
   if (be_verbose_global)
     warning (_f ("Relocation: framework_prefix=%s", prefix));
 
+  sane_putenv ("INSTALLER_ROOT", prefix, true);
+              
   string bindir = prefix + "/bin";
   string datadir = prefix + "/share";
   string libdir = prefix + "/lib";
@@ -260,7 +268,6 @@ setup_paths (char const *argv0_ptr)
   /* Adding mf/out make lilypond unchanged source directory, when setting
      LILYPONDPREFIX to lilypond-x.y.z */
   char const *suffixes[] = {"ly", "ps", "scm", 0 };
-
   
   vector<string> dirs;
   for (char const **s = suffixes; *s; s++)
@@ -268,8 +275,7 @@ setup_paths (char const *argv0_ptr)
       string path = prefix_directory + to_string ('/') + string (*s);
       dirs.push_back (path);
     }
-
-
+  
   dirs.push_back (prefix_directory + "/fonts/otf/");
   dirs.push_back (prefix_directory + "/fonts/type1/");
   dirs.push_back (prefix_directory + "/fonts/svg/");
@@ -404,3 +410,18 @@ read_relocation_file (string filename)
 
   fclose (f);
 }
+
+void
+read_relocation_dir (string dirname)
+{
+  DIR *dir = opendir  (dirname.c_str ());
+
+  while (struct dirent *ent = readdir (dir))
+    {
+      File_name name (ent->d_name);
+      if (name.ext_ == "reloc")
+       {
+         read_relocation_file (name.to_string ());
+       }
+    }
+}