Makefile revision 176
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# CDDL HEADER START
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# The contents of this file are subject to the terms of the
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Common Development and Distribution License (the "License").
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# You may not use this file except in compliance with the License.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# See the License for the specific language governing permissions
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# and limitations under the License.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
15a44745412679c30a6d022733925af70a38b715David Lawrence# information: Portions Copyright [yyyy] [name of copyright owner]
e85ffb301b294d70ddc1d90234788403666bb944David Lawrence# CDDL HEADER END
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2da2220fe7af2c45724b50b0187523b1fab0cf08Rob AusteinCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas GustafssonCOMPONENT_ARCHIVE_HASH= sha1:5f2d5dfcc17e7627ea752f675c605fe37c9c145c
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas GustafssonCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# Some of the GNU COPYING (GPL licence) files are delivered to the end
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# user by the emacs packages, so add the disclaimer text to all such
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# files as part of the prep. Copy one of these files into the component
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# directory to serve as emacs.license
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson for F in `find $(@D) -name COPYING`; do \
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# we build three different variants of emacs for our users. As Solaris
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# always has a 64-bit kernel, and 64-bit emacs can handle larger files,
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# we only build and deliver 64-bit binaries.
b897c52f865b2fc4e220e2110b874e59c716456bBob HalleyBUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
b897c52f865b2fc4e220e2110b874e59c716456bBob HalleyINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# contains the platform name. Although the name is platform dependent,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# the files inside it are the same on all platforms. By adding this
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# to the pkgmogrify macros, we can write our manifests in a portable way.
7877ad5db24dbad945afc670b2010c70d0d7e2f5Mark AndrewsEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# LD_OPTIONS is defined to apply desirable link-editor options to Userland
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# components. Non-executable stack and data break sparc emacs.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# This code is built with gcc. The primary reason for this is that the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# configure script has problems using a non-GNU cpp. I am not aware of
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# any reason Sun Studio could not be made to work, but simply made a
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# cost/benefit decision not to pursue it at this time
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Uncomment this for debugging only. It configures emacs to run from the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# local proto instead of from its final installed location.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# configure options common to all variants of emacs that we want to build.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark AndrewsCONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# variant specific configure options
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-x
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# we need to build all variants, but only have to install one in order
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# to remove unwanted files, copy the emacs binaries from the other tookit
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# builds into place, and install the additional files we provide.
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# Note that this tweaking is not required, as the proto need not match
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# the packaging. However, doing it this way allows us to examine the proto
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# as a finished and complete product, simplifies debugging emacs, and
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews# facilitates the use of 'gmake sample-manifest'.
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark AndrewsPETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsPGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# Remove emacs existing emacs executables/script from usr/bin
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid LawrenceCOMPONENT_POST_INSTALL_ACTION += rm -f $(PBIN)/emacs $(PBIN)/emacs-* ;
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# GTK binaries
8959ca20706f210127d0af1df769fb945c92baeaMark AndrewsCOMPONENT_POST_INSTALL_ACTION += cp $(BUILD_DIR)/$(MACH64)-gtk/src/emacs \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += ln $(PBIN)/emacs-gtk \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Non-X11 binaries
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += cp $(BUILD_DIR)/$(MACH64)-nox/src/emacs \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += ln $(PBIN)/emacs-nox \
5bae12051f80947fb9a5a6a3a54762e8bd08d95bMark Andrews# X11 (Athena) binaries
f6161d8b90541b52946ae845bc8e2bec2647d6cbMark AndrewsCOMPONENT_POST_INSTALL_ACTION += cp $(BUILD_DIR)/$(MACH64)-x/src/emacs \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += ln $(PBIN)/emacs-x \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Emacs shell script that picks the right variant at runtime
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += cp augment/emacs $(PBIN) ;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += chmod +x $(PBIN)/emacs ;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# ctags and etags go in /usr/gnu/bin instead of /usr/bin
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += mkdir -p $(PGBIN) ;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid LawrenceCOMPONENT_POST_INSTALL_ACTION += mv $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# We do not install the files under /var/games/emacs. The reason for
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# this is that we do not install update-game-score as setuid, and
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# therefore the game files are not usable. This the same decision made
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# by Debian, among others.
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid LawrenceCOMPONENT_POST_INSTALL_ACTION += rm -rf $(PVAR) ;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# Odd thing: The file usr/share/emacs/23.1/etc/DOC-23.1.1 needed by
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews# emacs gets installed as usr/share/emacs/23.1/etc/DOC-23.1.2. Correct it.
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += mv $(PETC)/DOC-$(COMPONENT_VERSION).2 \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews# Throw away the manpages that were installed, and generate them again, using
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews# sed to bolt on an ATTRIBUTES section. ctags is special in that it simply
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews# inlines etags.1, and should not pass through solman.pl.
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsMAN_DIST_PCORE= $(SOLMAN_CORE) < $(COMPONENT_SRC)/doc/man/XXX \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += rm $(PSHAREMAN1)/* ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=b2m.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=ebrowse.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=emacs.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=emacsclient.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=grep-changelog.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(MAN_DIST_PCORE:XXX=rcs-checkin.1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(SOLMAN) editor/gnu-emacs/gnu-emacs-gtk \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews < augment/man/man1/emacs-gtk.1 > $(PSHAREMAN1)/emacs-gtk.1 ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(SOLMAN) editor/gnu-emacs/gnu-emacs-no-x11 \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews < augment/man/man1/emacs-nox.1 > $(PSHAREMAN1)/emacs-nox.1 ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(SOLMAN) editor/gnu-emacs/gnu-emacs-x11 \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews < augment/man/man1/emacs-x.1 > $(PSHAREMAN1)/emacs-x.1 ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += mkdir -p $(PGSHAREMAN1) ;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += cp $(COMPONENT_SRC)/doc/man/ctags.1 \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark AndrewsCOMPONENT_POST_INSTALL_ACTION += $(SOLMAN_CORE) \
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews < $(COMPONENT_SRC)/doc/man/etags.1 > $(PGSHAREMAN1)/etags.1 ;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# Throw away usr/share/info/dir. This file is the topmost node of the Info
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# hierarchy. Emacs builds it, as presumably do all GNU packages, but on
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# Solaris, it is delivered by system/prerequisite/gnu.
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid LawrenceCOMPONENT_POST_INSTALL_ACTION += rm $(PROTO_DIR)/usr/share/info/dir ;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# common targets
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrenceinstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence @echo "no tests available"