• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9if [ -z "$ANDROID_BUILD_TOP" ]; then
10    echo error: ANDROID_BUILD_TOP not set
11    exit 1
12fi
13cd "$ANDROID_BUILD_TOP" >/dev/null
14SRCDIR="sdk/emulator/opengl/host/libs"
15DSTDIR="development/tools/emulator/opengl/system"
16if [ ! -d "$SRCDIR" -o ! -d "$DSTDIR" ]; then
17    echo error: can\'t find source and/or destination directory
18    exit 1
19fi
20
21if [ -z "$ANDROID_HOST_OUT" ]; then
22    echo error: ANDROID_HOST_OUT not set
23    exit 1
24fi
25EMUGEN="$ANDROID_HOST_OUT/bin/emugen"
26if [ ! -x "$EMUGEN" ]; then
27    echo error: emugen not available, did you forget to build?
28    exit 1
29fi
30
31function 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