From 3fe8098e9c5b5bc2eea171bd5ee2c6de3f0bc5f4 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Sun, 10 Mar 2013 17:57:23 +0100 Subject: [PATCH] include some header files conditionally add specific test for fcntl --- configure.ac | 6 ++++-- m4/efl_check_funcs.m4 | 17 +++++++++++++++++ src/lib/ecore/ecore.c | 4 +++- src/lib/ecore/ecore_coroutine.c | 4 +++- src/lib/eet/eet_cipher.c | 4 +++- src/lib/eet/eet_connection.c | 5 ++++- src/lib/eet/eet_data.c | 5 ++++- src/lib/eet/eet_image.c | 5 ++++- src/lib/eet/eet_lib.c | 5 ++++- src/modules/evas/loaders/psd/evas_image_load_psd.c | 5 ++++- 10 files changed, 50 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index b50957c..bc0ea2c 100644 --- a/configure.ac +++ b/configure.ac @@ -313,6 +313,7 @@ sys/signalfd.h \ sys/types.h \ sys/param.h \ sys/mman.h \ +netinet/in.h \ ]) have_inotify="${ac_cv_header_sys_inotify_h}" @@ -478,12 +479,11 @@ mkdirat \ mtrace \ realpath \ strlcpy \ -fcntl \ ]) AC_FUNC_ALLOCA -EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday dirfd]) +EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday dirfd fcntl]) have_atfile_source="${ac_cv_func_fstatat}" AC_DEFINE_IF([HAVE_ATFILE_SOURCE], @@ -1776,8 +1776,10 @@ EFL_EVAL_PKGS([ECORE]) AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([ \ +langinfo.h \ features.h \ sys/prctl.h \ +sys/resource.h \ sys/timerfd.h \ ]) diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4 index 59a38f7..b976caa 100644 --- a/m4/efl_check_funcs.m4 +++ b/m4/efl_check_funcs.m4 @@ -6,6 +6,7 @@ dnl Macros that check functions availability for the EFL: dnl dirfd dnl dladdr dnl dlopen +dnl fcntl dnl fnmatch dnl gettimeofday dnl iconv @@ -114,6 +115,22 @@ case "$host_os" in esac ]) +dnl _EFL_CHECK_FUNC_FCNTL is for internal use +dnl _EFL_CHECK_FUNC_FCNTL(EFL, VARIABLE) +AC_DEFUN([_EFL_CHECK_FUNC_FCNTL], +[ +case "$host_os" in + mingw*) + $2="yes" + ;; + *) + EFL_FIND_LIB_FOR_CODE([$1], [], [$2], [[ +#include +]], [[int g = fcntl(0, 0);]]) + ;; +esac +]) + dnl _EFL_CHECK_FUNC_FNMATCH is for internal use dnl _EFL_CHECK_FUNC_FNMATCH(EFL, VARIABLE) AC_DEFUN([_EFL_CHECK_FUNC_FNMATCH], diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 3c5a101..237b457 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -11,7 +11,9 @@ #include #include -#include +#ifdef HAVE_LANGINFO_H +# include +#endif #ifdef HAVE_SYS_MMAN_H # include diff --git a/src/lib/ecore/ecore_coroutine.c b/src/lib/ecore/ecore_coroutine.c index 5afd20e..6f28584 100644 --- a/src/lib/ecore/ecore_coroutine.c +++ b/src/lib/ecore/ecore_coroutine.c @@ -14,7 +14,9 @@ # include #elif defined(USE_SETJMP) # include -# include +# if HAVE_SYS_RESOURCE_H +# include +# endif # include #endif diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c index 270e957..f805ba7 100644 --- a/src/lib/eet/eet_cipher.c +++ b/src/lib/eet/eet_cipher.c @@ -8,7 +8,9 @@ #include #include -#include +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef HAVE_SIGNATURE # include diff --git a/src/lib/eet/eet_connection.c b/src/lib/eet/eet_connection.c index 21e9c1c..7945692 100644 --- a/src/lib/eet/eet_connection.c +++ b/src/lib/eet/eet_connection.c @@ -4,7 +4,10 @@ #include #include -#include + +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef _WIN32 # include diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c index fa64246..e2001c0 100644 --- a/src/lib/eet/eet_data.c +++ b/src/lib/eet/eet_data.c @@ -7,7 +7,10 @@ #include #include #include -#include + +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef _WIN32 # include diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c index 95f2a47..07fb1a7 100644 --- a/src/lib/eet/eet_image.c +++ b/src/lib/eet/eet_image.c @@ -5,7 +5,10 @@ #ifdef __OpenBSD__ # include #endif /* ifdef __OpenBSD__ */ -#include + +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef _WIN32 # include diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c index 6485eeb..cbe7da4 100644 --- a/src/lib/eet/eet_lib.c +++ b/src/lib/eet/eet_lib.c @@ -16,7 +16,10 @@ #include #include #include -#include + +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef HAVE_EVIL # include diff --git a/src/modules/evas/loaders/psd/evas_image_load_psd.c b/src/modules/evas/loaders/psd/evas_image_load_psd.c index d15e792..711298e 100644 --- a/src/modules/evas/loaders/psd/evas_image_load_psd.c +++ b/src/modules/evas/loaders/psd/evas_image_load_psd.c @@ -14,7 +14,10 @@ #include #include #include -#include + +#ifdef HAVE_NETINET_IN_H +# include +#endif #ifdef HAVE_EVIL # include -- 2.7.4