Files
haikuports/dev-lang/lua/patches/lua-5.1.4.patch

93 lines
2.8 KiB
Diff

diff -up lua-5.1.4/Makefile.orig lua-5.1.4/Makefile
--- lua-5.1.4/Makefile.orig 2010-04-27 22:29:15.068419584 -0600
+++ lua-5.1.4/Makefile 2010-04-27 22:29:20.697303040 -0600
@@ -38,12 +38,12 @@ RANLIB= ranlib
# == 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 ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so
TO_MAN= lua.1 luac.1
# Lua version and release.
diff -up lua-5.1.4/src/Makefile.orig lua-5.1.4/src/Makefile
--- lua-5.1.4/src/Makefile.orig 2010-04-27 22:29:26.027787264 -0600
+++ lua-5.1.4/src/Makefile 2010-04-27 22:29:38.680525824 -0600
@@ -20,9 +20,10 @@ MYLIBS=
# == 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 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
@@ -36,7 +37,7 @@ LUAC_T= luac
LUAC_O= luac.o print.o
ALL_O= $(CORE_O) $(LIB_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)
default: $(PLAT)
@@ -57,6 +58,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(MYLDFLAGS) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -95,6 +99,9 @@ freebsd:
generic:
$(MAKE) all MYCFLAGS=
+haiku:
+ $(MAKE) all MYCFLAGS=-DLUA_USE_HAIKU LIBS=
+
linux:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
diff -up lua-5.1.4/src/luaconf.h.orig lua-5.1.4/src/luaconf.h
--- lua-5.1.4/src/luaconf.h.orig 2010-04-27 22:29:48.387448832 -0600
+++ lua-5.1.4/src/luaconf.h 2010-04-27 22:29:58.184025088 -0600
@@ -33,6 +33,13 @@
#define LUA_WIN
#endif
+#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 */
@@ -94,7 +101,11 @@
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
-#define LUA_ROOT "/usr/local/"
+# if defined(LUA_USE_HAIKU)
+# define LUA_ROOT "/boot/common/"
+# else
+# define LUA_ROOT "/usr/local/"
+# endif
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \