From 533ab1b935a8f52c7fcd2a6982ce83f977aad3f6 Mon Sep 17 00:00:00 2001 From: Rekha Kumar Date: Wed, 19 Sep 2012 16:30:21 -0700 Subject: Compiling protobuf-c in Android Build --- Android.mk | 32 ++++++++++++++++++++++++++ src/google/protobuf-c/protobuf-c-data-buffer.c | 2 +- src/google/protobuf-c/protobuf-c-dispatch.c | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 Android.mk mode change 100644 => 100755 src/google/protobuf-c/protobuf-c-data-buffer.c mode change 100644 => 100755 src/google/protobuf-c/protobuf-c-dispatch.c diff --git a/Android.mk b/Android.mk new file mode 100755 index 0000000..88cebe7 --- /dev/null +++ b/Android.mk @@ -0,0 +1,32 @@ + +LOCAL_PATH := $(call my-dir) + +C_SRC_FILES := \ + src/google/protobuf-c/protobuf-c-rpc.c \ + src/google/protobuf-c/protobuf-c-dispatch.c \ + src/google/protobuf-c/protobuf-c-data-buffer.c \ + src/google/protobuf-c/protobuf-c.c + +# C library +# ======================================================= +include $(CLEAR_VARS) + +LOCAL_MODULE := libprotobuf-c +LOCAL_MODULE_TAGS := debug + +LOCAL_SRC_FILES := $(C_SRC_FILES) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/src + +LOCAL_COPY_HEADERS_TO := protobuf-c/include/google/protobuf-c/ +LOCAL_COPY_HEADERS := ./src/google/protobuf-c/protobuf-c.h +LOCAL_COPY_HEADERS += ./src/google/protobuf-c/protobuf-c-private.h + +LOCAL_SHARED_LIBRARIES := \ + libcutils libutils + +LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI -DHAVE_SYS_POLL_H -DHAVE_ALLOCA_H -DHAVE_UNISTD_H + +include $(BUILD_STATIC_LIBRARY) + diff --git a/src/google/protobuf-c/protobuf-c-data-buffer.c b/src/google/protobuf-c/protobuf-c-data-buffer.c old mode 100644 new mode 100755 index c7ead5d..4549c3b --- a/src/google/protobuf-c/protobuf-c-data-buffer.c +++ b/src/google/protobuf-c/protobuf-c-data-buffer.c @@ -35,7 +35,7 @@ #include #if HAVE_ALLOCA_H # include -#elif HAVE_MALLOC_H +#elif defined HAVE_MALLOC_H # include #endif #include diff --git a/src/google/protobuf-c/protobuf-c-dispatch.c b/src/google/protobuf-c/protobuf-c-dispatch.c old mode 100644 new mode 100755 index ff1e0e0..e280d77 --- a/src/google/protobuf-c/protobuf-c-dispatch.c +++ b/src/google/protobuf-c/protobuf-c-dispatch.c @@ -51,7 +51,7 @@ #include #if HAVE_ALLOCA_H # include -#elif HAVE_MALLOC_H +#elif defined HAVE_MALLOC_H # include #endif #include -- cgit v1.2.3