[En-Nut-Discussion] More Compiling 4.3.1 on Suse 10.2

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Mar 12 14:58:00 CET 2007


Hallo,

fiddling again to compile on Suse10.2
-- Regarding lua50/51:
Lua 51 only defines 
#define lua_open()      luaL_newstate()
So configure shouldn't check for lua_open(), especially as lua_open() isn't
used in ths sources. I replaced it with a check for
      AC_SEARCH_LIBS([luaL_openlibs], [lua lua50], [nutconf_tools_ok="yes"], [nutconf_tools_ok="no"])

and configure recognizes lua().


luaopen_loadlib is replaces by package.loadlib in 5.1. From the first google
hits for 'lua" and "package.loadlib"  I decides to replace the code like:
--- ./tools/nutconf/nutcomponent.c.~1.26.~      2007-02-15 20:33:45.000000000 +0100
+++ ./tools/nutconf/nutcomponent.c      2007-03-12 13:43:17.000000000 +0100
@@ -1019,7 +1019,9 @@
             lua_settop(repo->nr_ls, 0);
             luaopen_debug(repo->nr_ls);
             lua_settop(repo->nr_ls, 0);
-            luaopen_loadlib(repo->nr_ls);
+           lua_pushcfunction(repo->nr_ls, luaopen_package);
+           lua_pushliteral(repo->nr_ls, "package");
+           lua_call(repo->nr_ls, 1, 0 );
             lua_settop(repo->nr_ls, 0);
 
             /*

-- Usage of the VERSION macro in nutconf.cpp
I replace _T(VERSION) with wxT(VERSION)

-- The problem with the missing "EndsWith" member of the wxString class I
   worked araound by using the old code for wxDirTraverseResult OnDir() with
   IsSameAs(0 instead of EndsWith

-- Next problem:
repoptdlg.cpp: In member function ‘void CRepositoryOptionsDialog::OnBrowseRepositoryFile(wxCommandEvent&)’:
repoptdlg.cpp:125: error: ‘wxFD_OPEN’ was not declared in this scope

Is seems that ethernut now requires wxWidget 2.8 and wxFD_Open is a feature
of 2.8. To compiled with  earlier versions I used:

--- ./tools/nutconf/repoptdlg.cpp.~1.6.~        2007-02-15 20:33:45.000000000 +0100
+++ ./tools/nutconf/repoptdlg.cpp       2007-03-12 14:52:02.000000000 +0100
@@ -121,6 +121,11 @@
 {
     wxFileName fname(m_entryPath->GetValue());
 
+    // For compatibility with older wxWidgets versions (pre 2.8)
+#if (wxMINOR_VERSION < 8)
+# define wxFD_OPEN wxOPEN
+#endif
+ 
     wxFileDialog dlg(this, wxT("Choose a repository file"), fname.GetPath(), fname.GetFullName(), 
         wxT("Nut/OS Repository (*.nut)|*.nut"), wxFD_OPEN);
 

Now "mae" terminates successfully.

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list