mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 12:20:10 +01:00
mesa/es: Merge back to core mesa.
With the omit list gone, there are not too many differences in building core mesa and ES overlay. Remove the mesa/es and build both of them in src/mesa/Makefile.
This commit is contained in:
parent
8d5c83c467
commit
87cc2da16e
8 changed files with 104 additions and 131 deletions
|
|
@ -16,6 +16,7 @@ PIC_FLAGS = @PIC_FLAGS@
|
|||
DEFINES = @DEFINES@
|
||||
API_DEFINES = @API_DEFINES@
|
||||
APIS = @APIS@
|
||||
GLES_OVERLAY = @GLES_OVERLAY@
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
|
||||
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
|
||||
|
|
|
|||
|
|
@ -757,6 +757,7 @@ AC_ARG_ENABLE([gles-overlay],
|
|||
|
||||
API_DEFINES=""
|
||||
APIS=""
|
||||
GLES_OVERLAY=0
|
||||
if test "x$enable_opengl" = xno; then
|
||||
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
|
||||
else
|
||||
|
|
@ -775,11 +776,12 @@ if test "x$enable_gles_overlay" = xyes -o \
|
|||
"x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
|
||||
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
|
||||
if test "x$enable_gles_overlay" = xyes; then
|
||||
CORE_DIRS="$CORE_DIRS mesa/es"
|
||||
GLES_OVERLAY=1
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([API_DEFINES])
|
||||
AC_SUBST([APIS])
|
||||
AC_SUBST([GLES_OVERLAY])
|
||||
|
||||
dnl If $with_dri_drivers is yes, directories will be added through
|
||||
dnl platform checks
|
||||
|
|
@ -1331,7 +1333,7 @@ yes)
|
|||
if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
|
||||
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
|
||||
fi
|
||||
CORE_DIRS="$CORE_DIRS mesa/es"
|
||||
GLES_OVERLAY=1
|
||||
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
|
||||
fi
|
||||
tracker=""
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ your build. For example,</p>
|
|||
|
||||
<table border="1" style="text-align: center;">
|
||||
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
|
||||
<tr><td><code>src/mesa/libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
<tr><td><code>src/mesa/libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
<tr><td><code>src/mesa/es/libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr>
|
||||
<tr><td><code>src/mesa/es/libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr>
|
||||
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
<tr><td><code>libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr>
|
||||
<tr><td><code>libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr>
|
||||
</table>
|
||||
|
||||
<h3>Dispatch Table</h3>
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ OpenVG_SYS := -lm -L$(TOP)/$(LIB_DIR) -l$(VG_LIB)
|
|||
|
||||
# project libs
|
||||
GL_LIBS := $(TOP)/src/mesa/libmesagallium.a
|
||||
GLESv1_CM_LIBS := $(TOP)/src/mesa/es/libes1gallium.a
|
||||
GLESv2_LIBS := $(TOP)/src/mesa/es/libes2gallium.a
|
||||
GLESv1_CM_LIBS := $(TOP)/src/mesa/libes1gallium.a
|
||||
GLESv2_LIBS := $(TOP)/src/mesa/libes2gallium.a
|
||||
OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a
|
||||
|
||||
# objects
|
||||
|
|
|
|||
3
src/mesa/.gitignore
vendored
3
src/mesa/.gitignore
vendored
|
|
@ -1,2 +1,5 @@
|
|||
*/gen_matypes
|
||||
*/matypes.h
|
||||
depend.es*
|
||||
depend.es*
|
||||
objs-es*
|
||||
|
|
|
|||
|
|
@ -3,26 +3,68 @@
|
|||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
MESA_LIBS := libmesa.a libmesagallium.a
|
||||
DEPENDS := depend
|
||||
|
||||
ifeq ($(GLES_OVERLAY),1)
|
||||
ES1_LIBS := libes1gallium.a
|
||||
ES2_LIBS := libes2gallium.a
|
||||
DEPENDS += depend.es1 depend.es2
|
||||
endif
|
||||
|
||||
MESA_OBJ_DIR := .
|
||||
ES1_OBJ_DIR := objs-es1
|
||||
ES2_OBJ_DIR := objs-es2
|
||||
|
||||
MESA_CPPFLAGS := $(API_DEFINES)
|
||||
ES1_CPPFLAGS := -DFEATURE_ES1=1 -D__GL_EXPORTS
|
||||
ES2_CPPFLAGS := -DFEATURE_ES2=1 -D__GL_EXPORTS
|
||||
|
||||
include sources.mak
|
||||
|
||||
.SUFFIXES : .cpp
|
||||
# adjust object dirs
|
||||
ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_OBJECTS))
|
||||
ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_OBJECTS))
|
||||
MESA_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_OBJECTS))
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
|
||||
ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
|
||||
ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
|
||||
MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
|
||||
# adjust include dirs
|
||||
MESA_INCLUDES := $(INCLUDE_DIRS)
|
||||
ES1_INCLUDES := -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
|
||||
ES2_INCLUDES := -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
|
||||
|
||||
CFLAGS += $(API_DEFINES)
|
||||
define mesa-cc-c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CFLAGS)
|
||||
endef
|
||||
|
||||
$(MESA_OBJ_DIR)/%.o: %.c
|
||||
$(call mesa-cc-c,MESA)
|
||||
|
||||
$(MESA_OBJ_DIR)/%.o: %.S
|
||||
$(call mesa-cc-c,MESA)
|
||||
|
||||
$(ES1_OBJ_DIR)/%.o: %.c
|
||||
$(call mesa-cc-c,ES1)
|
||||
|
||||
$(ES1_OBJ_DIR)/%.o: %.S
|
||||
$(call mesa-cc-c,ES1)
|
||||
|
||||
$(ES2_OBJ_DIR)/%.o: %.c
|
||||
$(call mesa-cc-c,ES2)
|
||||
|
||||
$(ES2_OBJ_DIR)/%.o: %.S
|
||||
$(call mesa-cc-c,ES2)
|
||||
|
||||
|
||||
# Default: build dependencies, then asm_subdirs, GLSL built-in lib,
|
||||
# then convenience libs (.a) and finally the device drivers:
|
||||
default: depend asm_subdirs glsl_builtin libmesa.a libmesagallium.a \
|
||||
driver_subdirs
|
||||
default: $(DEPENDS) asm_subdirs glsl_builtin \
|
||||
$(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) driver_subdirs
|
||||
|
||||
main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
|
||||
$(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
|
||||
|
|
@ -37,13 +79,25 @@ main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py m
|
|||
libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS)
|
||||
@ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes1.a: $(ES1_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es1 -static $(ES1_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes2.a: $(ES2_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es2 -static $(ES2_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
# Make archive of subset of core mesa object files for gallium
|
||||
libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
@ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes1gallium.a: $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es1gallium -static $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes2gallium.a: $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es2gallium -static $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
######################################################################
|
||||
# Device drivers
|
||||
driver_subdirs: libmesa.a libmesagallium.a
|
||||
driver_subdirs: $(MESA_LIBS)
|
||||
@ (cd drivers && $(MAKE))
|
||||
|
||||
|
||||
|
|
@ -71,9 +125,22 @@ glsl_builtin:
|
|||
depend: $(ALL_SOURCES)
|
||||
@ echo "running $(MKDEP)"
|
||||
@ touch depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(DEFINES) \
|
||||
$(INCLUDE_DIRS) $(ALL_SOURCES) > /dev/null 2>/dev/null
|
||||
|
||||
depend.es1: $(ALL_SOURCES)
|
||||
@echo "running $(MKDEP) for ES1"
|
||||
@touch $@
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES1_OBJ_DIR)/ $(DEFINES) \
|
||||
$(ES1_CPPFLAGS) $(ES1_INCLUDES) $(ALL_SOURCES) \
|
||||
> /dev/null 2>/dev/null
|
||||
|
||||
depend.es2: $(ALL_SOURCES)
|
||||
@echo "running $(MKDEP) for ES2"
|
||||
@touch $@
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES2_OBJ_DIR)/ $(DEFINES) \
|
||||
$(ES2_CPPFLAGS) $(ES2_INCLUDES) $(ALL_SOURCES) \
|
||||
> /dev/null 2>/dev/null
|
||||
|
||||
######################################################################
|
||||
# Installation rules
|
||||
|
|
@ -151,8 +218,17 @@ install-dri: default
|
|||
tags:
|
||||
etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
|
||||
|
||||
clean-es1:
|
||||
-rm -f $(ES1_LIBS)
|
||||
-rm -rf $(ES1_OBJ_DIR)
|
||||
-rm -f depend.es1 depend.es1.bak
|
||||
|
||||
clean:
|
||||
clean-es2:
|
||||
-rm -f $(ES2_LIBS)
|
||||
-rm -rf $(ES2_OBJ_DIR)
|
||||
-rm -f depend.es2 depend.es2.bak
|
||||
|
||||
clean: clean-es1 clean-es2
|
||||
-rm -f */*.o
|
||||
-rm -f */*/*.o
|
||||
-rm -f depend depend.bak libmesa.a libmesagallium.a
|
||||
|
|
@ -166,4 +242,4 @@ clean:
|
|||
-@cd x86-64 && $(MAKE) clean
|
||||
|
||||
|
||||
-include depend
|
||||
-include $(DEPENDS)
|
||||
|
|
|
|||
5
src/mesa/es/.gitignore
vendored
5
src/mesa/es/.gitignore
vendored
|
|
@ -1,5 +0,0 @@
|
|||
glapi/glapi-es*
|
||||
glapi/glapi-stamp
|
||||
main/get_es*.c
|
||||
main/api_exec_es*.c
|
||||
objs-es*
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
# src/mesa/es/Makefile
|
||||
#
|
||||
# TODO Merge back to core mesa
|
||||
#
|
||||
TOP := ../../..
|
||||
MESA := ..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
ES1_LIBS := libes1gallium.a
|
||||
ES2_LIBS := libes2gallium.a
|
||||
|
||||
# Default rule: create ES1 and ES2 libs
|
||||
.PHONY: default subdirs es1 es2
|
||||
default: depend subdirs es1 es2
|
||||
|
||||
es1: $(ES1_LIBS)
|
||||
|
||||
es2: $(ES2_LIBS)
|
||||
|
||||
ES1_CPPFLAGS := -DFEATURE_ES1=1 -D__GL_EXPORTS
|
||||
ES2_CPPFLAGS := -DFEATURE_ES2=1 -D__GL_EXPORTS
|
||||
|
||||
ES1_OBJ_DIR := objs-es1
|
||||
ES2_OBJ_DIR := objs-es2
|
||||
|
||||
include $(MESA)/sources.mak
|
||||
|
||||
# adjust source dir
|
||||
ES_SOURCES := $(addprefix $(MESA)/, $(MESA_SOURCES))
|
||||
ES_GALLIUM_SOURCES := $(addprefix $(MESA)/, $(MESA_GALLIUM_SOURCES))
|
||||
|
||||
# adjust object dirs
|
||||
ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_OBJECTS))
|
||||
ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
|
||||
|
||||
ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_OBJECTS))
|
||||
ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
|
||||
|
||||
# adjust include dirs
|
||||
ES1_INCLUDES := -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
|
||||
ES2_INCLUDES := -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
|
||||
|
||||
|
||||
# compile either ES1 or ES2 sources
|
||||
define es-compile
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) -c $(CFLAGS) $(ES$(1)_CPPFLAGS) $(ES$(1)_INCLUDES) -o $@ $<
|
||||
endef
|
||||
|
||||
$(ES1_OBJ_DIR)/%.o: $(MESA)/%.c
|
||||
$(call es-compile,1)
|
||||
|
||||
$(ES1_OBJ_DIR)/%.o: $(MESA)/%.S
|
||||
$(call es-compile,1)
|
||||
|
||||
$(ES2_OBJ_DIR)/%.o: $(MESA)/%.c
|
||||
$(call es-compile,2)
|
||||
|
||||
$(ES2_OBJ_DIR)/%.o: $(MESA)/%.S
|
||||
$(call es-compile,2)
|
||||
|
||||
libes1.a: $(ES1_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es1 -static $(ES1_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes2.a: $(ES2_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es2 -static $(ES2_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes1gallium.a: $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es1gallium -static $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
libes2gallium.a: $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
@$(MKLIB) -o es2gallium -static $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(ES1_LIBS) $(ES2_LIBS)
|
||||
-rm -rf $(ES1_OBJ_DIR) $(ES2_OBJ_DIR)
|
||||
-rm -f depend depend.bak
|
||||
|
||||
# nothing to install
|
||||
install:
|
||||
|
||||
subdirs:
|
||||
@$(MAKE) -C $(MESA) asm_subdirs
|
||||
@$(MAKE) -C $(MESA) glsl_builtin
|
||||
|
||||
# sort to avoid duplicates
|
||||
ES_ALL_SOURCES := $(sort $(ES_SOURCES) $(ES_GALLIUM_SOURCES))
|
||||
|
||||
depend: $(ES_ALL_SOURCES)
|
||||
@echo "running $(MKDEP)"
|
||||
@touch depend
|
||||
@# MESA is "..", but luckily, directories are longer than 2 characters
|
||||
@$(MKDEP) -f- -p$(ES1_OBJ_DIR)/ $(DEFINES) $(ES1_CFLAGS) \
|
||||
$(ES1_INCLUDES) $(ES_ALL_SOURCES) 2>/dev/null | \
|
||||
sed -e 's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend
|
||||
@$(MKDEP) -f- -p$(ES2_OBJ_DIR)/ $(DEFINES) $(ES2_CFLAGS) \
|
||||
$(ES2_INCLUDES) $(ES_ALL_SOURCES) 2>/dev/null | \
|
||||
sed -e 's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
-include depend
|
||||
endif
|
||||
Loading…
Add table
Reference in a new issue