Add check-gl binary for gl capability check by emulator manager.
authorSangjin Kim <sangjin3.kim@samsung.com>
Thu, 7 Mar 2013 09:41:15 +0000 (18:41 +0900)
committerSangjin Kim <sangjin3.kim@samsung.com>
Thu, 7 Mar 2013 09:41:15 +0000 (18:41 +0900)
Signed-off-by: Sangjin Kim <sangjin3.kim@samsung.com>
Makefile.target
tizen/src/Makefile
tizen/src/check_gl.c [new file with mode: 0644]

index 5fa5c814aa2ca98ac4dae5af7df1cba6b38cd503..a0175dfcdbf429da0d337ddacf5a2b8c93d7f988 100755 (executable)
@@ -62,7 +62,7 @@ else
 stap:
 endif
 
-all: $(PROGS) stap
+all: $(PROGS) stap check-gl
 
 # Dummy command so that make thinks it has done something
        @true
@@ -298,6 +298,30 @@ $(QEMU_PROG): $(all-obj-y)
        $(call LINK,$^)
 endif
 
+CHECK_GL_OBJS = check_gl.o gloffscreen_test.o gloffscreen_common.o 
+CHECK_GL_LDFLAGS =
+CHECK_GL_TARGET =
+ifdef CONFIG_LINUX
+CHECK_GL_OBJS += gloffscreen_xcomposite.o
+CHECK_GL_LDFLAGS += -lGL -lXcomposite -lXext -lglib-2.0
+CHECK_GL_TARGET = check-gl
+endif
+ifdef CONFIG_WIN32
+CHECK_GL_OBJS += gloffscreen_wgl.o
+CHECK_GL_LDFLAGS += -fstack-protector `pkg-config --libs glib-2.0` -lopengl32 -lglu32 -lgdi32
+CHECK_GL_TARGET = check-gl.exe
+endif
+ifdef CONFIG_DARWIN
+CHECK_GL_OBJS += gloffscreen_agl.o
+CHECK_GL_LDFLAGS += -mmacosx-version-min=10.4 `pkg-config --cflags --libs glib-2.0` -framework GLUT -framework OpenGL -framework AGL
+CHECK_GL_TARGET = check-gl
+endif
+
+check-gl: check_gl.o
+       gcc -o $(CHECK_GL_TARGET) $(CHECK_GL_OBJS) $(CHECK_GL_LDFLAGS)
+check_gl.o: check_gl.c
+       gcc -c ../tizen/src/check_gl.c
+
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
        $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
 
index 2d068d629be1de4f7283e8420e0836d85b437e22..4dc67fdfe3c8e24a2a1ffb018a5db1864089f807 100755 (executable)
@@ -27,6 +27,7 @@ endif
 ifdef CONFIG_DARWIN
        $(CC) -mmacosx-version-min=10.4 -o check-hax check_hax.c        
 endif
+
 skin_client:
        ant -buildfile skin/client/build.xml make-jar
 
@@ -100,13 +101,16 @@ endif
        
        cp skin/client/emulator-skin.jar $(EMUL_DIR)/bin
 ifdef CONFIG_WIN32
+       cp ../../i386-softmmu/check-gl.exe $(EMUL_DIR)/bin/
        cp check-hax.exe $(EMUL_DIR)/bin
 endif
 ifdef CONFIG_DARWIN
+       cp ../../i386-softmmu/check-gl $(EMUL_DIR)/bin/
        cp check-hax $(EMUL_DIR)/bin
        cp sdbscript $(EMUL_DIR)/bin
 endif
 ifdef CONFIG_LINUX
+       cp ../../i386-softmmu/check-gl $(EMUL_DIR)/bin/
        cp -pPr ../distrib/initscript/tizen-kvm $(EMUL_DIR)/etc
        cp -pPr ../distrib/initscript/45-tizen-kvm.rules $(EMUL_DIR)/etc
 endif
diff --git a/tizen/src/check_gl.c b/tizen/src/check_gl.c
new file mode 100644 (file)
index 0000000..1d83edb
--- /dev/null
@@ -0,0 +1,7 @@
+#include "hw/gloffscreen_test.h"
+#include "debug_ch.h"
+
+int main (int argc, char** argv)
+{
+       return gl_acceleration_capability_check();
+}