From 35b77e50c45e486a629917191fec4b72d999d603 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Fri, 23 Dec 2011 18:59:24 +0000 Subject: [PATCH] Eina: better autotools for dirfd SVN revision: 66483 --- legacy/eina/configure.ac | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac index 9bd12afdf0..078f3d94be 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/configure.ac @@ -479,23 +479,29 @@ AC_ISC_POSIX AC_FUNC_ALLOCA AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp]) -AC_MSG_CHECKING([dirfd]) -AC_LINK_IFELSE([ - +AC_MSG_CHECKING([for dirfd]) +AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM( + [[ #include - -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_libs="" @@ -810,7 +816,7 @@ echo " on/off support.....: ${have_on_off_threads}" fi echo " Amalgamation.........: ${do_amalgamation}" echo " Iconv support........: ${have_iconv}" -echo " File dirfd...........: ${ac_cv_func_dirfd}" +echo " File dirfd...........: ${have_dirfd}" echo " File xattr...........: ${have_xattr}" echo echo " Documentation........: ${build_doc}"