VirtualBox

Changeset 87614 in vbox


Ignore:
Timestamp:
Feb 4, 2021 7:35:02 PM (4 years ago)
Author:
vboxsync
Message:

/configure: Improvements mainly for macOS. Can now deal with just the command line tools (VirtualBox never needed the full Xcode), looking in the appropriate place when no Xcode directory is specified. Added Big Sur.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r87584 r87614  
    194194{
    195195  rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
     196  [ "$OS" = "darwin" ] && rm -rf $ODIR.tmp_out.dSYM
    196197}
    197198
     
    635636        fail
    636637      else
     638        [ "$YASM" != "yasm" ] && cnf_append "PATH_TOOL_YASM" "`dirname $YASM`"
    637639        log_success "found version $yasm_ver"
    638640      fi
     
    22182220
    22192221#
     2222# Determines the Darwin version.
     2223#
     2224check_darwinversion()
     2225{
     2226  test_header "Darwin version"
     2227  darwin_ver=`uname -r`
     2228  case "$darwin_ver" in
     2229    20\.*)
     2230      darwin_ver="11.0" # Big Sur
     2231      ;;
     2232    19\.*)
     2233      darwin_ver="10.15" # Catalina
     2234      ;;
     2235    18\.*)
     2236      darwin_ver="10.14" # Mojave
     2237      ;;
     2238    17\.*)
     2239      darwin_ver="10.13" # High Sierra
     2240      ;;
     2241    16\.*)
     2242      darwin_ver="10.12" # Sierra
     2243      ;;
     2244    15\.*)
     2245      darwin_ver="10.11" # El Capitan
     2246      ;;
     2247    14\.*)
     2248      darwin_ver="10.10" # Yosemite
     2249      ;;
     2250    13\.*)
     2251      darwin_ver="10.9" # Mavericks
     2252      ;;
     2253    *)
     2254      echo "  failed to determine Darwin version. (uname -r: $darwin_ver)"
     2255      fail
     2256      darwin_ver="unknown"
     2257      ;;
     2258  esac
     2259
     2260  log_success "found version $darwin_ver"
     2261}
     2262
     2263#
    22202264# Check Xcode path
    22212265#
    2222 check_xcode_sdk_path()
     2266check_xcode_path()
    22232267{
    22242268    # Check if WITH_XCODE_DIR is set.
    22252269    if [ -z "$WITH_XCODE_DIR" ]; then
    2226         echo "Please specify --with-xcode-dir option."
    2227         return 0
     2270        if [ -d "/Library/Developer/CommandLineTools" -a -f "/Library/Developer/CommandLineTools/usr/bin/clang" ]; then
     2271            return 1
     2272        else
     2273            echo "Please specify --with-xcode-dir option."
     2274            return 0
     2275        fi
    22282276    fi
    22292277
     
    22372285}
    22382286
    2239 #
    2240 # Determines the Darwin version.
    2241 # @todo This should really check the Xcode/SDK version.
    2242 #
    2243 check_darwinversion()
    2244 {
    2245   test_header "Darwin version"
    2246   darwin_ver=`uname -r`
    2247   case "$darwin_ver" in
    2248     19\.*)
    2249       darwin_ver="10.15" # Catalina
    2250       ;;
    2251     18\.*)
    2252       darwin_ver="10.14" # Mojave
    2253       ;;
    2254     17\.*)
    2255       darwin_ver="10.13" # High Sierra
    2256       ;;
    2257     16\.*)
    2258       darwin_ver="10.12" # Sierra
    2259       ;;
    2260     15\.*)
    2261       darwin_ver="10.11" # El Capitan
    2262       ;;
    2263     14\.*)
    2264       darwin_ver="10.10" # Yosemite
    2265       ;;
    2266     13\.*)
    2267       darwin_ver="10.9" # Mavericks
    2268       ;;
    2269     *)
    2270       echo "  failed to determine Darwin version. (uname -r: $darwin_ver)"
    2271       fail
    2272       darwin_ver="unknown"
    2273       ;;
    2274   esac
    2275 
    2276   check_xcode_sdk_path "$WITH_XCODE_DIR"
     2287check_xcode()
     2288{
     2289  test_header "Xcode and SDK"
     2290  check_xcode_path "$WITH_XCODE_DIR"
    22772291  [ $? -eq 1 ] || fail
    22782292
    22792293  # Pick the oldest SDK offered by Xcode, to get maximum compatibility
    2280   devel_subdir="$WITH_XCODE_DIR/Contents/Developer"
    2281   sdk_subdir="$devel_subdir/Platforms/MacOSX.platform/Developer/SDKs"
     2294  if [ -z "$WITH_XCODE_DIR" ]; then
     2295    devel_subdir="/Library/Developer/CommandLineTools"
     2296    sdk_subdir="$devel_subdir/SDKs"
     2297  else
     2298    devel_subdir="$WITH_XCODE_DIR/Contents/Developer"
     2299    sdk_subdir="$devel_subdir/Platforms/MacOSX.platform/Developer/SDKs"
     2300  fi
    22822301  sdk_tries="$sdk_subdir"/MacOSX10.?.sdk" $sdk_subdir"/MacOSX10.??.sdk" $sdk_subdir"/MacOSX.sdk
    22832302  for t in $sdk_tries; do
     
    22922311    fail
    22932312  fi
    2294 
    2295   cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
    2296   cnf_append "PATH_TOOL_VBoxXcode62" "$devel_subdir"
    2297   cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$devel_subdir"
     2313  xcode_ver=`$devel_subdir/usr/bin/clang --version | sed -n 's/^.*version \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*$/\1/p'`
     2314  if [ $? -ne 0 -o -z "$xcode_ver" ]; then
     2315    echo "  failed to determine Xcode version."
     2316    fail
     2317  fi
     2318
     2319  if [ -z "$WITH_XCODE_DIR" ]; then
     2320    cnf_append "VBOX_WITH_EVEN_NEWER_XCODE" "1"
     2321  else
     2322    cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
     2323    cnf_append "PATH_TOOL_VBoxXcode62" "$devel_subdir"
     2324    cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$devel_subdir"
     2325  fi
    22982326  cnf_append "VBOX_PATH_MACOSX_SDK" "$sdk"
    22992327  if [ -n "$sdk_ver" ]; then
     
    23022330  fi
    23032331
    2304   log_success "found version $darwin_ver (SDK: $sdk)"
     2332  log_success "found version $xcode_ver (SDK: $sdk)"
    23052333}
    23062334
     
    23732401  --with-kbuild=DIR        kbuild directory [$KBUILDDIR]
    23742402  --with-iasl=PATH         location of the iasl compiler [$IASL]
     2403  --with-yasm=PATH         location of the iasl compiler [$YASM]
    23752404  --with-makeself=PATH     location of makeself [$MAKESELF]
    23762405EOF
     
    25042533      IASL=`echo $option | cut -d'=' -f2`
    25052534      ;;
     2535    --with-yasm=*)
     2536      YASM=`echo $option | cut -d'=' -f2`
     2537      ;;
    25062538    --with-xcode-dir=*)
    25072539      WITH_XCODE_DIR=`echo $option | cut -d'=' -f2`
    2508       echo $option
    25092540      ;;
    25102541    --with-linux=*)
     
    27912822
    27922823# Darwin-specific
    2793 if [ "$OS" = "darwin" ]; then
    2794   check_darwinversion
    2795 fi
     2824[ "$OS" = "darwin" ] && check_darwinversion
    27962825# the tools
    2797 check_gcc
     2826[ "$OS" != "darwin"  ] && check_gcc
     2827[ "$OS" = "darwin"  ] && check_xcode
    27982828if [ $ONLY_ADDITIONS -eq 0 ]; then
    27992829  check_open_watcom
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette