diff --git a/aclocal.m4 b/aclocal.m4 index 6614450a367ac5aef0d9e77f314e1d582cff4e2b..eca1dd63fc3f1952cf69a89c1c4c07df5f4795c1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -299,6 +299,28 @@ AC_DEFUN(STEPMAKE_DATADIR, [ ]) +## ugh: cut & paste programming from datadir. +AC_DEFUN(STEPMAKE_LIBDIR, [ + presome=${exec_prefix} + if test "$presome" = "NONE"; then + presome=${prefix} + fi + if test "$presome" = "NONE"; then + presome=${ac_default_prefix} + fi + + build_package_libdir=$ac_pwd/out/lib/$package + + LIBDIR=`echo ${libdir} | sed "s!\\\${exec_prefix}!$presome!"` + BUILD_PACKAGE_LIBDIR=`echo ${build_package_libdir} | sed "s!\\\${exec_prefix}!$presome!"` + + AC_SUBST(libdir) + AC_SUBST(build_package_libdir) + AC_DEFINE_UNQUOTED(CONFIG_LIBDIR, ["${LIBDIR}"]) + AC_DEFINE_UNQUOTED(BUILD_PACKAGE_LIBDIR, ["${BUILD_PACKAGE_LIBDIR}"]) +]) + + AC_DEFUN(STEPMAKE_PREFIX_EXPAND_FIXUP, [ # undo expanding of explicit --infodir=/usr/share # to ease install-time override with prefix=... @@ -306,6 +328,10 @@ AC_DEFUN(STEPMAKE_PREFIX_EXPAND_FIXUP, [ if test "$includedir" = "`eval echo $prefix$strip`"; then includedir='${prefix}'$strip'' fi + strip=`echo $libdir | eval sed s@^$exec_prefix@@` + if test "$libdir" = "`eval echo $exec_prefix$strip`"; then + libdir='${exec_prefix}'$strip'' + fi strip=`echo $infodir | eval sed s@^$datarootdir@@` if test "$infodir" = "`eval echo $datarootdir$strip`"; then infodir='${datarootdir}'$strip'' @@ -636,6 +662,7 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_SUBST(ROOTSEP) STEPMAKE_DATADIR + STEPMAKE_LIBDIR ]) diff --git a/config.hh.in b/config.hh.in index c0d25fb319d07fb632786ada9905efbb4dc0924d..fa5dddda0605c073e6f9e76a1655b1227a34a239 100644 --- a/config.hh.in +++ b/config.hh.in @@ -2,8 +2,10 @@ /* datadir */ #define CONFIG_DATADIR "@CONFIG_DATADIR@" +#define CONFIG_LIBDIR "@CONFIG_LIBDIR@" #define PACKAGE_DATADIR CONFIG_DATADIR "/lilypond" +#define PACKAGE_LIBDIR CONFIG_LIBDIR "/lilypond" /* default lilypond locale dir */ #define LOCALEDIR "@LOCALEDIR@" diff --git a/lily/global-vars.cc b/lily/global-vars.cc index 0b0aefab9a70a6042b7ea27435f1d68eb6e62143..4496a793bfdb295f99b53134d183f8daf06f15d1 100644 --- a/lily/global-vars.cc +++ b/lily/global-vars.cc @@ -55,3 +55,6 @@ File_path global_path; LILYPOND_DATADIR = /usr/share/lilypond */ string lilypond_datadir; + +/* Where the compiled Guile modules live. */ +string lilypond_libdir; diff --git a/lily/include/main.hh b/lily/include/main.hh index 9a5d03269354d642edd0be1a7c0c86f617b16e57..f029a605dc04668ce366746e34bf3f52bfb40d84 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -32,6 +32,7 @@ extern std::string output_name_global; extern bool be_safe_global; extern bool do_internal_type_checking_global; extern std::string lilypond_datadir; +extern std::string lilypond_libdir; extern bool strict_infinity_checking; extern std::string init_scheme_code_global; extern std::string init_scheme_variables_global; diff --git a/lily/main.cc b/lily/main.cc index 9d37e022f07b3c274b73fc9be322904e8df0c5b0..5564222b35b4fbb0f15d298f537f495b174ae88b 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -493,35 +493,11 @@ main_with_guile (void *, int, char **) %load-compiled-path is the symbol Guile V2 searches for .go files */ string scm_pct_load_path = "%load-path"; - string scm_pct_load_compiled_path = "%load-compiled-path"; - prepend_scheme_list (lilypond_datadir + "/scm", scm_pct_load_path); -#if 0 - /* this code is dead, but keeping this around until we sort the - guile2/3 situation. */ - /* - Just as ughy - prepend "/scm/out" onto GUILE V2+ %load-compiled-path - and set %compile-fallback-path to our scm/out directory - */ - /* - %load-compiled-path is the symbol Guile V2 searches for .go files - */ - prepend_scheme_list (lilypond_datadir + "/scm/out", - scm_pct_load_compiled_path); - /* - %compile-fallback-path is the guile cache root for auto-compiled files - */ - - string scm_pct_fallback_path = "%compile-fallback-path"; - string ly_scm_go_dir = lilypond_datadir + "/scm/out"; - //string scm_pct_set_fallback = "(set! " + scm_pct_fallback_path + - // " \"" + lilypond_datadir + "/scm/out\")"; - //scm_c_eval_string (scm_pct_set_fallback.c_str() ); - scm_primitive_eval - (scm_list_3 (scm_from_latin1_symbol ("set!"), - scm_from_latin1_symbol ("%compile-fallback-path"), - scm_from_locale_string (ly_scm_go_dir.c_str ()))); +#if GUILEV2 + string scm_pct_load_compiled_path = "%load-compiled-path"; + prepend_scheme_list (lilypond_libdir + "/ccache", scm_pct_load_compiled_path); #endif if (is_loglevel (LOG_DEBUG)) diff --git a/lily/relocate.cc b/lily/relocate.cc index b0827dfe1920d8dc3fc6978e16ecb4a0cb5c5c6b..bcb84e743b68ed31fdf673ab3190b48d61a43152 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -222,6 +222,11 @@ setup_paths (char const *argv0_ptr) PACKAGE_DATADIR "/" TOPLEVEL_VERSION, prefix + "/share/lilypond/" TOPLEVEL_VERSION, prefix + "/share/lilypond/current"); + lilypond_libdir = set_up_directory ("LILYPOND_LIBDIR", + "libdir", + PACKAGE_LIBDIR "/" TOPLEVEL_VERSION, + prefix + "/lib/lilypond/" TOPLEVEL_VERSION, + prefix + "/lib/lilypond/current"); string localedir = set_up_directory ("LILYPOND_LOCALEDIR", "localedir", LOCALEDIR,