From 5d52ffedf49ca14af2926eac9ddbf9bfc5e8c56c Mon Sep 17 00:00:00 2001 From: Jonas Kunze Date: Fri, 15 Jan 2016 18:48:57 +0100 Subject: [PATCH] Added solaris platform To compile on solaris some libs had to be linked. So far I was only able to test it on OmniOS r151006 --- makefile | 2 +- src/makefile | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index e34f5a9..cc15b4e 100644 --- a/makefile +++ b/makefile @@ -10,7 +10,7 @@ # print print the build settings PLAT?= linux -PLATS= macosx linux win32 mingw freebsd +PLATS= macosx linux win32 mingw freebsd solaris all: $(PLAT) diff --git a/src/makefile b/src/makefile index 3e8c128..adf687f 100644 --- a/src/makefile +++ b/src/makefile @@ -55,7 +55,7 @@ LDIR_linux?=share/lua/$(LUAV) # LUAINC_freebsd: # /usr/local/include/lua$(LUAV) -# where lua headers are found for linux builds +# where lua headers are found for freebsd builds LUAINC_freebsd_base?=/usr/local/include/ LUAINC_freebsd?=$(LUAINC_freebsd_base)/lua$(LUAV) LUAPREFIX_freebsd?=/usr/local/ @@ -86,6 +86,13 @@ LUALIB_win32?=$(LUAPREFIX_win32)/lib/lua/$(LUAV)/$(PLATFORM_win32) LUALIBNAME_win32?=lua$(subst .,,$(LUAV)).lib +# LUAINC_solaris: +LUAINC_solaris_base?=/usr/include +LUAINC_solaris?=$(LUAINC_solaris_base)/lua/$(LUAV) +LUAPREFIX_solaris?=/usr/local +CDIR_solaris?=lib/lua/$(LUAV) +LDIR_solaris?=share/lua/$(LUAV) + # prefix: /usr/local /usr /opt/local /sw # the top of the default install tree prefix?=$(LUAPREFIX_$(PLAT)) @@ -132,7 +139,7 @@ print: #------ # Supported platforms # -PLATS= macosx linux win32 mingw +PLATS= macosx linux win32 mingw solaris #------ # Compiler and linker settings @@ -182,6 +189,22 @@ LDFLAGS_freebsd=-O -shared -fpic -o LD_freebsd=gcc SOCKET_freebsd=usocket.o +#------ +# Compiler and linker settings +# for Solaris +SO_solaris=so +O_solaris=o +CC_solaris=gcc +DEF_solaris=-DLUASOCKET_$(DEBUG) \ + -DLUASOCKET_API='__attribute__((visibility("default")))' \ + -DUNIX_API='__attribute__((visibility("default")))' \ + -DMIME_API='__attribute__((visibility("default")))' +CFLAGS_solaris=-I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \ + -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden +LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o +LD_solaris=gcc +SOCKET_solaris=usocket.o + #------ # Compiler and linker settings # for MingW @@ -332,6 +355,9 @@ linux: mingw: $(MAKE) all PLAT=mingw + +solaris: + $(MAKE) all-unix PLAT=solaris none: @echo "Please run"