[En-Nut-Discussion] configure.ac and finding the lua includes

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu Nov 27 13:59:59 CET 2008


Hallo,

running on Opensuse11.0 with lua-50, wxwidgets-devel etc installed, I
stumbled about nutconf not finding wx/setup.h  in /usr/lib64/wx.

After many fiddling around, I took a close look at the compilation line for
nutconf.cpp:
g++ -DHAVE_CONFIG_H -I. -I../..  -I  \
-I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 \
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -MT\
 nutconf-nutconf.o -MD -MP -MF .deps/nutconf-nutconf.Tpo -c -o \
nutconf-nutconf.o `test -f 'nutconf.cpp' || echo './'`nutconf.cpp

where you see a dangling -I  -I/usr/lib64/wx/include/gtk...

Looking further, this is caused by the Header check for the lua headers. It
doesn't cope with Opensuse installing lua.h in /usr/include and creates an
empty $LUA_HEADERS.

Appended patch checks and warns about an empty $LUA_HEADERS and also looks
in more places. Patch is against to 4.6.4, but also applies to 4.7.4.

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

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Changelog:
Check for empty $LUA_HEADERS and look in more places
--- ethernut-4.6.4/configure.ac~	2008-10-04 19:38:36.000000000 +0200
+++ ethernut-4.6.4/configure.ac	2008-11-27 13:44:00.000000000 +0100
@@ -279,12 +279,19 @@
       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



More information about the En-Nut-Discussion mailing list