about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-04-11 21:43:15 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-04-11 22:10:33 +0900
commite5f8cc99f524db8db7c7fbe5957609db63869d0e (patch)
tree480c1872976c45a4e409d6ff0f4d54e8b82014ed /configure.ac
parent8a9aea907ac4844e2ee7348c4fa6417ae9873991 (diff)
downloadzsh-e5f8cc99f524db8db7c7fbe5957609db63869d0e.tar.gz
zsh-e5f8cc99f524db8db7c7fbe5957609db63869d0e.tar.xz
zsh-e5f8cc99f524db8db7c7fbe5957609db63869d0e.zip
51639: new parameter ZSH_EXEPATH (full path of zsh executable)
The full pathname is obatined by a reliable method on macOS and systems
that support procfs. But on other systems (FreeBSD, OpenBSD, ...) it is
guessed from argv[0], PWD and PATH.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e6ced85d9..d8a17791a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2011,6 +2011,25 @@ if test x$zsh_cv_sys_path_dev_fd != xno; then
   AC_DEFINE_UNQUOTED(PATH_DEV_FD, "$zsh_cv_sys_path_dev_fd")
 fi
 
+dnl ----------------------------------------------------
+dnl CHECK FOR SYMLINK TO THE CURRENT EXECUTABLE IN /proc
+dnl ----------------------------------------------------
+dnl Linux: /proc/self/exe
+dnl NetBSD: /proc/curproc/exe (or /proc/self/exe, but not /proc/curproc/file)
+dnl DragonFly: /proc/curproc/file
+dnl Solaris: /proc/self/path/a.out
+AH_TEMPLATE([PROC_SELF_EXE],
+[Define to the path of the symlink to the current executable file.])
+AC_CACHE_CHECK(for symlink to the current executable in /proc,
+zsh_cv_proc_self_exe,
+[for zsh_cv_proc_self_exe in /proc/self/exe /proc/curproc/exe \
+                             /proc/curproc/file /proc/self/path/a.out no; do
+   test -L $zsh_cv_proc_self_exe && break
+done])
+if test x$zsh_cv_proc_self_exe != xno; then
+  AC_DEFINE_UNQUOTED(PROC_SELF_EXE, "$zsh_cv_proc_self_exe")
+fi
+
 dnl ---------------------------------
 dnl CHECK FOR RFS SUPERROOT DIRECTORY
 dnl ---------------------------------