From 75cda540fbd6de6d992170922c8056308d99f250 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 2 Nov 2005 12:48:44 +0000 Subject: [PATCH] * lily/main.cc (setup_paths)[__MINGW32__]: Do not assume argv0 is absolute. Better diagnostics. * GNUmakefile.in: Add bin/ to tree and populate with some links. This makes lilypond run from the build directory using argv0 relocation (without any --prefix or LILYPONDPREFIX setting). --- ChangeLog | 9 ++++++ GNUmakefile.in | 76 ++++++++++++++++++++++++++++---------------------- lily/main.cc | 8 ++++-- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcde663b8c..25a8e1d623 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-11-02 Jan Nieuwenhuizen + + * lily/main.cc (setup_paths)[__MINGW32__]: Do not assume argv0 is + absolute. Better diagnostics. + + * GNUmakefile.in: Add bin/ to tree and populate with some links. + This makes lilypond run from the build directory using argv0 + relocation (without any --prefix or LILYPONDPREFIX setting). + 2005-11-02 Han-Wen Nienhuys * scm/define-grobs.scm: purge self-[XY]-offset varialbes, replace diff --git a/GNUmakefile.in b/GNUmakefile.in index 4e14224e25..c81a76af8f 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -81,76 +81,84 @@ local-WWW-post: cd $(top-build-dir) && ls *.html >> $(outdir)/weblist cat $(outdir)/weblist | (cd $(top-build-dir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -) -#share-prefix = $(top-build-dir)/share -#tree-prefix = $(top-build-dir)/share/lilypond/$(TOPLEVEL_VERSION) -share-prefix = $(outdir)/share -tree-prefix = $(share-prefix)/lilypond/$(TOPLEVEL_VERSION) +tree-prefix = $(outdir) +tree-bin = $(tree-prefix)/bin +tree-lib = $(tree-prefix)/lib +tree-share = $(tree-prefix)/share +tree-share-prefix = $(tree-share)/lilypond/$(TOPLEVEL_VERSION) +tree-lib-prefix = $(tree-lib)/lilypond/$(TOPLEVEL_VERSION) src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh web-clean: $(MAKE) out=www clean - $(MAKE) $(tree-prefix)/lilypond-force + $(MAKE) $(tree-share-prefix)/lilypond-force default: $(config_h) build-dir-setup -build-dir-setup: $(tree-prefix)/lilypond-force +build-dir-setup: $(tree-share-prefix)/lilypond-force PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po) HELP_CATALOGS = $(PO_FILES:$(src-depth)/po/%.po=%) CATALOGS = $(HELP_CATALOGS:lilypond=) -$(tree-prefix)/lilypond-force link-tree: GNUmakefile +$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile # Preparing LilyPond tree for build-dir exec - cd $(top-build-dir)/$(outbase) && rm -rf lib share - mkdir -p $(top-build-dir)/$(outbase)/lib/$(package) - mkdir -p $(tree-prefix) - mkdir -p $(tree-prefix)/dvips - mkdir -p $(tree-prefix)/elisp - mkdir -p $(tree-prefix)/fonts - mkdir -p $(tree-prefix)/fonts/otf - mkdir -p $(tree-prefix)/fonts/tfm - mkdir -p $(tree-prefix)/fonts/type1 - mkdir -p $(tree-prefix)/fonts/svg - mkdir -p $(tree-prefix)/fonts/map - mkdir -p $(tree-prefix)/fonts/enc - mkdir -p $(tree-prefix)/tex - cd $(top-build-dir)/$(outbase)/lib && \ - ln -s ../../../../python/$(outconfbase) python - cd $(tree-prefix) && \ + cd $(top-build-dir)/$(outbase) && rm -rf bin lib share + mkdir -p $(tree-bin) + mkdir -p $(tree-share-prefix) + mkdir -p $(tree-lib-prefix) + mkdir -p $(tree-share-prefix)/dvips + mkdir -p $(tree-share-prefix)/elisp + mkdir -p $(tree-share-prefix)/fonts + mkdir -p $(tree-share-prefix)/fonts/otf + mkdir -p $(tree-share-prefix)/fonts/tfm + mkdir -p $(tree-share-prefix)/fonts/type1 + mkdir -p $(tree-share-prefix)/fonts/svg + mkdir -p $(tree-share-prefix)/fonts/map + mkdir -p $(tree-share-prefix)/fonts/enc + mkdir -p $(tree-share-prefix)/tex + cd $(tree-bin) && \ + ln -sf ../../lily/$(outconfbase)/lilypond . && \ + ln -sf ../../scripts/$(outconfbase)/convert-ly . && \ + ln -sf ../../scripts/$(outconfbase)/lilypond-book . && \ + ln -sf ../../scripts/$(outconfbase)/*.ly . + cd $(tree-lib-prefix) && \ + ln -s ../../../../../python/$(outconfbase) python + cd $(tree-share-prefix) && \ ln -s $(top-src-dir)/ly ly && \ ln -s ../../../../mf mf && \ ln -s $(top-src-dir)/ps && \ ln -s ../../../../python/$(outconfbase) python && \ ln -s $(top-src-dir)/scm && \ ln -s $(top-src-dir)/scripts scripts - cd $(tree-prefix)/dvips && \ + cd $(tree-share-prefix)/dvips && \ ln -s ./../../../mf/$(outconfbase) mf-out && \ ln -s $(top-src-dir)/ps - cd $(tree-prefix)/tex && \ + cd $(tree-share-prefix)/tex && \ ln -s $(top-src-dir)/tex source && \ ln -s ../../../../../tex/$(outconfbase) tex-out && \ ln -s ../../../../../mf/$(outconfbase) mf-out - -cd $(tree-prefix)/fonts/otf && \ + -cd $(tree-share-prefix)/fonts/otf && \ ln -s ../../../../../../mf/$(outconfbase)/*.otf . - -cd $(tree-prefix)/fonts/svg && \ + -cd $(tree-share-prefix)/fonts/svg && \ ln -s ../../../../../../mf/$(outconfbase)/*.svg . - -cd $(tree-prefix)/fonts/tfm && \ + -cd $(tree-share-prefix)/fonts/tfm && \ ln -s ../../../../../../mf/$(outconfbase)/*.tfm . - -cd $(tree-prefix)/fonts/type1 && \ + -cd $(tree-share-prefix)/fonts/type1 && \ ln -s ../../../../../../mf/$(outconfbase)/*.pfa . - cd $(tree-prefix)/fonts && \ + cd $(tree-share-prefix)/fonts && \ ln -s $(top-src-dir)/mf source && \ true - -cd $(tree-prefix)/elisp && \ + -cd $(tree-share-prefix)/elisp && \ ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \ ln -s $(top-src-dir)/elisp/*.el . $(foreach i,$(CATALOGS), \ - mkdir -p $(share-prefix)/locale/$i/LC_MESSAGES && \ - cd $(share-prefix)/locale/$i/LC_MESSAGES && \ + mkdir -p $(tree-share)/locale/$i/LC_MESSAGES && \ + cd $(tree-share)/locale/$i/LC_MESSAGES && \ ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true # touch $@ - touch $(tree-prefix)/lilypond-force + touch $(tree-share-prefix)/lilypond-force local-clean: build-dir-setup-clean build-dir-setup-clean: diff --git a/lily/main.cc b/lily/main.cc index 1aae18e923..f3b8689d9b 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -322,7 +322,7 @@ setup_paths (char const *argv0) if (getenv ("LILYPOND_VERBOSE")) be_verbose_global = true; -#ifndef __MINGW32__ +#if 1 /* Huh, argv0 is not absolute on windows? ndef __MINGW32__ */ File_path p; p.parse_path (getenv ("PATH")); String bindir = dir_name (p.find (argv0)); @@ -333,8 +333,10 @@ setup_paths (char const *argv0) if (argv0_prefix != dir_name (dir_name (dir_name (prefix_directory)))) { if (be_verbose_global) - warning (_f ("argv0 relocation: argv0=%s, prefix=%s", argv0, - prefix_directory)); + warning (_f ("argv0 relocation: prefix=%s, argv0=%s, argv0_prefix=%s", + prefix_directory, + argv0, + argv0_prefix.to_str0 ())); String datadir = argv0_prefix + "/share"; String libdir = argv0_prefix + "/lib"; String localedir = datadir + "/locale"; -- 2.39.2