From 1ef8206db18ad1d50099f121a08759e3c3cdceee Mon Sep 17 00:00:00 2001 From: Brent Sanders Date: Mon, 15 Apr 2013 22:22:19 -0700 Subject: [PATCH] Changed paths.bin to respect BINDIR The compiled-in path to bin dir was not correct; it made the common assumption that `$(prefix)` == `$(prefix)/bin` which is usually true, but not in all cases. 1. [machine specific files](http://www.gnu.org/prep/standards/html_node/Directory-Variables.html#index-exec_005fprefix) should use `$(exec_prefix)` (`@exec_prefix@` in Makefile.in) instead of the usual `$(prefix)`. 2. [executable programs](http://www.gnu.org/prep/standards/html_node/Directory-Variables.html#index-bindir) should use the more-specific `$(bindir)` (`@bindir@` in Makefile.in) instead of assuming `$(exec_prefix)/bin` as this allows the executable install location to be changed with the `--bindir=_foo_` option to `./configure`. Fortunately, the makefile is mostly correct and *installs* the executable in the correct location. The problem shows up later such as during tab-completion, when fish_pager is run - the compiled-in path it uses was the incorrect `$(prefix)/bin` resulting in an "Unknown command" error, which only required this small fix. --- Makefile.in | 2 +- fish.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 06b6933c2..5227865f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,7 +61,7 @@ optbindirs = @optbindirs@ # Various flags # -MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" +MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" -DBINDIR=L\"$(bindir)\" CXXFLAGS = @CXXFLAGS@ $(MACROS) $(EXTRA_CXXFLAGS) LDFLAGS = @LIBS@ @LDFLAGS@ LDFLAGS_FISH = ${LDFLAGS} @LIBS_FISH@ @LDFLAGS_FISH@ diff --git a/fish.cpp b/fish.cpp index b46ce990e..4a6466f9e 100644 --- a/fish.cpp +++ b/fish.cpp @@ -202,7 +202,7 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0) paths.data = L"" DATADIR "/fish"; paths.sysconf = L"" SYSCONFDIR "/fish"; paths.doc = L"" DATADIR "/doc/fish"; - paths.bin = L"" PREFIX "/bin"; + paths.bin = L"" BINDIR; done = true; }