Advertisement
Guest User

oe-buildenv-internal for OSX

a guest
Oct 26th, 2014
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.38 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # OE-Core Build Environment Setup Script
  4. #
  5. # Copyright (C) 2006-2011 Linux Foundation
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20.  
  21. # It is assumed OEROOT is already defined when this is called
  22. if [ -z "$OEROOT" ]; then
  23.     echo >&2 "Error: OEROOT is not defined!"
  24.     return 1
  25. fi
  26.  
  27. if [ ! -z "$OECORE_SDK_VERSION" ]; then
  28.     echo >&2 "Error: The OE SDK/ADT was detected as already being present in this shell environment. Please use a clean shell when sourcing this environment script."
  29.     return 1
  30. fi
  31.  
  32. if [ "x$BDIR" = "x" ]; then
  33.     if [ "x$1" = "x" ]; then
  34.         BDIR="build"
  35.     else
  36.         BDIR="$1"
  37.         if [ "$BDIR" = "/" ]; then
  38.             echo >&2 "Error: / is not supported as a build directory."
  39.             return 1
  40.         fi
  41.  
  42.         # Remove any possible trailing slashes. This is used to work around
  43.         # buggy readlink in Ubuntu 10.04 that doesn't ignore trailing slashes
  44.         # and hence "readlink -f new_dir_to_be_created/" returns
  45.         # empty.
  46.         if [[ "$OSTYPE" == *"darwin"* ]]; then
  47.           BDIR=`echo $BDIR | sed -Ee 's|/+$||'`
  48.         else
  49.           BDIR=`echo $BDIR | sed -re 's|/+$||'`
  50.         fi
  51.        
  52.         if [[ "$OSTYPE" != *"darwin"* ]]; then
  53.           BDIR=`readlink -f "$BDIR"`
  54.         fi
  55.  
  56.         if [ -z "$BDIR" ]; then
  57.             PARENTDIR=`dirname "$1"`
  58.             echo >&2 "Error: the directory $PARENTDIR does not exist?"
  59.             return 1
  60.         fi
  61.     fi
  62.     if [ "x$2" != "x" ]; then
  63.         BITBAKEDIR="$2"
  64.     fi
  65. fi
  66. if expr "$BDIR" : '/.*' > /dev/null ; then
  67.     BUILDDIR="$BDIR"
  68. else
  69.     BUILDDIR="`pwd`/$BDIR"
  70. fi
  71. unset BDIR
  72.  
  73. if [ "x$BITBAKEDIR" = "x" ]; then
  74.     BITBAKEDIR="$OEROOT/bitbake$BBEXTRA/"
  75. fi
  76.  
  77. if [[ "$OSTYPE" != *"darwin"* ]]; then
  78.   BITBAKEDIR=`readlink -f "$BITBAKEDIR"`
  79.   BUILDDIR=`readlink -f "$BUILDDIR"`
  80. else
  81.   BITBAKEDIR=`dirname "$BITBAKEDIR"`
  82.   BUILDDIR=`dirname  "$BUILDDIR"`
  83. fi
  84.  
  85. if ! (test -d "$BITBAKEDIR"); then
  86.     echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist!  Please ensure a copy of bitbake exists at this location"
  87.     return 1
  88. fi
  89.  
  90. # Make sure our paths are at the beginning of $PATH
  91. NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin:"
  92. PATH=$NEWPATHS$(echo $PATH | sed -e "s|:$NEWPATHS|:|g" -e "s|^$NEWPATHS||")
  93. unset BITBAKEDIR NEWPATHS
  94.  
  95. # Used by the runqemu script
  96. export BUILDDIR
  97. export PATH
  98. export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \
  99. HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy ALL_PROXY \
  100. all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \
  101. SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \
  102. SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement