Makefile revision 519
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
700N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/Ainclude ../../make-rules/shared-macros.mk
2N/A
2N/ACOMPONENT_NAME= emacs
2N/ACOMPONENT_VERSION= 23.1
2N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
2N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
2N/ACOMPONENT_ARCHIVE_HASH= sha1:5f2d5dfcc17e7627ea752f675c605fe37c9c145c
2N/ACOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
2N/A
59N/Ainclude ../../make-rules/prep.mk
59N/Ainclude ../../make-rules/configure.mk
2N/Ainclude ../../make-rules/ips.mk
2N/A
2N/A# we build three different variants of emacs for our users. As Solaris
2N/A# always has a 64-bit kernel, and 64-bit emacs can handle larger files,
26N/A# we only build and deliver 64-bit binaries.
26N/AVARIANTS = nox x gtk
2N/A
26N/ABUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
38N/AINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
181N/A
26N/A# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
26N/A# contains the platform name. Although the name is platform dependent,
26N/A# the files inside it are the same on all platforms. By adding this
26N/A# to the pkgmogrify macros, we can write our manifests in a portable way.
26N/AEMACS_ULEV_PFX = $(MACH:sparc=sparc-sun)
26N/AEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
26N/APKG_MACROS += EMACS_ULEVDIR=$(EMACS_ULEVDIR)
26N/A
700N/A# LD_OPTIONS is defined to apply desirable link-editor options to Userland
700N/A# components. Non-executable stack and data break sparc emacs.
26N/A#
26N/ALD_MAP_NOEXSTK.sparc=
26N/ALD_MAP_NOEXDATA.sparc=
26N/A
151N/A# This code is built with gcc. The primary reason for this is that the
206N/A# configure script has problems using a non-GNU cpp. I am not aware of
26N/A# any reason Sun Studio could not be made to work, but simply made a
26N/A# cost/benefit decision not to pursue it at this time
26N/ACOMPILER = gcc
26N/A
26N/A# Uncomment this for debugging only. It configures emacs to run from the
26N/A# local proto instead of from its final installed location.
26N/A#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
2N/A
26N/A# configure options common to all variants of emacs that we want to build.
26N/ACONFIGURE_OPTIONS += CC="$(CC) -m64"
26N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
26N/ACONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
26N/ACONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
26N/ACONFIGURE_OPTIONS += --with-gif=no
26N/ACONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
26N/A
586N/A# variant specific configure options
26N/A$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-x
93N/A$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
166N/A$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
26N/A
379N/A# we need to build all variants, but only have to install one in order
379N/A# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
2N/A# to remove unwanted files, copy the emacs binaries from the other tookit
26N/A# builds into place, and install the additional files we provide.
26N/A#
181N/A# Note that this tweaking is not required, as the proto need not match
181N/A# the packaging. However, doing it this way allows us to examine the proto
181N/A# as a finished and complete product, simplifies debugging emacs, and
99N/A# facilitates the use of 'gmake sample-manifest'.
59N/APBIN= $(PROTO_DIR)/usr/bin
12N/APETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
30N/APGBIN= $(PROTO_DIR)/usr/gnu/bin
26N/APGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
26N/APSHAREMAN1= $(PROTO_DIR)/usr/share/man/man1
26N/APVAR= $(PROTO_DIR)/var
2N/A
26N/A# Remove emacs existing emacs executables/script from usr/bin
185N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
185N/A
185N/A# GTK binaries
2N/ACOMPONENT_POST_INSTALL_ACTION += \
255N/A $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
145N/A $(PBIN)/emacs-gtk ;
7N/ACOMPONENT_POST_INSTALL_ACTION += \
26N/A $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
26N/A
38N/A# Non-X11 binaries
26N/ACOMPONENT_POST_INSTALL_ACTION += \
197N/A $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
197N/A $(PBIN)/emacs-nox ;
197N/ACOMPONENT_POST_INSTALL_ACTION += \
197N/A $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
197N/A
26N/A# X11 (Athena) binaries
30N/ACOMPONENT_POST_INSTALL_ACTION += \
26N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
46N/A $(PBIN)/emacs-x ;
46N/ACOMPONENT_POST_INSTALL_ACTION += \
46N/A $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
64N/A
64N/A# Emacs shell script that picks the right variant at runtime
26N/ACOMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
46N/ACOMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
46N/A
46N/A# ctags and etags go in /usr/gnu/bin instead of /usr/bin
2N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
46N/ACOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
369N/A
53N/A# We do not install the files under /var/games/emacs. The reason for
46N/A# this is that we do not install update-game-score as setuid, and
46N/A# therefore the game files are not usable. This the same decision made
26N/A# by Debian, among others.
181N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
369N/A
181N/A# The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
181N/A# DOC-23.1.1. Remove and replace.
181N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
181N/ACOMPONENT_POST_INSTALL_ACTION += \
181N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/etc/DOC-$(COMPONENT_VERSION).1 \
181N/A $(PETC)/DOC-$(COMPONENT_VERSION).1 ;
76N/A
99N/ACOMPONENT_POST_INSTALL_ACTION += \
181N/A $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
99N/ACOMPONENT_POST_INSTALL_ACTION += \
26N/A $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
185N/ACOMPONENT_POST_INSTALL_ACTION += \
185N/A $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
185N/A
145N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
145N/ACOMPONENT_POST_INSTALL_ACTION += \
145N/A $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
145N/ACOMPONENT_POST_INSTALL_ACTION += \
145N/A $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
117N/A
84N/A# Throw away usr/share/info/dir. This file is the topmost node of the Info
145N/A# hierarchy. Emacs builds it, as presumably do all GNU packages, but on
145N/A# Solaris, it is delivered by system/prerequisite/gnu.
145N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PROTO_DIR)/usr/share/info/dir ;
38N/A
46N/A
99N/A# common targets
99N/Abuild: $(BUILD_64)
196N/A
185N/Ainstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
99N/A
46N/Atest:
2N/A @echo "no tests available"
145N/A
26N/ABUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
2N/A
32N/Ainclude ../../make-rules/depend.mk
32N/A