Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Splitted the lmm_constraint swag called element_set into enabled_element_set and...
[simgrid.git] / contrib / lua / lualib.patch
1 diff --git a/Makefile b/Makefile
2 index 5ee5601..93830a3 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -52,7 +52,7 @@ R= $V.1
6  all:   $(PLAT)
7  
8  $(PLATS) clean:
9 -       cd src && $(MAKE) $@
10 +       cd src && $(MAKE) $@ V=$(V) R=$(R)
11  
12  test:  dummy
13         src/lua -v
14 diff --git a/src/Makefile b/src/Makefile
15 index d71c75c..64bda79 100644
16 --- a/src/Makefile
17 +++ b/src/Makefile
18 @@ -7,7 +7,7 @@
19  PLAT= none
20  
21  CC= gcc -std=gnu99
22 -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
23 +CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC
24  LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
25  LIBS= -lm $(SYSLIBS) $(MYLIBS)
26  
27 @@ -29,6 +29,7 @@ MYOBJS=
28  PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
29  
30  LUA_A= liblua.a
31 +LUA_SO= liblua.so
32  CORE_O=        lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
33         lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
34         ltm.o lundump.o lvm.o lzio.o
35 @@ -43,7 +44,7 @@ LUAC_T=       luac
36  LUAC_O=        luac.o
37  
38  ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
39 -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
40 +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
41  ALL_A= $(LUA_A)
42  
43  # Targets start here.
44 @@ -59,6 +60,11 @@ $(LUA_A): $(BASE_O)
45         $(AR) $@ $(BASE_O)
46         $(RANLIB) $@
47  
48 +$(LUA_SO): $(CORE_O) $(LIB_O)
49 +       $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
50 +       ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
51 +       ln -sf $(LUA_SO).$(R) $(LUA_SO)
52 +
53  $(LUA_T): $(LUA_O) $(LUA_A)
54         $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
55