usr/src/cmd/emacs/tools/build_emacs
author Cyril Plisko <cyril.plisko@grigale.com>
Sun, 20 Dec 2009 07:12:51 +0200
changeset 2 8f1801a322e9
parent 0 b34509ac961f
child 72 82bde2a81435
permissions -rw-r--r--
Import sfw build 128 Bugs Fixed ---------- 6562055 FIPS-capable version of OpenSSL 6660998 include snmp support within php 6667232 [nvb79b] integrate mod-perl 2.0.4 6751764 Upgrade Subversion to 1.6.3 6818228 [nvb110] zlib functions are not working on sparc 6825797 php engine dumps core within gettext php test case 6835980 RFE: Integrate trove for StorageIM (fix build dependency) 6851099 Update mutt to version 1.5.20 (fix opensolaris build) 6864292 [nvb119] some JSP and SERVLET functional tests are failed (strict_servlet compliance) 6867572 acpidump to be included in SFW consolidation (fix incrementals) 6870491 A patch from sfw allows cdrecord to write any local file 6878859 Tomcat should create pid file for monitoring by other applications 6888690 TPM: The "tpmadm auth" command does not prompt user for PIN 6889305 emacs buffers menu is not updating in build 124 6889510 tomcat 6 is built with wrong version info 6890019 Tomcat packaging should better support custom ROOT web application deployment 6892088 memory leak in pam_pkcs11 pam_prompt() 6892736 Update GNU emacs to version 23.1 6893031 mod_sed consumes too much memory when used inside reverse proxy and line sizes are very long 6893192 Tomcat needs extra package for example web applications 6893884 warning thrown while loading xdebug extension 6893900 "tpmadm init" command causes core dump if verify PIN is incorrect 6893909 nanosleep function is not recognized in php 6895932 sox should not use /usr/lib/libgomp.so, even when the SFW build server has gcc installed 6896267 Wireshark update to version 1.2.3

#!/bin/sh -x
#
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)build_emacs	1.2	09/10/29 SMI"


# Build GNU emacs for the Solaris SFW consolidation:
#
#	build_emacs class variant insroot
#
# where:
#
#	class - Class of emacs to build (32 or 64)
#	variant - Toolkit variant. One of (lucid, nox, or gtk)
#	insroot - Root of tree where emacs is expected to be
#		be run from. Normally '', signifying the system
#		root, but can be set elsewhere for debugging purposes.
#
# This script assumes that it will be run from usr/src/cmd/emacs,
# from Makefile.sfw, within the environment exported by bldenv.
#
# We use this script rather than doing it all from Makefile.sfw,
# because the series of steps involved in a build is rather complex,
# and it occurs in the Makefile multiple times.

VER=emacs-23.1


case $1 in
32) 	CC=${GCC};;
64)	CC="${GCC} -m64";;
*)	echo "build_emacs: unknown class '$1'. Must be 32 or 64." >&2; exit 1;;
esac

case $2 in
lucid)	TOOLKIT_OPT='--with-x-toolkit=lucid --with-gif=no';;
nox)	TOOLKIT_OPT='--without-x';;
gtk)	TOOLKIT_OPT='--with-x-toolkit=gtk --with-gif=no';;
*)	echo "build_emacs: unknown variant '$2'. Must be lucid, nox, or gtk" >&2;
	exit 1;;
esac

INSTALL_ROOT=$3

# These are the options we specify for every build to determine
# where things get installed.
BASE_OPT="--prefix=${INSTALL_ROOT-/} \
	    --bindir=${INSTALL_ROOT}/usr/bin \
	    --datarootdir=${INSTALL_ROOT}/usr/share \
	    --libexecdir=${INSTALL_ROOT}/usr/lib"

# If the emacs tarball has not been unpacked, do that, and then
# apply our patches.
if [ ! -d $VER ]; then
	/usr/bin/gzip -dc ${VER}.tar.gz | /usr/sfw/bin/gtar xpf -
	/usr/bin/gpatch -p0 < augment/patch/buffer_menu.patch
	/usr/bin/gpatch -p0 < augment/patch/sysmalloc.patch
	/usr/bin/gpatch -p0 < augment/patch/dldump.patch


	# The GPL license under which emacs is published is
	# found in files named COPYING, throughout the package.
	# Prepend the Sun GPLv2 disclaimer text to all such
	# files stating that sun explicitly chooses GPLv2
	# in those cases where the license offers a choice.
	for F in `find . -name COPYING`; do
		mv $F $F.orig
		(echo "For the avoidance of doubt, except that if any license choice other than GPL or
LGPL is available it will apply instead, Sun elects to use only the General
Public License version 3 (GPLv3) at this time for any software where a choice of
GPL license versions is made available with the language indicating that GPLv3
or any later version may be used, or where a choice of which version of the GPL
is applied is otherwise unspecified.
====================================================================

"; cat $F.orig) > $F
	rm $F.orig
	done
fi

cd $VER

# If it has a makefile, do a clean
if [ -f Makefile ]; then
	make clean
fi

# If it has been configured, wipe it back to its unpacked state
if [ -f config.status ]; then
	make distclean
fi

# Export environment variables
export CC	# Set above
MAKE=${GMAKE-gmake}				export MAKE
if [ "$SFW_PATH" != '' ]; then
	PATH=$SFW_PATH
fi
ac_cv_sys_long_file_names=yes;		export ac_cv_sys_long_file_names

# Configure the distribution
./configure $BASE_OPT $TOOLKIT_OPT

# Build it
$MAKE

exit 0