diff --git a/legacy/eina/configure.in b/legacy/eina/configure.in index 10d9d1c0ba..3c31149bc3 100644 --- a/legacy/eina/configure.in +++ b/legacy/eina/configure.in @@ -104,6 +104,15 @@ AC_MSG_RESULT([$enable_ememoa]) PKG_PROG_PKG_CONFIG +# Evil library for compilation on Windows CE + +case "$host_os" in + mingw32ce* | cegcc*) + PKG_CHECK_MODULES([EVIL], [evil]) + AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed]) + ;; +esac + # Check library for unit tests if test "x${enable_tests}" = "xyes" ; then @@ -193,6 +202,17 @@ AC_C_BIGENDIAN AC_PROG_CC_STDC AC_C___ATTRIBUTE__ +EINA_CFLAGS="${COVERAGE_CFLAGS}" +case "${host_os}" in + cegcc*) + EINA_CFLAGS="${EINA_CFLAGS=} ${EVIL_CFLAGS} -mwin32" + ;; + mingw*) + EINA_CFLAGS="${EINA_CFLAGS=} ${EVIL_CFLAGS}" + ;; +esac +AC_SUBST(EINA_CFLAGS) + if test "x$enable_coverage" = "xyes" ; then CFLAGS="${DEBUG_CFLAGS}" fi @@ -203,13 +223,19 @@ fi ### Checks for linker characteristics +EINA_LIBS="" lt_enable_auto_import="" -case "$host_os" in +case "${host_os}" in mingw* | cegcc*) AC_DEFINE(EFL_EINA_BUILD, 1, [Define to mention that eina is built]) + EINA_LIBS="${COVERAGE_LIBS} ${EVIL_LIBS} -lm" lt_enable_auto_import="-Wl,--enable-auto-import" ;; + *) + EINA_LIBS="${COVERAGE_LIBS} -ldl -lrt -lm" + ;; esac +AC_SUBST(EINA_LIBS) AC_SUBST(lt_enable_auto_import) diff --git a/legacy/eina/src/lib/Makefile.am b/legacy/eina/src/lib/Makefile.am index a360cb2ec4..b4402f237a 100644 --- a/legacy/eina/src/lib/Makefile.am +++ b/legacy/eina/src/lib/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@COVERAGE_CFLAGS@ +@EINA_CFLAGS@ lib_LTLIBRARIES = libeina.la @@ -29,6 +29,8 @@ eina_convert.c \ eina_rbtree.c \ eina_stringshare.c -libeina_la_LIBADD = -ldl -lrt @COVERAGE_LIBS@ -lm +libeina_la_LIBADD = @EINA_LIBS@ libeina_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ -libeina_la_DEPENDENCIES = $(top_builddir)/config.h + +clean-local: + rm -rf *.gcno diff --git a/legacy/eina/src/lib/eina_counter.c b/legacy/eina/src/lib/eina_counter.c index 55c6068c4b..51034cbdce 100644 --- a/legacy/eina/src/lib/eina_counter.c +++ b/legacy/eina/src/lib/eina_counter.c @@ -28,7 +28,7 @@ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN -#endif /* ! _WIN2 */ +#endif /* _WIN2 */ #include "eina_counter.h" #include "eina_inlist.h" diff --git a/legacy/eina/src/lib/eina_file.c b/legacy/eina/src/lib/eina_file.c index 1c292835e5..f7c8785015 100644 --- a/legacy/eina/src/lib/eina_file.c +++ b/legacy/eina/src/lib/eina_file.c @@ -20,12 +20,21 @@ # include #endif -#define _GNU_SOURCE #include -#include -#include -#include -#include + +#ifndef _WIN32 +# define _GNU_SOURCE +# include +# include +# include +# include +#else +# define WIN32_LEAN_AND_MEAN +# include +# undef WIN32_LEAN_AND_MEAN +# include +#endif /* _WIN2 */ + #ifdef HAVE_ALLOCA_H # include @@ -66,6 +75,7 @@ void *alloca (size_t); EAPI Eina_Bool eina_file_dir_list(const char *dir, Eina_Bool recursive, Eina_File_Dir_List_Cb cb, void *data) { +#ifndef _WIN32 struct dirent *de; DIR *d; @@ -107,6 +117,69 @@ eina_file_dir_list(const char *dir, Eina_Bool recursive, Eina_File_Dir_List_Cb c } closedir(d); +#else + WIN32_FIND_DATA file; + HANDLE hSearch; + char *new_dir; + TCHAR *tdir; + int length_dir; + + if (!cb) return EINA_FALSE; + if (!dir || (*dir == '\0')) return EINA_FALSE; + + length_dir = strlen(dir); + new_dir = (char *)alloca(length_dir + 5); + if (!new_dir) return EINA_FALSE; + + memcpy(new_dir, dir, length_dir); + memcpy(new_dir + length_dir, "/*.*", 5); + +#ifdef UNICODE + tdir = evil_char_to_wchar(new_dir); +#else + tdir = new_dir; +#endif /* ! UNICODE */ + hSearch = FindFirstFile(tdir, &file); +#ifdef UNICODE + free(tdir); +#endif /* UNICODE */ + + if (hSearch == INVALID_HANDLE_VALUE) return EINA_FALSE; + + do + { + char *filename; + +#ifdef UNICODE + filename = evil_wchar_to_char(file.cFileName); +#else + filename = file.cFileName; +#endif /* ! UNICODE */ + if (!strcmp(filename, ".") || !strcmp(filename, "..")) + continue; + + cb(filename, dir, data); + + if (recursive == EINA_TRUE) { + char *path; + + path = alloca(strlen(dir) + strlen(filename) + 2); + strcpy(path, dir); + strcat(path, "/"); + strcat(path, filename); + + if (!(file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + continue ; + + eina_file_dir_list(path, recursive, cb, data); + } +#ifdef UNICODE + free(filename); +#endif /* UNICODE */ + + } while (FindNextFile(hSearch, &file)); + FindClose(hSearch); +#endif /* _WIN32 */ return EINA_TRUE; } diff --git a/legacy/eina/src/modules/mp/chained_pool/Makefile.am b/legacy/eina/src/modules/mp/chained_pool/Makefile.am index 24723c7a06..06a897e8a0 100644 --- a/legacy/eina/src/modules/mp/chained_pool/Makefile.am +++ b/legacy/eina/src/modules/mp/chained_pool/Makefile.am @@ -1,5 +1,4 @@ -MAINTAINERCLEANFILES = \ -Makefile.in +MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = \ -I. \ @@ -12,6 +11,9 @@ controller_LTLIBRARIES = eina_chained_mempool.la eina_chained_mempool_la_SOURCES = \ eina_chained_mempool.c -eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@ -eina_chained_mempool_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version +eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@ +eina_chained_mempool_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version eina_chained_mempool_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la + +clean-local: + rm -rf *.gcno diff --git a/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am b/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am index 41cdf9e252..3d23b6ec21 100644 --- a/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am +++ b/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am @@ -20,3 +20,6 @@ eina_ememoa_fixed_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -modul eina_ememoa_fixed_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la endif + +clean-local: + rm -rf *.gcno diff --git a/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am b/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am index 96b562a191..5c7dcd0b19 100644 --- a/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am +++ b/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am @@ -20,3 +20,6 @@ eina_ememoa_unknown_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -mod eina_ememoa_unknown_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la endif + +clean-local: + rm -rf *.gcno diff --git a/legacy/eina/src/modules/mp/pass_through/Makefile.am b/legacy/eina/src/modules/mp/pass_through/Makefile.am index 24badd48ee..d2f6522eb5 100644 --- a/legacy/eina/src/modules/mp/pass_through/Makefile.am +++ b/legacy/eina/src/modules/mp/pass_through/Makefile.am @@ -17,3 +17,6 @@ pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version pass_through_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +clean-local: + rm -rf *.gcno +