components/lua/patches/1.Makefile.patch
changeset 990 6bfca1239ccb
parent 115 c360825c3a3f
--- a/components/lua/patches/1.Makefile.patch	Mon Sep 24 13:38:18 2012 -0700
+++ b/components/lua/patches/1.Makefile.patch	Wed Sep 26 16:17:36 2012 +0000
@@ -1,6 +1,6 @@
---- lua-5.1.4/Makefile.orig	Mon Aug 11 17:40:48 2008
-+++ lua-5.1.4/Makefile	Fri Feb 18 13:00:25 2011
-@@ -5,15 +5,17 @@
+--- Makefile.~1~	2012-05-17 07:05:54.000000000 -0700
++++ Makefile	2012-09-06 17:26:51.006475447 -0700
+@@ -4,25 +4,26 @@
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
  # Your platform. See PLATS for possible values.
@@ -8,7 +8,9 @@
 +PLAT= solaris
  
  # Where to install. The installation starts in the src and doc directories,
- # so take care if INSTALL_TOP is not an absolute path.
+ # so take care if INSTALL_TOP is not an absolute path. See the local target.
+ # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
 -INSTALL_TOP= /usr/local
 +INSTALL_TOP= $(ROOT)/usr
  INSTALL_BIN= $(INSTALL_TOP)/bin
@@ -16,15 +18,12 @@
  INSTALL_LIB= $(INSTALL_TOP)/lib
 -INSTALL_MAN= $(INSTALL_TOP)/man/man1
 +INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
 +INSTALL_DOC= $(INSTALL_TOP)/share/doc/lua
-+INSTALL_TEST= $(INSTALL_TOP)/demo/lua/test
- #
- # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
-@@ -22,9 +24,9 @@
  
- # How to install. If your install program does not support "-p", then you
- # may have to run ranlib on the installed liblua.a (do "make ranlib").
+ # How to install. If your install program does not support "-p", then
+ # you may have to run ranlib on the installed liblua.a.
 -INSTALL= install -p
 -INSTALL_EXEC= $(INSTALL) -m 0755
 -INSTALL_DATA= $(INSTALL) -m 0644
@@ -32,10 +31,10 @@
 +INSTALL_EXEC= $(INSTALL) -m 0555
 +INSTALL_DATA= $(INSTALL) -m 0444
  #
- # If you don't have install you can use cp instead.
+ # If you don't have "install" you can use "cp" instead.
  # INSTALL= cp -p
-@@ -38,13 +40,15 @@
- # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+@@ -36,13 +37,14 @@
+ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
  
  # Convenience platforms targets.
 -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
@@ -43,23 +42,17 @@
  
  # What to install.
  TO_BIN= lua luac
--TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+-TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
 -TO_LIB= liblua.a
 +TO_INC= lua.h luaconf.h lualib.h lauxlib.h
 +TO_LIB= liblua.so
  TO_MAN= lua.1 luac.1
-+TO_DOC= amazon.gif contents.html cover.png logo.gif lua.css lua.html luac.html manual.css manual.html readme.html
-+TO_TEST= bisect.lua cf.lua echo.lua env.lua factorial.lua fib.lua fibfor.lua globals.lua hello.lua life.lua luac.lua printf.lua readonly.lua sieve.lua sort.lua table.lua trace-calls.lua trace-globals.lua xd.lua
++TO_DOC= contents.html osi-certified-72x60.png logo.gif lua.css manual.css manual.html readme.html
  
  # Lua version and release.
- V= 5.1
-@@ -55,16 +59,18 @@
- $(PLATS) clean:
- 	cd src && $(MAKE) $@
- 
-+check:  test
- test:	dummy
- 	src/lua test/hello.lua
+ V= 5.2
+@@ -58,11 +60,13 @@
+ 	src/lua -v
  
  install: dummy
 -	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
@@ -69,131 +62,8 @@
 -	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
 +	cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
  	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
--
 +	cd doc && $(INSTALL_DATA) $(TO_DOC) $(INSTALL_DOC)
-+	cd test && $(INSTALL_DATA) $(TO_TEST) $(INSTALL_TEST)
- ranlib:
- 	cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
-
---- lua-5.1.4/src/Makefile.orig	Sat Jan 19 11:37:58 2008
-+++ lua-5.1.4/src/Makefile	Wed Feb 16 15:43:24 2011
-@@ -4,25 +4,24 @@
- 
- # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
- 
--# Your platform. See PLATS for possible values.
--PLAT= none
--
--CC= gcc
--CFLAGS= -O2 -Wall $(MYCFLAGS)
-+CC=$(CC)
-+CFLAGS= -xO3 -Xc -Kpic $(MYCFLAGS)
-+FLAG_SPARC:sh=	if [ ${MACH64} = "sparcv9" ]; then echo -xcode=pic13; fi
-+CFLAGS= $(FLAG_SPARC)
- AR= ar rcu
- RANLIB= ranlib
- RM= rm -f
--LIBS= -lm $(MYLIBS)
-+LIBS= -lm -lc $(MYLIBS)
- 
- MYCFLAGS=
--MYLDFLAGS=
-+MYLDFLAGS= -zdefs -ztext
- MYLIBS=
- 
- # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
- 
--PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-+PLATS= solaris
- 
--LUA_A=	liblua.a
-+LUA_SO=	liblua.so
- CORE_O=	lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
- 	lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o  \
- 	lundump.o lvm.o lzio.o
-@@ -36,10 +35,10 @@
- LUAC_O=	luac.o print.o
- 
- ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
--ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
--ALL_A= $(LUA_A)
-+ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
-+ALL_A= $(LUA_SO)
- 
--default: $(PLAT)
-+default: solaris
- 
- all:	$(ALL_T)
- 
-@@ -47,15 +46,15 @@
- 
- a:	$(ALL_A)
++	
  
--$(LUA_A): $(CORE_O) $(LIB_O)
--	$(AR) $@ $?
--	$(RANLIB) $@
-+$(LUA_SO): $(CORE_O) $(LIB_O)
-+	$(CC) -o $(LUA_SO) -G -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
-+	$(LIB_O) $(LIBS)
- 
--$(LUA_T): $(LUA_O) $(LUA_A)
--	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-+$(LUA_T): $(LUA_O) $(LUA_SO)
-+	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
- 
--$(LUAC_T): $(LUAC_O) $(LUA_A)
--	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-+$(LUAC_T): $(LUAC_O) $(LUA_SO)
-+	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
- 
- clean:
- 	$(RM) $(ALL_T) $(ALL_O)
-@@ -74,46 +73,8 @@
- 	@echo "MYLDFLAGS = $(MYLDFLAGS)"
- 	@echo "MYLIBS = $(MYLIBS)"
- 
--# convenience targets for popular platforms
--
--none:
--	@echo "Please choose a platform:"
--	@echo "   $(PLATS)"
--
--aix:
--	$(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
--
--ansi:
--	$(MAKE) all MYCFLAGS=-DLUA_ANSI
--
--bsd:
--	$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
--
--freebsd:
--	$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
--
--generic:
--	$(MAKE) all MYCFLAGS=
--
--linux:
--	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
--
--macosx:
--	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
--# use this on Mac OS X 10.3-
--#	$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
--
--mingw:
--	$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
--	"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
--	"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
--	$(MAKE) "LUAC_T=luac.exe" luac.exe
--
--posix:
--	$(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
--
- solaris:
--	$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
-+	$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D__EXTENSIONS__" MYLIBS="-ldl"
- 
- # list targets that do not create files (but not all makes understand .PHONY)
- .PHONY: all $(PLATS) default o a clean depend echo none
- 
+ uninstall:
+ 	cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)