EFL core migration revision 68421
authorJeonghyun Yun <jh0506.yun@samsung.com>
Wed, 29 Feb 2012 06:59:47 +0000 (01:59 -0500)
committerJeonghyun Yun <jh0506.yun@samsung.com>
Fri, 2 Mar 2012 10:50:51 +0000 (05:50 -0500)
Merge remote-tracking branch 'origin/upstream'

configure.ac
m4/efl_fnmatch.m4
m4/efl_gettimeofday.m4 [new file with mode: 0644]
src/lib/Makefile.am
src/lib/embryo_amx.c
src/lib/embryo_str.c
src/lib/embryo_time.c

index 61c50b8..1ff8b4d 100644 (file)
@@ -109,6 +109,19 @@ AC_SUBST(EFL_EMBRYO_BUILD)
 # For embryo_cc_prefix.c
 PKG_CHECK_MODULES([EINA], [eina >= 1.1.0])
 
+### Checks for portability layer
+
+PKG_CHECK_MODULES([EXOTIC],
+   [exotic],
+   [enable_exotic="yes"],
+   [enable_exotic="no"])
+
+if test "x${enable_exotic}" = "xyes"; then
+    requirement_embryo="exotic ${requirement_embryo}"
+
+    AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.])
+fi
+
 ### Checks for header files
 
 AC_CHECK_HEADERS([unistd.h])
@@ -167,7 +180,7 @@ case "$host_os" in
       AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defined to 1 (MinGW platform)])
       ;;
    *)
-      AC_CHECK_FUNCS(gettimeofday)
+      EFL_CHECK_GETTIMEOFDAY([], [AC_MSG_ERROR([Cannot find gettimeofday()])])
       ;;
 esac
 
index a92ac6b..c857046 100644 (file)
@@ -13,7 +13,7 @@ AC_CHECK_HEADER([fnmatch.h], [_efl_have_fnmatch="yes"], [_efl_have_fnmatch="no"]
 
 if test "x${_efl_have_fnmatch}" = "xyes" ; then
    AC_SEARCH_LIBS([fnmatch],
-      [fnmatch evil iberty],
+      [fnmatch evil exotic iberty],
       [_efl_have_fnmatch="yes"],
       [_efl_have_fnmatch="no"])
 fi
diff --git a/m4/efl_gettimeofday.m4 b/m4/efl_gettimeofday.m4
new file mode 100644 (file)
index 0000000..9b767e5
--- /dev/null
@@ -0,0 +1,48 @@
+dnl Copyright (C) 2011 Cedric Bail <cedric.bail@free.fr>
+dnl This code is public domain and can be freely used or copied.
+
+dnl Macro that check for gettimeofday definition
+
+dnl Usage: EFL_CHECK_GETTIMEOFDAY(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
+dnl Define EFL_HAVE_GETTIMEOFDAY
+
+AC_DEFUN([EFL_CHECK_GETTIMEOFDAY],
+[
+
+_efl_have_gettimeofday="no"
+
+AC_LINK_IFELSE(
+   [AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <sys/time.h>
+                   ]],
+                   [[
+int res;
+res = gettimeofday(NULL, NULL);
+                   ]])],
+   [_efl_have_gettimeofday="yes"],
+   [_efl_have_gettimeofday="no"])
+
+if test "x${_efl_have_gettimeofday}" = "xno" -a "x${enable_exotic}" = "xyes"; then
+   SAVE_LIBS="${LIBS}"
+   SAVE_CFLAGS="${CFLAGS}"
+   LIBS="${LIBS} ${EXOTIC_LIBS}"
+   CFLAGS="${CFLAGS} ${EXOTIC_CFLAGS}"
+   AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[
+#include <Exotic.h>
+                      ]],
+                      [[
+int res;
+res = gettimeofday(NULL, NULL);
+                      ]])],
+      [_efl_have_gettimeofday="yes"],
+      [_efl_have_gettimeofday="no"])
+fi
+
+if test "x${_efl_have_gettimeofday}" = "xyes"; then
+   AC_DEFINE([EFL_HAVE_GETTIMEOFDAY], [1], [Defined if gettimeofday is available.])
+fi
+
+AS_IF([test "x${_efl_have_gettimeofday}" = "xyes"], [$1], [$2])
+])
index f5c78aa..d2ccb55 100644 (file)
@@ -11,6 +11,7 @@ AM_CPPFLAGS = \
 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
 -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
 @EVIL_CFLAGS@ \
+@EXOTIC_CFLAGS@ \
 @EMBRYO_CPPFLAGS@ \
 @EFL_EMBRYO_BUILD@
 
@@ -29,7 +30,7 @@ embryo_str.c \
 embryo_time.c
 
 libembryo_la_CFLAGS = @EMBRYO_CFLAGS@
-libembryo_la_LIBADD = @EVIL_LIBS@ -lm
+libembryo_la_LIBADD = @EXOTIC_LIBS@ @EVIL_LIBS@ -lm
 libembryo_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
 
 EXTRA_DIST = embryo_private.h
index 4fa84c5..7a41111 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
+#endif
+
 #include "Embryo.h"
 #include "embryo_private.h"
 
index 46a3284..0c2faa2 100644 (file)
@@ -2,28 +2,41 @@
 # include "config.h"
 #endif
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <fnmatch.h>
-
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
 #ifdef HAVE_ALLOCA_H
 # include <alloca.h>
-#elif defined __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# include <stddef.h>
-# ifdef  __cplusplus
+#elif !defined alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# elif !defined HAVE_ALLOCA
+#  ifdef  __cplusplus
 extern "C"
-# endif
+#  endif
 void *alloca (size_t);
+# endif
+#endif
+
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
 #endif
 
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fnmatch.h>
+
 #include "Embryo.h"
 #include "embryo_private.h"
 
index 8392ec3..90c14cf 100644 (file)
@@ -2,7 +2,7 @@
 # include "config.h"
 #endif
 
-#ifndef HAVE_GETTIMEOFDAY
+#ifndef EFL_HAVE_GETTIMEOFDAY
 # error "Your platform isn't supported yet"
 #endif
 
 # include <Evil.h>
 #endif
 
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
+#endif
+
 #include "Embryo.h"
 #include "embryo_private.h"