cedric pushed a commit to branch master.

commit 3fe8098e9c5b5bc2eea171bd5ee2c6de3f0bc5f4
Author: Cedric Bail <[email protected]>
Date:   Sun Mar 10 17:57:23 2013 +0100

    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 <fcntl.h>
+]], [[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 <fcntl.h>
 #include <errno.h>
 
-#include <langinfo.h>
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
 
 #ifdef HAVE_SYS_MMAN_H
 # include <sys/mman.h>
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 <ucontext.h>
 #elif defined(USE_SETJMP)
 # include <sys/time.h>
-# include <sys/resource.h>
+# if HAVE_SYS_RESOURCE_H
+#  include <sys/resource.h>
+# endif
 # include <setjmp.h>
 #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 <sys/stat.h>
 #include <unistd.h>
 
-#include <netinet/in.h>
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef HAVE_SIGNATURE
 # include <sys/mman.h>
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 <string.h>
 #include <stdlib.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef _WIN32
 # include <winsock2.h>
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 <math.h>
 #include <ctype.h>
 #include <limits.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef _WIN32
 # include <winsock2.h>
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 <sys/types.h>
 #endif /* ifdef __OpenBSD__ */
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef _WIN32
 # include <winsock2.h>
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 <fnmatch.h>
 #include <fcntl.h>
 #include <zlib.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef HAVE_EVIL
 # include <Evil.h>
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 <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 #ifdef HAVE_EVIL
 # include <Evil.h>

-- 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

Reply via email to