oe-init-build-env 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # OE 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. #
  20. # Normally this is called as '. ./oe-init-build-env builddir'
  21. #
  22. # This works in most shells (not dash), but not all of them pass arg1 when
  23. # being sourced. To workaround the shell limitation use "set arg1" prior
  24. # to sourcing this script.
  25. #
  26. if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./oe-init-build-env" ]; then
  27. echo "Error: This script needs to be sourced. Please run as '. ./oe-init-build-env'"
  28. else
  29. if [ -n "$BASH_SOURCE" ]; then
  30. OEROOT="`dirname $BASH_SOURCE`"
  31. else
  32. OEROOT="`pwd`"
  33. fi
  34. OEROOT=`readlink -f "$OEROOT"`
  35. export OEROOT
  36. . $OEROOT/scripts/oe-buildenv-internal
  37. $OEROOT/scripts/oe-setup-builddir
  38. unset OEROOT
  39. unset BBPATH
  40. [ -n "$BUILDDIR" ] && cd $BUILDDIR
  41. fi