forked from enlightenment/efl
* fix compilation on Windows
* improve a bit autotools SVN revision: 35761
This commit is contained in:
parent
d73b8c5d7b
commit
d722648292
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
#endif /* ! _WIN2 */
|
||||
#endif /* _WIN2 */
|
||||
|
||||
#include "eina_counter.h"
|
||||
#include "eina_inlist.h"
|
||||
|
|
|
@ -20,12 +20,21 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
# define _GNU_SOURCE
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <unistd.h>
|
||||
# include <dirent.h>
|
||||
#else
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# include <Evil.h>
|
||||
#endif /* _WIN2 */
|
||||
|
||||
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue