diff --git a/build_python.sh b/build_python.sh index 953ecf0..bec30d6 100644 --- a/build_python.sh +++ b/build_python.sh @@ -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} @@ -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') @@ -32,11 +39,6 @@ if [ ! -d "$1" ] || [ ! -r "${LIBNAME}" ]; then cp $(brew --prefix openssl@1.1)/lib/*.a ../openssl/lib cp -r $(brew --prefix openssl@1.1)/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