2012-08-02 04:13:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# this build file uses protoc to build all protocol buffers
|
|
|
|
|
# http://code.google.com/p/protobuf/downloads/list
|
|
|
|
|
|
|
|
|
|
TARGET_C="$TARGET/c"
|
|
|
|
|
|
|
|
|
|
mkdir -p "$TARGET_C"
|
|
|
|
|
|
|
|
|
|
# if you don't want to put protoc on the command line,
|
|
|
|
|
# then set a PROTOC environment variable
|
|
|
|
|
if [ -z $PROTOCC] ; then
|
|
|
|
|
PROTOCC="protoc-c"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# running protoc-c is currently optional
|
2012-08-21 02:04:11 +00:00
|
|
|
command -v $PROTOCC >/dev/null 2>&1 || { echo >&2 "protoc-c is required but not installed. Skipping c protocol buffers."; exit 0; }
|
2012-08-02 04:13:17 +00:00
|
|
|
|
|
|
|
|
# die on error at this point
|
|
|
|
|
set -e
|
|
|
|
|
|
2012-08-06 04:01:24 +00:00
|
|
|
echo "building c protocol buffers"
|
2012-08-02 04:13:17 +00:00
|
|
|
$PROTOCC $PROTO_FILES --c_out=$TARGET_C --proto_path=$SRC
|