efl: share HAVE_ATFILE_SOURCE between eina_file, ecore_file...

SVN revision: 80391
This commit is contained in:
Gustavo Sverzut Barbieri 2012-12-06 21:15:30 +00:00
parent 9f6ad6fd55
commit 81bd007e5b
2 changed files with 10 additions and 28 deletions

View File

@ -640,9 +640,11 @@ AC_CHECK_FUNCS([\
backtrace \ backtrace \
backtrace_symbols \ backtrace_symbols \
execvp \ execvp \
dirfd \
fpathconf \ fpathconf \
fstatat \ fstatat \
malloc_usable_size \ malloc_usable_size \
mkdirat \
mtrace \ mtrace \
openat \ openat \
strlcpy \ strlcpy \
@ -652,6 +654,11 @@ AC_FUNC_ALLOCA
EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday]) EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday])
have_atfile_source="${ac_cv_func_fstatat}"
AC_DEFINE_IF([HAVE_ATFILE_SOURCE],
[test "x${have_atfile_source}" = "xyes"],
[1], [Use fstatat and other -at file functions])
###################### EFL ###################### ###################### EFL ######################
@ -926,7 +933,7 @@ EFL_CHECK_LINKER_FLAGS([EINA], [-fno-strict-aliasing])
### Checks for library functions ### Checks for library functions
EFL_CHECK_FUNCS([EINA], [dirfd dlopen dladdr iconv shm_open setxattr]) EFL_CHECK_FUNCS([EINA], [dlopen dladdr iconv shm_open setxattr])
enable_log="no" enable_log="no"
if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then
@ -2345,33 +2352,8 @@ AC_MSG_NOTICE([Ecore_File checks])
### Additional options to configure ### Additional options to configure
AC_ARG_ENABLE([atfile-source],
[AC_HELP_STRING([--disable-atfile-source],
[disable use of atfile source functions as openat and mkdirat @<:@default=detect@:>@])],
[
if test "x${enableval}" = "xyes" ; then
have_atfile_source="yes"
else
have_atfile_source="no"
fi],
[have_atfile_source=auto])
### Default values ### Default values
if ! test "x${have_atfile_source}" = "xno" ; then
AC_CHECK_FUNCS([mkdirat],
[
have_atfile_source="yes"
AC_DEFINE(HAVE_ATFILE_SOURCE, 1, [mkdirat exists])
],
[
if test "x${have_atfile_source}" = "xyes" ; then
AC_MSG_ERROR([required atfile-source but no mkdirat()])
fi
have_atfile_source="no"
])
fi
### Checks for programs ### Checks for programs
### Checks for libraries ### Checks for libraries

View File

@ -1448,14 +1448,14 @@ EAPI int
eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st) eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st)
{ {
struct stat buf; struct stat buf;
#if defined(HAVE_FSTATAT) && defined(HAVE_DIRFD) #ifdef HAVE_ATFILE_SOURCE
int fd; int fd;
#endif #endif
EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1); EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1);
EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1); EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1);
#if defined(HAVE_FSTATAT) && defined(HAVE_DIRFD) #ifdef HAVE_ATFILE_SOURCE
fd = dirfd((DIR*) container); fd = dirfd((DIR*) container);
if (fstatat(fd, info->path + info->name_start, &buf, 0)) if (fstatat(fd, info->path + info->name_start, &buf, 0))
#else #else