Hey,
here is a patch for Efreet, so that it compiles on Windows, using Evil. I
had to reorganized the header files and i put only the requested ones in
each source file, because of EAPI nightmare on Windows. It's the cleanest
way to fix that problem.
It compiles on Windows, but the tests are not all "passed" (some are
specifically written for a Unix file system). It's just a matter of
compiling it, for now. My aim being the toolkits, as ewl uses efreet, I'll
fix only the requested part of efreet so that it will work with ewl.
I've not tested it on Linux, can someone test it on that platform ? If it
is good, I'll commit the patch
thank you
Vincent
? efreet.diff
? m4/libtool.m4
? m4/ltoptions.m4
? m4/ltsugar.m4
? m4/ltversion.m4
? m4/lt~obsolete.m4
Index: configure.in
===================================================================
RCS file: /cvs/e/e17/libs/efreet/configure.in,v
retrieving revision 1.21
diff -u -r1.21 configure.in
--- configure.in 19 May 2008 00:07:11 -0000 1.21
+++ configure.in 1 Jun 2008 10:18:23 -0000
@@ -28,7 +28,51 @@
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
AC_SUBST(version_info)
+PKG_PROG_PKG_CONFIG
+
+WIN32_CFLAGS=""
+WIN32_LIBS=""
+lt_no_undefined=""
+lt_enable_auto_import=""
+case "$host_os" in
+ mingw*|cegcc)
+ PKG_CHECK_MODULES([EVIL], [evil])
+ AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
+ dnl needed for correct definition of EAPI
+ AC_DEFINE(EFL_EFREET_BUILD, 1, [Define to mention that efreet
is built])
+ if test "$host_os" = "cegcc" ; then
+ WIN32_CFLAGS="-mwin32"
+ lt_enable_auto_import="-Wl,--enable-auto-import"
+ fi
+ lt_no_undefined="-no-undefined"
+ ;;
+esac
+AC_SUBST(WIN32_CFLAGS)
+AC_SUBST(WIN32_LIBS)
+AC_SUBST(lt_no_undefined)
+AC_SUBST(lt_enable_auto_import)
+
AC_FUNC_ALLOCA
+
+AC_CHECK_HEADERS(arpa/inet.h)
+
+AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure
your CFLAGS environment variable contains include lines for the location of
this file. MinGW users: see the INSTALL file]))
+
+fnmatch_libs=""
+AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
+if test "x$res" = "xno"; then
+ AC_CHECK_LIB(fnmatch, fnmatch, res=yes fnmatch_libs="-lfnmatch", res=no)
+dnl Test for compilation with MinGW.
+dnl fnmatch function is in the libiberty library
+ if test "x$res" = "xno"; then
+ AC_CHECK_LIB(iberty, fnmatch, res=yes fnmatch_libs="-liberty",
res=no)
+ fi
+ if test "x$res" = "xno"; then
+ AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor
libfnmatch, nor libiberty])
+ fi
+fi
+
+AC_SUBST(fnmatch_libs)
PCFLAGS=$CFLAGS
Index: src/bin/Makefile.am
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/bin/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- src/bin/Makefile.am 19 May 2008 00:07:12 -0000 1.9
+++ src/bin/Makefile.am 1 Jun 2008 10:18:23 -0000
@@ -6,18 +6,19 @@
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \
[EMAIL PROTECTED]@ \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
--DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\"
+-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
bin_PROGRAMS = efreet_test efreet_spec_test efreet_cache_test
-efreet_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet.la \
- $(top_builddir)/src/lib/libefreet_mime.la
-efreet_test_LDADD = $(top_builddir)/src/lib/libefreet.la \
- $(top_builddir)/src/lib/libefreet_mime.la \
- @ECORE_LIBS@
+efreet_test_DEPENDENCIES = $(top_builddir)/src/lib/libefreet_mime.la \
+ $(top_builddir)/src/lib/libefreet.la
+efreet_test_LDADD = $(top_builddir)/src/lib/libefreet_mime.la \
+ $(top_builddir)/src/lib/libefreet.la \
+ @ECORE_LIBS@ @EVIL_LIBS@
efreet_test_SOURCES = \
ef_test.h \
ef_data_dirs.c \
Index: src/bin/ef_data_dirs.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/bin/ef_data_dirs.c,v
retrieving revision 1.7
diff -u -r1.7 ef_data_dirs.c
--- src/bin/ef_data_dirs.c 6 Sep 2007 16:15:09 -0000 1.7
+++ src/bin/ef_data_dirs.c 1 Jun 2008 10:18:23 -0000
@@ -1,7 +1,12 @@
-#include "Efreet.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif /* HAVE_EVIL */
+
+#include "Efreet.h"
int
ef_cb_efreet_data_home(void)
Index: src/lib/Efreet.h
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/Efreet.h,v
retrieving revision 1.4
diff -u -r1.4 Efreet.h
--- src/lib/Efreet.h 4 Nov 2007 09:32:35 -0000 1.4
+++ src/lib/Efreet.h 1 Jun 2008 10:18:23 -0000
@@ -24,15 +24,23 @@
* @li Desktop Menu Specification
*/
+#include <Ecore.h>
+#include <Ecore_Data.h>
+
#ifdef EAPI
-#undef EAPI
+# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_EFREET_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_EFREET_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
Index: src/lib/Efreet_Mime.h
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/Efreet_Mime.h,v
retrieving revision 1.9
diff -u -r1.9 Efreet_Mime.h
--- src/lib/Efreet_Mime.h 4 Nov 2007 11:19:55 -0000 1.9
+++ src/lib/Efreet_Mime.h 1 Jun 2008 10:18:23 -0000
@@ -19,14 +19,19 @@
*/
#ifdef EAPI
-#undef EAPI
+# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_EFREET_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_EFREET_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
Index: src/lib/Makefile.am
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/Makefile.am,v
retrieving revision 1.10
diff -u -r1.10 Makefile.am
--- src/lib/Makefile.am 4 Nov 2007 10:28:23 -0000 1.10
+++ src/lib/Makefile.am 1 Jun 2008 10:18:23 -0000
@@ -4,7 +4,8 @@
AM_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir) \
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
lib_LTLIBRARIES = libefreet.la libefreet_mime.la
@@ -46,7 +47,8 @@
installed_headersdir = $(prefix)/include/efreet
installed_headers_DATA = $(EFREETHEADERS) $(EFREETMIMEHEADERS)
-libefreet_la_LIBADD = @ECORE_LIBS@
-libefreet_la_LDFLAGS = -version-info @version_info@
+libefreet_la_LIBADD = @ECORE_LIBS@ @EVIL_LIBS@ @fnmatch_libs@
+libefreet_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info
@version_info@
libefreet_mime_la_LIBADD = @ECORE_LIBS@ libefreet.la
+libefreet_mime_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@
-version-info @version_info@
Index: src/lib/efreet.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet.c,v
retrieving revision 1.7
diff -u -r1.7 efreet.c
--- src/lib/efreet.c 4 Nov 2007 09:32:35 -0000 1.7
+++ src/lib/efreet.c 1 Jun 2008 10:18:23 -0000
@@ -1,6 +1,18 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <Ecore_Str.h>
+
#include "Efreet.h"
#include "efreet_private.h"
+#include "efreet_xml.h"
+#include "efreet_ini.h"
static int init = 0;
static int efreet_parsed_locale = 0;
Index: src/lib/efreet_base.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_base.c,v
retrieving revision 1.5
diff -u -r1.5 efreet_base.c
--- src/lib/efreet_base.c 4 Nov 2007 09:32:35 -0000 1.5
+++ src/lib/efreet_base.c 1 Jun 2008 10:18:23 -0000
@@ -1,4 +1,17 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef HAVE_EVIL
+# include "Evil.h"
+#endif
+
#include "Efreet.h"
#include "efreet_private.h"
@@ -55,9 +68,13 @@
{
if (efreet_home_dir) return efreet_home_dir;
+#ifdef HAVE_EVIL
+ efreet_home_dir = evil_homedir_get();
+#else
efreet_home_dir = getenv("HOME");
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
efreet_home_dir = "/tmp";
+#endif /* ! HAVE_EVIL */
efreet_home_dir = ecore_string_instance(efreet_home_dir);
Index: src/lib/efreet_base.h
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_base.h,v
retrieving revision 1.3
diff -u -r1.3 efreet_base.h
--- src/lib/efreet_base.h 4 Nov 2007 09:32:35 -0000 1.3
+++ src/lib/efreet_base.h 1 Jun 2008 10:18:23 -0000
@@ -12,9 +12,6 @@
* @{
*/
-#include <Ecore.h>
-#include <Ecore_Data.h>
-
EAPI const char *efreet_data_home_get(void);
EAPI Ecore_List *efreet_data_dirs_get(void);
Index: src/lib/efreet_desktop.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_desktop.c,v
retrieving revision 1.38
diff -u -r1.38 efreet_desktop.c
--- src/lib/efreet_desktop.c 18 Mar 2008 04:01:41 -0000 1.38
+++ src/lib/efreet_desktop.c 1 Jun 2008 10:18:24 -0000
@@ -1,4 +1,26 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h> /* for gethostname */
+#endif /* _WIN32 */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#ifdef HAVE_EVIL
+# include "Evil.h"
+#endif
+
+#include <Ecore_File.h>
+#include <Ecore_Str.h>
+
#include "Efreet.h"
#include "efreet_private.h"
@@ -524,8 +546,10 @@
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
char *exec, int remaining __UNUSED__)
{
+#ifndef _WIN32
ecore_exe_run(exec, data);
free(exec);
+#endif
return NULL;
}
Index: src/lib/efreet_icon.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_icon.c,v
retrieving revision 1.30
diff -u -r1.30 efreet_icon.c
--- src/lib/efreet_icon.c 4 Nov 2007 09:32:35 -0000 1.30
+++ src/lib/efreet_icon.c 1 Jun 2008 10:18:25 -0000
@@ -1,4 +1,18 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <dirent.h>
+
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
Index: src/lib/efreet_ini.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_ini.c,v
retrieving revision 1.16
diff -u -r1.16 efreet_ini.c
--- src/lib/efreet_ini.c 29 May 2008 02:00:04 -0000 1.16
+++ src/lib/efreet_ini.c 1 Jun 2008 10:18:25 -0000
@@ -1,4 +1,33 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <ctype.h>
+
+#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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
#include "Efreet.h"
#include "efreet_private.h"
Index: src/lib/efreet_menu.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_menu.c,v
retrieving revision 1.26
diff -u -r1.26 efreet_menu.c
--- src/lib/efreet_menu.c 17 Jan 2008 22:38:46 -0000 1.26
+++ src/lib/efreet_menu.c 1 Jun 2008 10:18:26 -0000
@@ -1,6 +1,20 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <dirent.h>
+
+#include <Ecore_File.h>
+#include <Ecore_Str.h>
+
#include "Efreet.h"
#include "efreet_private.h"
+#include "efreet_xml.h"
/**
* Efreet_Menu_Move
Index: src/lib/efreet_mime.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_mime.c,v
retrieving revision 1.37
diff -u -r1.37 efreet_mime.c
--- src/lib/efreet_mime.c 29 May 2008 02:00:04 -0000 1.37
+++ src/lib/efreet_mime.c 1 Jun 2008 10:18:26 -0000
@@ -1,11 +1,55 @@
/* vim: set sw=4 ts=4 sts=4 et: */
-#include <Efreet.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/mman.h>
+
+#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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#ifdef _WIN32
+# include <winsock2.h> /* for ntohs and al. */
+#endif /* _WIN32 */
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif /* HAVE_EVIL */
+
#include <Ecore_Data.h>
+#include <Ecore_File.h>
+
+#include <Efreet.h>
#include <Efreet_Mime.h>
#include "efreet_private.h"
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/time.h>
static Ecore_List *globs = NULL; /* contains Efreet_Mime_Glob structs */
static Ecore_List *magics = NULL; /* contains Efreet_Mime_Magic structs */
@@ -541,8 +585,10 @@
if (S_ISREG(s.st_mode))
return NULL;
+#ifndef _WIN32
if (S_ISLNK(s.st_mode))
return "inode/symlink";
+#endif /* _WIN32 */
if (S_ISFIFO(s.st_mode))
return "inode/fifo";
@@ -553,8 +599,10 @@
if (S_ISBLK(s.st_mode))
return "inode/blockdevice";
+#ifndef _WIN32
if (S_ISSOCK(s.st_mode))
return "inode/socket";
+#endif /* _WIN32 */
if (S_ISDIR(s.st_mode))
{
Index: src/lib/efreet_private.h
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_private.h,v
retrieving revision 1.12
diff -u -r1.12 efreet_private.h
--- src/lib/efreet_private.h 4 Nov 2007 10:16:02 -0000 1.12
+++ src/lib/efreet_private.h 1 Jun 2008 10:18:26 -0000
@@ -11,31 +11,6 @@
* @{
*/
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <limits.h>
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <Ecore.h>
-#include <Ecore_File.h>
-#include <Ecore_Str.h>
-
-#include "efreet_xml.h"
-#include "efreet_ini.h"
-
/**
* @def NEW(x, c)
* Allocate and zero out c structures of type x
@@ -204,8 +179,6 @@
const char *efreet_lang_modifier_get(void);
size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
-
-const char *efreet_desktop_environment_get(void);
/**
* @}
Index: src/lib/efreet_utils.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_utils.c,v
retrieving revision 1.48
diff -u -r1.48 efreet_utils.c
--- src/lib/efreet_utils.c 3 Dec 2007 16:28:24 -0000 1.48
+++ src/lib/efreet_utils.c 1 Jun 2008 10:18:27 -0000
@@ -1,4 +1,17 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <dirent.h>
+#include <fnmatch.h>
+
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
Index: src/lib/efreet_xml.c
===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_xml.c,v
retrieving revision 1.4
diff -u -r1.4 efreet_xml.c
--- src/lib/efreet_xml.c 6 Sep 2007 16:15:10 -0000 1.4
+++ src/lib/efreet_xml.c 1 Jun 2008 10:18:27 -0000
@@ -1,6 +1,25 @@
/* vim: set sw=4 ts=4 sts=4 et: */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <ctype.h>
+#include <fcntl.h>
+
+#ifdef HAVE_EVIL
+# include "Evil.h"
+#endif
+
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
+#include "efreet_xml.h"
static void efreet_xml_dump(Efreet_Xml *xml, int level);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel