Quantcast
Channel: Linux Feed » config
Viewing all articles
Browse latest Browse all 10

Raspberry cross-compiling

$
0
0

I want to cross-compile some stuff for my Raspberry, this is a (memo for me) tutorial to do that.

  1. Take crosstool-ng from herehere or here (the last two are mirror, use them only if the official website is not working)
  2. you need some dependencies:
    apt-get install gcc gperf bison flex gawk libtool automake libncurses5-dev
  3. go into the crosstool-ng directory and:
    ./configure--prefix=path_where_to_put_the_files/
    make
    makeinstall
    cpct-ng.comp /etc/bash_completion.d/
  4. after I setup some bash vars in my .bashrc:
    export WORKSPACE=~/workspace
    export RASPBERRY=$WORKSPACE/raspberry
    export CROSS_INST_PATH=$RASPBERRY/crosstool-ng/installer/
    export PATH="$PATH:$CROSS_INST_PATH/bin"
  5. and after to use them:
    source ~/.bashrc
  6. go into path_where_to_put_the_files and:
    ct-ng menuconfig
  7. the important options are:
    • Paths and misc options
      • (Important) Enable “Try features marked as EXPERIMENTAL
      • (Optional) Change “Prefix directory” (for example, you can put “$RASPBERRY/crosstool-ng/x-tools/${CT_TARGET}” there)
    • Target options
      • (Important) Change “Target architecture” to “arm
      • (Important) Leave “Endianness” set to “Little endian
      • (Important) Leave “Bitness” set to “32-bit
    • Toolchain options
      • (Nothing to do here, the defaults are fine)
    • Operating system
      • (Important) Change “Target OS” to “linux
    • Binary utilities
      • (Optional) Change “binutils version” to “2.21.1a” or whichever is the latest that isn’t marked as experimental
    • C compiler
      • (Optional)”Show Linaro versions (EXPERIMENTAL)“. In the “gcc version” field, choose the “linaro-4.6-2012.04 (EXPERIMENTAL) compiler“. You’re free to choose a different one but this one works well. We do recommend the Linaro versions over the vanilla ones for the RPi
      • (Optional) Enable “C++” under the group “*** Additional supported languages: ***” if you need g++ tool also built for your RPi toolchain
  8. build the tool:
    ct-ng build
  9. after I setup some others bash vars (these is the final file):
    export WORKSPACE=~/workspace
    export RASPBERRY=$WORKSPACE/raspberry
    export CROSS_CC_PATH=$RASPBERRY/crosstool-ng/x-tools/arm-unknown-linux-gnueabi/
    export CROSS_INST_PATH=$RASPBERRY/crosstool-ng/installer/
    export PATH="$PATH:$CROSS_CC_PATH/bin:$CROSS_INST_PATH/bin"
  10. after you are ready to compile, an example:
    ./autogen.sh --with-parameter-expansion-string-replace-capable-shell=/bin/bash --host=arm-unknown-linux-gnueabi --enable-static --prefix=$RASPBERRY/compile

Bibliography:

https://trac.ffmpeg.org/wiki/CompilationGuide/RaspberryPi

http://tech4research.wordpress.com/2014/03/04/installing-crosstool-ng-on-debian-7-4/

 


Viewing all articles
Browse latest Browse all 10

Trending Articles