#include <cassert>
#include <clocale>
#include <cstring>
+#include <cerrno>
+using namespace std;
+
#include <unistd.h>
-#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
#ifdef __MINGW32__
-# include <winbase.h>
+#include <winbase.h>
#endif
static void
-setup_paths (char const* argv0)
+setup_paths (char const *argv0)
{
prefix_directory = LILYPOND_DATADIR;
}
/*
- ugh. C&P font-config.cc
+ When running from build dir, a full LILYPOND_PREFIX is set-up at
+
+ share/lilypond/TOPLEVEL_VERSION
+
+ This historical hack will allow the shorthand
+
+ LILYPONDPREFIX=. lily/out/lilypond ...
+
*/
struct stat statbuf;
- String builddir = prefix_directory + "/mf/out/";
- if (stat (builddir.to_str0 (), &statbuf) == 0)
- {
- dirs.push (builddir.to_str0 ());
- }
- else
- {
- dirs.push (prefix_directory + "/fonts/otf/");
- dirs.push (prefix_directory + "/fonts/type1/");
- dirs.push (prefix_directory + "/fonts/cff/");
- dirs.push (prefix_directory + "/fonts/svg/");
- dirs.push (prefix_directory + "/fonts/cff/");
- }
+ String build_prefix = prefix_directory + "share/lilypond/" TOPLEVEL_VERSION;
+ if (stat (build_prefix.to_str0 (), &statbuf) == 0)
+ prefix_directory = build_prefix;
+
+ dirs.push (prefix_directory + "/fonts/otf/");
+ dirs.push (prefix_directory + "/fonts/type1/");
+ dirs.push (prefix_directory + "/fonts/cff/");
+ dirs.push (prefix_directory + "/fonts/svg/");
for (int i = 0; i < dirs.size (); i++)
global_path.prepend (dirs[i]);
}
#endif
-
static void
main_with_guile (void *, int, char **)
{
warranty ();
exit (0);
break;
-
+
case 'b':
output_backend_global = option_parser->optional_argument_str0_;
break;
case 'f':
output_format_global = option_parser->optional_argument_str0_;
break;
-
+
case 'H':
dump_header_fieldnames_global
.push (option_parser->optional_argument_str0_);