Makefile revision 844
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# CDDL HEADER START
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# The contents of this file are subject to the terms of the
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# Common Development and Distribution License (the "License").
f01d121976553130cab6089d35c71d5b947d1204Matt Sweeney# You may not use this file except in compliance with the License.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# or http://www.opensolaris.org/os/licensing.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# See the License for the specific language governing permissions
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# and limitations under the License.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# When distributing Covered Code, include this CDDL HEADER in each
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# If applicable, add the following below this CDDL HEADER, with the
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# fields enclosed by brackets "[]" replaced with your own identifying
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# information: Portions Copyright [yyyy] [name of copyright owner]
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney#
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# CDDL HEADER END
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeneyinclude ../../make-rules/shared-macros.mk
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_NAME= emacs
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_VERSION= 23.4
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_PROJECT_URL= http://www.gnu.org/software/emacs/
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
49b2441cfaf50222c256670b81ff734d8be3f9a4Matt SweeneyCOMPONENT_ARCHIVE_HASH= \
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney sha256:26576f9e664397c729f78f5ffcd092969251988461896fe8793062346ee988b9
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeneyinclude ../../make-rules/prep.mk
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeneyinclude ../../make-rules/configure.mk
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeneyinclude ../../make-rules/ips.mk
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# we build three different variants of emacs for our users. As Solaris
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# always has a 64-bit kernel, and 64-bit emacs can handle larger files,
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# we only build and deliver 64-bit binaries.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyVARIANTS = nox x gtk
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyBUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# contains the platform name. Although the name is platform dependent,
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# the files inside it are the same on all platforms. By adding this
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# to the pkgmogrify macros, we can write our manifests in a portable way.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyEMACS_ULEV_PFX = $(MACH:sparc=sparc-sun)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyPKG_MACROS += EMACS_ULEVDIR=$(EMACS_ULEVDIR)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# LD_OPTIONS is defined to apply desirable link-editor options to Userland
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# components. Non-executable stack and data break sparc emacs.
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney#
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyLD_MAP_NOEXSTK.sparc=
b8e54cd0fdbfd4d5482a6c38e53b0d42e2e2baffMatt SweeneyLD_MAP_NOEXDATA.sparc=
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# This code is built with gcc. The primary reason for this is that the
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# configure script has problems using a non-GNU cpp. I am not aware of
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# any reason Sun Studio could not be made to work, but simply made a
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# cost/benefit decision not to pursue it at this time
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPILER = gcc
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# Uncomment this for debugging only. It configures emacs to run from the
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# local proto instead of from its final installed location.
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# The configure script runs the pkg-config command. Since we're building
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# 64-bit executables, we need pkg-config to use the 64-bit metadata files
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_ENV += PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# configure options common to all variants of emacs that we want to build.
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_OPTIONS += CC="$(CC) -m64"
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_OPTIONS += --with-gif=no
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyCONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# variant specific configure options
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-x
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# we need to build all variants, but only have to install one in order
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# to remove unwanted files, copy the emacs binaries from the other tookit
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# builds into place, and install the additional files we provide.
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney#
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# Note that this tweaking is not required, as the proto need not match
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# the packaging. However, doing it this way allows us to examine the proto
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# as a finished and complete product, simplifies debugging emacs, and
85a258143f630b36522d3d1835a8e5a916dbad2cMatt Sweeney# facilitates the use of 'gmake sample-manifest'.
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyPBIN= $(PROTO_DIR)/usr/bin
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyPETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyPGBIN= $(PROTO_DIR)/usr/gnu/bin
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyPGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyPSHAREMAN1= $(PROTO_DIR)/usr/share/man/man1
85a258143f630b36522d3d1835a8e5a916dbad2cMatt SweeneyPVAR= $(PROTO_DIR)/var
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# Remove emacs existing emacs executables/script from usr/bin
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# GTK binaries
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney $(PBIN)/emacs-gtk ;
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# Non-X11 binaries
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(PBIN)/emacs-nox ;
4a589644c0b4ea2684514116fbbad30d79536f8aMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# X11 (Athena) binaries
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(PBIN)/emacs-x ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney# Emacs shell script that picks the right variant at runtime
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# ctags and etags go in /usr/gnu/bin instead of /usr/bin
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney# We do not install the files under /var/games/emacs. The reason for
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# this is that we do not install update-game-score as setuid, and
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# therefore the game files are not usable. This the same decision made
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# by Debian, among others.
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney# DOC-23.1.1. Remove and replace.
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) $(BUILD_DIR)/$(MACH64)-x/etc/DOC-$(COMPONENT_VERSION).1 \
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney $(PETC)/DOC-$(COMPONENT_VERSION).1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += \
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney# Throw away usr/share/info/dir. This file is the topmost node of the Info
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney# hierarchy. Emacs builds it, as presumably do all GNU packages, but on
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt Sweeney# Solaris, it is delivered by system/prerequisite/gnu.
0dfbad86367ee46837c580e51d7d76e8bd6d88b7Matt SweeneyCOMPONENT_POST_INSTALL_ACTION += $(RM) $(PROTO_DIR)/usr/share/info/dir ;
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney# common targets
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeneybuild: $(BUILD_64)
4a589644c0b4ea2684514116fbbad30d79536f8aMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeneyinstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeneytest:
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney @echo "no tests available"
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt SweeneyBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeneyinclude ../../make-rules/depend.mk
100cd7da99ccec416d3021e9a567addc2d9ed3dfMatt Sweeney