Skip to content

Commit

Permalink
avoid useless rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Feb 7, 2024
1 parent 71d7293 commit 0ddbc13
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ if [ ! -r dist/Python-${BUILTIN_PYTHON_VERSION}.tgz ]; then
curl https://www.python.org/ftp/python/${BUILTIN_PYTHON_VERSION}/Python-${BUILTIN_PYTHON_VERSION}.tgz --output dist/Python-${BUILTIN_PYTHON_VERSION}.tgz
fi

case `uname` in
'Linux') LIBNAME="$1/lib/libpython3.12.so" ;;
'Darwin') LIBNAME="$1/lib/libpython3.12.dylib" ;;
*) echo 'Unsupported platform for the builtin Python interpreter'
exit 1
;;
esac

if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then
echo building in $1
rm -rf build/Python-${BUILTIN_PYTHON_VERSION}
Expand All @@ -22,7 +30,6 @@ if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then
'Linux')
export LDFLAGS="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib'"
export CFLAGS=""
LIBNAME="$1/lib/libpython3.12.so"
export ZLIB_LIBS="-lz -ldl"
;;
'Darwin')
Expand All @@ -32,11 +39,6 @@ if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then
cp $(brew --prefix [email protected])/lib/*.a ../openssl/lib
cp -r $(brew --prefix [email protected])/include/openssl ../openssl/include
export SSL="--with-openssl=$(pwd)/../openssl"
LIBNAME="$1/lib/libpython3.12.dylib"
;;
*)
echo 'Unsupported platform for the builtin Python interpreter'
exit 1
;;
esac

Expand Down

0 comments on commit 0ddbc13

Please sign in to comment.