[Issue#]
[Problem]
[Cause]
[Solution]
- Remove vendor dependencies in code section (MALI or ADRENO)
EXEC_PROGRAM(date OUTPUT_VARIABLE COMPILE_DATE)
ADD_DEFINITIONS("-D_COREGL_COMPILE_DATE=\"${COMPILE_DATE}\"")
EXEC_PROGRAM(date OUTPUT_VARIABLE COMPILE_DATE)
ADD_DEFINITIONS("-D_COREGL_COMPILE_DATE=\"${COMPILE_DATE}\"")
-IF(USE_MALI)
-ADD_DEFINITIONS(-DUSE_MALI)
-ENDIF(USE_MALI)
+IF(USE_ADRENO)
+ADD_DEFINITIONS("-D_COREGL_VENDOR_EGL_LIB_PATH=\"/usr/lib/egl/libEGL.so\"")
+ADD_DEFINITIONS("-D_COREGL_VENDOR_GL_LIB_PATH=\"/usr/lib/egl/libGLESv2.so\"")
+ENDIF(USE_ADRENO)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -O2 -fPIC -Wall -std=c99 -D_COREGL_EMBEDDED_GL")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -O2 -fPIC -Wall -std=c99 -D_COREGL_EMBEDDED_GL")
COMPILE_DATE = "\"`git log -1 --pretty=format:%ci`\""
COMPILE_DATE = "\"`git log -1 --pretty=format:%ci`\""
+VENDOR_EGL_LIB_PATH = "\"/usr/lib/egl/libEGL.so\""
+VENDOR_GL_LIB_PATH = "\"/usr/lib/egl/libGLESv2.so\""
+
CFLAGS = -g -O2 -fvisibility=hidden -fPIC -Wall -std=c99 -D_COREGL_COMPILE_DATE=$(COMPILE_DATE)
CFLAGS = -g -O2 -fvisibility=hidden -fPIC -Wall -std=c99 -D_COREGL_COMPILE_DATE=$(COMPILE_DATE)
+CFLAGS += -D_COREGL_VENDOR_EGL_LIB_PATH=$(VENDOR_EGL_LIB_PATH)
+CFLAGS += -D_COREGL_VENDOR_GL_LIB_PATH=$(VENDOR_GL_LIB_PATH)
CFLAGS += `pkg-config --cflags dlog`
LDFLAGS = -g -O2 -fvisibility=hidden -Wall -std=c99 -ldl -lpthread
CFLAGS += `pkg-config --cflags dlog`
LDFLAGS = -g -O2 -fvisibility=hidden -Wall -std=c99 -ldl -lpthread
%build
%if 0%{?sec_product_feature_graphics_adreno}
%build
%if 0%{?sec_product_feature_graphics_adreno}
-%else
-%global extra_option -DUSE_MALI=TRUE
+%global extra_option -DUSE_ADRENO=TRUE
%endif
cmake . -DCMAKE_INSTALL_PREFIX=/usr %{?extra_option}
%endif
cmake . -DCMAKE_INSTALL_PREFIX=/usr %{?extra_option}
void *egl_lib_handle;
void *gl_lib_handle;
void *egl_lib_handle;
void *gl_lib_handle;
-#if USE_MALI
-#define DRIVER_PATH "/usr/lib/driver"
-#else
-#define DRIVER_PATH "/usr/lib/egl"
+#ifndef _COREGL_VENDOR_EGL_LIB_PATH
+#define _COREGL_VENDOR_EGL_LIB_PATH "/usr/lib/driver/libEGL.so" /* DEFAULT EGL PATH */
+#endif
+
+#ifndef _COREGL_VENDOR_GL_LIB_PATH
+#define _COREGL_VENDOR_GL_LIB_PATH "/usr/lib/driver/libGLESv2.so" /* DEFAULT GL PATH */
#endif
// Symbol definition for real
#endif
// Symbol definition for real
{
//------------------------------------------------//
// Open EGL Library as EGL is separate
{
//------------------------------------------------//
// Open EGL Library as EGL is separate
- egl_lib_handle = dlopen(DRIVER_PATH "/libEGL.so", RTLD_LAZY | RTLD_LOCAL);
+ egl_lib_handle = dlopen(_COREGL_VENDOR_EGL_LIB_PATH, RTLD_LAZY | RTLD_LOCAL);
if (!egl_lib_handle)
{
COREGL_ERR("\E[40;31;1m%s\E[0m\n\n", dlerror());
if (!egl_lib_handle)
{
COREGL_ERR("\E[40;31;1m%s\E[0m\n\n", dlerror());
- COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libEGL.so)\E[0m\n", DRIVER_PATH);
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s)\E[0m\n", _COREGL_VENDOR_EGL_LIB_PATH);
return 0;
}
// test for invalid linking egl
if (dlsym(egl_lib_handle, "coregl_symbol_exported"))
{
return 0;
}
// test for invalid linking egl
if (dlsym(egl_lib_handle, "coregl_symbol_exported"))
{
- COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libEGL.so)\E[0m\n", DRIVER_PATH);
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s)\E[0m\n", _COREGL_VENDOR_EGL_LIB_PATH);
return 0;
}
// use gl_lib handle for GL symbols
return 0;
}
// use gl_lib handle for GL symbols
- gl_lib_handle = dlopen(DRIVER_PATH "/libGLESv2.so", RTLD_LAZY | RTLD_LOCAL);
+ gl_lib_handle = dlopen(_COREGL_VENDOR_GL_LIB_PATH, RTLD_LAZY | RTLD_LOCAL);
if (!gl_lib_handle)
{
COREGL_ERR("\E[40;31;1m%s\E[0m\n\n", dlerror());
if (!gl_lib_handle)
{
COREGL_ERR("\E[40;31;1m%s\E[0m\n\n", dlerror());
- COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libGLESv2.so)\E[0m\n", DRIVER_PATH);
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s)\E[0m\n", _COREGL_VENDOR_GL_LIB_PATH);
return 0;
}
// test for invalid linking gl
if (dlsym(gl_lib_handle, "coregl_symbol_exported"))
{
return 0;
}
// test for invalid linking gl
if (dlsym(gl_lib_handle, "coregl_symbol_exported"))
{
- COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libGLESv2.so)\E[0m\n", DRIVER_PATH);
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s)\E[0m\n", _COREGL_VENDOR_GL_LIB_PATH);
return 0;
}
//------------------------------------------------//
return 0;
}
//------------------------------------------------//