* define EAPI on Windows according to the following scheme:
authordoursse <doursse>
Sat, 8 Mar 2008 07:28:12 +0000 (07:28 +0000)
committerdoursse <doursse@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 8 Mar 2008 07:28:12 +0000 (07:28 +0000)
   - 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

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/e17/libs/eet@33959 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

INSTALL
configure.in
src/lib/Eet.h
src/lib/Eet_private.h
src/lib/Makefile.am
src/lib/eet_data.c
src/lib/eet_dictionary.c
src/lib/eet_image.c
src/lib/eet_lib.c
src/lib/eet_memfile.c
src/lib/eet_utils.c

diff --git a/INSTALL b/INSTALL
index 61f792e..97806b2 100644 (file)
--- a/INSTALL
+++ b/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
index ac51bf8..f8b5aed 100644 (file)
@@ -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"))
index 01ddbdc..aebcbc5 100644 (file)
@@ -4,14 +4,19 @@
 #include <stdlib.h>
 
 #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" {
index 8480230..055fed3 100644 (file)
@@ -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 <config.h>
-
 #include <stdio.h>
 #include <unistd.h>
 #include <limits.h>
index 95d4ca4..588502a 100644 (file)
@@ -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@
index 3a0313c..9f370f8 100644 (file)
@@ -1,5 +1,13 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include <math.h>
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>  /* so that EAPI in Eet.h is correctly defined */
+#endif
+
 #include "Eet.h"
 #include "Eet_private.h"
 
index 792158f..18a3f36 100644 (file)
@@ -1,5 +1,13 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include <math.h>
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>  /* so that EAPI in Eet.h is correctly defined */
+#endif
+
 #include "Eet.h"
 #include "Eet_private.h"
 
index 6b1eac5..014c08a 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>  /* so that EAPI in Eet.h is correctly defined */
+#endif
+
 #include "Eet.h"
 #include "Eet_private.h"
 
index bec5fd7..4a8b235 100644 (file)
@@ -2,6 +2,10 @@
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>  /* so that EAPI in Eet.h is correctly defined */
+#endif
+
 #include "Eet.h"
 #include "Eet_private.h"
 
index 59c7e2f..7dd5a44 100644 (file)
@@ -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 <config.h>  /* so that EAPI in Eet.h is correctly defined */
+#endif
+
 #include "Eet.h"
 #include "Eet_private.h"
 
index 7edc31d..f2bce76 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
 #include <stdio.h>
 #include <math.h>
 
@@ -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;