From 12a3bf3b0d80520175a460b5a6cdac49637e0dd6 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 26 Apr 2006 14:25:49 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 4 ++++ lily/main.cc | 6 +++--- lily/relocate.cc | 27 ++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1988b27df5..983302db67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-04-24 Han-Wen Nienhuys + + * lily/relocate.cc (read_relocation_dir): new function. + 2006-04-26 Graham Percival * Documentation/user/instrument-notation.itely: a few more fixes diff --git a/lily/main.cc b/lily/main.cc index 481d4542a6..ea5a29c7bc 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -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)) diff --git a/lily/relocate.cc b/lily/relocate.cc index 65e4bc29a7..512e9902b5 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -11,6 +11,12 @@ #include "config.hh" + +/* TODO: autoconf support */ + +#include +#include + #if HAVE_GETTEXT #include #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 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 ()); + } + } +} -- 2.39.5