• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/lua/lua-02-shared-libs-for-lua.patch
Peter KorsgaardPeter Korsgaard committed 684f208ecf117 Nov 2012
Raw file
Source viewDiff to previous
 
1
Add the compilation of a shared library.
2
Compile the lua binary with the shared library.
3
​
4
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
5
​
6
Index: b/src/Makefile
7
===================================================================
8
--- a/src/Makefile
9
+++ b/src/Makefile
10
@@ -23,6 +23,7 @@
11
 PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
12
 
13
 LUA_A= liblua.a
14
+LUA_SO=    liblua.so
15
 CORE_O=    lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
16
    lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o  \
17
    lundump.o lvm.o lzio.o
18
@@ -36,8 +37,9 @@
19
 LUAC_O=    luac.o print.o
20
 
21
 ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
22
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
23
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
24
 ALL_A= $(LUA_A)
25
+ALL_SO= $(LUA_SO)
26
 
27
 default: $(PLAT)
28
 
29
@@ -47,12 +49,18 @@
30
 
31
 a: $(ALL_A)
32
 
33
+so:    $(ALL_SO)
34
+
35
 $(LUA_A): $(CORE_O) $(LIB_O)
36
    $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
37
    $(RANLIB) $@
38
 
39
-$(LUA_T): $(LUA_O) $(LUA_A)
40
-   $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
41
+$(LUA_SO): $(CORE_O) $(LIB_O)
42
+   $(CC) -o $@.$(PKG_VERSION) -shared -Wl,-soname="$@.$(PKG_VERSION)" $?
43
+   ln -fs $@.$(PKG_VERSION) $@
44
+
45
+$(LUA_T): $(LUA_O) $(LUA_SO)
46
+   $(CC) -o $@ -L. $(MYLDFLAGS) $(LUA_O) -llua $(LIBS)
47
 
48
 $(LUAC_T): $(LUAC_O) $(LUA_A)
49
    $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.