#include "version.hh"
#include "warn.hh"
+#define FRAMEWORKDIR ".."
+
int
sane_putenv (char const *key, string value, bool overwrite)
prepend_env_path ("GS_FONTPATH", font_dir);
#endif
- /* FIXME: *cough* 8.15 *cough* */
- prepend_env_path ("GS_FONTPATH", datadir + "/ghostscript/8.15/fonts");
- prepend_env_path ("GS_LIB", datadir + "/ghostscript/8.15/Resource");
- prepend_env_path ("GS_LIB", datadir + "/ghostscript/8.15/lib");
+ 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");
#endif /* __MINGW32__ */
prefix_relocation (prefix);
string bindir = prefix + "/bin";
- framework_relocation (bindir + "/" FRAMEWORKDIR);
+ framework_relocation (bindir);
}
else if (relocate_binary)
{
if (argv0_prefix != compile_prefix)
prefix_relocation (argv0_prefix);
if (argv0_prefix != compile_prefix || string (FRAMEWORKDIR) != "..")
- framework_relocation (bindir + "/" FRAMEWORKDIR);
+ framework_relocation (bindir + "/" + FRAMEWORKDIR);
}
/* FIXME: use LILYPOND_DATADIR. */
/* Adding mf/out make lilypond unchanged source directory, when setting
LILYPONDPREFIX to lilypond-x.y.z */
- char *suffixes[] = {"ly", "ps", "scm", 0 };
+ char const *suffixes[] = {"ly", "ps", "scm", 0 };
vector<string> dirs;
- for (char **s = suffixes; *s; s++)
+ for (char const **s = suffixes; *s; s++)
{
string path = prefix_directory + to_string ('/') + string (*s);
dirs.push_back (path);