]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/relocate.cc
initial.
[lilypond.git] / lily / relocate.cc
index 0bb084cf7fe7c14e60bb9cc47c1033b901d0bbcd..6e3b2ab71e84b251aa82208f7a6cabbfd02eff49 100644 (file)
@@ -132,50 +132,6 @@ framework_relocation (string prefix)
   read_relocation_dir (prefix + "/etc/relocate/");
 
   string bindir = prefix + "/bin";
-
-#ifdef OLD_RELOCATION
-  string datadir = prefix + "/share";
-  string libdir = prefix + "/lib";
-  string sysconfdir = prefix + "/etc";
-  
-  /* need otherwise dynamic .so's aren't found.   */
-  prepend_env_path ("DYLD_LIBRARY_PATH", libdir);
-  
-  set_env_file ("FONTCONFIG_FILE", sysconfdir + "/fonts/fonts.conf", true);
-  set_env_dir ("FONTCONFIG_PATH", sysconfdir + "/fonts");
-
-#ifdef __MINGW32__
-  char font_dir[PATH_MAX];
-  ExpandEnvironmentStrings ("%windir%/fonts", font_dir, sizeof (font_dir));
-  prepend_env_path ("GS_FONTPATH", font_dir);
-#endif
-
-  string gs_version =
-#ifdef GHOSTSCRIPT_VERSION
-    GHOSTSCRIPT_VERSION
-#else
-    "ghostscript-version-undefined"
-#endif
-    ;
-  
-  if (char const *cur = getenv ("LILYPOND_GS_VERSION"))
-    gs_version = cur;
-  
-  prepend_env_path ("GS_FONTPATH", datadir + "/ghostscript/" + gs_version + "/fonts");
-  prepend_env_path ("GS_LIB", datadir + "/ghostscript/" + gs_version + "/Resource");
-  prepend_env_path ("GS_LIB", datadir + "/ghostscript/" + gs_version + "/lib");
-
-  prepend_env_path ("GS_FONTPATH", datadir + "/gs/fonts");
-  prepend_env_path ("GS_LIB", datadir + "/gs/Resource");
-  prepend_env_path ("GS_LIB", datadir + "/gs/lib");
-  
-  prepend_env_path ("GUILE_LOAD_PATH", datadir
-                   + to_string ("/guile/%d.%d",
-                                SCM_MAJOR_VERSION, SCM_MINOR_VERSION));
-  set_env_file ("PANGO_RC_FILE", sysconfdir + "/pango/pangorc");
-  set_env_dir ("PANGO_PREFIX", prefix);
-
-#endif
   
   prepend_env_path ("PATH", bindir);
 }
@@ -236,7 +192,7 @@ setup_paths (char const *argv0_ptr)
 #endif /* __MINGW32__ */
 
          if (argv0_abs.empty ())
-           programming_error ("can't find absolute argv0.");
+           programming_error (cannot find absolute argv0.");
        }
 
       string bindir = dir_name (argv0_abs);
@@ -399,7 +355,7 @@ read_relocation_file (string filename)
   char const *cname = filename.c_str ();
   FILE *f = fopen (cname, "r");
   if (!f)
-    error (_f ("can't open file %s", cname));
+    error (_f (cannot open file %s", cname));
 
   while (!feof (f))
     {
@@ -429,7 +385,7 @@ read_relocation_file (string filename)
       else if (command == "prependdir")
        prepend_env_path (variable.c_str (), value);
       else
-       error ( _f("Unknown relocation command %s", command));
+       error (_f ("Unknown relocation command %s", command));
     }
 
   fclose (f);
@@ -438,14 +394,11 @@ read_relocation_file (string filename)
 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 (dirname + "/" + name.to_string ());
-       }
-    }
+  if (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 (dirname + "/" + name.to_string ());
+      }
 }