Makefile revision 1639
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").
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov# 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
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_PROJECT_URL= http://www.gnu.org/software/emacs/
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sha256:26576f9e664397c729f78f5ffcd092969251988461896fe8793062346ee988b9
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# we build three different variants of emacs for our users. As Solaris
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# always has a 64-bit kernel, and 64-bit emacs can handle larger files,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# we only build and deliver 64-bit binaries.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweBUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# contains the platform name. Although the name is platform dependent,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# the files inside it are the same on all platforms. By adding this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# to the pkgmogrify macros, we can write our manifests in a portable way.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# LD_OPTIONS is defined to apply desirable link-editor options to Userland
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# components. Non-executable stack and data break sparc emacs.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is built with gcc. The primary reason for this is that the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# configure script has problems using a non-GNU cpp. I am not aware of
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# any reason Sun Studio could not be made to work, but simply made a
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# cost/benefit decision not to pursue it at this time
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Uncomment this for debugging only. It configures emacs to run from the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# local proto instead of from its final installed location.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The configure script runs the pkg-config command. Since we're building
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# 64-bit executables, we need pkg-config to use the 64-bit metadata files
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_ENV += PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# configure options common to all variants of emacs that we want to build.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# ASLR should remain disabled for emacs (the default);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# build consistently core dumps with ASLR
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# variant specific configure options
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-x
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# we need to build all variants, but only have to install one in order
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# to remove unwanted files, copy the emacs binaries from the other tookit
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# builds into place, and install the additional files we provide.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Note that this tweaking is not required, as the proto need not match
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# the packaging. However, doing it this way allows us to examine the proto
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# as a finished and complete product, simplifies debugging emacs, and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# facilitates the use of 'gmake sample-manifest'.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Remove emacs existing emacs executables/script from usr/bin
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# GTK binaries
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Non-X11 binaries
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# X11 (Athena) binaries
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Emacs shell script that picks the right variant at runtime
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# ctags and etags go in /usr/gnu/bin instead of /usr/bin
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# We do not install the files under /var/games/emacs. The reason for
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# this is that we do not install update-game-score as setuid, and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# therefore the game files are not usable. This the same decision made
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Debian, among others.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DOC-23.1.1. Remove and replace.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(BUILD_DIR)/$(MACH64)-x/etc/DOC-$(COMPONENT_VERSION).1 \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Throw away usr/share/info/dir. This file is the topmost node of the Info
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# hierarchy. Emacs builds it, as presumably do all GNU packages, but on
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Solaris, it is delivered by system/prerequisite/gnu.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PROTO_DIR)/usr/share/info/dir ;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# common targets
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @echo "no tests available"