diff --git a/tools/emulator/opengl/host/libs/GLESv1_dec/Android.mk b/tools/emulator/opengl/host/libs/GLESv1_dec/Android.mk index e9bc81c1e..e0413651e 100644 --- a/tools/emulator/opengl/host/libs/GLESv1_dec/Android.mk +++ b/tools/emulator/opengl/host/libs/GLESv1_dec/Android.mk @@ -2,9 +2,8 @@ LOCAL_PATH := $(call my-dir) $(call emugl-begin-host-shared-library,libGLESv1_dec) -$(call emugl-import, libOpenglCodecCommon) +$(call emugl-import, libOpenglCodecCommon libOpenglOsUtils) $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) -$(call emugl-export,LDLIBS,-ldl) $(call emugl-gen-decoder,$(EMUGL_PATH)/system/GLESv1_enc,gl) diff --git a/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp b/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp index facb3dbdf..e6ccbd981 100644 --- a/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp +++ b/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.cpp @@ -15,7 +15,6 @@ */ #include "GLDecoder.h" #include -#include #include #include #include @@ -31,7 +30,7 @@ GLDecoder::GLDecoder() GLDecoder::~GLDecoder() { if (m_glesDso != NULL) { - dlclose(m_glesDso); + delete m_glesDso; } } @@ -44,7 +43,7 @@ int GLDecoder::initGL(get_proc_func_t getProcFunc, void *getProcFuncData) libname = getenv(GLES_LIBNAME_VAR); } - m_glesDso = dlopen(libname, RTLD_NOW); + m_glesDso = osUtils::dynLibrary::open(libname); if (m_glesDso == NULL) { fprintf(stderr, "Couldn't find %s \n", GLES_LIBNAME); return -1; @@ -233,7 +232,7 @@ void *GLDecoder::s_getProc(const char *name, void *userData) func = (void *) eglGetProcAddress(name); #endif if (func == NULL) { - func = dlsym(ctx->m_glesDso, name); + func = (void *)(ctx->m_glesDso->findSymbol(name)); } return func; } diff --git a/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.h b/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.h index 7df3d1926..95d1e8202 100644 --- a/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.h +++ b/tools/emulator/opengl/host/libs/GLESv1_dec/GLDecoder.h @@ -19,6 +19,7 @@ #include "gl_dec.h" #include "FixedBuffer.h" #include "GLDecoderContextData.h" +#include #define GLES_LIBNAME_VAR "ANDROID_GLESv1_LIB" #define GLES_LIBNAME "libGLES_CM.so" @@ -64,7 +65,7 @@ private: static void * s_getProc(const char *name, void *userData); GLDecoderContextData *m_contextData; - void *m_glesDso; + osUtils::dynLibrary* m_glesDso; }; #endif diff --git a/tools/emulator/opengl/host/libs/Translator/GLcommon/Android.mk b/tools/emulator/opengl/host/libs/Translator/GLcommon/Android.mk index 1c7615b43..17ab080c9 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLcommon/Android.mk +++ b/tools/emulator/opengl/host/libs/Translator/GLcommon/Android.mk @@ -29,6 +29,6 @@ ifeq ($(HOST_OS),windows) endif $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/../include $(EMUGL_PATH)/shared) -$(call emugl-export,STATIC_LIBRARIES, libcutils liblog) +$(call emugl-export,STATIC_LIBRARIES, libcutils libutils liblog) $(call emugl-end-module) diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/Android.mk b/tools/emulator/opengl/host/libs/libOpenglRender/Android.mk index 9bf74b7cc..3f69f63d2 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/Android.mk +++ b/tools/emulator/opengl/host/libs/libOpenglRender/Android.mk @@ -25,6 +25,11 @@ LOCAL_SRC_FILES := \ $(call emugl-export,C_INCLUDES,$(EMUGL_PATH)/host/include) +# use Translator's egl/gles headers +LOCAL_C_INCLUDES += $(EMUGL_PATH)/host/libs/Translator/include + +LOCAL_STATIC_LIBRARIES += libutils liblog + $(call emugl-end-module) endif # HOST_OS != darwin diff --git a/tools/emulator/opengl/host/tools/emugen/Android.mk b/tools/emulator/opengl/host/tools/emugen/Android.mk index 9a9751d44..51330ec10 100644 --- a/tools/emulator/opengl/host/tools/emugen/Android.mk +++ b/tools/emulator/opengl/host/tools/emugen/Android.mk @@ -1,3 +1,5 @@ +ifneq ($(HOST_OS),windows) + LOCAL_PATH:=$(call my-dir) $(call emugl-begin-host-executable,emugen) @@ -14,3 +16,5 @@ $(call emugl-end-module) # The location of the emugen host tool that is used to generate wire # protocol encoders/ decoders. This variable is used by other emugl modules. EMUGL_EMUGEN := $(LOCAL_BUILT_MODULE) + +endif diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp b/tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp index e9e046199..50aeb030e 100644 --- a/tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp +++ b/tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp @@ -16,7 +16,7 @@ #include "TimeUtils.h" #ifdef _WIN32 -#include +#include #include #include #elif defined(__linux__)