Makefile revision 519
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Common Development and Distribution License (the "License").
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# and limitations under the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# When distributing Covered Code, include this CDDL HEADER in each
fe77cc0407fb667ddc04e1a8f2e203bb7b9c80e1Robert Mustacchi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bd93c05dbd9b8f1e8d2edf48c777bc881f927608Alexander Eremin# If applicable, add the following below this CDDL HEADER, with the
ead9bb4b1be81d7bbf8ed86ee41d6c1e58b069a3Yuri Pankov# fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# CDDL HEADER END
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_ARCHIVE_HASH= sha1:5f2d5dfcc17e7627ea752f675c605fe37c9c145c
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# we build three different variants of emacs for our users. As Solaris
d0054224e0ba320a05d1c27de508dc5224ff99d1Adam Stevko# always has a 64-bit kernel, and 64-bit emacs can handle larger files,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# we only build and deliver 64-bit binaries.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovBUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# contains the platform name. Although the name is platform dependent,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# the files inside it are the same on all platforms. By adding this
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# to the pkgmogrify macros, we can write our manifests in a portable way.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# LD_OPTIONS is defined to apply desirable link-editor options to Userland
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# components. Non-executable stack and data break sparc emacs.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# This code is built with gcc. The primary reason for this is that the
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# configure script has problems using a non-GNU cpp. I am not aware of
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# any reason Sun Studio could not be made to work, but simply made a
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# cost/benefit decision not to pursue it at this time
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Uncomment this for debugging only. It configures emacs to run from the
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# local proto instead of from its final installed location.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# configure options common to all variants of emacs that we want to build.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# variant specific configure options
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-x
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# we need to build all variants, but only have to install one in order
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# to remove unwanted files, copy the emacs binaries from the other tookit
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# builds into place, and install the additional files we provide.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Note that this tweaking is not required, as the proto need not match
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# the packaging. However, doing it this way allows us to examine the proto
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# as a finished and complete product, simplifies debugging emacs, and
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# facilitates the use of 'gmake sample-manifest'.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovPETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Remove emacs existing emacs executables/script from usr/bin
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# GTK binaries
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Non-X11 binaries
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# X11 (Athena) binaries
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Emacs shell script that picks the right variant at runtime
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# ctags and etags go in /usr/gnu/bin instead of /usr/bin
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# We do not install the files under /var/games/emacs. The reason for
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# this is that we do not install update-game-score as setuid, and
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# therefore the game files are not usable. This the same decision made
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# by Debian, among others.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# DOC-23.1.1. Remove and replace.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(BUILD_DIR)/$(MACH64)-x/etc/DOC-$(COMPONENT_VERSION).1 \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Throw away usr/share/info/dir. This file is the topmost node of the Info
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# hierarchy. Emacs builds it, as presumably do all GNU packages, but on
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Solaris, it is delivered by system/prerequisite/gnu.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PROTO_DIR)/usr/share/info/dir ;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# common targets
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankovinstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov @echo "no tests available"