diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2011-12-23 18:59:24 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2011-12-23 18:59:24 +0000 |
commit | d37a05d501d0336a3c3213b3f501d2ef97590f5e (patch) | |
tree | ce217a6eefdb65a390ae1d5fcf6bba0714df26d4 /configure.ac | |
parent | f4549b62e9302d9c4a33395b509ba479bd1db0ff (diff) | |
download | eina-d37a05d501d0336a3c3213b3f501d2ef97590f5e.tar.gz |
Eina: better autotools for dirfd
SVN revision: 66483
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index 9bd12af..078f3d9 100644 --- a/configure.ac +++ b/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 <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_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}" |