diff options
-rw-r--r-- | CleanSpec.mk | 3 | ||||
-rw-r--r-- | Makefile.android | 5 | ||||
-rw-r--r-- | android/opengles.c | 25 | ||||
-rwxr-xr-x | distrib/build-kernel.sh | 4 | ||||
-rw-r--r-- | distrib/libpng-1.2.19/sources.make | 3 | ||||
-rw-r--r-- | distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c | 8 | ||||
-rw-r--r-- | exec.c | 2 | ||||
-rw-r--r-- | net-android.c | 2 | ||||
-rw-r--r-- | net.c | 2 |
9 files changed, 38 insertions, 16 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk index 0bfecdc..b64769e 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -1,3 +1,6 @@ # This empty file is here solely for the purpose of optimizing the Android build # Please keep it there, and empty, thanks :-) # + +$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/obj/{SHARED,STATIC}_LIBRARIES/emulator*) +$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/obj/EXECUTABLES/emulator*) diff --git a/Makefile.android b/Makefile.android index d61264b..00faa1c 100644 --- a/Makefile.android +++ b/Makefile.android @@ -39,8 +39,9 @@ MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM) # Overwrite configuration for debug builds. # ifeq ($(BUILD_DEBUG_EMULATOR),true) - MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \ - -fno-PIC -falign-functions=0 + MY_CFLAGS := $(CONFIG_INCLUDES) + MY_CFLAGS += -O0 -g + MY_CFLAGS += -fno-PIC -falign-functions=0 endif MY_LDLIBS := diff --git a/android/opengles.c b/android/opengles.c index f56252c..7405750 100644 --- a/android/opengles.c +++ b/android/opengles.c @@ -60,6 +60,7 @@ extern int android_init_opengles_pipes(void); #endif static ADynamicLibrary* rendererLib; +static int rendererStarted; /* Define the function pointers */ #define DYNLINK_FUNC(name) \ @@ -147,10 +148,16 @@ android_startOpenglesRenderer(int width, int height) return -1; } + if (rendererStarted) { + return 0; + } + if (!initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT)) { D("Can't start OpenGLES renderer?"); return -1; } + + rendererStarted = 1; return 0; } @@ -199,6 +206,15 @@ android_getOpenglesHardwareStrings(char* vendor, size_t vendorBufSize, { const char *vendorSrc, *rendererSrc, *versionSrc; + assert(vendorBufSize > 0 && rendererBufSize > 0 && versionBufSize > 0); + assert(vendor != NULL && renderer != NULL && version != NULL); + + if (!rendererStarted) { + D("Can't get OpenGL ES hardware strings when renderer not started"); + vendor[0] = renderer[0] = version = '\0'; + return; + } + getHardwareStrings(&vendorSrc, &rendererSrc, &versionSrc); if (!vendorSrc) vendorSrc = ""; if (!rendererSrc) rendererSrc = ""; @@ -221,15 +237,16 @@ android_getOpenglesHardwareStrings(char* vendor, size_t vendorBufSize, void android_stopOpenglesRenderer(void) { - if (rendererLib) { + if (rendererStarted) { stopOpenGLRenderer(); + rendererStarted = 0; } } int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation) { - if (rendererLib) { + if (rendererStarted) { int success = createOpenGLSubwindow((FBNativeWindowType)window, x, y, width, height, rotation); return success ? 0 : -1; } else { @@ -240,7 +257,7 @@ android_showOpenglesWindow(void* window, int x, int y, int width, int height, fl int android_hideOpenglesWindow(void) { - if (rendererLib) { + if (rendererStarted) { int success = destroyOpenGLSubwindow(); return success ? 0 : -1; } else { @@ -251,7 +268,7 @@ android_hideOpenglesWindow(void) void android_redrawOpenglesWindow(void) { - if (rendererLib) { + if (rendererStarted) { repaintOpenGLDisplay(); } } diff --git a/distrib/build-kernel.sh b/distrib/build-kernel.sh index 67488ac..5838da3 100755 --- a/distrib/build-kernel.sh +++ b/distrib/build-kernel.sh @@ -231,9 +231,9 @@ esac cp -f vmlinux $OUTPUT/$OUTPUT_VMLINUX if [ ! -z $ZIMAGE ]; then cp -f arch/$ARCH/boot/$ZIMAGE $OUTPUT/$OUTPUT_KERNEL - echo "Kernel $CONFIG prebuilt images ($OUTPUT_KERNEL and $OUTPUT_VMLINUX) copied to $OUTPUT successfully !" else - echo "Kernel $CONFIG prebuilt image ($OUTPUT_VMLINUX) copied to $OUTPUT successfully !" + cp -f vmlinux $OUTPUT/$OUTPUT_KERNEL fi +echo "Kernel $CONFIG prebuilt images ($OUTPUT_KERNEL and $OUTPUT_VMLINUX) copied to $OUTPUT successfully !" exit 0 diff --git a/distrib/libpng-1.2.19/sources.make b/distrib/libpng-1.2.19/sources.make index f512f7b..4d11126 100644 --- a/distrib/libpng-1.2.19/sources.make +++ b/distrib/libpng-1.2.19/sources.make @@ -7,8 +7,10 @@ LIBPNG_SOURCES := png.c pngerror.c pngget.c pngmem.c pngpread.c pngread.c \ # Enable MMX code path for x86, except on Darwin where it fails PNG_MMX := no ifeq ($(HOST_ARCH),x86) +ifneq ($(BUILD_DEBUG_EMULATOR),true) PNG_MMX := yes endif +endif ifeq ($(HOST_OS),darwin) PNG_MMX := no endif @@ -20,4 +22,3 @@ else endif LIBPNG_SOURCES := $(LIBPNG_SOURCES:%=$(LIBPNG_DIR)/%) - diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c b/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c index 346e9e7..34abbb0 100644 --- a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c +++ b/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c @@ -601,9 +601,9 @@ SDL_NAME(XF86DGAForkApp)(int screen) XSync(sp->display, False); } if (WIFEXITED(status)) - _exit(0); + exit(0); else - _exit(-1); + exit(-1); } return pid; } @@ -652,7 +652,7 @@ XF86cleanup(int sig) static char beenhere = 0; if (beenhere) - _exit(3); + exit(3); beenhere = 1; for (i = 0; i < numScrs; i++) { @@ -660,7 +660,7 @@ XF86cleanup(int sig) SDL_NAME(XF86DGADirectVideo)(sp->display, sp->screen, 0); XSync(sp->display, False); } - _exit(3); + exit(3); } Bool @@ -1527,7 +1527,7 @@ void cpu_set_log(int log_flags) logfile = fopen(logfilename, log_append ? "a" : "w"); if (!logfile) { perror(logfilename); - _exit(1); + exit(1); } #if !defined(CONFIG_SOFTMMU) /* must avoid mmap() usage of glibc by setting a buffer "by hand" */ diff --git a/net-android.c b/net-android.c index 6459eff..50b816c 100644 --- a/net-android.c +++ b/net-android.c @@ -1485,7 +1485,7 @@ static int launch_script(const char *setup_script, const char *ifname, int fd) *parg++ = (char *)ifname; *parg++ = NULL; execv(setup_script, args); - _exit(1); + exit(1); } else if (pid > 0) { while (waitpid(pid, &status, 0) != pid) { /* loop */ @@ -1357,7 +1357,7 @@ static int launch_script(const char *setup_script, const char *ifname, int fd) *parg++ = (char *)ifname; *parg++ = NULL; execv(setup_script, args); - _exit(1); + exit(1); } else if (pid > 0) { while (waitpid(pid, &status, 0) != pid) { /* loop */ |