Eina: better autotools for dirfd

SVN revision: 66483
This commit is contained in:
Vincent Torri 2011-12-23 18:59:24 +00:00
parent aec13b5d41
commit 35b77e50c4
1 changed files with 20 additions and 14 deletions

View File

@ -479,23 +479,29 @@ AC_ISC_POSIX
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp]) AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp])
AC_MSG_CHECKING([dirfd]) AC_MSG_CHECKING([for dirfd])
AC_LINK_IFELSE([ AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[
#include <dirent.h> #include <dirent.h>
]],
DIR *dirp; [[
int main(void)
int
main(void)
{ {
return dirfd(dirp); DIR *dirp;
return dirfd(dirp);
} }
], [ AC_MSG_RESULT([yes]) ]])
AC_DEFINE([HAVE_DIRFD], 1, [ Define to 1 if you have the `dirfd' function or macro. ])
], ],
[ AC_MSG_RESULT([no])] [have_dirfd="yes"],
) [have_dirfd="no"])
AC_MSG_RESULT([${have_dirfd}])
if test "x${have_dirfd}" = "xyes" ; then
AC_DEFINE([HAVE_DIRFD], [1], [ Define to 1 if you have the `dirfd' function or macro.])
fi
# dlopen and dladdr # dlopen and dladdr
dlopen_libs="" dlopen_libs=""
@ -810,7 +816,7 @@ echo " on/off support.....: ${have_on_off_threads}"
fi fi
echo " Amalgamation.........: ${do_amalgamation}" echo " Amalgamation.........: ${do_amalgamation}"
echo " Iconv support........: ${have_iconv}" echo " Iconv support........: ${have_iconv}"
echo " File dirfd...........: ${ac_cv_func_dirfd}" echo " File dirfd...........: ${have_dirfd}"
echo " File xattr...........: ${have_xattr}" echo " File xattr...........: ${have_xattr}"
echo echo
echo " Documentation........: ${build_doc}" echo " Documentation........: ${build_doc}"