From 62aa03931753e532cbae0fa56725bb5e2a757dff Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 30 Nov 2014 23:33:19 +0100 Subject: 33820: detect support for realpath() with a NULL argument and fixes to the use of it --- configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'configure.ac') 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 +#include +],[ +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 -- cgit 1.4.1