OpenWrt Forum Archive

Topic: warning: environment variable 'STAGING_DIR' not defined

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!
I try to compile user space package, but unsuccesfully sad

When I've check whats wrong I've got:

[rusink@localhost ]$ mipsel-openwrt-linux-uclibc-gcc --std=gnu99 -E -I.  -Wall -c main.c >main.E
mipsel-openwrt-linux-uclibc-gcc: warning: environment variable 'STAGING_DIR' not defined
main.c:1:27: fatal error: libubox/uloop.h: No such file or directory
compilation terminated.

I've checked  ~/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/include/libubox/utils.h - is on place....


Who can tell where and how should I define 'STAGING_DIR?
I've tried to do it like:

export PATH=$PATH:~/openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/ 
export STAGING_DIR=~/openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/

And than do make package/my_package/compile but got the same errors.

sad

(Last edited by rusink on 6 Mar 2013, 05:39)

Hi rusink,

please try this:

 export STAGING_DIR=~/openwrt/staging_dir/

wink

(Last edited by tl71 on 6 Mar 2013, 13:12)

I'm wondering why this happened.
How did you set up the build environment?
In the mean time, do try tl71's solution.
My only concern is what else is broken.

robthebrew wrote:

I'm wondering why this happened.
How did you set up the build environment?

I try to compile programm which isn't  in openwrt trunk. It's new  small manager for QMI modems by nbd. -git://nbd.name/uqmi.git
So I've made Makefile (using cmake.mk rules). but I can't  hook up header from libubox. (which are already in ~/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/include/libubox ). I can't compile programm in a result.
For example I've got :

openwrt/build_dir/target-mipsel_r2_uClibc-0.9.33.2/uqmi-r-0.0.1/qmi-message.h: In function 'tlv_data_len':
/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.33.2/uqmi-r-0.0.1/qmi-message.h:88:2: error: implicit declaration of function 'le16_to_cpu' [-Werror=implicit-function-declaration] 

When I've checked & got that answer from gcc.

So, I've no idea  how to solve it yet. sad

P.S. I gess. I've should   start ' export STAGING_DIR=~/openwrt/staging_dir/' befor checking main.c

[rusink@localhost uqmi-r-0.0.1]$ export PATH=$PATH:~/openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin
[rusink@localhost uqmi-r-0.0.1]$ export STAGING_DIR=~/openwrt/staging_dir/
[rusink@localhost uqmi-r-0.0.1]$ mipsel-openwrt-linux-uclibc-gcc --std=gnu99 -E -I.  -Wall -c main.c >main.E
[rusink@localhost uqmi-r-0.0.1]$ 

(Last edited by rusink on 6 Mar 2013, 16:58)

robthebrew wrote:

It is a pain, but if you follow the full build install (http://wiki.openwrt.org/doc/howto/buildroot.exigence) and then follow the instructions for crosscompiling (http://wiki.openwrt.org/doc/devel/crosscompile) that might help

Thanks. But I'm afraid it's not exactly what I need. smile Look:

[rusink@localhost ~]$ cd '/home/rusink/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.33.2/uqmi-r-0.0.1' 
[rusink@localhost uqmi-r-0.0.1]$ export PATH=$PATH:/home/rusink/openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin
[rusink@localhost uqmi-r-0.0.1]$ export STAGING_DIR=~/openwrt/staging_dir/
[rusink@localhost uqmi-r-0.0.1]$ mipsel-openwrt-linux-uclibc-gcc
mipsel-openwrt-linux-uclibc-gcc: fatal error: no input files
compilation terminated.
[rusink@localhost uqmi-r-0.0.1]$ mipsel-openwrt-linux-uclibc-gcc --std=gnu99 -E -I.  -Wall -c main.c >main.E
main.c:1:27: fatal error: libubox/uloop.h: No such file or directory
compilation terminated.
[rusink@localhost uqmi-r-0.0.1]$ ls '/home/rusink/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/include/libubox' 
avl-cmp.h  blobmsg.h       list.h   ustream.h      utils.h
avl.h      blobmsg_json.h  uloop.h  ustream-io.h   vlist.h
blob.h     list_compat.h   usock.h  ustream-ssl.h
[rusink@localhost uqmi-r-0.0.1]$

I've compiled libubox before, but compiler can't find this folder and hooks up needed  *.h . Any ideas - why?

(Last edited by rusink on 6 Mar 2013, 19:03)

The discussion might have continued from here.