oe-init-build-env-memres 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. # OE Build Environment 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 <portnumber> <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 "$1" ]; then
  27. echo "No port specified, using 12345"
  28. port=12345
  29. else
  30. port=$1
  31. shift
  32. fi
  33. if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./oe-init-build-env" ]; then
  34. echo "Error: This script needs to be sourced. Please run as '. ./oe-init-build-env'"
  35. else
  36. if [ -n "$BASH_SOURCE" ]; then
  37. OEROOT="`dirname $BASH_SOURCE`"
  38. elif [ -n "$ZSH_NAME" ]; then
  39. OEROOT="`dirname $0`"
  40. else
  41. OEROOT="`pwd`"
  42. fi
  43. if [ -n "$BBSERVER" ]; then
  44. unset BBSERVER
  45. fi
  46. OEROOT=`readlink -f "$OEROOT"`
  47. export OEROOT
  48. . $OEROOT/scripts/oe-buildenv-internal && \
  49. $OEROOT/scripts/oe-setup-builddir && \
  50. [ -n "$BUILDDIR" ] && cd $BUILDDIR
  51. unset OEROOT
  52. unset BBPATH
  53. fi
  54. bitbake --server-only -t xmlrpc -B localhost:$port
  55. export BBSERVER=localhost:$port
  56. echo "Bitbake server started on port $port, use bitbake -m to shut it down"