We want to use IoTivity on MIPS CPUs running in big endian mode with OpenWrt as 
the Linux distribution. It would be nice to make it possible to add IoTivity to 
mainline OpenWrt, it supports many CPU architectures.
Currently the scons build systems sets all the parameters for gcc and so on by 
itself base on the architecture specified, this is the way one should go with 
scons as far as I know. I think this does not scale, when you want to support 
many different CPU architectures with different gcc optio,ns it will get a 
mess. OpenWrt calls the scons build system with all the necessary options for 
this specific target in it environment variables. It looks like this:

CC="mips-openwrt-linux-uclibc-gcc" \
CXX="mips-openwrt-linux-uclibc-g++" \
AR="mips-openwrt-linux-uclibc-ar" \
RANLIB="mips-openwrt-linux-uclibc-ranlib" \
CFLAGS="-Os -pipe -mips32r2 -mtune=1004kc -fno-caller-saves -fhonour-copts 
-fhonour-copts -Wno-error=unused-but-set-variable -msoft-float "\
CXXFLAGS="-Os -pipe -mips32r2 -mtune=1004kc -fno-caller-saves -fhonour-copts 
-fhonour-copts -Wno-error=unused-but-set-variable -msoft-float " \
CPPFLAGS="-I/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte/usr/include
 
-I/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte/include
 
-I/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/toolchain-mips_r2_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include
 
-I/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/toolchain-mips_r2_gcc-4.8-linaro_uClibc-0.9.33.2/include
 " \
LDFLAGS="-L/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte/usr/lib
 
-L/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte/lib
 
-L/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/toolchain-mips_r2_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib
 
-L/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/toolchain-mips_r2_gcc-4.8-linaro_uClibc-0.9.33.2/lib
 " \
DESTDIR="/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/build_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte/iotivity-0.9.1-RC1/ipkg-install"
 \
scons \
TARGET_OS=linux \
TARGET_TRANSPORT=ALL \
TARGET_ARCH=mips \
STAGING_DIR=/disk/fs1/tmp2/mehrtens/UGW/UGW-new/openwrt/core/staging_dir/target-mips_r2_uClibc-0.9.33.2_grx350_gw_he_vdsl_lte
 \
VERBOSE=true \
LOGGING=yes 


I created the attached patch 004-use-env.patch to use these environment 
variables instead of the variables hard coded in the IoTivity build files. In 
addition I had to allow the mips architecture with patch 003-add-mips.patch.

Is this the right approach or how should I handle it? I do not think adding 
every option to the IoTivity build files will work, for example see -mtune this 
will be different for many SoCs. I also would like to get such a patch into 
upstream IoTivity so I do not have to take care of it manually. The attached 
Makefile is the OpenWrt Makefile with all the IoTivity specific options.


Hauke Mehrtens
Lantiq Beteiligungs-GmbH & Co.KG

office:      Lilienthalstra?e 15, 85579 Neubiberg Germany
phone:    +49 (89) 89899 - 7179
e-mail:     hauke.mehrtens at lantiq.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 003-add-mips.patch
Type: application/octet-stream
Size: 1690 bytes
Desc: 003-add-mips.patch
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150609/0e50776c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 004-use-env.patch
Type: application/octet-stream
Size: 1644 bytes
Desc: 004-use-env.patch
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150609/0e50776c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 3891 bytes
Desc: Makefile
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150609/0e50776c/attachment-0002.obj>

Reply via email to