oe-buildenv-internal 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. # OE-Core Build Enviroment Setup Script
  3. #
  4. # Copyright (C) 2006-2011 Linux Foundation
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. # It is assumed OEROOT is already defined when this is called
  20. if [ -z "$OEROOT" ]; then
  21. echo >&2 "Error: OEROOT is not defined!"
  22. return 1
  23. fi
  24. if [ "x$BDIR" = "x" ]; then
  25. if [ "x$1" = "x" ]; then
  26. BDIR="build"
  27. else
  28. BDIR="$1"
  29. if [ "$BDIR" = "/" ]; then
  30. echo >&2 "Error: / is not supported as a build directory."
  31. return 1
  32. fi
  33. # Remove any possible trailing slashes. This is used to work around
  34. # buggy readlink in Ubuntu 10.04 that doesn't ignore trailing slashes
  35. # and hence "readlink -f new_dir_to_be_created/" returns empty.
  36. BDIR=`echo $BDIR | sed -re 's|/+$||'`
  37. BDIR=`readlink -f "$BDIR"`
  38. if [ -z "$BDIR" ]; then
  39. PARENTDIR=`dirname "$1"`
  40. echo >&2 "Error: the directory $PARENTDIR does not exist?"
  41. return 1
  42. fi
  43. fi
  44. fi
  45. if expr "$BDIR" : '/.*' > /dev/null ; then
  46. BUILDDIR="$BDIR"
  47. else
  48. BUILDDIR="`pwd`/$BDIR"
  49. fi
  50. unset BDIR
  51. BITBAKEDIR="$OEROOT/bitbake$BBEXTRA/"
  52. BITBAKEDIR=`readlink -f "$BITBAKEDIR"`
  53. BUILDDIR=`readlink -f "$BUILDDIR"`
  54. if ! (test -d "$BITBAKEDIR"); then
  55. echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Please ensure a copy of bitbake exists at this location"
  56. return 1
  57. fi
  58. PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"
  59. unset BITBAKEDIR
  60. # Used by the runqemu script
  61. export BUILDDIR
  62. export PATH
  63. export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER"