summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-05-05 15:38:02 +0800
committerChia-I Wu <[email protected]>2010-05-08 14:57:21 +0800
commit63ab2509bf324812d9632c12528677724bdb8775 (patch)
tree24a04e31adcef0f5ef4ab0f1b84178cd9e5cc8ab /src/gallium/targets
parent559046e7917e5b9e4226bb02e86da17e62f1385e (diff)
gallium: Add egl-apis target.
The new target installs client API modules to EGL_DRIVER_INSTALL_DIR. They are used by st/egl. The client APIs are built from OpenGL and OpenVG state trackers. For this to work, st/vega is modified to produce a static library, libvega.a, instead. st/es is also not needed any more. It is removed and --with-state-trackers=es is replaced by --enable-gles-overlay. As st/egl now has its own client API modules, this solves the ABI issue between st/egl and client APIs, as long as the client API modules are distributed with st/egl. Plus, this allows st/egl to support OpenGL with non-Gallium libGL.so.
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/egl-apis/Makefile67
-rw-r--r--src/gallium/targets/egl-apis/api_GL.c7
-rw-r--r--src/gallium/targets/egl-apis/api_GLESv1_CM.c7
-rw-r--r--src/gallium/targets/egl-apis/api_GLESv2.c8
-rw-r--r--src/gallium/targets/egl-apis/api_OpenVG.c8
5 files changed, 97 insertions, 0 deletions
diff --git a/src/gallium/targets/egl-apis/Makefile b/src/gallium/targets/egl-apis/Makefile
new file mode 100644
index 00000000000..15556a13464
--- /dev/null
+++ b/src/gallium/targets/egl-apis/Makefile
@@ -0,0 +1,67 @@
+# src/gallium/targets/egl-apis
+
+TOP = ../../../..
+include $(TOP)/configs/current
+
+OUTPUT_PREFIX := api_
+OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
+
+OUTPUTS := $(addsuffix .so, $(EGL_CLIENT_APIS))
+OUTPUTS := $(addprefix $(OUTPUT_PATH)/$(OUTPUT_PREFIX), $(OUTPUTS))
+
+# include dirs
+GL_INCLUDES := -I$(TOP)/src/mesa -I$(TOP)/src/gallium/include
+GLESv1_CM_INCLUDES := $(GL_INCLUDES)
+GLESv2_INCLUDES := $(GL_INCLUDES)
+OpenVG_INCLUDES := -I$(TOP)/src/gallium/state_trackers/vega -I$(TOP)/src/gallium/include
+
+# system libs
+GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
+GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB)
+GLESv2_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv2_LIB)
+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
+OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a
+
+# objects
+GL_OBJECTS := api_GL.o
+GLESv1_CM_OBJECTS := api_GLESv1_CM.o
+GLESv2_OBJECTS := api_GLESv2.o
+OpenVG_OBJECTS := api_OpenVG.o
+
+default: $(OUTPUTS)
+
+api_%.o: api_%.c
+ $(CC) -c -o $@ $< $($*_INCLUDES) $(DEFINES) $(CFLAGS)
+
+define mklib
+$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+ -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
+ $($(1)_OBJECTS) $($(1)_LIBS) $(GALLIUM_AUXILIARIES) $($(1)_SYS)
+endef
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GL_LIB).so: $(GL_OBJECTS) $(GL_LIBS)
+ $(call mklib,GL)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv1_CM_LIB).so: $(GLESv1_CM_OBJECTS) $(GLESv1_CM_LIBS)
+ $(call mklib,GLESv1_CM)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(GLESv2_LIB).so: $(GLESv2_OBJECTS) $(GLESv2_LIBS)
+ $(call mklib,GLESv2)
+
+$(OUTPUT_PATH)/$(OUTPUT_PREFIX)$(VG_LIB).so: $(OpenVG_OBJECTS) $(OpenVG_LIBS)
+ $(call mklib,OpenVG)
+
+install: $(OUTPUTS)
+ $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
+ for out in $(OUTPUTS); do \
+ $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
+ done
+
+clean:
+ -rm -f $(OUTPUTS)
+ -rm -f *.o
diff --git a/src/gallium/targets/egl-apis/api_GL.c b/src/gallium/targets/egl-apis/api_GL.c
new file mode 100644
index 00000000000..6d172745c01
--- /dev/null
+++ b/src/gallium/targets/egl-apis/api_GL.c
@@ -0,0 +1,7 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL()
+{
+ return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_GLESv1_CM.c b/src/gallium/targets/egl-apis/api_GLESv1_CM.c
new file mode 100644
index 00000000000..825fdac2150
--- /dev/null
+++ b/src/gallium/targets/egl-apis/api_GLESv1_CM.c
@@ -0,0 +1,7 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES1()
+{
+ return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_GLESv2.c b/src/gallium/targets/egl-apis/api_GLESv2.c
new file mode 100644
index 00000000000..5c773aaf93b
--- /dev/null
+++ b/src/gallium/targets/egl-apis/api_GLESv2.c
@@ -0,0 +1,8 @@
+#include "state_tracker/st_gl_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenGL_ES2()
+{
+ /* linker magic creates different versions */
+ return st_gl_api_create();
+}
diff --git a/src/gallium/targets/egl-apis/api_OpenVG.c b/src/gallium/targets/egl-apis/api_OpenVG.c
new file mode 100644
index 00000000000..f85ebea8a1c
--- /dev/null
+++ b/src/gallium/targets/egl-apis/api_OpenVG.c
@@ -0,0 +1,8 @@
+#include "state_tracker/st_api.h"
+#include "vg_api.h"
+
+PUBLIC struct st_api *
+st_api_create_OpenVG()
+{
+ return (struct st_api *) vg_api_get();
+}