st/egl: Allow APIs other than OpenGL.
authorChia-I Wu <olvaffe@gmail.com>
Mon, 9 Nov 2009 02:54:19 +0000 (10:54 +0800)
committerBrian Paul <brianp@vmware.com>
Tue, 10 Nov 2009 18:24:26 +0000 (11:24 -0700)
This is done by stopping linking to libmesagallium.a and removing DRI
related stuff.  The state tracker an application links to decides the
API supported.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/state_trackers/egl/egl_tracker.c
src/gallium/winsys/drm/intel/egl/Makefile
src/gallium/winsys/drm/intel/egl/dummy.c [new file with mode: 0644]
src/gallium/winsys/drm/radeon/egl/Makefile
src/gallium/winsys/drm/radeon/egl/dummy.c [new file with mode: 0644]

index 8d29bf4..1ad0097 100644 (file)
@@ -167,8 +167,6 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
                goto err_screen;
        dev->winsys = dev->screen->winsys;
 
-       driInitExtensions(NULL, NULL, GL_FALSE);
-
        drm_update_res(dev);
        res = dev->res;
        if (res)
index 1397e9f..c9c92b6 100644 (file)
@@ -2,7 +2,7 @@ TOP = ../../../../../..
 GALLIUMDIR = ../../../..
 include $(TOP)/configs/current
 
-LIBNAME = EGL_i915.so
+LIBNAME = egl_i915.so
 
 PIPE_DRIVERS = \
        $(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
@@ -11,19 +11,28 @@ PIPE_DRIVERS = \
        $(TOP)/src/gallium/drivers/trace/libtrace.a \
        $(TOP)/src/gallium/drivers/i915/libi915.a
 
-DRIVER_SOURCES =
+DRIVER_EXTRAS = -lm -lpthread -ldrm_intel
 
-C_SOURCES = \
-       $(COMMON_GALLIUM_SOURCES) \
-       $(DRIVER_SOURCES)
+OBJECTS = dummy.o
 
-DRIVER_EXTRAS = -ldrm_intel
+default: $(TOP)/$(LIB_DIR)/$(LIBNAME)
 
-ASM_SOURCES = 
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+       @mkdir -p $(TOP)/$(LIB_DIR)
+       $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
 
-DRIVER_DEFINES = -I../gem $(shell pkg-config libdrm --atleast-version=2.3.1 \
-                               && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
+$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile
+       $(MKLIB) -noprefix -o $@ $(OBJECTS) \
+               -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \
+               -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \
+                 $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
 
-include ../../Makefile.template
+clean:
+       -rm -f *.o *.so *~
+
+depend:
 
 symlinks:
+
+install: $(LIBNAME)
+       $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR)
diff --git a/src/gallium/winsys/drm/intel/egl/dummy.c b/src/gallium/winsys/drm/intel/egl/dummy.c
new file mode 100644 (file)
index 0000000..58c7af8
--- /dev/null
@@ -0,0 +1 @@
+/* mklib expects at least one .o is given */
index 6a1448d..2bd05a8 100644 (file)
@@ -2,7 +2,7 @@ TOP = ../../../../../..
 GALLIUMDIR = ../../../..
 include $(TOP)/configs/current
 
-LIBNAME = EGL_r300.so
+LIBNAME = egl_r300.so
 
 PIPE_DRIVERS = \
        $(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
@@ -11,16 +11,28 @@ PIPE_DRIVERS = \
        $(TOP)/src/gallium/drivers/trace/libtrace.a \
        $(TOP)/src/gallium/drivers/r300/libr300.a
 
-DRIVER_SOURCES =
+DRIVER_EXTRAS = -lm -lpthread -ldrm_radeon
 
-C_SOURCES = \
-       $(COMMON_GALLIUM_SOURCES) \
-       $(DRIVER_SOURCES)
+OBJECTS = dummy.o
 
-DRIVER_EXTRAS = -ldrm_radeon
+default: $(TOP)/$(LIB_DIR)/$(LIBNAME)
 
-ASM_SOURCES = 
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+       @mkdir -p $(TOP)/$(LIB_DIR)
+       $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
 
-include ../../Makefile.template
+$(LIBNAME): $(OBJECTS) $(GALLIUM_AUXILIARIES) $(PIPE_DRIVERS) Makefile
+       $(MKLIB) -noprefix -o $@ $(OBJECTS) \
+               -Wl,--whole-archive $(PIPE_DRIVERS) -Wl,--no-whole-archive \
+               -Wl,--start-group $(GALLIUM_AUXILIARIES) -Wl,--end-group \
+                 $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
+
+clean:
+       -rm -f *.o *.so *~
+
+depend:
 
 symlinks:
+
+install: $(LIBNAME)
+       $(MINSTALL) -m 755 $(LIBNAME) $(INSTALL_DIR)/$(LIB_DIR)
diff --git a/src/gallium/winsys/drm/radeon/egl/dummy.c b/src/gallium/winsys/drm/radeon/egl/dummy.c
new file mode 100644 (file)
index 0000000..58c7af8
--- /dev/null
@@ -0,0 +1 @@
+/* mklib expects at least one .o is given */