aboutsummaryrefslogtreecommitdiffstats
path: root/distrib/update-audio.sh
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:32 -0800
commit8b23a6c7e1aee255004dd19098d4c2462b61b849 (patch)
tree7a4d682ba51f0ff0364c5ca2509f515bdaf96de9 /distrib/update-audio.sh
parentf721e3ac031f892af46f255a47d7f54a91317b30 (diff)
downloadexternal_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.zip
external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.gz
external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'distrib/update-audio.sh')
-rwxr-xr-xdistrib/update-audio.sh95
1 files changed, 95 insertions, 0 deletions
diff --git a/distrib/update-audio.sh b/distrib/update-audio.sh
new file mode 100755
index 0000000..56bada2
--- /dev/null
+++ b/distrib/update-audio.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+# this script is used to update the prebuilt libqemu-audio.a file in the Android source tree
+# we use a prebuilt package because we don't want to force the installation of the ALSA / EsounD / Whatever
+# development packages on every developer machine, or every build server.
+#
+
+# assumes this script is located in the 'distrib' sub-directory
+cd `dirname $0`
+cd ..
+
+locate_depot_files ()
+{
+ root=$(p4 where $1) || (
+ echo "you need to map $1 into your workspace to build an emulator source release package"
+ exit 3
+ )
+ root=$(echo $root | cut -d" " -f3 | sed -e "s%/\.\.\.%%")
+ echo $root
+}
+
+# find the prebuilt directory
+OS=`uname -s`
+EXE=""
+case "$OS" in
+ Darwin)
+ CPU=`uname -p`
+ if [ "$CPU" == "i386" ] ; then
+ OS=darwin-x86
+ else
+ OS=darwin-ppc
+ fi
+ ;;
+ Linux)
+ CPU=`uname -m`
+ case "$CPU" in
+ i?86|x86_64|amd64)
+ CPU=x86
+ ;;
+ esac
+ OS=linux-$CPU
+ ;;
+ *_NT-*)
+ OS=windows
+ EXE=.exe
+ ;;
+esac
+
+PREBUILT=$(locate_depot_files //branches/cupcake/android/prebuilt/$OS)
+
+# find the GNU Make program
+is_gnu_make ()
+{
+ version=$($1 -v | grep GNU)
+ if test -n "$version"; then
+ echo "$1"
+ else
+ echo ""
+ fi
+}
+
+if test -z "$GNUMAKE"; then
+ GNUMAKE=`which make` && GNUMAKE=$(is_gnu_make $GNUMAKE)
+fi
+
+if test -z "$GNUMAKE"; then
+ GNUMAKE=`which gmake` && GNUMAKE=$(is_gnu_make $GNUMAKE)
+fi
+
+if test -z "$GNUMAKE"; then
+ echo "could not find GNU Make on this machine. please define GNUMAKE to point to it"
+ exit 3
+fi
+
+TEST=$(is_gnu_make $GNUMAKE)
+if test -z "$TEST"; then
+ echo "it seems that '$GNUMAKE' is not a working GNU Make binary. please check the definition of GNUMAKE"
+ exit 3
+fi
+
+# ensure we have a recent audio library built
+#
+#echo "GNUMAKE is $GNUMAKE"
+source=objs/libqemu-audio.a
+./android-configure.sh
+$GNUMAKE $source BUILD_QEMU_AUDIO_LIB=true || (echo "could not build the audio library. Aborting" && exit 1)
+
+# now do a p4 edit, a copy and ask for submission
+#
+TARGET=$PREBUILT/emulator/libqemu-audio.a
+
+p4 edit $TARGET || (echo "could not p4 edit $TARGET" && exit 3)
+cp -f $source $TARGET
+echo "please do: p4 submit $TARGET"
+