Home | History | Annotate | Download | only in distrib
      1 #!/bin/bash
      2 #
      3 # this script is used to update the prebuilt libqemu-audio.a file in the Android source tree
      4 # we use a prebuilt package because we don't want to force the installation of the ALSA / EsounD / Whatever
      5 # development packages on every developer machine, or every build server.
      6 #
      7 
      8 # assumes this script is located in the 'distrib' sub-directory
      9 cd `dirname $0`
     10 cd ..
     11 . android/build/common.sh
     12 
     13 check_android_build
     14 if [ $IN_ANDROID_BUILD != yes ] ; then
     15     echo "Sorry, this script can only be run from a full Android build tree"
     16     exit 1
     17 fi
     18 
     19 force_32bit_binaries
     20 locate_android_prebuilt
     21 
     22 # find the prebuilt directory
     23 OS=`uname -s`
     24 EXE=""
     25 case "$OS" in
     26     Darwin)
     27         CPU=`uname -p`
     28         if [ "$CPU" == "i386" ] ; then
     29             OS=darwin-x86
     30         else
     31             OS=darwin-ppc
     32         fi
     33         ;;
     34     Linux)
     35         CPU=`uname -m`
     36         case "$CPU" in
     37         i?86|x86_64|amd64)
     38             CPU=x86
     39             ;;
     40         esac
     41         OS=linux-$CPU
     42         ;;
     43     *_NT-*)
     44         OS=windows
     45         EXE=.exe
     46         ;;
     47 esac
     48 
     49 PREBUILT=$(locate_depot_files //branches/cupcake/android/prebuilt/$OS)
     50 
     51 # find the GNU Make program
     52 is_gnu_make ()
     53 {
     54     version=$($1 -v | grep GNU)
     55     if test -n "$version"; then
     56         echo "$1"
     57     else
     58         echo ""
     59     fi
     60 }
     61 
     62 if test -z "$GNUMAKE"; then
     63     GNUMAKE=`which make` && GNUMAKE=$(is_gnu_make $GNUMAKE)
     64 fi
     65 
     66 if test -z "$GNUMAKE"; then
     67     GNUMAKE=`which gmake` && GNUMAKE=$(is_gnu_make $GNUMAKE)
     68 fi
     69 
     70 if test -z "$GNUMAKE"; then
     71     echo "could not find GNU Make on this machine. please define GNUMAKE to point to it"
     72     exit 3
     73 fi
     74 
     75 TEST=$(is_gnu_make $GNUMAKE)
     76 if test -z "$TEST"; then
     77     echo "it seems that '$GNUMAKE' is not a working GNU Make binary. please check the definition of GNUMAKE"
     78     exit 3
     79 fi
     80 
     81 # ensure we have a recent audio library built
     82 #
     83 #echo "GNUMAKE is $GNUMAKE"
     84 source=objs/libqemu-audio.a
     85 ./android-configure.sh
     86 $GNUMAKE $source BUILD_QEMU_AUDIO_LIB=true || (echo "could not build the audio library. Aborting" && exit 1)
     87 
     88 # now do a p4 edit, a copy and ask for submission
     89 #
     90 TARGET=$ANDROID_PREBUILT/emulator/libqemu-audio.a
     91 
     92 cp -f $source $TARGET
     93 echo "ok, file copied to $TARGET"
     94 
     95