From cb7c92bdacd0d801b564741a1b456283e1bcd243 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Mon, 5 May 2014 15:59:15 +0000 Subject: import patch from 5.2.1 diff --git a/Makefile b/Makefile index 8efa2eb..ff139c0 100644 --- a/Makefile +++ b/Makefile @@ -36,12 +36,12 @@ RM= rm -f # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris +PLATS= guess aix bsd c89 freebsd generic ios haiku linux linux-readline 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. @@ -52,7 +52,7 @@ R= $V.6 all: $(PLAT) $(PLATS) help test clean: - @cd src && $(MAKE) $@ + @cd src && $(MAKE) V=$(V) $@ install: dummy cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) diff --git a/src/Makefile b/src/Makefile index b771196..9c5ff15 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,7 +30,7 @@ CMCFLAGS= # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= -PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris +PLATS= guess aix bsd c89 freebsd generic ios haiku linux linux-readline macosx mingw posix solaris LUA_A= liblua.a 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 @@ -44,7 +44,7 @@ LUAC_T= luac 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. @@ -66,6 +66,9 @@ $(LUA_T): $(LUA_O) $(LUA_A) $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS) + test: ./$(LUA_T) -v @@ -117,6 +120,9 @@ FreeBSD NetBSD OpenBSD freebsd: generic: $(ALL) +haiku: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_HAIKU -DLUA_USE_POSIX" LIBS= + ios: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_IOS" diff --git a/src/luaconf.h b/src/luaconf.h index 137103e..73951a0 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -75,6 +75,12 @@ #define LUA_USE_DLOPEN #endif +#if defined(LUA_USE_HAIKU) +#define LUA_USE_MKSTEMP +#define LUA_USE_ISATTY +#define LUA_USE_POPEN +#define LUA_USE_DLOPEN +#endif /* @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. @@ -223,8 +229,12 @@ #else /* }{ */ +#ifndef LUA_ROOT #define LUA_ROOT "/usr/local/" +#endif +#ifndef LUA_LDIR #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" +#endif #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" #if !defined(LUA_PATH_DEFAULT) -- 2.39.2 From 36473ed9d445326d7215198ceb970e1fb540b76c Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 6 Jul 2023 10:28:47 -0600 Subject: enable readline support on Haiku diff --git a/src/Makefile b/src/Makefile index 9c5ff15..f2a74ab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -121,7 +121,7 @@ FreeBSD NetBSD OpenBSD freebsd: generic: $(ALL) haiku: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_HAIKU -DLUA_USE_POSIX" LIBS= + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_HAIKU -DLUA_USE_POSIX -DLUA_USE_READLINE" SYSLIBS="-lreadline" ios: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_IOS" -- 2.39.2