Below are my notes on what I needed to do to get the Enlightenment
libraries (version 1.7.1 and evil 1.7.0) to build on Windows with
MinGW (www.mingw.org version) and msys.  Am not sure how much can be
incorporated as patches back into the originals, but at least there's
some information for other MinGW users on what they may have to do to
get the latest versions to build on their systems.  Hope some of this
will be useful.

I reset my environment for each build and use automated scripts
(similar to Slackware Slackbuild scripts).  I also have a program to
install tarballs to /usr/local (PREFIX) within msys.  Am just going to
post the highlights not entire scripts.  First thing I had to do after
setting basic environment variables in the scripts was to set
environment variables so it could find pkg-config (
https://github.com/pkgconf/pkgconf ).

export PKG_CONFIG="/usr/local/bin/pkg-config"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

Evil compiled fine with standard options:
./configure --prefix=$PREFIX
make
make install DESTDIR=$DESTDIR

Eina:
patch -p2 < patch.diff
./configure --prefix=$PREFIX
make
make install DESTDIR=$DESTDIR

patch.diff for Eina:
diff -Naurp src/eina-1.7.1/src/lib/eina_file_win32.c
tmp/eina-1.7.1/src/lib/eina_file_win32.c
--- src/eina-1.7.1/src/lib/eina_file_win32.c    2012-09-07 22:33:29 -0400
+++ tmp/eina-1.7.1/src/lib/eina_file_win32.c    
@@ -38,7 +38,14 @@ void *alloca (size_t);
 #endif

 #include <sys/types.h>
+#ifdef __MINGW32__
+#define __MSVCRT_VERSION__ 0x0601
+#endif
 #include <sys/stat.h>
+#ifdef __MINGW32__
+#define stat64 _stat64
+#include <stdint.h>
+#endif

 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
diff -Naurp src/eina-1.7.1/src/lib/eina_inarray.c
tmp/eina-1.7.1/src/lib/eina_inarray.c
--- src/eina-1.7.1/src/lib/eina_inarray.c       2012-09-07 22:33:29 -0400
+++ tmp/eina-1.7.1/src/lib/eina_inarray.c       
@@ -22,6 +22,7 @@

 #include <stdlib.h>
 #include <string.h>
+#include <malloc.h>

 #include "eina_config.h"
 #include "eina_private.h"
diff -Naurp src/eina-1.7.1/src/lib/eina_log.c tmp/eina-1.7.1/src/lib/eina_log.c
--- src/eina-1.7.1/src/lib/eina_log.c   2012-09-07 22:33:29 -0400
+++ tmp/eina-1.7.1/src/lib/eina_log.c   
@@ -28,6 +28,11 @@
 #include <assert.h>
 #include <errno.h>

+#ifndef COMMON_LVB_REVERSE_VIDEO
+#define COMMON_LVB_REVERSE_VIDEO   0x4000
+#define COMMON_LVB_UNDERSCORE      0x8000
+#endif
+
 #if defined HAVE_EXECINFO_H && defined HAVE_BACKTRACE && defined
HAVE_BACKTRACE_SYMBOLS
 # include <execinfo.h>
 # define EINA_LOG_BACKTRACE

Evas:
There was an option in the configure to use liblinebreak, but when I
went to download, it looked like the library was being replaced by
libunibreak ( http://vimgadgets.sourceforge.net/libunibreak/ ).  So, I
built and installed libunibreak and passed the library through the
LIBS environment variable.  Also, pthread doesn't seem to work and I
didn't see a working option to turn threading off, so I did it through
sed.  It couldn't find the evas_engine_common_op_blend_master_sse3
library at one point as well.

export CFLAGS="$CFLAGS -I/usr/local/include/evil-1"
export LIBS="-lpthread -lunibreak $LIBS"
sed -i.bk0 -e "s|-pthread||" configure
./configure --prefix=$PREFIX --disable-pthreads
sed -i.bk1 -e "s|^LDFLAGS = \(.*\)$|LDFLAGS = \1
-Lengines/common/evas_op_blend|" src/lib/Makefile
sed -i.bk2 -e "s|^LIBS =|LIBS =
-levas_engine_common_op_blend_master_sse3|" src/lib/Makefile
make
make install DESTDIR=$DESTDIR

Eet:
Built fine with standard options.
./configure --prefix=$PREFIX
make
make install DESTDIR=$DESTDIR

Embryo:
export CFLAGS="$CFLAGS -I/usr/local/include/evil-1"
./configure --prefix=$PREFIX
make
make install DESTDIR=$DESTDIR

Ecore:
Kept getting errors about it trying to use winsock.h and that it
should be using winsock2.h instead.  Also, _argc and _argv are already
declared in the MinGW headers and the definitions weren't compatible
with those in ecore_getopt.  There's a define for HAVE_WINSOCK2_H in
the code in one location, but no place to turn it on.  (It wasn't an
option in config.h or elsewhere.)

export LIBS="-lgdi32 $LIBS"
patch -p2 < patch.diff
./configure --prefix=$PREFIX
sed -i.bk0 -e "s|_argv|_ecoreargv|" src/lib/ecore/ecore_getopt.c
sed -i.bk1 -e "s|_argc|_ecoreargc|" src/lib/ecore/ecore_getopt.c
sed -i.bk2 -e "s|\/\* #undef const \*\/|\/\* #undef const
\*\/\n#define HAVE_WINSOCK2_H 1|" config.h

patch.diff for ecore:
diff -Naurp src/ecore-1.7.1/src/lib/ecore_con/ecore_con_ssl.c
tmp/ecore-1.7.1/src/lib/ecore_con/ecore_con_ssl.c
--- src/ecore-1.7.1/src/lib/ecore_con/ecore_con_ssl.c   2012-09-07 22:34:01 
-0400
+++ tmp/ecore-1.7.1/src/lib/ecore_con/ecore_con_ssl.c   
@@ -2,6 +2,11 @@
 # include <config.h>
 #endif

+#ifdef HAVE_WS2TCPIP_H
+#include <winsock2.h>
+# include <ws2tcpip.h>
+#endif
+
 #if USE_GNUTLS
 # include <gnutls/gnutls.h>
 # include <gnutls/x509.h>
@@ -12,10 +17,6 @@
 # include <openssl/dh.h>
 #endif

-#ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-
 #include <sys/stat.h>
 #include "Ecore.h"
 #include "ecore_con_private.h"

Edje:
Still do not have edje building and haven't really had time to debug
it further.  I did get as far as the following patch for using lua
5.2.1.  Haven't been able to test the patch.  I used some examples of
replacement code for upgrading lua libraries, so not sure how well it
works.

diff -Naurp src/edje-1.7.1/src/lib/edje_lua2.c
tmp/edje-1.7.1/src/lib/edje_lua2.c
--- src/edje-1.7.1/src/lib/edje_lua2.c  2012-09-07 22:33:23 -0400
+++ tmp/edje-1.7.1/src/lib/edje_lua2.c  
@@ -985,7 +985,11 @@ _elua_messagesend(lua_State *L)  // Stac
         int i, n;
         const char *str;
         luaL_checktype(L, 3, LUA_TTABLE);                    // Stack
usage [-0, +0, v]
+#if LUA_VERSION_NUM > 501
+        n = lua_rawlen(L, 3);
+#else
         n = lua_objlen(L, 3);                                // Stack
usage [-0, +0, -]
+#endif
         emsg = alloca(sizeof(Edje_Message_String_Set) + ((n - 1) *
sizeof(char *)));
         emsg->count = n;
         for (i = 1; i <= n; i ++)
@@ -1003,7 +1007,11 @@ _elua_messagesend(lua_State *L)  // Stac
         Edje_Message_Int_Set *emsg;
         int i, n;
         luaL_checktype(L, 3, LUA_TTABLE);                    // Stack
usage [-0, +0, v]
+#if LUA_VERSION_NUM > 501
+        n = lua_rawlen(L, 3);
+#else
         n = lua_objlen(L, 3);                                // Stack
usage [-0, +0, -]
+#endif
         emsg = alloca(sizeof(Edje_Message_Int_Set) + ((n - 1) * sizeof(int)));
         emsg->count = n;
         for (i = 1; i <= n; i ++)
@@ -1020,7 +1028,11 @@ _elua_messagesend(lua_State *L)  // Stac
         Edje_Message_Float_Set *emsg;
         int i, n;
         luaL_checktype(L, 3, LUA_TTABLE);                    // Stack
usage [-0, +0, v]
+#if LUA_VERSION_NUM > 501
+        n = lua_rawlen(L, 3);
+#else
         n = lua_objlen(L, 3);                                // Stack
usage [-0, +0, -]
+#endif
         emsg = alloca(sizeof(Edje_Message_Float_Set) + ((n - 1) *
sizeof(double)));
         emsg->count = n;
         for (i = 1; i <= n; i ++)
@@ -1057,7 +1069,11 @@ _elua_messagesend(lua_State *L)  // Stac
         const char *str = luaL_checkstring(L, 3);            // Stack
usage [-0, +0, v]
         if (!str) return 0;
         luaL_checktype(L, 4, LUA_TTABLE);                    // Stack
usage [-0, +0, v]
+#if LUA_VERSION_NUM > 501
+        n = lua_rawlen(L, 4);
+#else
         n = lua_objlen(L, 4);                                // Stack
usage [-0, +0, -]
+#endif
         emsg = alloca(sizeof(Edje_Message_String_Int_Set) + ((n - 1)
* sizeof(int)));
         emsg->str = (char *)str;
         emsg->count = n;
@@ -1077,7 +1093,11 @@ _elua_messagesend(lua_State *L)  // Stac
         const char *str = luaL_checkstring(L, 3);            // Stack
usage [-0, +0, v]
         if (!str) return 0;
         luaL_checktype(L, 4, LUA_TTABLE);                    // Stack
usage [-0, +0, v]
+#if LUA_VERSION_NUM > 501
+        n = lua_rawlen(L, 4);
+#else
         n = lua_objlen(L, 4);
+#endif
         emsg = alloca(sizeof(Edje_Message_String_Float_Set) + ((n -
1) * sizeof(double)));
         emsg->str = (char *)str;
         emsg->count = n;
@@ -3734,7 +3754,11 @@ _elua_bogan_protect(lua_State *L)
 {
    lua_pushnil(L);                                   // Stack usage [-0, +1, -]
    luaL_newmetatable(L, "bogan");                    // Stack usage [-0, +1, m]
+#if LUA_VERSION_NUM > 501
+   luaL_setfuncs(L, _elua_bogan_funcs, 0);           // Stack usage [-1, +1, m]
+#else
    luaL_register(L, 0, _elua_bogan_funcs);           // Stack usage [-1, +1, m]
+#endif
    lua_setmetatable(L, -2);                          // Stack usage [-1, +0, -]
    lua_pop(L, 1);                                    // Stack usage [-1, +0, -]
 }
@@ -3746,14 +3770,25 @@ static void
 _elua_add_functions(lua_State *L, const char *api, const luaL_Reg
*funcs, const char *meta, const char *parent, const char *base)  //
Stack usage [-3, +5, m]  if inheriting [-6, +11, em]
 {
    // Create an api table, fill it full of the methods.
+#if LUA_VERSION_NUM > 501
+   lua_newtable(L);
+   luaL_setfuncs (L,funcs,0);
+   lua_pushvalue(L,-1);
+   lua_setglobal(L,api);
+#else
    luaL_register(L, api, funcs);              // Stack usage [-0, +1, m]
+#endif
    // Set the api metatable to the bogan metatable.
    luaL_getmetatable(L, "bogan");             // Stack usage [-0, +1, -]
    lua_setmetatable(L, -2);                   // Stack usage [-1, +0, -]
    // Creat a meta metatable.
    luaL_newmetatable(L, meta);                // Stack usage [-0, +1, m]
    // Put the gc functions in the metatable.
+#if LUA_VERSION_NUM > 501
+   luaL_setfuncs(L, _elua_edje_gc_funcs, 0);           // Stack usage
[-1, +1, m]
+#else
    luaL_register(L, 0, _elua_edje_gc_funcs);  // Stack usage [-1, +1, m]
+#endif
    // Create an __index entry in the metatable, make it point to the api table.
    lua_pushliteral(L, "__index");             // Stack usage [-0, +1, m]
    lua_pushvalue(L, -3);                      // Stack usage [-0, +1, -]
@@ -3826,10 +3861,20 @@ _elua_init(void)
         lua_call(L, 1, 0);
                     // Stack usage [-2, +0, e]
      }

+#if LUA_VERSION_NUM > 501
+   lua_newtable(L);
+   luaL_setfuncs (L,_elua_edje_funcs,0);
+   lua_pushvalue(L,-1);
+   lua_setglobal(L,_elua_edje_api);
+#else
    luaL_register(L, _elua_edje_api, _elua_edje_funcs);
                     // Stack usage [-0, +1, m]
+#endif
    luaL_newmetatable(L, _elua_edje_meta);
                     // Stack usage [-0, +1, m]
+#if LUA_VERSION_NUM > 501
+   luaL_setfuncs(L, _elua_edje_gc_funcs, 0);
+#else
    luaL_register(L, 0, _elua_edje_gc_funcs);
                     // Stack usage [-1, +1, m]
-
+#endif
    _elua_add_functions(L, _elua_evas_api, _elua_evas_funcs,
_elua_evas_meta, NULL, NULL);  // Stack usage [-3, +5, m]

    // weak table for our objects
@@ -3880,11 +3925,22 @@ _edje_lua2_script_init(Edje *ed)

    _elua_bogan_protect(L);                                        //
Stack usage [+3, -3, m]

+#if LUA_VERSION_NUM > 501
+   lua_newtable(L);
+   luaL_setfuncs (L,_elua_edje_funcs,0);
+   lua_pushvalue(L,-1);
+   lua_setglobal(L,_elua_edje_api);
+#else
    luaL_register(L, _elua_edje_api, _elua_edje_funcs);            //
Stack usage [-0, +1, m]
+#endif
    luaL_getmetatable(L, "bogan");                                 //
Stack usage [-0, +1, -]
    lua_setmetatable(L, -2);                                       //
Stack usage [-1, +0, -]
    luaL_newmetatable(L, _elua_edje_meta);                         //
Stack usage [-0, +1, m]
+#if LUA_VERSION_NUM > 501
+   luaL_setfuncs(L, _elua_edje_gc_funcs, 0);
+#else
    luaL_register(L, 0, _elua_edje_gc_funcs);                      //
Stack usage [-1, +1, m]
+#endif

    lua_pop(L, 2);                                                 //
Stack usage [-n, +0, -]

------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to