summaryrefslogtreecommitdiff
blob: 0c88748f5d023b6dfeb04a96bd054ecefd860579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/sh
#
# Tiny startup wrapper for the Eclipse 2.1.x series
#
# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
# Copyright (c) 2004, Gentoo Foundation
#
# Licensed under the GNU General Public License, version 2
#

if [ -f $HOME/.eclipserc ] ; then
	. $HOME/.eclipserc
fi

if [ -z "${ECLIPSE_HOME}" ] ; then
	ECLIPSE_HOME=/usr/lib/eclipse-2
fi

if [ "${PREFERRED_FRONTEND}" == "gtk" ] && [ -x ${ECLIPSE_HOME}/eclipse-gtk ] ; then
	ECLIPSE_BIN=${ECLIPSE_HOME}/eclipse-gtk
elif [ "${PREFERRED_FRONTEND}" == "motif" ] && [ -x ${ECLIPSE_HOME}/eclipse-motif ] ; then
	ECLIPSE_BIN=${ECLIPSE_HOME}/eclipse-motif
else
	if [ -x "${ECLIPSE_HOME}/eclipse-gtk" ] ; then
		ECLIPSE_BIN=${ECLIPSE_HOME}/eclipse-gtk
	elif [ -x "${ECLIPSE_HOME}/eclipse-motif" ] ; then
		ECLIPSE_BIN=${ECLIPSE_HOME}/eclipse-motif
	fi
fi

if [ ! -x "${ECLIPSE_BIN}" ] ; then
	echo "Failed to find executable '${ECLIPSE_BIN}'" > /dev/stderr
	exit -1
fi

${ECLIPSE_BIN} $*