]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/main.cc
Merge with git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond.git
[lilypond.git] / lily / main.cc
index 6f985ae25381650c0993d20266e0ef92fc117d5d..2eb6cec0bad9765e704859aeb7f01cfa317b4e9b 100644 (file)
@@ -57,6 +57,7 @@ string init_name_global;
 /* Selected output backend
    One of (gnome, ps [default], eps, scm, svg, tex, texstr)") */
 string output_backend_global = "ps";
+
 /* Output formats to generate.  */
 string output_format_global = "";
 
@@ -88,7 +89,7 @@ bool make_print = true;
 
 
 bool relocate_binary =
-#if ARGV0_RELOCATION
+#if 1
   true;
 #else
   false
@@ -128,7 +129,7 @@ static char const *WARRANTY
       "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
       "General Public License for more details.\n"
       "\n"
-      "    You should have received a copy (refer to the file COPYING) of the\n"
+      "    You should have received a copy of the\n"
       "GNU General Public License along with this program; if not, write to\n"
       "the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
       "Boston, MA 02111-1307, USA.\n");
@@ -211,6 +212,7 @@ dir_info (FILE *out)
       env_var_info (out, "GS_LIB");
       env_var_info (out, "GUILE_LOAD_PATH");
       env_var_info (out, "PANGO_RC_FILE");
+      env_var_info (out, "PANGO_PREFIX");
       env_var_info (out, "PATH");
     }
 }
@@ -303,8 +305,8 @@ do_chroot_jail ()
   vector<string> components = string_split (jail_spec, ',');
   if (components.size () != JAIL_MAX)
     {
-      error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX,
-                components.size ()));
+      error (_f ("expected %d arguments with jail, found: %u", JAIL_MAX,
+                (unsigned) components.size ()));
       exit (2);
     }
 
@@ -425,6 +427,7 @@ main_with_guile (void *, int, char **)
       *tail = scm_cons (scm_makfrom0str (arg), SCM_EOL);
       tail = SCM_CDRLOC (*tail);
     }
+  
   delete option_parser;
   option_parser = 0;
 
@@ -538,7 +541,12 @@ parse_argv (int argc, char **argv)
          break;
 
        case 'f':
-         output_format_global = option_parser->optional_argument_str0_;
+         {
+           vector<string> components
+             = string_split (option_parser->optional_argument_str0_, ',');
+           for (vsize i = 0; i < components.size (); i++)
+             add_output_format (components[i]);
+         }
          break;
 
        case 'H':
@@ -603,6 +611,9 @@ setup_guile_env ()
   sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite);
 }
 
+void
+read_relocation_dir (string);
+
 int
 main (int argc, char **argv)
 {
@@ -630,3 +641,25 @@ main (int argc, char **argv)
   /* Only reachable if GUILE exits.  That is an error.  */
   return 1;
 }
+
+SCM atexit_list = SCM_EOL;
+
+LY_DEFINE (ly_atexit, "ly:atexit",
+          2, 0, 0, (SCM proc, SCM args),
+          "Just before exiting, call the procedure given. "
+"If this is called multiple times, the procedures are called "
+"in LIFO order.")
+{
+  atexit_list = scm_cons (scm_cons (proc, args), atexit_list);
+  scm_gc_protect_object (atexit_list);
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_do_atexit, "ly:do-atexit",
+          0, 0, 0, (),
+          "Call the atexit procedures.")
+{
+  for (SCM s = atexit_list; scm_is_pair (s); s = scm_cdr (s))
+    scm_apply_0 (scm_caar (s), scm_cdar (s));
+  return SCM_UNSPECIFIED;
+}