From 5e5b18f769e24576f907c445da0baa6e26680be7 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Sun, 30 Aug 2015 17:34:56 +0900 Subject: [PATCH] configure: "CROSS_PREFIX" is introduced for cross-compiling If "CROSS_PREFIX" or "--cross-prefix" is provided, "emulator_configure.sh" prepare cross-compiling environments. Applied "--static-libgcc" and "--static-libstdc++" for static linking compiler libraries. Change-Id: Id095e43eb00cffdfe635d1cec404549b364c5940 Signed-off-by: SeokYeon Hwang --- tizen/emulator_configure.sh | 62 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index 84fac12..34c1e09 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -1,9 +1,5 @@ #!/bin/sh -if [ -z "$TIZEN_SDK_DEV_PATH" ] ; then - TIZEN_SDK_DEV_PATH=${HOME}/tizen-sdk-dev -fi - CONFIGURE_APPEND="" EMUL_TARGET_LIST="x86_64-softmmu" @@ -16,7 +12,9 @@ usage() { echo "options:" echo "-d, --debug" echo " build debug configuration" - echo "-e|--extra" + echo "-e|--extra EXTRA" + echo " extra options for QEMU configure" + echo "-p|--cross-prefix CROSS_PREFIX" echo " extra options for QEMU configure" echo "-u|-h|--help|--usage" echo " display this help message and exit" @@ -39,15 +37,6 @@ set_target() { esac } - -# OS specific -targetos=`uname -s` -echo "##### checking for os... targetos $targetos" - -echo "##### TIZEN_SDK_DEV_PATH: ${TIZEN_SDK_DEV_PATH}" - -echo "$*" - while [ "$#" -gt "0" ] do case $1 in @@ -61,6 +50,10 @@ do shift CONFIGURE_APPEND="$CONFIGURE_APPEND $1" ;; + -p|--cross-prefix) + shift + CROSS_PREFIX="$1" + ;; -u|-h|--help|--usage) usage exit 0 @@ -74,12 +67,32 @@ do shift done +hostos=`uname -s` +if [ -z "$CROSS_PREFIX" ] ; then + targetos=$hostos +else + # FIXME + targetos="CROSS_MINGW"; +fi + +if [ -z "$TIZEN_SDK_DEV_PATH" ] ; then + if [ -z "$CROSS_PREFIX" ] ; then + TIZEN_SDK_DEV_PATH=${HOME}/tizen-sdk-dev + else + TIZEN_SDK_DEV_PATH=${HOME}/${CROSS_PREFIX}tizen-sdk-dev + fi +fi + +echo "##### checking for os... Host OS $hostos, Target OS $targetos" +echo "##### TIZEN_SDK_DEV_PATH: ${TIZEN_SDK_DEV_PATH}" +echo "$*" + if [ -z "$EMUL_TARGET_LIST" ] ; then set_target all fi # append common flags -CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST --enable-yagl --enable-curl --enable-vigs --enable-maru --enable-qt --enable-libav --enable-libpng --disable-sdl --disable-gtk --disable-vnc --disable-spice --disable-curses --disable-xen $CONFIGURE_APPEND" +CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST --enable-yagl --enable-curl --enable-vigs --enable-maru --enable-qt --enable-libpng --disable-sdl --disable-gtk --disable-vnc --disable-spice --disable-curses --disable-xen $CONFIGURE_APPEND" if [ -z ${PKG_CONFIG_PATH} ] ; then # avoid pkg-config bug on Windows export PKG_CONFIG_PATH=${TIZEN_SDK_DEV_PATH}/distrib/lib/pkgconfig @@ -100,6 +113,22 @@ exec ./configure \ --enable-virtfs \ $CONFIGURE_APPEND \ ;; +CROSS_MINGW*) +cd .. +echo "" +echo "##### QEMU configuring for emulator" +echo "##### QEMU configure append:" $CONFIGURE_APPEND +exec ./configure \ + --enable-werror \ + --cross-prefix=$CROSS_PREFIX \ + --extra-ldflags=-Wl,--large-address-aware \ + --extra-ldflags=-Wl,--export-all-symbols \ + --extra-ldflags=-static-libgcc \ + --extra-ldflags=-static-libstdc++ \ + --audio-drv-list=dsound \ + --enable-hax \ + $CONFIGURE_APPEND \ +;; MINGW*) cd .. echo "" @@ -108,11 +137,14 @@ echo "##### QEMU configure append:" $CONFIGURE_APPEND exec ./configure \ --enable-werror \ --cc=gcc \ + --cxx=g++ \ --extra-cflags=-Wno-error=format \ --extra-cflags=-Wno-error=format-extra-args \ --extra-cflags=-Wno-error=redundant-decls \ --extra-ldflags=-Wl,--large-address-aware \ --extra-ldflags=-Wl,--export-all-symbols \ + --extra-ldflags=-static-libgcc \ + --extra-ldflags=-static-libstdc++ \ --audio-drv-list=dsound \ --enable-hax \ $CONFIGURE_APPEND \ -- 2.7.4