diff options
author | Jesse Hall <jessehall@google.com> | 2012-04-26 15:13:27 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-04-26 16:54:26 -0700 |
commit | 183e927350a14945e13ab217e16ab5dce20349f3 (patch) | |
tree | 190bdb0d954f3dbe952c94895d147c0df2145073 | |
parent | 0c8a719be79b979a039abaf24432de6fbc9b13e6 (diff) | |
download | external_qemu-183e927350a14945e13ab217e16ab5dce20349f3.zip external_qemu-183e927350a14945e13ab217e16ab5dce20349f3.tar.gz external_qemu-183e927350a14945e13ab217e16ab5dce20349f3.tar.bz2 |
Fix standalone emulator build.
- Allow building with OpenGL ES acceleration disabled, avoiding a
dependency on stuff outside the QEMU project.
- Allow the standalone configure.sh to provide the include/lib path
for the OpenGL ES libraries.
- Update the default OpenGL ES include path for standalone builds.
Change-Id: I03f4627af4c271783b65a116ceb5934385c68cdc
-rw-r--r-- | Makefile.android | 3 | ||||
-rw-r--r-- | Makefile.common | 4 | ||||
-rw-r--r-- | Makefile.target | 5 | ||||
-rwxr-xr-x | android-configure.sh | 2 | ||||
-rw-r--r-- | android/config/darwin-x86/config-host.h | 1 | ||||
-rw-r--r-- | android/config/linux-x86/config-host.h | 1 | ||||
-rw-r--r-- | android/config/windows/config-host.h | 1 | ||||
-rw-r--r-- | android/opengles.c | 49 |
8 files changed, 58 insertions, 8 deletions
diff --git a/Makefile.android b/Makefile.android index 7b35039..7e66bd9 100644 --- a/Makefile.android +++ b/Makefile.android @@ -116,6 +116,9 @@ ifneq ($(BUILD_STANDALONE_EMULATOR),true) endif ccache := endif + + QEMU_OPENGLES_INCLUDE := sdk/emulator/opengl/host/include + QEMU_OPENGLES_LIBS := $(HOST_OUT) endif diff --git a/Makefile.common b/Makefile.common index 5307b28..20b6fa7 100644 --- a/Makefile.common +++ b/Makefile.common @@ -164,7 +164,9 @@ endif # HOST_OS == linux common_LOCAL_CFLAGS = common_LOCAL_SRC_FILES = -EMULATOR_LIBUI_CFLAGS := -Isdk/emulator/opengl/host/include +ifneq ($(QEMU_OPENGLES_INCLUDE),) + EMULATOR_LIBUI_CFLAGS := -I$(QEMU_OPENGLES_INCLUDE) +endif common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) diff --git a/Makefile.target b/Makefile.target index f7122fa..45c8e69 100644 --- a/Makefile.target +++ b/Makefile.target @@ -274,8 +274,11 @@ LOCAL_CFLAGS += \ $(EMULATOR_TARGET_CFLAGS) \ -DCONFIG_STANDALONE_CORE \ -LOCAL_CFLAGS += -Isdk/emulator/opengl/host/include -Wno-missing-field-initializers +ifneq ($(QEMU_OPENGLES_INCLUDE),) + LOCAL_CFLAGS += -I$(QEMU_OPENGLES_INCLUDE) +endif +LOCAL_CFLAGS += -Wno-missing-field-initializers LOCAL_STATIC_LIBRARIES := \ emulator-libqemu \ diff --git a/android-configure.sh b/android-configure.sh index 5620e0e..beb7427 100755 --- a/android-configure.sh +++ b/android-configure.sh @@ -240,7 +240,7 @@ if [ "$IN_ANDROID_BUILD" = "yes" ] ; then GLES_SUPPORT=yes if [ -z "$GLES_INCLUDE" ]; then log "GLES : Probing for headers" - GLES_INCLUDE=$ANDROID_TOP/development/tools/emulator/opengl/host/include + GLES_INCLUDE=$ANDROID_TOP/sdk/emulator/opengl/host/include if [ -d "$GLES_INCLUDE" ]; then log "GLES : Headers in $GLES_INCLUDE" else diff --git a/android/config/darwin-x86/config-host.h b/android/config/darwin-x86/config-host.h index 97a83dc..d5e8507 100644 --- a/android/config/darwin-x86/config-host.h +++ b/android/config/darwin-x86/config-host.h @@ -26,3 +26,4 @@ #define CONFIG_ANDROID 1 #define CONFIG_POSIX 1 #define CONFIG_MADVISE 1 +#define CONFIG_ANDROID_OPENGLES 1 diff --git a/android/config/linux-x86/config-host.h b/android/config/linux-x86/config-host.h index 70b9ce7..d9f04fa 100644 --- a/android/config/linux-x86/config-host.h +++ b/android/config/linux-x86/config-host.h @@ -26,3 +26,4 @@ #define CONFIG_POSIX 1 #define CONFIG_ANDROID 1 #define CONFIG_MADVISE 1 +#define CONFIG_ANDROID_OPENGLES 1 diff --git a/android/config/windows/config-host.h b/android/config/windows/config-host.h index 1b50927..2d2fdc6 100644 --- a/android/config/windows/config-host.h +++ b/android/config/windows/config-host.h @@ -18,3 +18,4 @@ #define QEMU_PKGVERSION "Android" #define CONFIG_WIN32 1 #define CONFIG_ANDROID 1 +#define CONFIG_ANDROID_OPENGLES 1 diff --git a/android/opengles.c b/android/opengles.c index e90a477..d1f4322 100644 --- a/android/opengles.c +++ b/android/opengles.c @@ -10,25 +10,29 @@ ** GNU General Public License for more details. */ -#define RENDER_API_NO_PROTOTYPES 1 - #include "config-host.h" #include "android/opengles.h" + +/* Declared in "android/globals.h" */ +int android_gles_fast_pipes = 1; + +#if CONFIG_ANDROID_OPENGLES + #include "android/globals.h" #include <android/utils/debug.h> #include <android/utils/path.h> #include <android/utils/bufprint.h> #include <android/utils/dll.h> + +#define RENDER_API_NO_PROTOTYPES 1 #include <libOpenglRender/render_api.h> + #include <stdio.h> #include <stdlib.h> #define D(...) VERBOSE_PRINT(init,__VA_ARGS__) #define DD(...) VERBOSE_PRINT(gles,__VA_ARGS__) -/* Declared in "android/globals.h" */ -int android_gles_fast_pipes = 1; - /* Name of the GLES rendering library we're going to use */ #if HOST_LONG_BITS == 32 #define RENDERER_LIB_NAME "libOpenglRender" @@ -199,3 +203,38 @@ android_gles_unix_path(char* buff, size_t buffsize, int port) } p = bufprint(p, end, "qemu-gles-%d", port); } + +#else // CONFIG_ANDROID_OPENGLES + +int android_initOpenglesEmulation(void) +{ + return -1; +} + +int android_startOpenglesRenderer(int width, int height, OnPostFunc onPost, void* onPostContext) +{ + return -1; +} + +void android_stopOpenglesRenderer(void) +{} + +int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation) +{ + return -1; +} + +int android_hideOpenglesWindow(void) +{ + return -1; +} + +void android_redrawOpenglesWindow(void) +{} + +void android_gles_unix_path(char* buff, size_t buffsize, int port) +{ + buff[0] = '\0'; +} + +#endif // !CONFIG_ANDROID_OPENGLES |