blob: 3dc7aee59a7eebcca5bb669a87c16028d97cf257 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
--- /home/mabi/gentoo/lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
+++ ./Makefile 2006-11-16 02:16:53.000000000 +0100
@@ -22,10 +22,10 @@
# How to install. You may prefer "install" instead of "cp" if you have it.
# To remove debug information from binaries, use "install -s" in INSTALL_EXEC.
#
-INSTALL_EXEC= $(CP)
-INSTALL_DATA= $(CP)
-#INSTALL_EXEC= $(INSTALL) -m 0755
-#INSTALL_DATA= $(INSTALL) -m 0644
+#INSTALL_EXEC= $(CP)
+#INSTALL_DATA= $(CP)
+INSTALL_EXEC= $(INSTALL) -m 0755
+INSTALL_DATA= $(INSTALL) -m 0644
# Utilities.
CP= cp
@@ -127,3 +127,21 @@
.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
# (end of Makefile)
+
+# Use libtool for binary installs, etc.
+
+export V
+export LIBTOOL = libtool --quiet --tag=CC
+# See libtool manual about how to set this
+
+gentoo_clean:
+ cd src; $(MAKE) $@
+
+gentoo_test: gentoo_linux
+ src/lua-$(V) test/hello.lua
+
+gentoo_install:
+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN)
+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua-$(V) luac-$(V) $(INSTALL_BIN)
+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
--- /home/mabi/gentoo/lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
+++ ./src/Makefile 2006-11-16 02:10:27.000000000 +0100
@@ -176,3 +176,32 @@
ltm.h lzio.h lmem.h lopcodes.h lundump.h
# (end of Makefile)
+
+export LIBTOOL = libtool --quiet --tag=CC
+export LIB_VERSION = 6:1:1
+
+# The following rules use libtool for compiling and linking in order to
+# provide shared library support. While we are at it, our desired version
+# suffixes are added to the targets, preventing conflicts with rules in
+# the upstream makefile.
+
+LIB_NAME = liblua.la
+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
+
+%.lo %.o: %.c
+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+$(LIB_NAME) $(LIB_NAME:.la=.a): $(LIB_OBJS)
+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
+ -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
+
+lua-$(V): $(LUA_O) $(LIB_NAME)
+ $(LIBTOOL) --mode=link $(CC) -Wl,-E -o $@ $(LUA_O) $(LUA_LIBS) -llua
+
+luac-$(V): $(LUAC_O) $(LIB_NAME)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O) $(LIB_NAME)
+
+gentoo_clean:
+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua-$(V) luac-$(V)
+
+gentoo_all: $(LIB_NAME) lua-$(V) luac-$(V)
|