Commit bec7515f authored by Rob Buckley's avatar Rob Buckley
Browse files

use MB_PYTHON_OSX_VER for defaults in osx_utils.sh

parent e62f5118
......@@ -15,13 +15,14 @@ BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}"
# Default compilation flags for OSX
# IS_OSX is defined in common_utils.sh
if [ -n "$IS_OSX" ]; then
MAC_ARCH=$(mac_arch_for_pyosx_version $MB_PYTHON_OSX_VER)
if [[ "$MAC_ARCH" == "intel" ]]; then
source $MULTIBUILD_DIR/osx_utils.sh
PLAT=$(mac_cpython_arch_for_osx_ver)
if [[ $PLAT == intel ]]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
elif [[ "$MAC_ARCH" == "x86_x64" ]]; then
elif [[ $PLAT == x86_64 ]]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch x86_64"}
else
echo "invalid ARCH = '$MAC_ARCH'"
echo "invalid platform = '$PLAT', supported values are 'intel' or 'x86_64'"
exit 1
fi
# Only set CFLAGS, FFLAGS if they are not already defined. Build functions
......
......@@ -9,6 +9,7 @@ source $MULTIBUILD_DIR/common_utils.sh
MACPYTHON_URL=https://www.python.org/ftp/python
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
MACPYTHON_DEFAULT_OSX="10.6"
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$MACPYTHON_DEFAULT_OSX}
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
DOWNLOADS_SDIR=downloads
WORKING_SDIR=working
......@@ -123,8 +124,7 @@ function pyinst_fname_for_version {
# $py_version (python version in major.minor.extra format)
# $py_osx_ver: {major.minor | not defined}
# if defined, the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, uses the default
# MACPYTHON_DEFAULT_OSX
# "10.6" or "10.9", if not defined, uses the default MACPYTHON_DEFAULT_OSX
# Note: this is the version the Python is built for, and hence
# the min version supported, NOT the version of the current system
local py_version=$1
......@@ -134,16 +134,15 @@ function pyinst_fname_for_version {
}
function mac_arch_for_pyosx_version {
# echo arch (intel or x86_64) that cpython builds targetted for the
# given minimum macOS are targetted for
function mac_cpython_arch_for_osx_ver {
# echo arch (intel or x86_64) for cpython python.org builds targetted for
# the given minimum macOS version
# Parameters
# $py_osx_ver (major.minor | not defined}
# if defined, the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, uses the default
# MACPYTHON_DEFAULT_OSX
py_osx_ver=${1:-$MACPYTHON_DEFAULT_OSX}
check_var $py_osx_ver
# the macosx version that python is built for, e.g.
# "10.6" or "10.9", or MB_PYTHON_OSX_VER if undefined
#
py_osx_ver=${1:-$MB_PYTHON_OSX_VER}
if [[ "$py_osx_ver" == "10.6" ]]; then
echo "intel"
elif [[ "$py_osx_ver" == "10.9" ]]; then
......@@ -301,8 +300,10 @@ function get_macpython_environment {
# $venv_dir : {directory_name|not defined}
# If defined - make virtualenv in this directory, set python / pip
# commands accordingly
# NOTE: to use the default for $py_osx_ver while defining $venv_dir, set
# $py_osx_ver to "" (empty string)
# $py_osx_ver: {major.minor | not defined}
# if defined, the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, use the version from the
# environment variable MB_PYTHON_OSX_VER
#
# Installs Python
# Sets $PYTHON_EXE to path to Python executable
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment