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