diff --git a/legacy/ecore/configure.ac b/legacy/ecore/configure.ac index cfad06fbb6..35e7118b3e 100644 --- a/legacy/ecore/configure.ac +++ b/legacy/ecore/configure.ac @@ -473,6 +473,21 @@ case "$host_vendor" in ;; esac + +### Checks for portability layer + +PKG_CHECK_MODULES([EXOTIC], + [exotic], + [enable_exotic="yes"], + [enable_exotic="no"]) + +if test "x${enable_exotic}" = "xyes"; then + requirement_exotic="exotic ${requirement_exotic}" + + AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.]) +fi +AM_CONDITIONAL([ECORE_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"]) + AC_SUBST(EFL_ECORE_BUILD) AC_SUBST(EFL_ECORE_CON_BUILD) AC_SUBST(EFL_ECORE_EVAS_BUILD) diff --git a/legacy/ecore/m4/efl_gettimeofday.m4 b/legacy/ecore/m4/efl_gettimeofday.m4 new file mode 100644 index 0000000000..9b767e5a9b --- /dev/null +++ b/legacy/ecore/m4/efl_gettimeofday.m4 @@ -0,0 +1,48 @@ +dnl Copyright (C) 2011 Cedric Bail +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 +#include + ]], + [[ +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 + ]], + [[ +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]) +]) diff --git a/legacy/ecore/src/lib/ecore/Ecore.h b/legacy/ecore/src/lib/ecore/Ecore.h index 289855d2f4..8ab3e716e7 100644 --- a/legacy/ecore/src/lib/ecore/Ecore.h +++ b/legacy/ecore/src/lib/ecore/Ecore.h @@ -320,7 +320,9 @@ sudo make install # include #else # include -# include +# if !defined (EXOTIC_NO_SIGNAL) +# include +# endif #endif #include @@ -592,7 +594,7 @@ struct _Ecore_Event_Signal_User /** User signal event */ int number; /**< The signal number. Either 1 or 2 */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; @@ -601,7 +603,7 @@ struct _Ecore_Event_Signal_Hup /** Hup signal event */ { void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; @@ -613,7 +615,7 @@ struct _Ecore_Event_Signal_Exit /** Exit request event */ Eina_Bool terminate : 1; /**< Set if the exit request was a terminate singal */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; @@ -622,7 +624,7 @@ struct _Ecore_Event_Signal_Power /** Power event */ { void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; @@ -631,7 +633,7 @@ struct _Ecore_Event_Signal_Realtime /** Realtime event */ { int num; /**< The realtime signal's number */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; @@ -725,7 +727,7 @@ struct _Ecore_Exe_Event_Del /** Process exit event */ Eina_Bool exited : 1; /** < set to 1 if the process exited of its own accord */ Eina_Bool signalled : 1; /** < set to 1 id the process exited due to uncaught signal */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) +#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) siginfo_t data; /**< Signal info */ #endif }; diff --git a/legacy/ecore/src/lib/ecore/Makefile.am b/legacy/ecore/src/lib/ecore/Makefile.am index ec3d99fa9b..6f14387e5b 100644 --- a/legacy/ecore/src/lib/ecore/Makefile.am +++ b/legacy/ecore/src/lib/ecore/Makefile.am @@ -47,6 +47,12 @@ libecore_la_SOURCES += ecore_exe_ps3.c else +if ECORE_HAVE_EXOTIC + +libecore_la_SOURCES += + +else + libecore_la_SOURCES += ecore_signal.c ecore_exe.c endif @@ -55,6 +61,8 @@ endif endif +endif + libecore_la_LIBADD = @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm libecore_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ @EFL_PTHREAD_LIBS@ diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c index 7e0f9738d4..d8b8723ad1 100644 --- a/legacy/ecore/src/lib/ecore/ecore.c +++ b/legacy/ecore/src/lib/ecore/ecore.c @@ -163,8 +163,10 @@ ecore_init(void) if (!ecore_mempool_init()) goto shutdown_mempool; _ecore_main_loop_init(); _ecore_signal_init(); - _ecore_thread_init(); +#ifndef HAVE_EXOTIC _ecore_exe_init(); +#endif + _ecore_thread_init(); _ecore_glib_init(); _ecore_job_init(); _ecore_time_init(); @@ -252,7 +254,9 @@ ecore_shutdown(void) _ecore_glib_shutdown(); _ecore_job_shutdown(); _ecore_thread_shutdown(); +#ifndef HAVE_EXOTIC _ecore_exe_shutdown(); +#endif _ecore_idle_enterer_shutdown(); _ecore_idle_exiter_shutdown(); _ecore_idler_shutdown(); diff --git a/legacy/ecore/src/lib/ecore/ecore_getopt.c b/legacy/ecore/src/lib/ecore/ecore_getopt.c index 76272d3718..cd681897c3 100644 --- a/legacy/ecore/src/lib/ecore/ecore_getopt.c +++ b/legacy/ecore/src/lib/ecore/ecore_getopt.c @@ -38,6 +38,10 @@ void *alloca(size_t); # include #endif +#ifdef HAVE_EXOTIC +# include +#endif + #include "Ecore.h" #include "Ecore_Getopt.h" diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c index 79814c4bce..8f438bd326 100644 --- a/legacy/ecore/src/lib/ecore/ecore_main.c +++ b/legacy/ecore/src/lib/ecore/ecore_main.c @@ -229,10 +229,14 @@ static Eina_Bool win32_handlers_delete_me = EINA_FALSE; #ifdef _WIN32 Ecore_Select_Function main_loop_select = _ecore_main_win32_select; #else -# ifdef HAVE_SYS_SELECT_H -# include -# endif +# if !defined EXOTIC_NO_SELECT +# ifdef HAVE_SYS_SELECT_H +# include +# endif Ecore_Select_Function main_loop_select = select; +# else +Ecore_Select_Function main_loop_select = NULL; +# endif #endif #ifndef USE_G_MAIN_LOOP diff --git a/legacy/ecore/src/lib/ecore/ecore_pipe.c b/legacy/ecore/src/lib/ecore/ecore_pipe.c index 9304357eb4..099559835f 100644 --- a/legacy/ecore/src/lib/ecore/ecore_pipe.c +++ b/legacy/ecore/src/lib/ecore/ecore_pipe.c @@ -74,6 +74,9 @@ #endif /* ! _WIN32 */ +#include +#include "ecore_private.h" + struct _Ecore_Pipe { ECORE_MAGIC; diff --git a/legacy/ecore/src/lib/ecore/ecore_private.h b/legacy/ecore/src/lib/ecore/ecore_private.h index 50d502c8e7..1dfc7e7eb5 100644 --- a/legacy/ecore/src/lib/ecore/ecore_private.h +++ b/legacy/ecore/src/lib/ecore/ecore_private.h @@ -174,7 +174,7 @@ void *_ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler); void _ecore_main_shutdown(void); -#if defined (_WIN32) || defined (__lv2ppu__) +#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC) static inline void _ecore_signal_shutdown(void) { } static inline void _ecore_signal_init(void) { } diff --git a/legacy/ecore/src/lib/ecore/ecore_time.c b/legacy/ecore/src/lib/ecore/ecore_time.c index 8e7611b200..23e26f9d03 100644 --- a/legacy/ecore/src/lib/ecore/ecore_time.c +++ b/legacy/ecore/src/lib/ecore/ecore_time.c @@ -21,7 +21,7 @@ #include -#ifdef HAVE_CLOCK_GETTIME +#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) static clockid_t _ecore_time_clock_id = -1; #elif defined(__APPLE__) && defined(__MACH__) static double _ecore_time_clock_conversion = 1e-9; @@ -52,7 +52,7 @@ double _ecore_time_loop_time = -1.0; EAPI double ecore_time_get(void) { -#ifdef HAVE_CLOCK_GETTIME +#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) struct timespec t; if (EINA_UNLIKELY(_ecore_time_clock_id < 0)) @@ -86,7 +86,7 @@ ecore_time_get(void) EAPI double ecore_time_unix_get(void) { -#ifdef HAVE_GETTIMEOFDAY +#ifdef EFL_HAVE_GETTIMEOFDAY struct timeval timev; gettimeofday(&timev, NULL); @@ -136,7 +136,7 @@ ecore_loop_time_get(void) void _ecore_time_init(void) { -#ifdef HAVE_CLOCK_GETTIME +#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) struct timespec t; if (_ecore_time_clock_id != -1) return;