Add build support for NaCL - Google Native Client.

This commit is contained in:
Nigel Stewart 2012-08-16 14:26:32 -05:00
parent 2de0716a46
commit 287c58f930
4 changed files with 79 additions and 1 deletions

View File

@ -184,7 +184,13 @@ VISUALINFO.BIN.SRC := src/visualinfo.c
VISUALINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(VISUALINFO.BIN.SRC)))
VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o)
# Don't build glewinfo or visualinfo for NaCL, yet.
ifneq ($(filter nacl%,$(SYSTEM)),)
glew.bin: glew.lib bin
else
glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
endif
bin:
mkdir bin

View File

@ -4,7 +4,7 @@
return ret;
}
#elif !defined(__ANDROID__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
#if defined(GLEW_MX)
GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name)

36
config/Makefile.nacl-32 Normal file
View File

@ -0,0 +1,36 @@
NAME = $(REGAL_NAME)
M_PREFIX = i686
M_NAME ?= $(shell uname -s)
ifeq (Linux,${M_NAME})
M_PREFIX = i686
endif
CC = $(M_PREFIX)-nacl-gcc
CXX = $(M_PREFIX)-nacl-g++
LD = $(M_PREFIX)-nacl-ld
STRIP ?=
EXT.DYNAMIC = so
LDFLAGS.EXTRA =
LIBDIR =
CFLAGS.EXTRA += -fPIC
CFLAGS.EXTRA += -m32
LDFLAGS.EXTRA += -melf_nacl
LDFLAGS.GL =
LDFLAGS.GLU = -lRegalGLU
LDFLAGS.GLUT = -lRegalGLUT
LDFLAGS.STATIC =
LDFLAGS.DYNAMIC = -shared
WARN = -Wall -W -Wno-unused-parameter
POPT = -O2
BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME.MX)

36
config/Makefile.nacl-64 Normal file
View File

@ -0,0 +1,36 @@
NAME = $(REGAL_NAME)
M_PREFIX = i686
M_NAME ?= $(shell uname -s)
ifeq (Linux,${M_NAME})
M_PREFIX = i686
endif
CC = $(M_PREFIX)-nacl-gcc
CXX = $(M_PREFIX)-nacl-g++
LD = $(M_PREFIX)-nacl-ld
STRIP ?=
EXT.DYNAMIC = so
LDFLAGS.EXTRA =
LIBDIR =
CFLAGS.EXTRA += -fPIC
CFLAGS.EXTRA += -m64
LDFLAGS.EXTRA += -melf64_nacl
LDFLAGS.GL =
LDFLAGS.GLU = -lRegalGLU
LDFLAGS.GLUT = -lRegalGLUT
LDFLAGS.STATIC =
LDFLAGS.DYNAMIC = -shared
WARN = -Wall -W -Wno-unused-parameter
POPT = -O2
BIN.SUFFIX =
LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME)
LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
LIB.DEVLNK.MX = lib$(NAME)mx.so
LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = $(LDFLAGS.DYNAMIC) -soname=$(LIB.SONAME.MX)