Skip to content

Instantly share code, notes, and snippets.

@dawidd6
Created December 4, 2020 19:56

Revisions

  1. dawidd6 created this gist Dec 4, 2020.
    47 changes: 47 additions & 0 deletions lua-5.3.6.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    diff --git a/Makefile b/Makefile
    index 7fa91c8..dccf485 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -52,7 +52,7 @@ R= $V.0
    all: $(PLAT)

    $(PLATS) clean:
    - cd src && $(MAKE) $@
    + cd src && $(MAKE) $@ V=$(V) R=$(R)

    test: dummy
    src/lua -v
    diff --git a/src/Makefile b/src/Makefile
    index 2e7a412..fa5769f 100644
    --- a/src/Makefile
    +++ b/src/Makefile
    @@ -29,6 +29,7 @@ MYOBJS=
    PLATS= aix bsd c89 freebsd generic 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_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.
    @@ -59,6 +60,12 @@ $(LUA_A): $(BASE_O)
    $(AR) $@ $(BASE_O)
    $(RANLIB) $@

    +$(LUA_SO): $(CORE_O) $(LIB_O)
    + $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
    + ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
    + ln -sf $(LUA_SO).$(R) $(LUA_SO)
    +
    +
    $(LUA_T): $(LUA_O) $(LUA_A)
    $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)