2022-09-09 17:10:08 -04:00
|
|
|
#!/bin/bash
|
2014-05-01 14:42:16 -04:00
|
|
|
###############################################################################
|
2024-05-10 10:18:07 -04:00
|
|
|
# Copyright (c) 2014, 2024 Red Hat, Inc. and others
|
2018-11-20 13:02:15 +00:00
|
|
|
#
|
|
|
|
# This program and the accompanying materials
|
|
|
|
# are made available under the terms of the Eclipse Public License 2.0
|
2014-05-01 14:42:16 -04:00
|
|
|
# which accompanies this distribution, and is available at
|
2018-11-20 13:02:15 +00:00
|
|
|
# https://www.eclipse.org/legal/epl-2.0/
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EPL-2.0
|
2014-05-01 14:42:16 -04:00
|
|
|
#
|
|
|
|
# Contributors:
|
|
|
|
# Red Hat Inc. - initial API and implementation
|
|
|
|
###############################################################################
|
2014-07-11 14:15:58 -04:00
|
|
|
|
2014-07-07 16:03:37 -04:00
|
|
|
# Verify that the install script is being run from a plug-ins folder of a
|
|
|
|
# downloaded Eclipse and not in a local user .eclipse folder.
|
2014-07-11 14:15:58 -04:00
|
|
|
|
|
|
|
SCRIPT_DIR=`dirname $0`
|
|
|
|
|
2016-04-02 18:04:58 -04:00
|
|
|
IS_MAC=0
|
|
|
|
|
2014-07-11 14:15:58 -04:00
|
|
|
if [ ! -f "$SCRIPT_DIR/../../../eclipse" ]; then
|
2016-04-02 18:04:58 -04:00
|
|
|
if [ ! -f "$SCRIPT_DIR/../../../../MacOS/eclipse" ]; then
|
|
|
|
echo "$0: error: eclipse executable not found in expected location"
|
|
|
|
echo " "
|
|
|
|
echo "This can occur if you are running this script from your local .eclipse directory"
|
|
|
|
echo "which would mean you are running a shared instance of the Eclipse platform for"
|
|
|
|
echo "your distro and have installed the Stand-alone Debugger from an eclipse.org"
|
|
|
|
echo "download repo. Downloading the Stand-alone Debugger feature on top of a distro"
|
|
|
|
echo "version of Eclipse Debugger is not supported. If you are using a distro version"
|
|
|
|
echo "of the Eclipse platform, you should not use this script. Instead, install the"
|
|
|
|
echo "corresponding Eclipse CDT package for your distro (e.g. eclipse-cdt package)"
|
|
|
|
echo "which will install the Stand-alone Debugger for you."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
IS_MAC=1
|
|
|
|
fi
|
2014-07-07 16:03:37 -04:00
|
|
|
fi
|
2014-07-11 14:15:58 -04:00
|
|
|
|
|
|
|
if [ ! -d "$HOME/cdtdebugger" ]; then
|
|
|
|
mkdir -p "$HOME/cdtdebugger"
|
2014-05-01 14:42:16 -04:00
|
|
|
fi
|
2014-07-11 14:15:58 -04:00
|
|
|
cp "$SCRIPT_DIR/cdtdebug.sh" "$HOME/cdtdebugger"
|
|
|
|
chmod +x "$HOME/cdtdebugger/cdtdebug.sh"
|
|
|
|
|
2016-04-02 18:04:58 -04:00
|
|
|
if [ $IS_MAC -eq 0 ]; then
|
|
|
|
ECLIPSE_HOME=$(cd "$SCRIPT_DIR/../../.." && pwd)
|
|
|
|
else
|
|
|
|
ECLIPSE_HOME=$(cd "$SCRIPT_DIR/../../../../MacOS" && pwd)
|
|
|
|
fi
|
|
|
|
|
2014-07-11 14:15:58 -04:00
|
|
|
# Replace the entire line with tag @#@# by the actual location of the eclipse installation
|
|
|
|
sed -i -e "s,^.*@#@#.*$,ECLIPSE_HOME=$ECLIPSE_HOME," "$HOME/cdtdebugger/cdtdebug.sh"
|
2014-06-04 12:08:10 -04:00
|
|
|
echo "Installation complete"
|