Commit 007a08b8 authored by Larry Sachs's avatar Larry Sachs Committed by Rick Bell

Add build script for swig generated c/c++ files

The script will build a shared object from the swig
generated c/c++ files named 'libiotivity-lite-jni.so'

This build script should be changed to a Makefile or a
scons script.

Change-Id: I6f5c7c576efe71a5b8b69e2c046a40630e14f0e8
Signed-off-by: Larry Sachs's avatarLarry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/27161Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
Reviewed-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
Reviewed-by: default avatarRick Bell <richard.s.bell@intel.com>
parent 1e618652
#!/bin/bash
# remove existing .o files
rm -rf ./obj
# create .o files directory
mkdir ./obj
# compile swig generated C/C++ files
g++ -c -fPIC -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -ffreestanding -Os -fno-stack-protector -ffunction-sections -fdata-sections -fno-reorder-functions -fno-defer-pop -fno-strict-overflow -I"$JAVA_HOME/include/" -I"$JAVA_HOME/include/linux/" -I../.. -I../../include/ -I../../port/ -I../../port/linux/ -I../../util/ -I../../deps/tinycbor/src/ -std=c++11 -Wall -Wextra -Werror -pedantic -D__OC_RANDOM -DOC_CLIENT -DOC_SERVER -DOC_IPV4 -DOC_DYNAMIC_ALLOCATION -DOC_DEBUG -g -O0 -Wno-unused-parameter -Wno-strict-aliasing -Wno-unused-function -Wno-sign-compare -Wno-address oc_api_wrap.cxx -o ./obj/oc_api_wrap.o
gcc -c -fPIC -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -ffreestanding -Os -fno-stack-protector -ffunction-sections -fdata-sections -fno-reorder-functions -fno-defer-pop -fno-strict-overflow -I"$JAVA_HOME/include/" -I"$JAVA_HOME/include/linux/" -I../../port/ -I../../port/linux -std=gnu99 -Wall -Wextra -Werror -pedantic -D__OC_RANDOM -DOC_CLIENT -DOC_SERVER -DOC_IPV4 -DOC_DYNAMIC_ALLOCATION -DOC_DEBUG -g -O0 -Wno-unused-parameter oc_storage_wrap.c -o ./obj/oc_storage_wrap.o
gcc -c -fPIC -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -ffreestanding -Os -fno-stack-protector -ffunction-sections -fdata-sections -fno-reorder-functions -fno-defer-pop -fno-strict-overflow -I"$JAVA_HOME/include/" -I"$JAVA_HOME/include/linux/" -I../../port/ -I../../port/linux -std=gnu99 -Wall -Wextra -Werror -pedantic -D__OC_RANDOM -DOC_CLIENT -DOC_SERVER -DOC_IPV4 -DOC_DYNAMIC_ALLOCATION -DOC_DEBUG -g -O0 -Wno-unused-parameter -Wno-strict-aliasing oc_clock_wrap.c -o ./obj/oc_clock_wrap.o
# create shared library
gcc -shared ./obj/*.o ../../port/linux/obj/*.o ../../port/linux/obj/client_server/*.o -lm -pthread -lrt -lstdc++ -o libiotivity-lite-jni.so
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment