GP-5282: Adding linux_arm_64 and mac_arm_64 support to make-postgres.sh

This commit is contained in:
Ryan Kurtz
2025-01-17 10:16:16 -05:00
parent 5ca27e36c9
commit 483dee2889
2 changed files with 22 additions and 7 deletions

View File

@@ -55,10 +55,13 @@ echo $DIR
POSTGRES_GZ_PATH=${DIR}/../../../../ghidra.bin/Ghidra/Features/BSim/${POSTGRES_GZ} POSTGRES_GZ_PATH=${DIR}/../../../../ghidra.bin/Ghidra/Features/BSim/${POSTGRES_GZ}
if [ ! -f "${POSTGRES_GZ_PATH}" ]; then if [ ! -f "${POSTGRES_GZ_PATH}" ]; then
POSTGRES_GZ_PATH=${DIR}/support/${POSTGRES_GZ} POSTGRES_GZ_PATH=${DIR}/../../../dependencies/BSim/${POSTGRES_GZ}
if [ ! -f "${POSTGRES_GZ_PATH}" ]; then if [ ! -f "${POSTGRES_GZ_PATH}" ]; then
echo "Postgres source bundle not found: ${POSTGRES_GZ_PATH}" POSTGRES_GZ_PATH=${DIR}/support/${POSTGRES_GZ}
exit -1 if [ ! -f "${POSTGRES_GZ_PATH}" ]; then
echo "Postgres source bundle not found: ${POSTGRES_GZ_PATH}"
exit -1
fi
fi fi
fi fi
@@ -81,15 +84,27 @@ pushd build/${POSTGRES}
if [ "$OS" = "Darwin" ]; then if [ "$OS" = "Darwin" ]; then
export MACOSX_DEPLOYMENT_TARGET=10.5 export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS="-arch x86_64" export ARCHFLAGS="-arch $ARCH"
OSDIR=mac_x86_64 if [ "$ARCH" = "x86_64" ]; then
OSDIR="mac_x86_64"
HOMEBREW="/usr/local"
else
OSDIR="mac_arm_64"
HOMEBREW="/opt/homebrew"
fi
POSTGRES_CONFIG_OPTIONS+="--with-includes=${HOMEBREW}/include"
POSTGRES_CONFIG_OPTIONS+="--with-libraries=${HOMEBREW}/lib"
elif [ "$ARCH" = "x86_64" ]; then elif [ "$ARCH" = "x86_64" ]; then
OSDIR=linux_x86_64 OSDIR="linux_x86_64"
elif [ "$ARCH" = "aarch64" ]; then
OSDIR="linux_arm_64"
else else
echo "Unsupported platform: $OS $ARCH" echo "Unsupported platform: $OS $ARCH"
exit -1 exit -1
fi fi
echo "Platform: $OSDIR"
# Install within build/os # Install within build/os
INSTALL_DIR=${DIR}/build/os/${OSDIR}/postgresql INSTALL_DIR=${DIR}/build/os/${OSDIR}/postgresql
rm -rf ${INSTALL_DIR} > /dev/null rm -rf ${INSTALL_DIR} > /dev/null

View File

@@ -8,7 +8,7 @@ So we can just build PostgreSQL and harvest the object files we need.
**Note**: For the tutorial, we continue to use the H2 BSim backend. **Note**: For the tutorial, we continue to use the H2 BSim backend.
We do not run any PostgreSQL code, we simply analyze some files produced when building PostgreSQL. We do not run any PostgreSQL code, we simply analyze some files produced when building PostgreSQL.
Note that these files must be built on a machine running Linux. Note that these files must be built on a machine running Linux or macOS.
Windows users can build these files in a Linux virtual machine. Windows users can build these files in a Linux virtual machine.
To build the files, execute the following commands in a shell: [^1] To build the files, execute the following commands in a shell: [^1]