I hit the following error when building latest openwrt (cloned just today):
make[6]: Entering directory `<mydir>/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
[ 14%] Building C object CMakeFiles/kmodloader.dir/kmodloader.c.o
<mydir>openwrt/build_dir/target-arm-linux/ubox-2014-10-06/kmodloader.c:35:25: fatal error: libubox/avl.h: No such file or directory
#include <libubox/avl.h>
I work for Broadcom and I was asked to see if I can get running our new chip with openwrt (at this point just a proof-of-concept). I substituted the tooolchain with our own and pointed to our own kernel tree (all done through make menuconfig). I did not change anything else in the openwrt config - all default packages.
Unfortunately I am not very familiar with cmake... Below is the full log of the ubox build:
make[3]: Entering directory `/home/promanus/projects/local/openwrt/package/system/ubox'
. /home/promanus/projects/local/openwrt/include/shell.sh; gzip -dc /home/promanus/projects/local/openwrt/dl/ubox-2014-10-06-0b274c16a3f9d235735a4b84215071e1e004caa9.tar.gz | tar -C /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/.. -xf -
touch /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/.prepared_529efcce488818d51acdbd7fd631f93d
(cd /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06; CFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fomit-frame-pointer -fno-strict-aliasing -marm -fno-caller-saves -mfloat-abi=hard " CXXFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fomit-frame-pointer -fno-strict-aliasing -marm -fno-caller-saves -mfloat-abi=hard " LDFLAGS="-L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/lib -L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/lib -L/opt/toolchains/stbgcc-4.8-1.0//usr/lib -L/opt/toolchains/stbgcc-4.8-1.0//lib " cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_C_COMPILER="/opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-gcc" -DCMAKE_C_COMPILER_ARG1="" -DCMAKE_CXX_COMPILER="/opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-g++" -DCMAKE_CXX_COMPILER_ARG1="" -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/lib -L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/lib -L/opt/toolchains/stbgcc-4.8-1.0//usr/lib -L/opt/toolchains/stbgcc-4.8-1.0//lib " -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/lib -L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/lib -L/opt/toolchains/stbgcc-4.8-1.0//usr/lib -L/opt/toolchains/stbgcc-4.8-1.0//lib " -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/lib -L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/lib -L/opt/toolchains/stbgcc-4.8-1.0//usr/lib -L/opt/toolchains/stbgcc-4.8-1.0//lib " -DCMAKE_AR="/opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-ar" -DCMAKE_NM="/opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-nm" -DCMAKE_RANLIB="/opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-ranlib" -DCMAKE_FIND_ROOT_PATH="/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux;/home/promanus/projects/local/openwrt/staging_dir/toolchain-arm-linux" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/usr -DDL_LIBRARY=/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux -DCMAKE_PREFIX_PATH=/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux -DCMAKE_SKIP_RPATH=TRUE . )
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-gcc
-- Check for working C compiler: /opt/toolchains/stbgcc-4.8-1.0/bin/arm-linux-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER_ARG1
CMAKE_CXX_FLAGS_RELEASE
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
CMAKE_MODULE_LINKER_FLAGS
DL_LIBRARY
-- Build files have been written to: /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06
rm -f /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/.configured_
touch /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/.configured_
CFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fomit-frame-pointer -fno-strict-aliasing -marm -fno-caller-saves -mfloat-abi=hard -I/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/include -I/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/include -I/opt/toolchains/stbgcc-4.8-1.0//usr/include -I/opt/toolchains/stbgcc-4.8-1.0//include " CXXFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a9 -fomit-frame-pointer -fno-strict-aliasing -marm -fno-caller-saves -mfloat-abi=hard -I/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/include -I/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/include -I/opt/toolchains/stbgcc-4.8-1.0//usr/include -I/opt/toolchains/stbgcc-4.8-1.0//include " LDFLAGS="-L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/usr/lib -L/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/lib -L/opt/toolchains/stbgcc-4.8-1.0//usr/lib -L/opt/toolchains/stbgcc-4.8-1.0//lib " make -j1 -C /home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/. AR="arm-linux-ar" AS="arm-linux-gcc -c -Os -pipe -march=armv7-a -mtune=cortex-a9 -fomit-frame-pointer -fno-strict-aliasing -marm -fno-caller-saves -mfloat-abi=hard" LD=arm-linux-ld NM="arm-linux-nm" CC="arm-linux-gcc" GCC="arm-linux-gcc" CXX="arm-linux-g++" RANLIB="arm-linux-ranlib" STRIP=arm-linux-strip OBJCOPY=arm-linux-objcopy OBJDUMP=arm-linux-objdump SIZE=arm-linux-size CROSS="arm-linux-" ARCH="arm" ;
make[4]: Entering directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[5]: Entering directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[6]: Entering directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
Scanning dependencies of target kmodloader
make[6]: Leaving directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[6]: Entering directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
[ 14%] Building C object CMakeFiles/kmodloader.dir/kmodloader.c.o
/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/kmodloader.c:35:25: fatal error: libubox/avl.h: No such file or directory
#include <libubox/avl.h>
^
compilation terminated.
make[6]: *** [CMakeFiles/kmodloader.dir/kmodloader.c.o] Error 1
make[6]: Leaving directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[5]: *** [CMakeFiles/kmodloader.dir/all] Error 2
make[5]: Leaving directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06'
make[3]: *** [/home/promanus/projects/local/openwrt/build_dir/target-arm-linux/ubox-2014-10-06/.built] Error 2
make[3]: Leaving directory `/home/promanus/projects/local/openwrt/package/system/ubox'
make[2]: *** [package/system/ubox/compile] Error 2
make[2]: Leaving directory `/home/promanus/projects/local/openwrt'
make[1]: *** [/home/promanus/projects/local/openwrt/staging_dir/target-arm-linux/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/promanus/projects/local/openwrt'
make: *** [world] Error 2