[En-Nut-Discussion] Nut/OS 4.8

Thiago A. Corrêa thiago.correa at gmail.com
Mon Mar 9 20:28:00 CET 2009


On Mon, Mar 9, 2009 at 3:51 PM, Harald Kipp <harald.kipp at egnite.de> wrote:
> Ole Reinhardt wrote:
>>> But I think I found a way to fix the nutconfigure compile under
>>> gentoo, by using pkg-config.
>
>> We shoudl definately use pkg-config if it's not yet done.
>
> After doing some evaluation I see, that pkg-config supports all major
> platforms including OS-X. Looks like a good solution to me.
>

I just found that wxWidgets doesn't show up in pkg-config --list :(
But at least look like this is something else, I really don't have
wx/frame.h. Wonder which package I need to install.

Anyway, for lua, what I did was this (below).
I don't have other platforms to test besides Gentoo.

Index: configure.ac
===================================================================
RCS file: /cvsroot/ethernut/nut/configure.ac,v
retrieving revision 1.46
diff -u -r1.46 configure.ac
--- configure.ac        9 Mar 2009 08:28:03 -0000       1.46
+++ configure.ac        9 Mar 2009 19:25:18 -0000
@@ -296,27 +296,20 @@
       AC_MSG_WARN([Lua $lua_ver is too old.])
       lua_ok=no
     else
-      AC_SEARCH_LIBS([lua_open], [lua lua50], [lua_ok="yes"], [lua_ok="no"])
-      AC_SEARCH_LIBS([luaL_loadfile], [lualib lualib50],,
[lua_ok="no"],[-lm -ldl])
-      if test "x$lua_ok" = "xno"; then
+      for i in lua lua5.1; do
+        PKG_CHECK_MODULES(LUA, [$i], [lua_ok="yes"], [ false ])
+      done
+
+      if test "x$lua_ok" != "xyes"; then
         AC_MSG_WARN([Lua library missing, will not build configuration tools.])
-      else
-        AC_CHECK_HEADERS(/usr/include/lua50/lua.h,
AC_SUBST(LUA_HEADERS, "/usr/include/lua50"))
-        AC_CHECK_HEADERS(/usr/local/include/lua50/lua.h,
AC_SUBST(LUA_HEADERS, "/usr/local/include/lua50"))
-        AC_CHECK_HEADERS(/usr/local/include/lua.h,
AC_SUBST(LUA_HEADERS, "/usr/local/include"))
-        AC_CHECK_HEADERS(/usr/include/lua.h, AC_SUBST(LUA_HEADERS,
"/usr/include"))
       fi
+
 #    AC_CHECK_FUNC(sin, LIBS=$LIBS, LIBS="-lm $LIBS")
 #    AC_CHECK_LIB(dl, dlopen)
     fi
   fi
 fi

-if test "x$LUA_HEADERS" = "x"; then
-   AC_MSG_WARN(Lua Headers not found disabled)
-   lua_ok=no
-fi
-
 # END lua #################################################################################################
 # nutconfigure
############################################################################################
 if test "x$enable_nutconf_tools" = "xno"; then
Index: tools/nutconf/Makefile.am
===================================================================
RCS file: /cvsroot/ethernut/nut/tools/nutconf/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- tools/nutconf/Makefile.am   18 Jul 2007 11:44:23 -0000      1.8
+++ tools/nutconf/Makefile.am   9 Mar 2009 19:25:18 -0000
@@ -104,12 +104,13 @@
 bitmaps/save.xpm bitmaps/save_large.xpm \
 bitmaps/search.xpm bitmaps/search_large.xpm
 nutconf_CXXFLAGS = @WX_CXXFLAGS@
-nutconf_CPPFLAGS = -I$(LUA_HEADERS)
-nutconf_LDADD = $(WX_LIBS)
+nutconf_CPPFLAGS = $(LUA_CFLAGS)
+nutconf_LDADD = $(WX_LIBS) $(LUA_LIBS)

 endif

 nutconfigure_SOURCES = nutcomponent.c nutcomponent.h
-nutconfigure_CPPFLAGS = -DNUT_CONFIGURE_EXEC -I$(LUA_HEADERS)
+nutconfigure_CPPFLAGS = -DNUT_CONFIGURE_EXEC $(LUA_CFLAGS)
+nutconfigure_LDADD = $(LUA_LIBS)

 endif



More information about the En-Nut-Discussion mailing list