pkgsrc/lang/lua52/patches/patch-ab
dholland 7d313c888d Reimport lang/lua as lang/lua52, and bring back the previous Lua 5.1
package as lang/lua51.

I've adjusted the depends and switched the PKGNAMEs but these packages
are otherwise unchanged. This means that you can't install both at
once. There are preliminary patches for that (see tech-pkg) but they
aren't quite ready yet.

This also doesn't include agc's builtin.mk, although it should be
possible to drop it into the lua51 package with only very minor
modifications. I don't think the builtin packages will allow having
one builtin.mk for both lua51 and lua52, but I'd be happy to be shown
wrong about that.

Add infrastructure support for Lua module packages (including
multiversion support), application packages written in Lua, and a
redirecting bl3.mk file for packages that just link Lua in. This is
based on the Python infrastructure.

The new variable LUA_VERSION_DEFAULT picks which Lua package you get
by default; it is set to 52 so as to maintain the status quo.

Packages can set LUA_VERSIONS_ACCEPTED and/or LUA_VERSIONS_INCOMPATIBLE.
I have found (I think) most or all the packages that don't work with
lua51 and will be marking those; I have not tracked down most of the
ones that don't work with lua52 yet as I was originally intending to
roll back to 5.1 as the default.
2013-10-30 06:18:09 +00:00

74 lines
2.2 KiB
Text

$NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
--- src/Makefile.orig 2012-12-27 10:51:43.000000000 +0000
+++ src/Makefile
@@ -6,8 +6,7 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS+= -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -24,23 +23,28 @@ MYLDFLAGS=
MYLIBS=
MYOBJS=
+.SUFFIXES: .lo
+.c.lo:
+ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) -c $<
+LV= 5:2
+
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua.la
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
LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
-BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+BASE_O= $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) $(MYOBJS:.o=.lo)
LUA_T= lua
-LUA_O= lua.o
+LUA_O= lua.lo
LUAC_T= luac
-LUAC_O= luac.o
+LUAC_O= luac.lo
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
@@ -56,14 +60,13 @@ o: $(ALL_O)
a: $(ALL_A)
$(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
+ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $(BASE_O) -rpath ${PREFIX}/lib -version-info ${LV} ${LIBS}
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ ${LIBTOOL} --tag=CC --mode=link $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ ${LIBTOOL} --tag=CC --mode=link $(CC) -static -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -95,7 +98,7 @@ ansi:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_ANSI"
bsd:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -lreadline -lhistory"
freebsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"