about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-11-30 23:33:19 +0100
committerOliver Kiddle <opk@zsh.org>2014-11-30 23:33:30 +0100
commit62aa03931753e532cbae0fa56725bb5e2a757dff (patch)
tree12b2373c90553e939369e84db18fcc7de32575e5 /configure.ac
parent40c5e00de09066916ef42067ae21e58a5268c647 (diff)
downloadzsh-62aa03931753e532cbae0fa56725bb5e2a757dff.tar.gz
zsh-62aa03931753e532cbae0fa56725bb5e2a757dff.tar.xz
zsh-62aa03931753e532cbae0fa56725bb5e2a757dff.zip
33820: detect support for realpath() with a NULL
argument and fixes to the use of it
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 56c4cfb13..8ea9737c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1302,6 +1302,23 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
 	       cygwin_conv_path)
 AC_FUNC_STRCOLL
 
+AH_TEMPLATE([REALPATH_ACCEPTS_NULL],
+[Define if realpath() accepts NULL as its second argument.])
+AC_CACHE_CHECK([if realpath accepts NULL],
+zsh_cv_func_realpath_accepts_null,
+[AC_RUN_IFELSE([AC_LANG_PROGRAM([
+#include <stdlib.h>
+#include <limits.h>
+],[
+exit(!realpath("/", (char*)0));
+])],
+[zsh_cv_func_realpath_accepts_null=yes],
+[zsh_cv_func_realpath_accepts_null=no],
+[zsh_cv_func_realpath_accepts_null=$ac_cv_func_canonicalize_file_name])])
+if test x$zsh_cv_func_realpath_accepts_null = xyes; then
+  AC_DEFINE(REALPATH_ACCEPTS_NULL)
+fi
+
 if test x$enable_cap = xyes; then
   AC_CHECK_FUNCS(cap_get_proc)
 fi