Makefile revision 783
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#
703N/A# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
176N/A#
176N/Ainclude ../../make-rules/shared-macros.mk
176N/A
176N/ACOMPONENT_NAME= emacs
703N/ACOMPONENT_VERSION= 23.4
618N/ACOMPONENT_PROJECT_URL= http://www.gnu.org/software/emacs/
176N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
176N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
703N/ACOMPONENT_ARCHIVE_HASH= sha1:5effbd2af6bf7a4feb2d80810e49b0ce47b463cb
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# 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
703N/A# The configure script runs the pkg-config command. Since we're building
703N/A# 64-bit executables, we need pkg-config to use the 64-bit metadata files
703N/ACONFIGURE_ENV += PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig
703N/A
176N/A# configure options common to all variants of emacs that we want to build.
519N/ACONFIGURE_OPTIONS += CC="$(CC) -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
414N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
176N/A
176N/A# GTK binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-gtk ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
176N/A
176N/A# Non-X11 binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-nox ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
176N/A
176N/A# X11 (Athena) binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-x ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
176N/A
176N/A# Emacs shell script that picks the right variant at runtime
414N/ACOMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
414N/ACOMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
176N/A
176N/A# ctags and etags go in /usr/gnu/bin instead of /usr/bin
414N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
414N/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.
414N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
176N/A
414N/A# The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
414N/A# DOC-23.1.1. Remove and replace.
414N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/etc/DOC-$(COMPONENT_VERSION).1 \
414N/A $(PETC)/DOC-$(COMPONENT_VERSION).1 ;
176N/A
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
176N/A
414N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(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.
414N/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/Atest:
176N/A @echo "no tests available"
176N/A
176N/ABUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
176N/A
176N/Ainclude ../../make-rules/depend.mk