Makefile revision 5680
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
3817N/A
2N/A#
2N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A# As Solaris always has a 64-bit kernel, and 64-bit emacs can handle larger
2N/A# files, we only build and deliver 64-bit binaries.
2N/ABUILD_BITS= 64
2N/Ainclude ../../make-rules/shared-macros.mk
2N/A
3817N/ACOMPONENT_NAME= emacs
166N/ACOMPONENT_VERSION= 24.5
166N/ACOMPONENT_ARCHIVE_HASH= \
2N/A sha256:2737a6622fb2d9982e9c47fb6f2fb297bda42674e09db40fc9bcc0db4297c3b6
2N/A
59N/ATPNO= 23457
59N/A
166N/AINSTALL_TARGET=
59N/A# The upstream emacs distribution does not have tests to be run
59N/A# from this target.
2N/ATEST_TARGET= $(NO_TESTS)
166N/Ainclude $(WS_MAKE_RULES)/gnu-component.mk
166N/A
166N/A# We patch the configure.ac file. Get the new configure generated during prep.
2N/ACOMPONENT_PREP_ACTION = (cd $(@D) ; aclocal -I m4; autoconf )
2N/A
2N/A# We build three different variants of emacs for our users.
2N/AVARIANTS = nox x gtk
2N/A
166N/ABUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
2N/AINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
2N/A
2N/A# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
2N/A# contains the platform name. Although the name is platform dependent,
166N/A# the files inside it are the same on all platforms. By adding this
2N/A# to the pkgmogrify macros, we can write our manifests in a portable way.
2N/AEMACS_ULEV_PFX = $(MACH:sparc=sparc-sun)
58N/AEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
58N/APKG_MACROS += EMACS_ULEVDIR=$(EMACS_ULEVDIR)
58N/A
58N/A# LD_OPTIONS is defined to apply desirable link-editor options to Userland
58N/A# components. Non-executable stack and data break sparc emacs.
58N/A#
151N/ALD_MAP_NOEXSTK.sparc=
151N/ALD_MAP_NOEXDATA.sparc=
58N/A
58N/A# Uncomment this for debugging only. It configures emacs to run from the
58N/A# local proto instead of from its final installed location. This is useful
58N/A# for initial bringup of new emacs versions, but can only be used up through
119N/A# the 'gmake build' stage.
58N/A#
57N/A#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
57N/A
278N/A# The configure script runs the pkg-config command. This allows it to
278N/A# find the non-default GnuTLS v3 library.
3N/ACONFIGURE_ENV += PKG_CONFIG_PATH=$(PKG_CONFIG_PATH.64)/gnutls-3
206N/A
58N/A# Never use xmkmf to find X11 libraries from autoconf. They are all available
278N/A# from standard system locations, and we don't want the ld -L option that
58N/A# gets injected.
58N/ACONFIGURE_ENV += XMKMF="false"
58N/A
151N/A# configure options common to all variants of emacs that we want to build.
278N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
62N/ACONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
58N/ACONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
58N/ACONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.32)
2N/ACONFIGURE_OPTIONS += --with-gif=no
181N/ACONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
181N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
2N/ACONFIGURE_OPTIONS += emacs_cv_prog_cc_o=no
62N/Aendif
814N/A
814N/A# Disable gsettings and dbus. gsettings causes numerous startup errors
814N/A# of the form
814N/A# (process:25309): GLib-GIO-CRITICAL **: file gsettingsschema.c:
814N/A# line 416: assertion 'source != NULL' failed
814N/A# without providing much benefit on Solaris. dbus does not offer sufficient
814N/A# utility for Solaris to be worth the negative interactions with ssh, where
814N/A# the session blocks on exit due to dbus holding an open port.
814N/A#
814N/ACONFIGURE_OPTIONS += --without-gsettings --without-dbus
2N/A
716N/A# ASLR should remain disabled for emacs. ASLR undermines emacs's dumping
716N/A# code, which requires every execution to have the same mappings. Since
2077N/A# emacs is not network facing, or run with elevated privileges, this is
716N/A# not a security concern.
716N/A#
2N/A# As with ASLR, ADIHEAP should be explicitly disabled for emacs, as the
151N/A# dumped emacs cannot work with ADI. Recognizing that ASLR_MODE could really
59N/A# be SX_MODE, and generalized to handle all the sxadm extensions, redefine
2N/A# it here to handle both cases. It is expected that in due course, the
2N/A# Userland framework will evolve in this direction.
16N/A#
151N/Aifeq ($(OS_VERSION), 5.11)
2N/AASLR_MODE = $(ASLR_DISABLE)
2N/Aelse
2N/AASLR_MODE = -z sx=aslr=disable,adiheap=disable
2N/Aendif
59N/A
2N/A# variant specific configure options
16N/A$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-all --without-x
151N/A$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
2N/A$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
814N/A
1780N/A# we need to build all variants, but only have to install one in order
814N/A# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
2N/A# to remove unwanted files, copy the emacs binaries from the other tookit
2N/A# builds into place, and install the additional files we provide.
2N/A#
59N/A# Note that this tweaking is not required, as the proto need not match
2N/A# the packaging. However, doing it this way allows us to examine the proto
16N/A# as a finished and complete product, simplifies debugging emacs, and
58N/A# facilitates the use of 'gmake sample-manifest'.
2N/APBIN= $(PROTO_DIR)/usr/bin
2N/APETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
59N/APGBIN= $(PROTO_DIR)/usr/gnu/bin
166N/APGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
3558N/APSHAREMAN1= $(PROTO_DIR)/usr/share/man/man1
3864N/APVAR= $(PROTO_DIR)/var
3864N/A
166N/A# Remove existing emacs executable from usr/bin. We install the binaries
3558N/A# under their variant names. /usr/bin/emacs ends up as an IPS mediated link.
3558N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
3205N/A
3558N/A# GTK binaries
3558N/ACOMPONENT_POST_INSTALL_ACTION += \
166N/A $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
3558N/A $(PBIN)/emacs-gtk ;
3558N/ACOMPONENT_POST_INSTALL_ACTION += \
3558N/A $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
3558N/A
3558N/A# Non-X11 binaries
3558N/ACOMPONENT_POST_INSTALL_ACTION += \
3558N/A $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
3558N/A $(PBIN)/emacs-nox ;
3558N/ACOMPONENT_POST_INSTALL_ACTION += \
3558N/A $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
3558N/A
3558N/A# X11 (Athena) binaries
3558N/ACOMPONENT_POST_INSTALL_ACTION += \
3558N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
166N/A $(PBIN)/emacs-x ;
166N/ACOMPONENT_POST_INSTALL_ACTION += \
4089N/A $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
4089N/A
4089N/A# ctags and etags go in /usr/gnu/bin instead of /usr/bin. At this time,
4089N/A# etags could arguably go into /usr/bin, but we'd like to preserve the
4089N/A# ability to replace the standard Solaris /usr/bin/ctags, along with
4089N/A# both of the ones we're delivering, with Exuberant Ctags. Putting both
4089N/A# emacs tags programs in /usr/gnu/bin helps that, and is a simpler story.
4089N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
4089N/ACOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
4089N/A
4089N/A# We do not install the files under /var/games/emacs. The reason for
4089N/A# this is that we do not install update-game-score as setuid, and
4089N/A# therefore the game files are not usable. This the same decision made
4089N/A# by Debian, among others.
4089N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
4089N/A
4089N/A# Provide manpages for the emacs variants, which are our creation, referring
4089N/A# the reader to the main emacs(1) manpage.
4089N/ACOMPONENT_POST_INSTALL_ACTION += \
4089N/A $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
4089N/ACOMPONENT_POST_INSTALL_ACTION += \
4089N/A $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
4089N/ACOMPONENT_POST_INSTALL_ACTION += \
4089N/A $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
4089N/A
4089N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
4089N/ACOMPONENT_POST_INSTALL_ACTION += \
814N/A $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
1780N/ACOMPONENT_POST_INSTALL_ACTION += \
814N/A $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
814N/A
814N/A# Throw away usr/share/info/dir and usr/share/info/info.info. These files
814N/A# live at the topmost node of the Info hierarchy. Emacs builds them, as
814N/A# presumably do all GNU packages, but on Solaris, they are delivered by
59N/A# pkg:/text/texinfo.
59N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) \
3817N/A $(PROTO_DIR)/usr/share/info/dir \
3817N/A $(PROTO_DIR)/usr/share/info/info.info ;
3817N/A
3817N/A# By default, emacs is configured to compress lisp files, manpages, and info
3817N/A# files. The option to disable that (--without-compress-install) has no
3817N/A# granularity --- it's all or nothing. For Solaris, we want to compress lisp
3817N/A# sources, but not the others. It's simplest to let everything be compressed.
3817N/A# and then explicitly decompress the manpages and info files.
3817N/ACOMPONENT_POST_INSTALL_ACTION += $(GUNZIP) \
$(PROTO_DIR)/usr/share/info/*.gz \
$(PROTO_DIR)/usr/share/man/man1/*.gz ;
# common targets
install: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
# Desktop packages differ slightly between S11 & S12: list union to allow
# for BUILD_TYPE=evaluation and normal builds.
REQUIRED_PACKAGES += editor/gnu-emacs
REQUIRED_PACKAGES += file/gnu-findutils
REQUIRED_PACKAGES += gnome/config/gconf
REQUIRED_PACKAGES += image/imagemagick
REQUIRED_PACKAGES += image/library/libjpeg
REQUIRED_PACKAGES += image/library/libpng
REQUIRED_PACKAGES += image/library/librsvg
REQUIRED_PACKAGES += image/library/libtiff
REQUIRED_PACKAGES += library/desktop/cairo
REQUIRED_PACKAGES += library/desktop/gdk-pixbuf
REQUIRED_PACKAGES += library/desktop/gtk2
REQUIRED_PACKAGES += library/desktop/gtk3
REQUIRED_PACKAGES += library/desktop/pango
REQUIRED_PACKAGES += library/glib2
REQUIRED_PACKAGES += library/gnutls
REQUIRED_PACKAGES += library/gnutls-3
REQUIRED_PACKAGES += library/libxml2
REQUIRED_PACKAGES += library/ncurses
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/perl-512
REQUIRED_PACKAGES += runtime/perl-520
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/library/fontconfig
REQUIRED_PACKAGES += system/library/freetype-2
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += x11/library/libice
REQUIRED_PACKAGES += x11/library/libsm
REQUIRED_PACKAGES += x11/library/libx11
REQUIRED_PACKAGES += x11/library/libxft
REQUIRED_PACKAGES += x11/library/libxinerama
REQUIRED_PACKAGES += x11/library/libxmu
REQUIRED_PACKAGES += x11/library/libxpm
REQUIRED_PACKAGES += x11/library/libxrandr
REQUIRED_PACKAGES += x11/library/libxrender
REQUIRED_PACKAGES += x11/library/toolkit/libxaw7
REQUIRED_PACKAGES += x11/library/toolkit/libxt