From ab873b750621bca7eef41869c685dec8c363333a Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Mon, 8 Mar 2010 18:33:50 -0800 Subject: Add --static option to android-configure.sh in order to build static emulator executable. This is needed to run the emulator in restricted environment where libX11.so and even libstdc++.so are not available. Only tested on Linux. The resulting binary will not start unless you use -no-window. Also don't expect any audio output working. Change-Id: Ia736898cd3ae6eb928614a00a1a3e18cc8086a5c --- android-configure.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'android-configure.sh') diff --git a/android-configure.sh b/android-configure.sh index 742fe21..045e56d 100755 --- a/android-configure.sh +++ b/android-configure.sh @@ -28,6 +28,7 @@ OPTION_NO_PREBUILTS=no OPTION_TRY_64=no OPTION_HELP=no OPTION_DEBUG=no +OPTION_STATIC=no if [ -z "$CC" ] ; then CC=gcc @@ -63,6 +64,8 @@ for opt do ;; --try-64) OPTION_TRY_64=yes ;; + --static) OPTION_STATIC=yes + ;; *) echo "unknown option '$opt', use --help" exit 1 @@ -87,6 +90,7 @@ EOF echo " --ignore-audio ignore audio messages (may build sound-less emulator)" echo " --no-prebuilts do not use prebuilt libraries and compiler" echo " --try-64 try to build a 64-bit executable (may crash)" + echo " --static build a completely static executable" echo " --verbose verbose configuration" echo " --debug build debug version of the emulator" echo "" @@ -394,6 +398,10 @@ echo "BUILD_STANDALONE_EMULATOR := true" >> $config_mk if [ $OPTION_DEBUG = yes ] ; then echo "BUILD_DEBUG_EMULATOR := true" >> $config_mk fi +if [ $OPTION_STATIC = yes ] ; then + echo "CONFIG_STATIC_EXECUTABLE := true" >> $config_mk +fi + if [ -n "$ANDROID_SDK_TOOLS_REVISION" ] ; then echo "ANDROID_SDK_TOOLS_REVISION := $ANDROID_SDK_TOOLS_REVISION" >> $config_mk fi @@ -443,6 +451,11 @@ case "$OS" in *) CONFIG_OS=$OS esac +if [ "$OPTION_STATIC" = "yes" ] ; then + echo "CONFIG_STATIC_EXECUTABLE := true" >> $config_mk + echo "#define CONFIG_STATIC_EXECUTABLE 1" >> $config_h +fi + case $OS in linux-*|darwin-*) echo "#define HAVE_IOVEC 1" >> $config_h -- cgit v1.1