Home | History | Annotate | Download | only in opengl
      1 #!/bin/sh
      2 # Generate the Android-side encoder source files. 
      3 # Requirements:
      4 # (a) The ANDROID_BUILD_TOP and ANDROID_HOST_OUT environment variables must be
      5 #     defined appropriately. The Android "lunch" bash function will do this.
      6 # (b) The emugen binary must already be built. Any normal build that includes
      7 #     the emulator will do this.
      8 
      9 if [ -z "$ANDROID_BUILD_TOP" ]; then
     10     echo error: ANDROID_BUILD_TOP not set
     11     exit 1
     12 fi
     13 cd "$ANDROID_BUILD_TOP" >/dev/null
     14 SRCDIR="sdk/emulator/opengl/host/libs"
     15 DSTDIR="development/tools/emulator/opengl/system"
     16 if [ ! -d "$SRCDIR" -o ! -d "$DSTDIR" ]; then
     17     echo error: can\'t find source and/or destination directory
     18     exit 1
     19 fi
     20 
     21 if [ -z "$ANDROID_HOST_OUT" ]; then
     22     echo error: ANDROID_HOST_OUT not set
     23     exit 1
     24 fi
     25 EMUGEN="$ANDROID_HOST_OUT/bin/emugen"
     26 if [ ! -x "$EMUGEN" ]; then
     27     echo error: emugen not available, did you forget to build?
     28     exit 1
     29 fi
     30 
     31 function gen() {
     32     local src="$SRCDIR/$1_dec"
     33     local dst="$DSTDIR/$1_enc"
     34     local name="$2"
     35     echo "${EMUGEN}" -E "$dst" -i "$src" "$name" "$src/$name".{attrib,in,types}
     36 }
     37 
     38 $(gen GLESv1 gl)
     39 $(gen GLESv2 gl2)
     40 $(gen renderControl renderControl)
     41