scripts: modified launch script
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 22 May 2015 08:15:48 +0000 (17:15 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 12 Jun 2015 10:05:57 +0000 (19:05 +0900)
Modified launch script for Mac.
Added remote/lib to library path under Linux.
All environment variables set by script.
Added "--with-gdb" features in batch file.
Installed emulator.sh on Windows for mingw users.

Change-Id: Ida332ccc2c6ffc448b83ca73b4adf9c650b86153
(cherry picked from commit ac1ffe7ddb195b5950eef74f181aacbc82f86a15)
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
tizen/src/Makefile
tizen/src/scripts/emulator.bat [deleted file]
tizen/src/scripts/emulator.cmd [new file with mode: 0644]
tizen/src/scripts/emulator.sh

index fb0aca2..20ff2fa 100644 (file)
@@ -144,10 +144,9 @@ install: all
 
        cp -pP ../../qemu-img$(EXESUF) $(EMUL_DIR)/bin
 
-ifndef CONFIG_WIN32
        cp -pP scripts/emulator.sh $(EMUL_DIR)/bin
-else
-       cp -pP scripts/emulator.bat $(EMUL_DIR)/bin
+ifdef CONFIG_WIN32
+       cp -pP scripts/emulator.cmd $(EMUL_DIR)/bin
 endif
 
 # resources and jar for skin
@@ -269,10 +268,9 @@ install_dibs: all_dibs
 
        cp -pP ../../qemu-img$(EXESUF) $(DIBS_COMMON_DIR)/bin
 
-ifndef CONFIG_WIN32
        cp -pP scripts/emulator.sh $(DIBS_COMMON_DIR)/bin
-else
-       cp -pP scripts/emulator.bat $(DIBS_COMMON_DIR)/bin
+ifdef CONFIG_WIN32
+       cp -pP scripts/emulator.cmd $(DIBS_COMMON_DIR)/bin
 endif
 
 # resources and jar for skin
diff --git a/tizen/src/scripts/emulator.bat b/tizen/src/scripts/emulator.bat
deleted file mode 100644 (file)
index e390305..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-
-rem find EMULATOR_BIN_PATH
-SET EMULATOR_BIN_PATH=%~dp0
-
-rem run emulator
-%EMULATOR_BIN_PATH%\emulator-x86 %*
diff --git a/tizen/src/scripts/emulator.cmd b/tizen/src/scripts/emulator.cmd
new file mode 100644 (file)
index 0000000..edae181
--- /dev/null
@@ -0,0 +1,23 @@
+@echo off
+
+SETLOCAL
+
+SET EMULATOR_BIN_PATH=%~dp0
+
+rem set environment variables
+SET SDL_STDIO_REDIRECT=0
+SET GL_VERSION=2
+SET VIGS_SYNC_READ_PIXELS=1
+
+set WITH_GDB="no"
+IF "%1"=="--with-gdb" (
+       set WITH_GDB="yes"
+       SHIFT
+)
+
+rem run emulator
+IF %WITH_GDB%=="yes" (
+       gdb --args %EMULATOR_BIN_PATH%\emulator-x86 %*
+) ELSE (
+       %EMULATOR_BIN_PATH%\emulator-x86 %*
+)
index 3c3a703..a6096fb 100755 (executable)
@@ -1,23 +1,33 @@
 #!/bin/sh
 
-# find EMUALTOR_INSTALLED_PATH
-SCRIPT=$(readlink -f "$0")
-SCRIPT_DIR=$(dirname "$SCRIPT")
-
-if [ ! -z $TIZEN_SDK_PATH ]; then
-       EMULATOR_INSTALLED_PATH=$TIZEN_SDK_PATH/tools/emulator
-elif [ -e "$SCRIPT_DIR/../../../sdk.info" ]; then
-       EMULATOR_INSTALLED_PATH=$SCRIPT_DIR/..
-elif [ -e "$HOME/.installmanager/tizensdkpath" ]; then
-       . $HOME/.installmanager/tizensdkpath
-       EMULATOR_INSTALLED_PATH=$TIZEN_SDK_INSTALLED_PATH/tools/emulator
-fi
+if [ "$(uname | cut -c 1-5)" = "Linux" ]; then
+# under linux
+SCRIPT_DIR=$(dirname $(readlink -f "$0"))
+EMULATOR_INSTALLED_PATH=$(readlink -f "$SCRIPT_DIR/..")
+EMULATOR_BIN_PATH=$EMULATOR_INSTALLED_PATH/bin
+EMULATOR_TOOL_PATH=$EMULATOR_INSTALLED_PATH/../../../../tools/emulator
 
-EMULATOR_INSTALLED_PATH=$(readlink -f $EMULATOR_INSTALLED_PATH)
+# set env variables for linux
+export LD_LIBRARY_PATH=$EMULATOR_BIN_PATH:$EMULATOR_TOOL_PATH/remote/lib:
+elif [ "$(uname | cut -c 1-6)" = "Darwin" ]; then
+# under darwin
+EMULATOR_INSTALLED_PATH=$(cd $(dirname "$0"); cd ..; pwd)
+EMULATOR_BIN_PATH=$EMULATOR_INSTALLED_PATH/bin
 
-# prepare running
+# set env variables for darwin
+# nothing now...
+elif [ "$(uname | cut -c 1-5)" = "MINGW" ]; then
+# under mingw
+SCRIPT_DIR=$(dirname $(readlink -f "$0"))
+EMULATOR_INSTALLED_PATH=$(readlink -f "$SCRIPT_DIR/..")
 EMULATOR_BIN_PATH=$EMULATOR_INSTALLED_PATH/bin
-LIBRARY_PATH=$EMULATOR_BIN_PATH:$EMULATOR_INSTALLED_PATH/remote/lib:
+# set env variables for windows
+export SDL_STDIO_REDIRECT=0
+fi
+
+# set platform independent environment variables
+export GL_VERSION=2
+export VIGS_SYNC_READ_PIXELS=1
 
 # check "--with-gdb"
 WITH_GDB="no"
@@ -26,7 +36,7 @@ if [ "$1" = "--with-gdb" ]; then
        WITH_GDB="yes"
 fi
 
-# use default conf file if no options provided
+# try to use default conf file if no options provided
 if [ -z $1 ]; then
        if [ -e $HOME/.emulator_default.conf ]; then
                set -- "--conf" "$HOME/.emulator_default.conf"
@@ -36,7 +46,7 @@ fi
 
 # run emulator
 if [ "$WITH_GDB" = "yes" ]; then
-       LD_LIBRARY_PATH=$LIBRARY_PATH gdb --args $EMULATOR_BIN_PATH/emulator-x86 $@
+       gdb --args $EMULATOR_BIN_PATH/emulator-x86 $@
 else
-       LD_LIBRARY_PATH=$LIBRARY_PATH $EMULATOR_BIN_PATH/emulator-x86 $@
+       $EMULATOR_BIN_PATH/emulator-x86 $@
 fi