include some header files conditionally add specific test for fcntl
authorCedric Bail <cedric.bail@free.fr>
Sun, 10 Mar 2013 16:57:23 +0000 (17:57 +0100)
committerCedric BAIL <cedric.bail@samsung.com>
Mon, 11 Mar 2013 01:34:47 +0000 (10:34 +0900)
configure.ac
m4/efl_check_funcs.m4
src/lib/ecore/ecore.c
src/lib/ecore/ecore_coroutine.c
src/lib/eet/eet_cipher.c
src/lib/eet/eet_connection.c
src/lib/eet/eet_data.c
src/lib/eet/eet_image.c
src/lib/eet/eet_lib.c
src/modules/evas/loaders/psd/evas_image_load_psd.c

index b50957c..bc0ea2c 100644 (file)
@@ -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 \
 ])
 
index 59a38f7..b976caa 100644 (file)
@@ -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],
index 3c5a101..237b457 100644 (file)
@@ -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>
index 5afd20e..6f28584 100644 (file)
@@ -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
 
index 270e957..f805ba7 100644 (file)
@@ -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>
index 21e9c1c..7945692 100644 (file)
@@ -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>
index fa64246..e2001c0 100644 (file)
@@ -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>
index 95f2a47..07fb1a7 100644 (file)
@@ -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>
index 6485eeb..cbe7da4 100644 (file)
 #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>
index d15e792..711298e 100644 (file)
 #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>