components/lua/patches/1.Makefile.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 115 c360825c3a3f
child 990 6bfca1239ccb
child 4226 efcbdc9d6dd8
permissions -rw-r--r--
Close of build 10.
--- 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 @@
 # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
 
 # Your platform. See PLATS for possible values.
-PLAT= none
+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.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= $(ROOT)/usr
 INSTALL_BIN= $(INSTALL_TOP)/bin
 INSTALL_INC= $(INSTALL_TOP)/include
 INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+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").
-INSTALL= install -p
-INSTALL_EXEC= $(INSTALL) -m 0755
-INSTALL_DATA= $(INSTALL) -m 0644
+INSTALL= ginstall -p
+INSTALL_EXEC= $(INSTALL) -m 0555
+INSTALL_DATA= $(INSTALL) -m 0444
 #
 # 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 =========
 
 # Convenience platforms targets.
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= solaris
 
 # What to install.
 TO_BIN= lua luac
-TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/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
 
 # Lua version and release.
 V= 5.1
@@ -55,16 +59,18 @@
 $(PLATS) clean:
 	cd src && $(MAKE) [email protected]
 
+check:  test
 test:	dummy
 	src/lua test/hello.lua
 
 install: dummy
-	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_DOC) $(INSTALL_MAN) $(INSTALL_TEST)
 	cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-	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) [email protected] $?
-	$(RANLIB) [email protected]
+$(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 [email protected] $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+$(LUA_T): $(LUA_O) $(LUA_SO)
+	$(CC) -o [email protected] $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
 
-$(LUAC_T): $(LUAC_O) $(LUA_A)
-	$(CC) -o [email protected] $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
+	$(CC) -o [email protected] $(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