83 lines
2.4 KiB
Text
83 lines
2.4 KiB
Text
$NetBSD: patch-ab,v 1.5 2015/12/29 23:34:51 dholland Exp $
|
|
|
|
Configure for pkgsrc.
|
|
Use libtool.
|
|
Install by Lua version so multiple versions can coexist.
|
|
Use readline.
|
|
|
|
--- src/Makefile.orig 2013-11-11 11:45:49.000000000 +0000
|
|
+++ src/Makefile
|
|
@@ -6,9 +6,8 @@
|
|
# Your platform. See PLATS for possible values.
|
|
PLAT= none
|
|
|
|
-CC= gcc
|
|
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
|
|
-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
|
|
+CFLAGS+= -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
|
|
+LDFLAGS+= $(SYSLDFLAGS) $(MYLDFLAGS)
|
|
LIBS= -lm $(SYSLIBS) $(MYLIBS)
|
|
|
|
AR= ar rcu
|
|
@@ -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= liblua5.2.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_T= lua5.2
|
|
+LUA_O= lua.lo
|
|
|
|
-LUAC_T= luac
|
|
-LUAC_O= luac.o
|
|
+LUAC_T= luac5.2
|
|
+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) -no-undefined $(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"
|