1 #!/bin/sh |
|
2 # |
|
3 # |
|
4 # CDDL HEADER START |
|
5 # |
|
6 # The contents of this file are subject to the terms of the |
|
7 # Common Development and Distribution License (the "License"). |
|
8 # You may not use this file except in compliance with the License. |
|
9 # |
|
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
11 # or http://www.opensolaris.org/os/licensing. |
|
12 # See the License for the specific language governing permissions |
|
13 # and limitations under the License. |
|
14 # |
|
15 # When distributing Covered Code, include this CDDL HEADER in each |
|
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
17 # If applicable, add the following below this CDDL HEADER, with the |
|
18 # fields enclosed by brackets "[]" replaced with your own identifying |
|
19 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
20 # |
|
21 # CDDL HEADER END |
|
22 # |
|
23 # Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 |
|
26 |
|
27 # GNU emacs is delivered to Solaris as a core package (pkg:/editor/gnu-emacs) |
|
28 # that contains a complete emacs environment, minus the actual emacs |
|
29 # binaries. There are multiple binaries, which are optionally |
|
30 # installed from separate packages: |
|
31 # |
|
32 # emacs-gtk (pkg:/editor/gnu-emacs/gnu-emacs-gtk) |
|
33 # X11 support, using the GTK toolkit. |
|
34 # |
|
35 # emacs-x (pkg:/editor/gnu-emacs/gnu-emacs-x11) |
|
36 # X11 support, using the Athena (Xaw) toolkit. |
|
37 # |
|
38 # emacs-nox (pkg:/editor/gnu-emacs/gnu-emacs-x11) |
|
39 # Pure tty emacs, without any X Window support. |
|
40 # emacs-nox can run on a system minimized to not include |
|
41 # the X11 libraries. |
|
42 # |
|
43 # This script is installed as /usr/bin/emacs. It examines the |
|
44 # emacs binaries on the system, and runs the "best" version available. |
|
45 # |
|
46 for EXE in emacs-gtk emacs-x emacs-nox; do |
|
47 if [ -f /usr/bin/$EXE ]; then |
|
48 exec /usr/bin/$EXE "$@" |
|
49 fi |
|
50 done |
|
51 |
|
52 # If we get here, the system has pkg:/editor/gnu-emacs installed without |
|
53 # one of the packages that deliver the executables. That's not supposed to |
|
54 # happen, because the packages specify dependencies to prevent it, but |
|
55 # if it does, issue an appropriate message. |
|
56 # |
|
57 echo "$0: no emacs binaries available. Install software package pkg:/editor/gnu-emacs/gnu-emacs-gtk, pkg:/editor/gnu-emacs/gnu-emacs-x11, or pkg:/editor/gnu-emacs/gnu-emacs-x11" 1>&2 |
|
58 |
|
59 exit 1 |
|