diff -ru lua-5.2.1/Makefile lua-5.2.1.patched/Makefile --- lua-5.2.1/Makefile 2012-05-17 16:05:54.032768000 +0200 +++ lua-5.2.1.patched/Makefile 2012-08-12 16:50:24.994574336 +0200 @@ -36,12 +36,12 @@ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris +PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris # What to install. TO_BIN= lua luac TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp -TO_LIB= liblua.a +TO_LIB= liblua.a liblua.so TO_MAN= lua.1 luac.1 # Lua version and release. diff -ru lua-5.2.1/src/luaconf.h lua-5.2.1.patched/src/luaconf.h --- lua-5.2.1/src/luaconf.h 2012-05-11 16:14:42.025690112 +0200 +++ lua-5.2.1.patched/src/luaconf.h 2012-08-12 16:56:30.385875968 +0200 @@ -40,6 +40,13 @@ +#if defined(LUA_USE_HAIKU) +#define LUA_USE_MKSTEMP +#define LUA_USE_ISATTY +#define LUA_USE_POPEN +#define LUA_USE_DLOPEN +#endif + #if defined(LUA_USE_LINUX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ @@ -100,7 +107,11 @@ #else /* }{ */ #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/" +#if defined(LUA_USE_HAIKU) +#define LUA_ROOT "/boot/common/" +#else #define LUA_ROOT "/usr/local/" +#endif #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR #define LUA_PATH_DEFAULT \ diff -ru lua-5.2.1/src/Makefile lua-5.2.1.patched/src/Makefile --- lua-5.2.1/src/Makefile 2012-03-09 17:32:16.029884416 +0100 +++ lua-5.2.1.patched/src/Makefile 2012-08-12 16:52:43.662437888 +0200 @@ -26,9 +26,10 @@ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris +PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris LUA_A= liblua.a +LUA_SO= liblua.so CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ ltm.o lundump.o lvm.o lzio.o @@ -43,7 +44,7 @@ LUAC_O= luac.o ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) ALL_A= $(LUA_A) # Targets start here. @@ -65,6 +66,9 @@ $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS) + clean: $(RM) $(ALL_T) $(ALL_O) @@ -102,6 +106,9 @@ generic: $(ALL) +haiku: + $(MAKE) all MUCFLAGS=-DLUA_USE_HAIKU LIBS= + linux: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"