From bb32035399e1d1d88f1e03b5adb133ba55357e11 Mon Sep 17 00:00:00 2001 From: doursse Date: Sat, 8 Mar 2008 07:28:12 +0000 Subject: [PATCH] * define EAPI on Windows according to the following scheme: - if Eet is built: . if the shared lib is built, EAPI must be __declspec(dllexport) . if the static lib is built, EAPI must be empty - otherwise EAPI must be __declspec(dllimport) * move config.h from Eet_private.h to source files so that EAPI is correctly defined in Eet.h * add notes for compilation with cegcc and mingw32ce in INSTALL * add support for compilation with cegcc * add indentation information for vi * remove trailing spaces SVN revision: 33959 --- legacy/eet/INSTALL | 28 +++++++++++++++++++++++++--- legacy/eet/configure.in | 19 ++++++++++++++++--- legacy/eet/src/lib/Eet.h | 15 ++++++++++----- legacy/eet/src/lib/Eet_private.h | 6 ++++-- legacy/eet/src/lib/Makefile.am | 3 ++- legacy/eet/src/lib/eet_data.c | 8 ++++++++ legacy/eet/src/lib/eet_dictionary.c | 8 ++++++++ legacy/eet/src/lib/eet_image.c | 8 ++++++++ legacy/eet/src/lib/eet_lib.c | 4 ++++ legacy/eet/src/lib/eet_memfile.c | 8 ++++++++ legacy/eet/src/lib/eet_utils.c | 10 +++++++--- 11 files changed, 100 insertions(+), 17 deletions(-) diff --git a/legacy/eet/INSTALL b/legacy/eet/INSTALL index 61f792e143..97806b21b8 100644 --- a/legacy/eet/INSTALL +++ b/legacy/eet/INSTALL @@ -2,9 +2,9 @@ COMPILING and INSTALLING: If you got a official release tar archive do: ./configure - + ( otherwise if you got this from enlightenment cvs do: ./autogen.sh ) - + Then to compile: make @@ -13,7 +13,29 @@ To install (run this as root, or the user who handles installs): NOTE: You MUST make install Eet for it to run properly. -NOTE: for compilation with MinGW, fnmatch.h is probably missing. +NOTE: For compilation with MinGW, fnmatch.h is probably missing. That file can be found here: http://www.koders.com/c/fid2B518462CB1EED3D4E31E271DB83CD1582F6EEBE.aspx It should be installed in the mingw include directory. + +NOTE: For compilation with mingw32ce, run configure with the option + +--host=arm-wince-mingw32ce + +NOTE: For compilation with cegcc, you have to do the following steps: + +1) After having run autogen.sh, add in config.sub file: + + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + +after the mingw32ce case + +2) in config.sub, add -cegcc* after -pe*. You should have a line like: + | -cygwin* | -pe* | -cegcc* | -psos* | -moss* | -proelf* | -rtems* \ + +3) run configure with the option + +--host=arm-wince-cegcc diff --git a/legacy/eet/configure.in b/legacy/eet/configure.in index ac51bf88fe..f8b5aed5f6 100644 --- a/legacy/eet/configure.in +++ b/legacy/eet/configure.in @@ -30,17 +30,30 @@ AC_SUBST(version_info) AC_FUNC_ALLOCA -win32_libs="" +WIN32_CFLAGS="" +WIN32_LIBS="" create_shared_lib="" case "$host_os" in mingw|mingw32) PKG_CHECK_MODULES([EVIL], [evil]) AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed]) - win32_libs="-lws2_32" + dnl needed for correct definition of EAPI + AC_DEFINE(EFL_EET_BUILD, 1, [Define to mention that eet is built]) + WIN32_LIBS="-lws2_32" + create_shared_lib="-no-undefined " + ;; + 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_EET_BUILD, 1, [Define to mention that eet is built]) + WIN32_CFLAGS="-mwin32" + WIN32_LIBS="-lws2" create_shared_lib="-no-undefined " ;; esac -AC_SUBST(win32_libs) +AC_SUBST(WIN32_CFLAGS) +AC_SUBST(WIN32_LIBS) AC_SUBST(create_shared_lib) AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")) diff --git a/legacy/eet/src/lib/Eet.h b/legacy/eet/src/lib/Eet.h index 01ddbdcb15..aebcbc514c 100644 --- a/legacy/eet/src/lib/Eet.h +++ b/legacy/eet/src/lib/Eet.h @@ -4,14 +4,19 @@ #include #ifdef EAPI -#undef EAPI +# undef EAPI #endif + #ifdef _WIN32 -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) +# ifdef EFL_EET_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif /* ! DLL_EXPORT */ # else # define EAPI __declspec(dllimport) -# endif +# endif /* ! EFL_EET_BUILD */ #else # ifdef __GNUC__ # if __GNUC__ >= 4 @@ -22,7 +27,7 @@ # else # define EAPI # endif -#endif +#endif /* ! _WIN32 */ #ifdef __cplusplus extern "C" { diff --git a/legacy/eet/src/lib/Eet_private.h b/legacy/eet/src/lib/Eet_private.h index 8480230894..055fed3252 100644 --- a/legacy/eet/src/lib/Eet_private.h +++ b/legacy/eet/src/lib/Eet_private.h @@ -1,8 +1,10 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #ifndef _EET_PRIVATE_H #define _EET_PRIVATE_H -#include - #include #include #include diff --git a/legacy/eet/src/lib/Makefile.am b/legacy/eet/src/lib/Makefile.am index 95d4ca4c56..588502a49c 100644 --- a/legacy/eet/src/lib/Makefile.am +++ b/legacy/eet/src/lib/Makefile.am @@ -7,6 +7,7 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@WIN32_CFLAGS@ \ @EVIL_CFLAGS@ lib_LTLIBRARIES = libeet.la @@ -20,6 +21,6 @@ eet_dictionary.c \ eet_utils.c \ Eet_private.h -libeet_la_LIBADD = @EVIL_LIBS@ -lz -ljpeg @fnmatch_libs@ @win32_libs@ -lm +libeet_la_LIBADD = @EVIL_LIBS@ @WIN32_LIBS@ -lz -ljpeg @fnmatch_libs@ -lm libeet_la_DEPENDENCIES = $(top_builddir)/config.h libeet_la_LDFLAGS = @create_shared_lib@ -version-info @version_info@ diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c index 3a0313cd95..9f370f8f7d 100644 --- a/legacy/eet/src/lib/eet_data.c +++ b/legacy/eet/src/lib/eet_data.c @@ -1,5 +1,13 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #include +#ifdef HAVE_CONFIG_H +# include /* so that EAPI in Eet.h is correctly defined */ +#endif + #include "Eet.h" #include "Eet_private.h" diff --git a/legacy/eet/src/lib/eet_dictionary.c b/legacy/eet/src/lib/eet_dictionary.c index 792158f8f9..18a3f36554 100644 --- a/legacy/eet/src/lib/eet_dictionary.c +++ b/legacy/eet/src/lib/eet_dictionary.c @@ -1,5 +1,13 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #include +#ifdef HAVE_CONFIG_H +# include /* so that EAPI in Eet.h is correctly defined */ +#endif + #include "Eet.h" #include "Eet_private.h" diff --git a/legacy/eet/src/lib/eet_image.c b/legacy/eet/src/lib/eet_image.c index 6b1eac5665..014c08ae7a 100644 --- a/legacy/eet/src/lib/eet_image.c +++ b/legacy/eet/src/lib/eet_image.c @@ -1,3 +1,11 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + +#ifdef HAVE_CONFIG_H +# include /* so that EAPI in Eet.h is correctly defined */ +#endif + #include "Eet.h" #include "Eet_private.h" diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c index bec5fd79cf..4a8b235da8 100644 --- a/legacy/eet/src/lib/eet_lib.c +++ b/legacy/eet/src/lib/eet_lib.c @@ -2,6 +2,10 @@ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ +#ifdef HAVE_CONFIG_H +# include /* so that EAPI in Eet.h is correctly defined */ +#endif + #include "Eet.h" #include "Eet_private.h" diff --git a/legacy/eet/src/lib/eet_memfile.c b/legacy/eet/src/lib/eet_memfile.c index 59c7e2fc4c..7dd5a447df 100644 --- a/legacy/eet/src/lib/eet_memfile.c +++ b/legacy/eet/src/lib/eet_memfile.c @@ -1,5 +1,13 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +# include /* so that EAPI in Eet.h is correctly defined */ +#endif + #include "Eet.h" #include "Eet_private.h" diff --git a/legacy/eet/src/lib/eet_utils.c b/legacy/eet/src/lib/eet_utils.c index 7edc31d582..f2bce7667c 100644 --- a/legacy/eet/src/lib/eet_utils.c +++ b/legacy/eet/src/lib/eet_utils.c @@ -1,3 +1,7 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #include #include @@ -7,7 +11,7 @@ _eet_hash_gen(const char *key, int hash_size) int hash_num = 0; int value, i; unsigned char *ptr; - + const int masks[9] = { 0x00, @@ -20,10 +24,10 @@ _eet_hash_gen(const char *key, int hash_size) 0x7f, 0xff }; - + /* no string - index 0 */ if (!key) return 0; - + /* calc hash num */ for (i = 0, ptr = (unsigned char *)key, value = (int)(*ptr); value;