diff -urb --exclude configure monotone-0.3/ChangeLog monotone-0.3-patched/ChangeLog --- monotone-0.3/ChangeLog 2003-08-25 15:16:21.000000000 -0700 +++ monotone-0.3-patched/ChangeLog 2003-08-31 03:15:34.000000000 -0700 @@ -1,1 +1,9 @@ +2003-08-31 Nathaniel Smith + + * configure.ac: Check for lua40/lua.h, lua40/lualib.h and -llua40, + -lliblua40. + * config.h.in: Add LUA_H, LIBLUA_H templates, remove HAVE_LIBLUA, + HAVE_LIBLUALIB templates. + * lua.cc: Include config.h. Use LUA_H, LIBLUA_H macros. + diff -urb --exclude configure monotone-0.3/config.h.in monotone-0.3-patched/config.h.in --- monotone-0.3/config.h.in 2003-08-25 14:13:04.000000000 -0700 +++ monotone-0.3-patched/config.h.in 2003-08-31 01:40:07.000000000 -0700 @@ -24,12 +24,6 @@ /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL -/* Define to 1 if you have the `lua' library (-llua). */ -#undef HAVE_LIBLUA - -/* Define to 1 if you have the `lualib' library (-llualib). */ -#undef HAVE_LIBLUALIB - /* Define to 1 if you have the `popt' library (-lpopt). */ #undef HAVE_LIBPOPT @@ -101,6 +95,12 @@ slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK +/* Location of lualib.h */ +#undef LUALIB_H + +/* Location of lua.h */ +#undef LUA_H + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O diff -urb --exclude configure monotone-0.3/configure.ac monotone-0.3-patched/configure.ac --- monotone-0.3/configure.ac 2003-08-25 14:11:36.000000000 -0700 +++ monotone-0.3-patched/configure.ac 2003-08-31 01:38:05.000000000 -0700 @@ -86,15 +86,30 @@ # simple library checks AC_CHECK_LIB([dl], [dlsym]) -AC_CHECK_LIB([lua], [lua_open]) -AC_CHECK_LIB([lualib], [lua_strlibopen], , ,[-llua]) -AC_CHECK_LIB([popt], [poptGetArg]) +AC_CHECK_LIB([popt], [poptGetArg], , AC_MSG_FAILURE([popt is required])) AC_CHECK_LIB([pthread], [pthread_attr_init]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/file.h sys/socket.h sys/time.h termios.h unistd.h]) +# Check for Lua libraries: +AC_SEARCH_LIBS([lua_open], [lua40 lua], , AC_MSG_FAILURE([lua is required])) +AC_SEARCH_LIBS([lua_strlibopen], [lualib40 lualib], + , + AC_MSG_FAILURE([lualib is required])) +# And check for Lua headers: +AC_CHECK_HEADER([lua40/lua.h], + [AC_DEFINE([LUA_H], [], [Location of lua.h])], + [AC_CHECK_HEADER([lua.h], + [AC_DEFINE([LUA_H], [])], + [AC_MSG_FAILURE([lua header not found])])]) +AC_CHECK_HEADER([lua40/lualib.h], + [AC_DEFINE([LUALIB_H], [], [Location of lualib.h])], + [AC_CHECK_HEADER([lualib.h], + [AC_DEFINE([LUALIB_H], [])], + [AC_MSG_FAILURE([lualib header not found])])]) + # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST diff -urb --exclude configure monotone-0.3/lua.cc monotone-0.3-patched/lua.cc --- monotone-0.3/lua.cc 2003-08-24 18:53:46.000000000 -0700 +++ monotone-0.3-patched/lua.cc 2003-08-31 01:40:31.000000000 -0700 @@ -3,9 +3,11 @@ // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details +#include "config.h" + extern "C" { -#include -#include +#include LUA_H +#include LUALIB_H } #include