Squashed commit of the following:
[project/luci.git] / contrib / luaposix / patches / 100-darwin_compile.patch
1 Index: luaposix-5.1.2/Makefile
2 ===================================================================
3 --- luaposix-5.1.2.orig/Makefile        2008-01-29 14:49:27.000000000 +0100
4 +++ luaposix-5.1.2/Makefile     2008-05-28 14:15:30.000000000 +0200
5 @@ -34,6 +34,13 @@
6  
7  T=             $(MYLIB).so
8  
9 +OS=$(shell uname)
10 +ifeq ($(OS),Darwin)
11 +  LDFLAGS_SHARED=-bundle -undefined dynamic_lookup
12 +else
13 +  LDFLAGS_SHARED=-shared
14 +endif
15 +
16  # targets
17  phony += all
18  all:   $T
19 @@ -43,7 +50,7 @@
20         $(LUA) test.lua
21  
22  $T:    $(OBJS)
23 -       $(CC) $(LDFLAGS) -o $@ -shared $(OBJS)
24 +       $(CC) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $(OBJS)
25  
26  $(OBJS): modemuncher.c
27