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