From e9a5aef8d4176f41750d28a22afba95d22387843 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Fri, 20 Jul 2012 21:26:39 +0900 Subject: [PATCH] [Title] Fix several build issues on Mac [Type] [Module] Emulator [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- configure | 2 +- hw/virtio-pci.c | 8 ++++---- tizen/src/Makefile.tizen | 24 ++++++++++++++++++------ tizen/src/skin/maruskin_client.h | 4 ++++ vl.c | 16 ++++++++-------- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 494bcb5..528e025 100755 --- a/configure +++ b/configure @@ -417,7 +417,7 @@ Darwin) QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" fi darwin_user="yes" - cocoa="yes" + cocoa="no" audio_drv_list="coreaudio" audio_possible_drivers="coreaudio sdl fmod" LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index ce14a0d..bc14b53 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -779,7 +779,7 @@ static int virtio_balloon_exit_pci(PCIDevice *pci_dev) return virtio_exit_pci(pci_dev); } -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN extern VirtIODevice *virtio_gl_init(DeviceState *dev); static int virtio_gl_init_pci(PCIDevice *pci_dev) { @@ -793,7 +793,7 @@ static int virtio_gl_init_pci(PCIDevice *pci_dev) virtio_init_pci(proxy, vdev); return 0; } -//#endif +#endif static PCIDeviceInfo virtio_info[] = { { @@ -880,7 +880,7 @@ static PCIDeviceInfo virtio_info[] = { }, .qdev.reset = virtio_pci_reset, },{ -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN .qdev.name = "virtio-gl-pci", .qdev.alias = "virtio-gl", .qdev.size = sizeof(VirtIOPCIProxy), @@ -895,7 +895,7 @@ static PCIDeviceInfo virtio_info[] = { }, .qdev.reset = virtio_pci_reset, },{ -//#endif +#endif /* end of list */ } }; diff --git a/tizen/src/Makefile.tizen b/tizen/src/Makefile.tizen index 7a3eb5f..6e13e09 100755 --- a/tizen/src/Makefile.tizen +++ b/tizen/src/Makefile.tizen @@ -13,9 +13,14 @@ CFLAGS += -g -O2 ifdef CONFIG_WIN32 LIBS += -lavformat -lavcodec -lavutil -lm -lopengl32 -lglu32 -lgdi32 -else +endif +ifdef CONFIG_LINUX LIBS += -lavformat -lavcodec -lavutil -lm -lGL endif +ifdef CONFIG_DARWIN +# FIXME: disabled codec on Mac now +# LIBS += -lavformat -lavcodec -lavutil -lm +endif ifdef CONFIG_DEBUG_EXEC GL_CFLAGS := -Wall -g -O0 -fno-strict-aliasing @@ -23,7 +28,7 @@ else GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing endif -#ifndef CONFIG_WIN32 +ifndef CONFIG_DARWIN ########################################################### ## Build openGL # i386 @@ -51,8 +56,8 @@ opengl_exec.o : opengl_exec.c server_stub.c opengl_func.h gl_beginend.h opengl_p endif #($(TARGET_ARCH), i386) ########################################################### -#endif #CONFIG_WIN32 - +endif #!CONFIG_DARWIN + # maru loader obj-y += emulator.o emul_state.o option.o maru_err_table.o @@ -71,14 +76,21 @@ obj-y += debug_ch.o # maru hardware obj-i386-y += maru_board.o obj-i386-y += maru_overlay.o +ifndef CONFIG_DARWIN obj-i386-y += maru_codec.o +endif obj-i386-y += maru_pm.o obj-i386-y += maru_vga.o obj-i386-y += maru_brightness.o obj-i386-y += maru_touchscreen.o + +# FIXME: camera disabled +ifndef CONFIG_DARWIN obj-i386-$(CONFIG_PCI) += maru_camera_common_pci.o obj-i386-$(CONFIG_LINUX) += maru_camera_linux_pci.o obj-i386-$(CONFIG_WIN32) += maru_camera_win32_pci.o +endif + ifdef CONFIG_LINUX # libs for maru camera on linux host LIBS += -lv4l2 -lv4lconvert endif @@ -94,9 +106,9 @@ obj-i386-y += maruskin_client.o maruskin_server.o maruskin_operation.o maruskin_ # guest server obj-i386-y += guest_server.o -#ifndef CONFIG_WIN32 +ifndef CONFIG_DARWIN ########################################################### ## opengl library for i386 obj-i386-y += virtio-gl.o helper_opengl.o opengl_exec.o mesa_mipmap.o gloffscreen_common.o gloffscreen_xcomposite.o gloffscreen_wgl.o gloffscreen_test.o ########################################################### -#endif +endif diff --git a/tizen/src/skin/maruskin_client.h b/tizen/src/skin/maruskin_client.h index 4ebb900..bbde542 100644 --- a/tizen/src/skin/maruskin_client.h +++ b/tizen/src/skin/maruskin_client.h @@ -34,7 +34,11 @@ #define JAR_SKINFILE_PATH "emulator-skin.jar" #define JAVA_EXEFILE_PATH "java" +#ifndef CONFIG_DARWIN #define JAVA_EXEOPTION "-jar" +#else +#define JAVA_EXEOPTION "-XstartOnFirstThread -jar" // Must start the Java window on the first thread on Mac +#endif #define JAVA_SIMPLEMODE_OPTION "simple.msg" diff --git a/vl.c b/vl.c index f8a1500..2a77956 100644 --- a/vl.c +++ b/vl.c @@ -263,11 +263,11 @@ int boot_splash_filedata_size; uint8_t qemu_extra_params_fw[2]; //virtio-gl -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN extern int gl_acceleration_capability_check (void); int enable_gl = 0; int capability_check_gl = 0; -//#endif +#endif typedef struct FWBootEntry FWBootEntry; @@ -1792,7 +1792,7 @@ static int device_init_func(QemuOpts *opts, void *opaque) { DeviceState *dev; -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN // virtio-gl pci device if (!enable_gl) { // ignore virtio-gl-pci device, even if users set it in option. @@ -1801,7 +1801,7 @@ static int device_init_func(QemuOpts *opts, void *opaque) return 0; } } -//#endif +#endif dev = qdev_device_add(opts); if (!dev) @@ -2961,9 +2961,9 @@ int main(int argc, char **argv, char **envp) qemu_opts_parse(olist, "accel=kvm", 0); break; case QEMU_OPTION_enable_gl: -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN enable_gl = 1; -//#endif +#endif break; case QEMU_OPTION_machine: olist = qemu_find_opts("machine"); @@ -3217,7 +3217,7 @@ int main(int argc, char **argv, char **envp) } loc_set_none(); -//#ifndef _WIN32 +#ifndef CONFIG_DARWIN capability_check_gl = gl_acceleration_capability_check(); if (enable_gl && (capability_check_gl != 0)) { enable_gl = 0; @@ -3239,7 +3239,7 @@ int main(int argc, char **argv, char **envp) } } } -//#endif +#endif /* Open the logfile at this point, if necessary. We can't open the logfile -- 2.7.4