From 5adce1b31102963d3008cae3fa401658d378eb12 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Mon, 12 Jan 2015 18:11:23 -0500 Subject: Add Mac support to script to download gdb -Make sure getopt command is present (not included by default on Mac but available through MacPorts -Patch wrong include Change-Id: I3ad1e19091896f8644ededa9d8200efe40bae82b Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/39438 Reviewed-by: Simon Marchi --- .../scripts/download-build-gdb.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh index b9bda931022..d8fb83e3d68 100755 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh @@ -12,6 +12,12 @@ # Stop the script if any command fails set -e +# Make sure getopt is the command and not the bash built-in +if [[ `getopt --version` != *"getopt"* ]]; then + echo "getopt command not found." + exit 1 +fi + # Our work directory default_base_dir="$HOME/gdb-all" base_dir="${default_base_dir}" @@ -146,8 +152,10 @@ function fixup_gdb() { ${dryrun} find "${build}/gdb" -type f -exec sed -i -e 's/struct siginfo/siginfo_t/g' {} \; ;; esac -} + # Fix wrong include on Mac + ${dryrun} find "${build}" -name "darwin-nat.c" -type f -exec sed -i -e "s/machine\/setjmp.h/setjmp.h/g" {} \; +} # Run ./configure. # -- cgit v1.2.3