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)
+
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -O2 -fPIC -Wall -std=c99 -D_COREGL_EMBEDDED_GL")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
BuildRequires: pkgconfig(x11)
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
+BuildRequires: sec-product-features
%description
This package contains the GLESv2.0/EGL
%setup -q -n %{name}-%{version}
%build
-cmake . -DCMAKE_INSTALL_PREFIX=/usr
+
+%if 0%{?sec_product_feature_graphics_adreno}
+%else
+%global extra_option -DUSE_MALI=TRUE
+%endif
+
+cmake . -DCMAKE_INSTALL_PREFIX=/usr %{?extra_option}
make %{?jobs:-j%jobs}
void *egl_lib_handle;
void *gl_lib_handle;
+#if USE_MALI
+#define DRIVER_PATH "/usr/lib/driver"
+#else
+#define DRIVER_PATH "/usr/lib/egl"
+#endif
+
// Symbol definition for real
#define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) RET_TYPE (*_sym_##FUNC_NAME) PARAM_LIST;
#include "headers/sym.h"
{
//------------------------------------------------//
// Open EGL Library as EGL is separate
- egl_lib_handle = dlopen("/usr/lib/egl/libEGL.so", RTLD_LAZY | RTLD_LOCAL);
+ egl_lib_handle = dlopen(DRIVER_PATH "/libEGL.so", RTLD_LAZY | RTLD_LOCAL);
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 -> /usr/lib/egl/libEGL.so)\E[0m\n");
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libEGL.so)\E[0m\n", DRIVER_PATH);
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 -> /usr/lib/egl/libEGL.so)\E[0m\n");
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libEGL.so)\E[0m\n", DRIVER_PATH);
return 0;
}
// use gl_lib handle for GL symbols
- gl_lib_handle = dlopen("/usr/lib/egl/libGLESv2.so", RTLD_LAZY | RTLD_LOCAL);
+ gl_lib_handle = dlopen(DRIVER_PATH "/libGLESv2.so", RTLD_LAZY | RTLD_LOCAL);
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 -> /usr/lib/egl/libGLESv2.so)\E[0m\n");
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libGLESv2.so)\E[0m\n", DRIVER_PATH);
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 -> /usr/lib/egl/libGLESv2.so)\E[0m\n");
+ COREGL_ERR("\E[40;31;1mInvalid library link! (Check linkage of libCOREGL -> %s/libGLESv2.so)\E[0m\n", DRIVER_PATH);
return 0;
}
//------------------------------------------------//