mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-30 09:25:32 +08:00
GP-1209: Support for building natives from a release.
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#----------------------------------------
|
||||
# Build Native Binaries
|
||||
#
|
||||
# args: forwarded to gradle (-i, -s, etc)
|
||||
#----------------------------------------
|
||||
|
||||
# Make sure gradle is on the path
|
||||
if ! [ -x "$(command -v gradle)" ] ; then
|
||||
echo "Gradle not found on the PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Resolve symbolic link if present and get the directory this script lives in.
|
||||
# NOTE: "readlink -f" is best but works on Linux only, "readlink" will only work if your PWD
|
||||
# contains the link you are calling (which is the best we can do on macOS), and the "echo" is the
|
||||
# fallback, which doesn't attempt to do anything with links.
|
||||
SCRIPT_FILE="$(readlink -f "$0" 2>/dev/null || readlink "$0" 2>/dev/null || echo "$0")"
|
||||
SCRIPT_DIR="${SCRIPT_FILE%/*}"
|
||||
|
||||
buildGhidraNatives () {
|
||||
echo "Building natives in Ghidra..."
|
||||
pushd ${SCRIPT_DIR}/../Ghidra &>/dev/null
|
||||
gradle "$@" buildNatives
|
||||
result=$?
|
||||
popd &>/dev/null
|
||||
return $result
|
||||
}
|
||||
|
||||
buildGplNatives () {
|
||||
echo "Building natives in GPL..."
|
||||
pushd ${SCRIPT_DIR}/../GPL &>/dev/null
|
||||
gradle "$@" buildNatives
|
||||
result=$?
|
||||
popd &>/dev/null
|
||||
return $result
|
||||
}
|
||||
|
||||
buildGhidraNatives "$@" && buildGplNatives "$@"
|
||||
|
||||
Reference in New Issue
Block a user