Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The default $fpath



On Sat, 20 Sep 2014 20:36:48 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> But surely the only place we're ever likely to get an other copy of the
> directory from is $sitefndir, whether set explicitly or based on the
> prefix?

Oh, I see.  If it's not set explicitly, it hasn't been expanded yet,
hence the test for the parts.  And the parts haven't been expanded.
And prefix may be set to NONE to use the default prefix but may also
explicitly be set to /usr/local.

Er...

I couldn't be bothered to test if datadir had been moved from
${prefix}/share.

An eval would be more effective but less safe.

diff --git a/configure.ac b/configure.ac
index b202940..1d77098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -317,9 +317,17 @@ fi], [sitefndir=${datadir}/${tzsh_name}/site-functions])
 
 dnl Add /usr/local/share/zsh/site-functions if not yet present
 dnl owing to $sitefndir, whether or not explicitly given.
+dnl If not explicitly given, it hasn't been expanded yet.
 if test X$sitefndir = X/usr/local/share/zsh/site-functions
 then fixed_sitefndir=''
-else fixed_sitefndir=/usr/local/share/zsh/site-functions
+elif test X$prefix != X/usr/local; then
+  if test X$prefix = XNONE && test X$ac_default_prefix = X/usr/local
+  then fixed_sitefndir=''
+  else fixed_sitefndir=/usr/local/share/zsh/site-functions
+  fi
+elif test X$tzsh_name != Xzsh
+then fixed_sitefndir=/usr/local/share/zsh/site-functions
+else fixed_sitefndir=''
 fi
 
 ifdef([function_subdirs],[undefine([function_subdirs])])



Messages sorted by: Reverse Date, Date, Thread, Author