Skip to content

Instantly share code, notes, and snippets.

@gamaral
Created April 21, 2014 19:05
Show Gist options
  • Save gamaral/11152972 to your computer and use it in GitHub Desktop.
Save gamaral/11152972 to your computer and use it in GitHub Desktop.
Buildroot generic environment file
#!/bin/bash
# find base
export BUILDROOT_BASE_DIR=`readlink -f \`dirname ${BASH_SOURCE}\``
# host lib path
export LD_LIBRARY_PATH="${BUILDROOT_BASE_DIR}/host/usr/lib:${LD_LIBRARY_PATH}"
# exports
export BUILDROOT_SYSTEM_PROCESSOR=arm
export BUILDROOT_HOST_DIR="${BUILDROOT_BASE_DIR}/host"
export BUILDROOT_SYSROOT_DIR="${BUILDROOT_BASE_DIR}/staging"
# overrides
export CC="${BUILDROOT_HOST_DIR}/usr/bin/arm-linux-gcc"
export CXX="${BUILDROOT_HOST_DIR}/usr/bin/arm-linux-g++"
export LD="${BUILDROOT_HOST_DIR}/usr/bin/arm-linux-ld"
# execute
[ "${0}" != "-bash" ] && [ ${#*} -gt 0 ] && exec ${*:1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment