lua-5.2.4-shared_library-1.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Submitted By: Igor Živković <contact at igor hyphen zivkovic dot from dot hr>
  2. Date: 2013-06-19
  3. Initial Package Version: 5.2.2
  4. Upstream Status: Rejected
  5. Origin: Arch Linux packages repository
  6. Description: Adds the compilation of a shared library.
  7. diff -Naur lua-5.2.2.orig/Makefile lua-5.2.2/Makefile
  8. --- lua-5.2.2.orig/Makefile 2012-05-17 16:05:54.000000000 +0200
  9. +++ lua-5.2.2/Makefile 2013-06-19 20:04:12.338167412 +0200
  10. @@ -52,7 +52,7 @@
  11. all: $(PLAT)
  12. $(PLATS) clean:
  13. - cd src && $(MAKE) $@
  14. + cd src && $(MAKE) $@ V=$(V) R=$(R)
  15. test: dummy
  16. src/lua -v
  17. diff -Naur lua-5.2.2.orig/src/Makefile lua-5.2.2/src/Makefile
  18. --- lua-5.2.2.orig/src/Makefile 2012-12-27 11:51:43.000000000 +0100
  19. +++ lua-5.2.2/src/Makefile 2013-06-19 20:04:40.924213226 +0200
  20. @@ -7,7 +7,7 @@
  21. PLAT= none
  22. CC= gcc
  23. -CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
  24. +CFLAGS= -fPIC -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
  25. LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
  26. LIBS= -lm $(SYSLIBS) $(MYLIBS)
  27. @@ -29,6 +29,7 @@
  28. PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
  29. LUA_A= liblua.a
  30. +LUA_SO= liblua.so
  31. CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
  32. lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
  33. ltm.o lundump.o lvm.o lzio.o
  34. @@ -43,7 +44,7 @@
  35. LUAC_O= luac.o
  36. ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
  37. -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
  38. +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
  39. ALL_A= $(LUA_A)
  40. # Targets start here.
  41. @@ -59,6 +60,12 @@
  42. $(AR) $@ $(BASE_O)
  43. $(RANLIB) $@
  44. +$(LUA_SO): $(CORE_O) $(LIB_O)
  45. + $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
  46. + ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
  47. + ln -sf $(LUA_SO).$(R) $(LUA_SO)
  48. +
  49. +
  50. $(LUA_T): $(LUA_O) $(LUA_A)
  51. $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)