+2002-07-24 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * aclocal.m4: Regenerate.
+
+ * config.hh.in:
+ * config.make.in:
+ * stepmake/aclocal.m4: Cleanups and more conventional naming for
+ datadir ($prefix/share), package_datadir ($prefix/$package), and
+ local_package_datadir ($prefix/$package/$version).
+
+ * make/lilypond-vars.make:
+ * scripts/ly2dvi.py:
+ * scripts/lilypond-book.py:
+ * scripts/mup2ly.py:
+ * scripts/midi2ly.py: use local_package_datadir iso datadir.
+
+ * GNUmakefile.in: build_datadir without version.
+
+ * lily/main.cc: Datadir cleanup.
+
+ * lily/text-item.cc (lookup_text):
+ * lily/music-output-def.cc (print_smob):
+ * lily/mensural-ligature.cc (brew_molecule):
+ * lily/beam-quanting.cc (score_slopes_dy, score_forbidden_quants):
+ Fix warnings.
+
2002-07-23 Jan Nieuwenhuizen <janneke@gnu.org>
* input/mutopia/J.S.Bach/baerenreiter-sarabande.ly: Warn when not
default: builddir-setup
-builddir-setup: $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force
+builddir-setup: $(builddir)/share/lilypond-force
-$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force:
+$(builddir)/share/lilypond-force:
# Preparing LilyPond tree for builddir exec
@echo Making $(builddir)/share
@cd $(builddir) && rm -rf share
- @cd $(builddir) && mkdir -p share/lilypond
- @cd $(builddir)/share/lilypond && mkdir -p $(TOPLEVEL_VERSION)
- @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
+ @mkdir -p $(builddir)/share/lilypond
+ @mkdir -p $(builddir)/share/lilypond/fonts
+ @mkdir -p $(builddir)/share/lilypond/tex
+ @cd $(builddir)/share/lilypond && \
ln -s $(abs-srcdir)/ly ly && \
- ln -s ../../../mf/$(outconfbase) dvips && \
- ln -s ../../../mf/$(outconfbase) afm && \
- ln -s ../../../mf/$(outconfbase) tfm && \
+ ln -s ../../mf/$(outconfbase) dvips && \
+ ln -s ../../mf/$(outconfbase) afm && \
+ ln -s ../../mf/$(outconfbase) tfm && \
ln -s $(abs-srcdir)/mf && \
ln -s $(abs-srcdir)/ps && \
ln -s $(abs-srcdir)/scm
- @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
- mkdir tex
- @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/tex && \
+ @cd $(builddir)/share/lilypond/tex && \
ln -s $(abs-srcdir)/tex source && \
- ln -s ../../../../mf/$(outconfbase) generate
- @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
- mkdir fonts
- @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/fonts && \
+ ln -s ../../../mf/$(outconfbase) generate
+ @cd $(builddir)/share/lilypond/fonts && \
ln -s $(abs-srcdir)/mf source && \
- ln -s ../../../../mf/$(outconfbase) afm && \
- ln -s ../../../../mf/$(outconfbase) tfm && \
- ln -s ../../../../mf/$(outconfbase) type1
+ ln -s ../../../mf/$(outconfbase) afm && \
+ ln -s ../../../mf/$(outconfbase) tfm && \
+ ln -s ../../../mf/$(outconfbase) type1
local-clean: builddir-setup-clean
builddir-setup-clean:
dnl aclocal.m4 -*-shell-script-*-
dnl WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from /users/hanwen/usr/src/lilypond/stepmake/aclocal.m4
+dnl do not edit! this is aclocal.m4, generated from /home/fred/cvs/savannah/lilypond/stepmake/aclocal.m4
dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
AC_DEFUN(STEPMAKE_DATADIR, [
- if test "$datadir" = "\${prefix}/share"; then
- datadir='${prefix}/share/'$package/$FULL_VERSION
- fi
- DIR_DATADIR=${datadir}
presome=${prefix}
if test "$prefix" = "NONE"; then
- presome=${ac_default_prefix}
+ presome=${ac_default_prefix}
fi
- DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
-
- AC_SUBST(datadir)
- AC_SUBST(DIR_DATADIR)
-
- # we used to set DIR_SHAREDSTATEDIR here,
- # but apparently that broke something
+ datadir=$(echo ${datadir} | sed "s!\\\${prefix}!$presome!")
- AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
+ package_datadir=$datadir/$package
+ local_package_datadir=$package_datadir/$FULL_VERSION
+ build_package_datadir=$builddir/share/$package
+
+ AC_SUBST(datadir)
+ AC_SUBST(package_datadir)
+ AC_SUBST(local_package_datadir)
+ AC_SUBST(build_package_datadir)
+ AC_DEFINE_UNQUOTED(DATADIR, "${datadir}")
+ AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "${package_datadir}")
+ AC_DEFINE_UNQUOTED(LOCAL_PACKAGE_DATADIR, "${local_package_datadir}")
+ AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, "${build_package_datadir}")
])
AC_DEFUN(STEPMAKE_GETTEXT, [
- DIR_LOCALEDIR=${localedir}
presome=${prefix}
if test "$prefix" = "NONE"; then
presome=${ac_default_prefix}
fi
- DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
+ localedir=$(echo ${localedir} | sed "s!\\\${prefix}!$presome!")
+
AC_SUBST(localedir)
- AC_SUBST(DIR_LOCALEDIR)
- AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
-
+ AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}")
AC_CHECK_LIB(intl, gettext)
AC_CHECK_FUNCS(gettext)
])
fi
AC_MSG_CHECKING(Package)
- if test "x$PACKAGE" = "xSTEPMAKE"; then
+ if test "$PACKAGE" = "STEPMAKE"; then
AC_MSG_RESULT(Stepmake package!)
AC_MSG_CHECKING(builddir)
AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
- if test "$package_depth" = "" ; then
+ if test -z "$package_depth"; then
package_depth="."
else
package_depth="../$package_depth"
# . lilypond-profile
-
-if [ "$LILYPONDPREFIX" == "" ] ; then
+if [ -z "$LILYPONDPREFIX" ]; then
datadir=`echo "@datadir@" | sed 's!//!/!g'`
else
- if [ -d "$LILYPONDPREFIX/fonts" ] ; then
+ if [ -d "$LILYPONDPREFIX/fonts" ]; then
datadir=$LILYPONDPREFIX
else
eval `cat $LILYPONDPREFIX/VERSION`
GS_LIB="$datadir/ps:"${GS_LIB:=""}
export GS_LIB
-
-
-
# For direct ps output fonts. Add all available TeX Type1 fonts
GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
export GS_FONTPATH
/* @AUTOGENERATE@ */
-/* Hmm */
#define PACKAGE "@package@"
-/* default lilypond init and input dir */
-#define DIR_DATADIR "@DIR_DATADIR@"
+/* datadir */
+#define DATADIR "@DATADIR@"
+
+/* LilyPond init and input base directory */
+#define PACKAGE_DATADIR "@PACKAGE_DATADIR@"
+#define LILYPOND_DATADIR PACKAGE_DATADIR
+
+/* LilyPond specific init and input directory */
+#define LOCAL_PACKAGE_DATADIR "@local_package_datadir@"
+#define LOCAL_LILYPOND_DATADIR LOCAL_PACKAGE_DATADIR
/* default lilypond locale dir */
-#define DIR_LOCALEDIR "@DIR_LOCALEDIR@"
+#define LOCALEDIR "@LOCALEDIR@"
/* define if you have memmem */
#define HAVE_MEMMEM 0
exec_prefix = @exec_prefix@
builddir = @builddir@
+build_lilypond_datadir = @build_package_datadir@
bindir = @bindir@
datadir = @datadir@
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
+lilypond_datadir = @package_datadir@
+local_lilypond_datadir = @local_package_datadir@
localedir = @localedir@
mandir = @mandir@
program_prefix = @program_prefix@
for (int i = qscores.size (); i--;)
{
qscores[i].demerits
- += score_slopes_dy (me, qscores[i].yl, qscores[i].yr,
+ += score_slopes_dy (qscores[i].yl, qscores[i].yr,
dy_mus, yr- yl, xstaff);
}
if (qscores[i].demerits < reasonable_score)
{
qscores[i].demerits
- += score_forbidden_quants (me, qscores[i].yl, qscores[i].yr,
+ += score_forbidden_quants (qscores[i].yl, qscores[i].yr,
rad, slt, thickness, beam_translation,
beam_count, ldir, rdir);
}
base_lengths, stem_xposns,
xl, xr,
knee_b,
- me, qscores[i].yl, qscores[i].yr);
+ qscores[i].yl, qscores[i].yr);
}
Array<Real> stem_xs,
Real xl, Real xr,
bool knee,
- Grob*me,
Real yl, Real yr)
{
Real pen = STEM_LENGTH_LIMIT_PENALTY;
}
Real
-Beam::score_slopes_dy (Grob *me,
- Real yl, Real yr,
+Beam::score_slopes_dy (Real yl, Real yr,
Real dy_mus, Real dy_damp,
bool xstaff)
{
}
Real
-Beam::score_forbidden_quants (Grob*me,
- Real yl, Real yr,
+Beam::score_forbidden_quants (Real yl, Real yr,
Real rad,
Real slt,
Real thickness, Real beam_translation,
DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));
DECLARE_SCHEME_CALLBACK (quanting, (SCM));
- static Real score_slopes_dy (Grob*, Real,Real,Real,Real, bool);
+ static Real score_slopes_dy (Real, Real, Real, Real, bool);
static Real score_stem_lengths (Link_array<Grob>,
Array<Stem_info>,
Array<Real>, Array<Real>,
- Real, Real,
- bool,Grob*,Real , Real);
- static Real score_forbidden_quants (Grob*, Real, Real,
+ Real, Real, bool, Real, Real);
+ static Real score_forbidden_quants (Real, Real,
Real, Real, Real, Real,
int, Direction, Direction);
#include "array.hh"
void read_lily_scm_file (String);
-void init_lily_guile (String dir);
+void ly_init_guile ();
bool ly_dir_p (SCM s);
bool ly_number_pair_p (SCM);
scm_init_funcs_->push (f);
}
-extern void init_cxx_function_smobs ();
+extern void init_cxx_function_smobs ();
-void
-prepend_load_path (String p )
-{
- char s[1024];
- sprintf (s,
- "(set! %%load-path (cons \"%s\" %%load-path))", p.ch_C());
-
- scm_c_eval_string (s);
-}
void
-init_lily_guile (String p )
+ly_init_guile ()
{
- prepend_load_path (p);
-
- // todo: junk this. We should make real modules iso. just loading files.
- prepend_load_path (p + "/scm/");
-
SCM last_mod = scm_current_module ();
scm_set_current_module (scm_c_resolve_module ("guile"));
void
-taint (SCM * foo)
+taint (SCM *)
{
/*
nop.
};
void
-identify (FILE* os)
+identify (FILE *out)
{
- fputs(gnu_lilypond_version_str ().ch_C(), os);
+ fputs (gnu_lilypond_version_str ().ch_C (), out);
+}
+
+void
+dirinfo (FILE *out)
+{
+ fputs ("\n", out);
+ fprintf (out, "lilypond_datadir: `%s'\n", LILYPOND_DATADIR);
+ fprintf (out, "local_lilypond_datadir: `%s'\n", LOCAL_LILYPOND_DATADIR);
+ fprintf (out, "localedir: `%s'\n", LOCALEDIR);
+
+ char *lilypond_prefix = getenv ("LILYPONDPREFIX");
+ fprintf (out, "LILYPONDPREFIX: `%s'\n",
+ (lilypond_prefix ? lilypond_prefix : ""));
}
void
usage ()
{
-
- /*
- No version number or newline here. It confuses help2man
- */
- std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").ch_C();
+ std::cout << "\n";
+ /* No version number or newline here. It confuses help2man. */
+ std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").ch_C ();
std::cout << "\n\n";
- std::cout << _ ("Typeset music and or play MIDI from FILE").ch_C();
+ std::cout << _ ("Typeset music and or play MIDI from FILE").ch_C ();
std::cout << "\n\n";
std::cout <<
_ (
"LilyPond is a music typesetter. It produces beautiful sheet music\n"
"using a high level description file as input. LilyPond is part of \n"
"the GNU Project.\n"
-).ch_C();
+).ch_C ();
std::cout << '\n';
- std::cout << _ ("Options:").ch_C();
+ std::cout << _ ("Options:").ch_C ();
std::cout << '\n';
- std::cout << Long_option_init::table_str (options_static).ch_C();
+ std::cout << Long_option_init::table_str (options_static).ch_C ();
std::cout << '\n';
- std::cout << _ ("This binary was compiled with the following options:") .ch_C()
- << " " <<
-#ifdef NDEBUG
- "NDEBUG "
-#endif
- "\n"
- "datadir: `" DIR_DATADIR "'\n"
- "localedir: `" DIR_LOCALEDIR "'\n"
- "\n";
-
-
std::cout << std::endl;
- std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").ch_C() << std::endl;
+ std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").ch_C () << std::endl;
}
void
"This is free software. It is covered by the GNU General Public License,\n"
"and you are welcome to change it and/or distribute copies of it under\n"
"certain conditions. Invoke as `%s --warranty' for more information.\n",
- "lilypond").ch_C();
+ "lilypond").ch_C ();
std::cout << std::endl;
- std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C();
+ std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C ();
std::cout << '\n';
std::cout << " Han-Wen Nienhuys <hanwen@cs.uu.nl>\n";
std::cout << " Jan Nieuwenhuizen <janneke@gnu.org>\n";
notice ()
{
std::cout << '\n';
- std::cout << _ ("GNU LilyPond -- The music typesetter").ch_C();
+ std::cout << _ ("GNU LilyPond -- The music typesetter").ch_C ();
std::cout << '\n';
- std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C();
+ std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C ();
std::cout << '\n';
std::cout << " Han-Wen Nienhuys <hanwen@cs.uu.nl>\n";
std::cout << " Jan Nieuwenhuizen <janneke@gnu.org>\n";
" You should have received a copy (refer to the file COPYING) of the\n"
"GNU General Public License along with this program; if not, write to\n"
"the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
- "USA.\n").ch_C();
+ "USA.\n").ch_C ();
}
-String prefix_directory;
+
+/* Where LilyPond's init files live. Typically:
+ LILYPOND_DATADIR = /usr/local/share/lilypond
+ LOCAL_LILYPOND_DATADIR = /usr/local/share/lilypond/1.5.68 */
+char const *prefix_directory[2] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR};
void
setup_paths ()
{
- // facilitate binary distributions
- char const *env_lily = getenv ("LILYPONDPREFIX");
-
- if (env_lily)
- prefix_directory = env_lily;
+ if (char const *lilypond_prefix = getenv ("LILYPONDPREFIX"))
+ prefix_directory[1] = lilypond_prefix;
#if HAVE_GETTEXT
setlocale (LC_ALL, ""); /* enable locales */
urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share
handy for multiple source-dir runs, though...
*/
- if (!prefix_directory.empty_b ())
+ if (!String (prefix_directory[0]).empty_b ())
{
- lily_locale_dir = prefix_directory + "/share/locale";
+ lily_locale_dir = String (prefix_directory[0]) + "/share/locale";
bindtextdomain (name.ch_C (), lily_locale_dir.ch_C ());
}
else
- bindtextdomain (name.ch_C (), DIR_LOCALEDIR);
+ bindtextdomain (name.ch_C (), LOCALEDIR);
textdomain (name.ch_C ());
#endif
LILYPONDPREFIX to lilypond-x.y.z */
char *suffixes[] = {"ly", "afm", "mf/out", "scm", "tfm", "ps", 0};
- if (prefix_directory.empty_b ())
- prefix_directory = DIR_DATADIR;
- for (char **s = suffixes; *s; s++)
- {
- String p = prefix_directory + to_str ('/') + String (*s);
- global_path.add (p);
-
+ for (unsigned i = 0; i < sizeof (prefix_directory)
+ / sizeof (*prefix_directory); i++)
+ for (char **s = suffixes; *s; s++)
+ {
+ String p = prefix_directory[i] + to_str ('/') + String (*s);
+ global_path.add (p);
+
#if !KPATHSEA
- /* Urg: GNU make's $ (word) index starts at 1 */
- int i = 1;
- while (global_path.try_add (p + to_str (".") + to_str (i)))
- i++;
+ /* Urg: GNU make's $ (word) index starts at 1 */
+ int i = 1;
+ while (global_path.try_add (p + to_str (".") + to_str (i)))
+ i++;
#endif
- }
-}
-
+ }
+ }
+
/**
Make input file name from command argument.
}
void
-main_prog (void * , int, char**)
+prepend_load_path (String dir)
{
- /*
- need to do this first. Engravers use lily.scm contents.
- */
-
- /*
- prepend onto GUILE loadpath.
-
- Very ugh.
- */
+ String s = "(set! %load-path (cons \""
+ + dir
+ + "\" %load-path))";
+ scm_c_eval_string (s.ch_C ());
+}
- init_lily_guile (prefix_directory);
+void
+main_prog (void *, int, char **)
+{
+ /* Engravers use lily.scm contents, need to make Guile find it.
+ Prepend onto GUILE %load-path, very ugh. */
+
+ for (unsigned i = 0; i < sizeof (prefix_directory)
+ / sizeof (*prefix_directory); i++)
+ {
+ prepend_load_path (prefix_directory[i]);
+ /* Junk this. We should make real modules iso. just loading files. */
+ prepend_load_path (String (prefix_directory[i]) + "/scm");
+ }
+
+ if (verbose_global_b)
+ dirinfo (stderr);
+
+ ly_init_guile ();
+
std::cout << std::endl;
call_constructors ();
all_fonts_global_p = new All_font_metrics (global_path.str ());
init_scheme_code_string += ")";
- gh_eval_str ((char *)init_scheme_code_string.ch_C());
+ gh_eval_str ((char *)init_scheme_code_string.ch_C ());
int p=0;
const char *arg = oparser_p_static->get_next_arg ();
/* No FILE arguments is now a usage error */
exit (2);
}
- else
- do
+
+ do
{
String infile (arg);
-
- /* What/when was this supposed to do?
- It looks like it reset the outname_str_global for every new
- file, but only if user didn't specify a outname? Huh?
-
- // if (outname_str_global == "")
-
- */
- {
- Midi_def::reset_score_count ();
- Paper_def::reset_score_count ();
- }
+ Midi_def::reset_score_count ();
+ Paper_def::reset_score_count ();
Path inpath = distill_inname (infile);
sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608", false);
ly_init_kpath (argv[0]);
-
+
+ bool help_b = false;
oparser_p_static = new Getopt_long (argc, argv, options_static);
while (Long_option_init const * opt = (*oparser_p_static) ())
{
init_name_global = oparser_p_static->optional_argument_ch_C_;
break;
case 'h':
- usage ();
- exit (0);
+ help_b = true;
break;
case 'V':
verbose_global_b = true;
}
identify (stderr);
+ if (help_b)
+ {
+ usage ();
+ if (verbose_global_b)
+ dirinfo (stdout);
+ exit (0);
+ }
+
#ifdef WINNT
scm_boot_guile (argc, argv, main_prog, 0);
#else
MAKE_SCHEME_CALLBACK (Mensural_ligature, brew_molecule, 1);
SCM
-Mensural_ligature::brew_molecule (SCM smob)
+Mensural_ligature::brew_molecule (SCM)
{
return SCM_EOL;
}
{
Music_output_def * def = unsmob_music_output_def (s);
scm_puts ("#<Music_output_def ", p);
- //scm_write (def->type_name_, p);
+#if 0
+ scm_write (def->type_name_, p);
+#else
+ (void) def;
+#endif
scm_puts (">", p);
return 1;
}
Molecule
-Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text)
+Text_item::lookup_text (Grob *, Font_metric*fm, SCM text)
{
SCM list = scm_list_n (ly_symbol2scm ("text"), text, SCM_UNDEFINED);
list = fontify_atom (fm, list);
# LilyPond is often run from within $(outdir), making a relative
# PREFIX incorrect.
-export LILYPONDPREFIX:=$(shell cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION); pwd)
+export LILYPONDPREFIX:=$(build_lilypond_datadir)
export PYTHONPATH:=$(topdir)/python:$(PYTHONPATH)
(string<? (symbol->string (car x))
(symbol->string (car y))))
-
(define (ly-load x)
- (let*
- (
- (fn (%search-load-path x))
- )
+ (let* ((fn (%search-load-path x)))
(if (ly-verbose)
(format (current-error-port) "[~A]" fn))
- (primitive-load fn)
-
- ))
-
-
+ (primitive-load fn)))
(use-modules (scm tex)
# if set, LILYPONDPREFIX must take prevalence
# if datadir is not set, we're doing a build and LILYPONDPREFIX
-datadir = '@datadir@'
+datadir = '@local_package_datadir@'
if os.environ.has_key ('LILYPONDPREFIX') :
datadir = os.environ['LILYPONDPREFIX']
else:
- datadir = '@datadir@'
+ datadir = '@local_package_datadir@'
while datadir[-1] == os.sep:
datadir= datadir[:-1]
# if set, LILYPONDPREFIX must take prevalence
# if datadir is not set, we're doing a build and LILYPONDPREFIX
-datadir = '@datadir@'
+datadir = '@local_package_datadir@'
if os.environ.has_key ('LILYPONDPREFIX') :
datadir = os.environ['LILYPONDPREFIX']
else:
- datadir = '@datadir@'
+ datadir = '@local_package_datadir@'
while datadir[-1] == os.sep:
# do fuddling: we must load the midi module from the right directory.
-datadir = '@datadir@'
+datadir = '@local_package_datadir@'
if os.environ.has_key ('LILYPONDPREFIX'):
datadir = os.environ['LILYPONDPREFIX']
else:
- datadir = '@datadir@'
+ datadir = '@local_package_datadir@'
sys.path.append (os.path.join (datadir, 'python'))
sys.path.append (os.path.join (datadir, 'python/out'))
# if set, LILYPONDPREFIX must take prevalence
# if datadir is not set, we're doing a build and LILYPONDPREFIX
-datadir = '@datadir@'
+datadir = '@local_package_datadir@'
if os.environ.has_key ('LILYPONDPREFIX') \
- or '@datadir@' == '@' + 'datadir' + '@':
+ or '@local_package_datadir@' == '@' + 'local_package_datadir' + '@':
datadir = os.environ['LILYPONDPREFIX']
else:
- datadir = '@datadir@'
+ datadir = '@local_package_datadir@'
sys.path.append (os.path.join (datadir, 'python'))
sys.path.append (os.path.join (datadir, 'python/out'))
AC_DEFUN(STEPMAKE_DATADIR, [
- if test "$datadir" = "\${prefix}/share"; then
- datadir='${prefix}/share/'$package/$FULL_VERSION
- fi
- DIR_DATADIR=${datadir}
presome=${prefix}
if test "$prefix" = "NONE"; then
- presome=${ac_default_prefix}
+ presome=${ac_default_prefix}
fi
- DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
-
- AC_SUBST(datadir)
- AC_SUBST(DIR_DATADIR)
-
- # we used to set DIR_SHAREDSTATEDIR here,
- # but apparently that broke something
+ datadir=$(echo ${datadir} | sed "s!\\\${prefix}!$presome!")
- AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
+ package_datadir=$datadir/$package
+ local_package_datadir=$package_datadir/$FULL_VERSION
+ build_package_datadir=$builddir/share/$package
+
+ AC_SUBST(datadir)
+ AC_SUBST(package_datadir)
+ AC_SUBST(local_package_datadir)
+ AC_SUBST(build_package_datadir)
+ AC_DEFINE_UNQUOTED(DATADIR, "${datadir}")
+ AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "${package_datadir}")
+ AC_DEFINE_UNQUOTED(LOCAL_PACKAGE_DATADIR, "${local_package_datadir}")
+ AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, "${build_package_datadir}")
])
AC_DEFUN(STEPMAKE_GETTEXT, [
- DIR_LOCALEDIR=${localedir}
presome=${prefix}
if test "$prefix" = "NONE"; then
presome=${ac_default_prefix}
fi
- DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
+ localedir=$(echo ${localedir} | sed "s!\\\${prefix}!$presome!")
+
AC_SUBST(localedir)
- AC_SUBST(DIR_LOCALEDIR)
- AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
-
+ AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}")
AC_CHECK_LIB(intl, gettext)
AC_CHECK_FUNCS(gettext)
])
fi
AC_MSG_CHECKING(Package)
- if test "x$PACKAGE" = "xSTEPMAKE"; then
+ if test "$PACKAGE" = "STEPMAKE"; then
AC_MSG_RESULT(Stepmake package!)
AC_MSG_CHECKING(builddir)
AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
- if test "$package_depth" = "" ; then
+ if test -z "$package_depth"; then
package_depth="."
else
package_depth="../$package_depth"
#define TOPLEVEL_VERSION "@TOPLEVEL_VERSION@"
/* default init and input dir */
-#define DIR_DATADIR "@DIR_DATADIR@"
+#define DATADIR "@DATADIR@"
/* default locale dir */
-#define DIR_LOCALEDIR "@DIR_LOCALEDIR@"
+#define LOCALEDIR "@LOCALEDIR@"