Some overall information that would be useful to know:
- What project/software you are trying to cross compile?
- What device are you trying to cross compile for (what device do you want the code to run on)?
You need to compile your toolchain first. Starting at the point of checking out (using Git, use SVN if you like):
git clone git://git.openwrt.org/openwrt.git
cd openwrt
#optional: update feeds and install packages if you like
./scripts/feeds update -a
./scripts/feeds install -a
#end optional steps
#use menuconfig and select your platform, profile and any packages you want in your final image
make menuconfig
#build host tools and toolchain
make tools/install
make toolchain/install
Now you can move on to your steps (check that your paths actually make sense):
Pankaj wrote:Step 1) PATH=/home/hclintel/pankaj/openwrt_compiled/trunk/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_musl-1.1.10/bin
Step 2) export PATH
Step3 ) STAGING_DIR=/home/hclintel/pankaj/openwrt_compiled/trunk/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_musl-1.1.10
Step4)export STAGING_DIR
step 5)
Now in step 5 ./configure --build=x86_64-unkown-linux-gnu --host=mips-openwrt-linux-uclibc is provided but configure file is not available.
A project may or may not ship a configure script. If it doesn't ship one, there is obviously no configure file available. It may use some other tool, e.g. CMake or qmake. Is this project available online, so you can link to its source?
Doing steps 1-4 of yours, and cd to the the project you are trying to compile, you can try this:
make CC=mips-openwrt-linux-musl-gcc LD=mips-openwrt-linux-musl-ld
This will run make (which will read the project Makefile), and use the OpenWrt toolchain if the Makefile lets you override the CC variable. If it doesn't, you will have to fix the Makefile or write your own.
Once you have your compiled file, cd to your openwrt checkout (where you built your toolchain earlier), and do:
mkdir -p files/usr/bin
mv /path/to/project/binaries files/usr/bin/
make
This moves your compiled files (fix the path, obviously) into /usr/bin, adapt to wherever they belong. Make builds your final image with selected packages, and your custom files in files/ will be included in the image.
when I replace openwrt toolchain with i686's mother board toolchain then I get below mentioned logs :
[...]
make[5]: i686-cm-linux-gccgcc: Command not found
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
/bin/sh: 1: i686-cm-linux-gccgcc: not found
[...]
See questions at top - at first you were trying to cross compile for MIPS, now you are trying to use an i686 toolchain. This does not make sense. I also don't understand what "motherboard toolchain" means. Anyway, the problem here is that make looks for i686-cm-linux-gccgcc. You are probably passing i686-cm-linux-gcc as a variable somewhere, and make appends gcc, because the Makefile says so. The variable in question probably refers to the environment in general (i686-cm-linux), and not a specific binary (i686-cm-linux-gcc). The project documentation likely explains this.
(Last edited by makro on 20 Jul 2015, 14:25)