Differences

This shows you the differences between two versions of the page.

doc:devel:crosscompile [2012/12/18 18:13]
uvray313
doc:devel:crosscompile [2013/12/11 10:34] (current)
infrastation editorial
Line 11: Line 11:
  * Follow the build instructions outlined in [[doc:howto:build|OpenWrt Buildroot – Usage]]   * Follow the build instructions outlined in [[doc:howto:build|OpenWrt Buildroot – Usage]]
  * Locate the toolchain binaries in the ''staging_dir/toolchain-//architecture//_gcc-//compilerver//_uClibc-//libcver///bin/'' directory   * Locate the toolchain binaries in the ''staging_dir/toolchain-//architecture//_gcc-//compilerver//_uClibc-//libcver///bin/'' directory
-  * Add the toolchain directory to the ''PATH'' environment variable: +  * Add that directory to the ''PATH'' environment variable: 
-    * ''PATH=$PATH:(your toolchain directory here)''+    * ''PATH=$PATH:(your toolchain/bin directory here)''
    * ''export PATH''     * ''export PATH''
-  * Set the ''STAGING_DIR'' environment variable to the toolchain dir and export it: +  * Set the ''STAGING_DIR'' environment variable to the above toolchain dir and export it: 
-    * ''STAGING_DIR=(your staging directory here)''+    * ''STAGING_DIR=(your toolchain directory here)''
    * ''export STAGING_DIR''     * ''export STAGING_DIR''
  * Download and unpack the code to be compiled, change into the unpacked directory   * Download and unpack the code to be compiled, change into the unpacked directory
-  * Pass the //target// to the build system of the package to compile +  * Pass the //host// to the build system of the package to compile 
-    * For GNU configure, use ''%%--target=%%//architecture//-openwrt-linux-uclibc'' +    * For GNU configure, use ''%%--host=%%//architecture//-openwrt-linux-uclibc'' (for example: ''mips-openwrt-linux-uclibc'') 
-    * For GNU make, override the ''CC'' and ''LD'' environment variables+    * For GNU make, override the ''CC'' and ''LD'' environment variables (usually not needed if GNU configure was used)
      * ''make CC=//architecture//-openwrt-linux-uclibc-gcc'' ''LD=//architecture//-openwrt-linux-uclibc-ld''       * ''make CC=//architecture//-openwrt-linux-uclibc-gcc'' ''LD=//architecture//-openwrt-linux-uclibc-ld''
  * If compilation aborts due to missing header files or shared objects, you might need to override ''CFLAGS'' and ''LDFLAGS'' to point to the ''staging_dir/target-//architecture//_uClibc-//libcver///usr/include'' and ''.../usr/lib'' directories   * If compilation aborts due to missing header files or shared objects, you might need to override ''CFLAGS'' and ''LDFLAGS'' to point to the ''staging_dir/target-//architecture//_uClibc-//libcver///usr/include'' and ''.../usr/lib'' directories
Line 26: Line 26:
  * Remote debugging can be done using script ''.///scripts///remote-gdb''   * Remote debugging can be done using script ''.///scripts///remote-gdb''
-When compilation is finished, copy the resulting binary and realted libraries to the target device to test it. It might be necessary to set ''LD_LIBRARY_PATH'' on the target to point the binary to libraries in nonstandard locations.+When compilation is finished, copy the resulting binary and related libraries to the target device to test it. It might be necessary to set ''LD_LIBRARY_PATH'' on the target to point the binary to libraries in non-standard locations.
If the program works well enough, you maybe want to build a real package for the opkg package manager and make it easily accessible for everyone out there. If the program works well enough, you maybe want to build a real package for the opkg package manager and make it easily accessible for everyone out there.

Back to top

doc/devel/crosscompile.1355850811.txt.bz2 · Last modified: 2012/12/18 18:13 by uvray313