0
|
1 |
#!/bin/sh -x
|
|
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 |
#
|
72
|
23 |
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
0
|
24 |
#
|
72
|
25 |
# ident "@(#)build_emacs 1.3 11/03/08 SMI"
|
0
|
26 |
|
|
27 |
|
|
28 |
# Build GNU emacs for the Solaris SFW consolidation:
|
|
29 |
#
|
|
30 |
# build_emacs class variant insroot
|
|
31 |
#
|
|
32 |
# where:
|
|
33 |
#
|
|
34 |
# class - Class of emacs to build (32 or 64)
|
|
35 |
# variant - Toolkit variant. One of (lucid, nox, or gtk)
|
|
36 |
# insroot - Root of tree where emacs is expected to be
|
|
37 |
# be run from. Normally '', signifying the system
|
|
38 |
# root, but can be set elsewhere for debugging purposes.
|
|
39 |
#
|
|
40 |
# This script assumes that it will be run from usr/src/cmd/emacs,
|
|
41 |
# from Makefile.sfw, within the environment exported by bldenv.
|
|
42 |
#
|
|
43 |
# We use this script rather than doing it all from Makefile.sfw,
|
|
44 |
# because the series of steps involved in a build is rather complex,
|
|
45 |
# and it occurs in the Makefile multiple times.
|
|
46 |
|
2
|
47 |
VER=emacs-23.1
|
0
|
48 |
|
|
49 |
|
|
50 |
case $1 in
|
|
51 |
32) CC=${GCC};;
|
|
52 |
64) CC="${GCC} -m64";;
|
|
53 |
*) echo "build_emacs: unknown class '$1'. Must be 32 or 64." >&2; exit 1;;
|
|
54 |
esac
|
|
55 |
|
|
56 |
case $2 in
|
2
|
57 |
lucid) TOOLKIT_OPT='--with-x-toolkit=lucid --with-gif=no';;
|
0
|
58 |
nox) TOOLKIT_OPT='--without-x';;
|
2
|
59 |
gtk) TOOLKIT_OPT='--with-x-toolkit=gtk --with-gif=no';;
|
|
60 |
*) echo "build_emacs: unknown variant '$2'. Must be lucid, nox, or gtk" >&2;
|
0
|
61 |
exit 1;;
|
|
62 |
esac
|
|
63 |
|
|
64 |
INSTALL_ROOT=$3
|
|
65 |
|
|
66 |
# These are the options we specify for every build to determine
|
|
67 |
# where things get installed.
|
|
68 |
BASE_OPT="--prefix=${INSTALL_ROOT-/} \
|
|
69 |
--bindir=${INSTALL_ROOT}/usr/bin \
|
|
70 |
--datarootdir=${INSTALL_ROOT}/usr/share \
|
|
71 |
--libexecdir=${INSTALL_ROOT}/usr/lib"
|
|
72 |
|
|
73 |
# If the emacs tarball has not been unpacked, do that, and then
|
|
74 |
# apply our patches.
|
|
75 |
if [ ! -d $VER ]; then
|
|
76 |
/usr/bin/gzip -dc ${VER}.tar.gz | /usr/sfw/bin/gtar xpf -
|
2
|
77 |
/usr/bin/gpatch -p0 < augment/patch/buffer_menu.patch
|
0
|
78 |
/usr/bin/gpatch -p0 < augment/patch/sysmalloc.patch
|
|
79 |
/usr/bin/gpatch -p0 < augment/patch/dldump.patch
|
72
|
80 |
/usr/bin/gpatch -p0 < augment/patch/xft.patch
|
0
|
81 |
|
|
82 |
|
|
83 |
# The GPL license under which emacs is published is
|
|
84 |
# found in files named COPYING, throughout the package.
|
|
85 |
# Prepend the Sun GPLv2 disclaimer text to all such
|
|
86 |
# files stating that sun explicitly chooses GPLv2
|
|
87 |
# in those cases where the license offers a choice.
|
|
88 |
for F in `find . -name COPYING`; do
|
|
89 |
mv $F $F.orig
|
2
|
90 |
(echo "For the avoidance of doubt, except that if any license choice other than GPL or
|
|
91 |
LGPL is available it will apply instead, Sun elects to use only the General
|
|
92 |
Public License version 3 (GPLv3) at this time for any software where a choice of
|
|
93 |
GPL license versions is made available with the language indicating that GPLv3
|
|
94 |
or any later version may be used, or where a choice of which version of the GPL
|
0
|
95 |
is applied is otherwise unspecified.
|
|
96 |
====================================================================
|
|
97 |
|
|
98 |
"; cat $F.orig) > $F
|
2
|
99 |
rm $F.orig
|
0
|
100 |
done
|
|
101 |
fi
|
|
102 |
|
|
103 |
cd $VER
|
|
104 |
|
|
105 |
# If it has a makefile, do a clean
|
|
106 |
if [ -f Makefile ]; then
|
|
107 |
make clean
|
|
108 |
fi
|
|
109 |
|
|
110 |
# If it has been configured, wipe it back to its unpacked state
|
|
111 |
if [ -f config.status ]; then
|
|
112 |
make distclean
|
|
113 |
fi
|
|
114 |
|
|
115 |
# Export environment variables
|
|
116 |
export CC # Set above
|
|
117 |
MAKE=${GMAKE-gmake} export MAKE
|
|
118 |
if [ "$SFW_PATH" != '' ]; then
|
|
119 |
PATH=$SFW_PATH
|
|
120 |
fi
|
|
121 |
ac_cv_sys_long_file_names=yes; export ac_cv_sys_long_file_names
|
|
122 |
|
|
123 |
# Configure the distribution
|
|
124 |
./configure $BASE_OPT $TOOLKIT_OPT
|
|
125 |
|
72
|
126 |
|
0
|
127 |
# Build it
|
|
128 |
$MAKE
|
|
129 |
|
|
130 |
exit 0
|