lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I wanted to reply earlier, but since I do this in my free time, and I've been pretty busy lately, I could not give you feedback earlier.

I've build an SRV4 package with Lua for Solaris. It should work for Solaris 10, Nevada and OpenSolaris. I've tested on Nevada and OpenSolaris only.

The package doesn't have a static liblua.a but only a dynamic liblua.so.1. I complied 32-bit and 64-bit versions of the library. lua.cpp is not shipped in this package. The *.h header files have the '#ifdef __cplusplus' directive for use in C++ programs.

I used SunStudio 11 compilers, not gcc. I am attaching in this email, the patches for the Makefiles and headers I used to compile Lua on Solaris. The package is too big (514K) to attach and send to the mailing list. Is there a place where I can upload it? I don't have a website for it.

The version of Lua in the package is 5.1.3,REV=2008.03.04.11.04

BTW, this is not an official package from SUN. Hopefully there will be an official Lua package from SUN soon.

Antonello
*** lua-5.1.3.original/src/lua.h	Mon Feb 25 11:37:11 2008
--- lua-5.1.3/src/lua.h	Mon Feb 25 11:37:16 2008
***************
*** 9,14 ****
--- 9,18 ----
  #ifndef lua_h
  #define lua_h
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
  #include <stdarg.h>
  #include <stddef.h>
  
***************
*** 385,388 ****
--- 389,396 ----
  ******************************************************************************/
  
  
+ #ifdef  __cplusplus
+ }
  #endif
+ 
+ #endif
*** lua-5.1.3.original/src/lualib.h	Mon Feb 25 11:37:11 2008
--- lua-5.1.3/src/lualib.h	Mon Feb 25 11:37:14 2008
***************
*** 8,13 ****
--- 8,17 ----
  #ifndef lualib_h
  #define lualib_h
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
  #include "lua.h"
  
  
***************
*** 50,53 ****
--- 54,61 ----
  #endif
  
  
+ #ifdef  __cplusplus
+ }
  #endif
+ 
+ #endif
*** lua-5.1.3.original/src/lauxlib.h	Mon Feb 25 11:37:11 2008
--- lua-5.1.3/src/lauxlib.h	Mon Feb 25 11:37:16 2008
***************
*** 9,14 ****
--- 9,18 ----
  #define lauxlib_h
  
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
  #include <stddef.h>
  #include <stdio.h>
  
***************
*** 169,174 ****
--- 173,182 ----
  
  #define luaL_reg	luaL_Reg
  
+ #ifdef  __cplusplus
+ }
  #endif
+ 
+ #endif
  
  
*** lua-5.1.3.original/Makefile	Mon Feb 25 11:37:13 2008
--- lua-5.1.3/Makefile	Mon Feb 25 17:16:52 2008
***************
*** 5,11 ****
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
  # Your platform. See PLATS for possible values.
! PLAT= none
  
  # Where to install. The installation starts in the src directory, so take care
  # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
--- 5,11 ----
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
  # Your platform. See PLATS for possible values.
! PLAT= solaris
  
  # Where to install. The installation starts in the src directory, so take care
  # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
***************
*** 12,18 ****
  # doc directory.) You may want to make these paths consistent with LUA_ROOT,
  # LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
  #
! INSTALL_TOP= /usr/local
  INSTALL_BIN= $(INSTALL_TOP)/bin
  INSTALL_INC= $(INSTALL_TOP)/include
  INSTALL_LIB= $(INSTALL_TOP)/lib
--- 12,18 ----
  # doc directory.) You may want to make these paths consistent with LUA_ROOT,
  # LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
  #
! INSTALL_TOP= $(ROOT)/usr
  INSTALL_BIN= $(INSTALL_TOP)/bin
  INSTALL_INC= $(INSTALL_TOP)/include
  INSTALL_LIB= $(INSTALL_TOP)/lib
***************
*** 33,44 ****
  # == 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
  
  # 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_MAN= lua.1 luac.1
  
  # Lua version and release.
--- 33,44 ----
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
  # Convenience platforms targets.
! 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.$(V).so.1
  TO_MAN= lua.1 luac.1
  
  # Lua version and release.
***************
*** 48,54 ****
  all:	$(PLAT)
  
  $(PLATS) clean:
! 	cd src && $(MAKE) $@
  
  test:	dummy
  	src/lua test/hello.lua
--- 48,54 ----
  all:	$(PLAT)
  
  $(PLATS) clean:
! 	cd src && env V=$(V) $(MAKE) $@
  
  test:	dummy
  	src/lua test/hello.lua
*** lua-5.1.3.original/src/Makefile	Mon Feb 25 11:37:12 2008
--- lua-5.1.3/src/Makefile	Mon Mar  3 09:21:57 2008
***************
*** 4,28 ****
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
! # Your platform. See PLATS for possible values.
! PLAT= none
! 
! CC= gcc
! CFLAGS= -O2 -Wall $(MYCFLAGS)
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
! LIBS= -lm $(MYLIBS)
  
  MYCFLAGS=
! MYLDFLAGS=
  MYLIBS=
  
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
! PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
  
! LUA_A=	liblua.a
  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
--- 4,25 ----
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
! CC= cc
! CFLAGS= -xO3 -Xc -Kpic $(MYCFLAGS)
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
! LIBS= -lm -lc $(MYLIBS)
  
  MYCFLAGS=
! MYLDFLAGS= -zdefs -ztext
  MYLIBS=
  
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
! PLATS= solaris
  
! LUA_SO=	liblua.so.1
  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,45 ****
  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)
  
! default: $(PLAT)
  
  all:	$(ALL_T)
  
--- 33,42 ----
  LUAC_O=	luac.o print.o
  
  ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
! ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
! ALL_A= $(LUA_SO)
  
! default: solaris
  
  all:	$(ALL_T)
  
***************
*** 47,61 ****
  
  a:	$(ALL_A)
  
! $(LUA_A): $(CORE_O) $(LIB_O)
! 	$(AR) $@ $?
! 	$(RANLIB) $@
  
! $(LUA_T): $(LUA_O) $(LUA_A)
! 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
  
! $(LUAC_T): $(LUAC_O) $(LUA_A)
! 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
  
  clean:
  	$(RM) $(ALL_T) $(ALL_O)
--- 44,58 ----
  
  a:	$(ALL_A)
  
! $(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_SO)
! 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
  
! $(LUAC_T): $(LUAC_O) $(LUA_SO)
! 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
  
  clean:
  	$(RM) $(ALL_T) $(ALL_O)
***************
*** 74,119 ****
  	@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"
  
  # list targets that do not create files (but not all makes understand .PHONY)
  .PHONY: all $(PLATS) default o a clean depend echo none
--- 71,78 ----
  	@echo "MYLDFLAGS = $(MYLDFLAGS)"
  	@echo "MYLIBS = $(MYLIBS)"
  
  solaris:
! 	$(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
*** lua-5.1.3.original/Makefile	Mon Feb 25 11:37:13 2008
--- lua-5.1.3-64/Makefile	Tue Feb 26 14:18:26 2008
***************
*** 4,18 ****
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
- # Your platform. See PLATS for possible values.
- PLAT= none
- 
  # Where to install. The installation starts in the src directory, so take care
  # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
  # doc directory.) You may want to make these paths consistent with LUA_ROOT,
  # LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
  #
! INSTALL_TOP= /usr/local
  INSTALL_BIN= $(INSTALL_TOP)/bin
  INSTALL_INC= $(INSTALL_TOP)/include
  INSTALL_LIB= $(INSTALL_TOP)/lib
--- 4,15 ----
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
  # Where to install. The installation starts in the src directory, so take care
  # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
  # doc directory.) You may want to make these paths consistent with LUA_ROOT,
  # LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
  #
! INSTALL_TOP= $(ROOT)/usr
  INSTALL_BIN= $(INSTALL_TOP)/bin
  INSTALL_INC= $(INSTALL_TOP)/include
  INSTALL_LIB= $(INSTALL_TOP)/lib
***************
*** 32,44 ****
  
  # == 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
- 
  # 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_MAN= lua.1 luac.1
  
  # Lua version and release.
--- 29,38 ----
  
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
  # What to install.
  TO_BIN= lua luac
  TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
! TO_LIB= liblua.$(V).so.1
  TO_MAN= lua.1 luac.1
  
  # Lua version and release.
***************
*** 45,54 ****
  V= 5.1
  R= 5.1.3
  
! all:	$(PLAT)
  
! $(PLATS) clean:
! 	cd src && $(MAKE) $@
  
  test:	dummy
  	src/lua test/hello.lua
--- 39,48 ----
  V= 5.1
  R= 5.1.3
  
! default: all
  
! all clean:
! 	cd src && env V=$(V) $(MAKE) $@
  
  test:	dummy
  	src/lua test/hello.lua
*** lua-5.1.3.original/src/Makefile	Mon Feb 25 11:37:12 2008
--- lua-5.1.3-64/src/Makefile	Mon Mar  3 09:36:21 2008
***************
*** 4,28 ****
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
! # Your platform. See PLATS for possible values.
! PLAT= none
! 
! CC= gcc
! CFLAGS= -O2 -Wall $(MYCFLAGS)
! AR= ar rcu
! RANLIB= ranlib
  RM= rm -f
! LIBS= -lm $(MYLIBS)
  
  MYCFLAGS=
! MYLDFLAGS=
  MYLIBS=
  
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
! PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
! 
! LUA_A=	liblua.a
  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
--- 4,21 ----
  
  # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
  
! CC= cc
! CFLAGS= -xO3 -Xc -Kpic $(CFLAGS64) $(MYCFLAGS)
  RM= rm -f
! LIBS= -lm -lc $(MYLIBS)
  
  MYCFLAGS=
! MYLDFLAGS= -zdefs -ztext $(CFLAGS64)
  MYLIBS=
  
  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  
! LUA_SO=	liblua.so.1
  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
***************
*** 29,62 ****
  LIB_O=	lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
  	lstrlib.o loadlib.o linit.o
  
- LUA_T=	lua
  LUA_O=	lua.o
  
! LUAC_T=	luac
! 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)
  
- default: $(PLAT)
- 
- all:	$(ALL_T)
- 
  o:	$(ALL_O)
  
! a:	$(ALL_A)
  
- $(LUA_A): $(CORE_O) $(LIB_O)
- 	$(AR) $@ $?
- 	$(RANLIB) $@
- 
- $(LUA_T): $(LUA_O) $(LUA_A)
- 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
- 
- $(LUAC_T): $(LUAC_O) $(LUA_A)
- 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
- 
  clean:
  	$(RM) $(ALL_T) $(ALL_O)
  
--- 22,40 ----
  LIB_O=	lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
  	lstrlib.o loadlib.o linit.o
  
  LUA_O=	lua.o
  
! ALL_O= $(CORE_O) $(LIB_O) $(LUA_O)
! ALL_T= $(LUA_SO)
  
! default: all
  
  o:	$(ALL_O)
  
! $(LUA_SO): $(CORE_O) $(LIB_O)
! 	$(CC) -o $(LUA_SO) -G -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
! 	$(LIB_O) $(LIBS)
  
  clean:
  	$(RM) $(ALL_T) $(ALL_O)
  
***************
*** 74,122 ****
  	@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"
- 
  # list targets that do not create files (but not all makes understand .PHONY)
! .PHONY: all $(PLATS) default o a clean depend echo none
  
  # DO NOT DELETE
  
--- 52,62 ----
  	@echo "MYLDFLAGS = $(MYLDFLAGS)"
  	@echo "MYLIBS = $(MYLIBS)"
  
! all:
! 	$(MAKE) $(LUA_SO) 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 default o clean depend echo none
  
  # DO NOT DELETE