poky-init-build-env 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. if test x"$0" = x"./poky-init-build-env"; then
  3. echo "Error: Run via '. ./poky-init-build-env'"
  4. exit 1
  5. fi
  6. #
  7. # Change this to the location of this file.
  8. # Also update the locations at the top of conf/local.conf
  9. #
  10. OEROOT=`pwd`
  11. BBDIR=$OEROOT/bitbake/
  12. PKGDIR=$OEROOT/meta/
  13. BUILDDIR=$OEROOT/build/
  14. MSG=''
  15. PATH=$BBDIR/bin/:$PATH
  16. cd $BUILDDIR
  17. # Remove any symlinks from paths
  18. BBDIR=`readlink -f $BBDIR`
  19. PKGDIR=`readlink -f $PKGDIR`
  20. BUILDDIR=`readlink -f $BUILDDIR`
  21. if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then
  22. echo >&2 "Error: Not all directories exist! Did you run this script in poky directory?"
  23. exit 1
  24. fi
  25. if ! (test -r $BUILDDIR/conf/local.conf); then
  26. cat $BUILDDIR/conf/local.conf.sample | sed -e"s|POKYROOT|${OEROOT}|g" > $BUILDDIR/conf/local.conf
  27. echo
  28. echo "..Created initial 'build/conf/local.conf'"
  29. fi
  30. BBPATH=$BBDIR
  31. if test x"$BBDIR" != x"$PKGDIR"; then
  32. BBPATH=$PKGDIR:$BBPATH
  33. fi
  34. if test x"$PKGDIR" != x"$BUILDDIR"; then
  35. BBPATH=$BUILDDIR:$BBPATH
  36. fi
  37. export BBPATH
  38. # Blank this so we don't link non-arm libraries
  39. LD_LIBRARY_PATH=
  40. # Don't export TARGET_ARCH - it *will* cause build failures
  41. export PATH LD_LIBRARY_PATH OEROOT
  42. # Stop multi byte characters breaking the patcher stuff - This is for Redhat / Fedora people really
  43. export LANG=C
  44. echo
  45. echo "### Shell environment set up for Poky builds. ###"
  46. echo