Makefile revision 1621
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane###############################################################################
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# xterm - terminal emulator for X
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Permission is hereby granted, free of charge, to any person obtaining a
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# copy of this software and associated documentation files (the "Software"),
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# to deal in the Software without restriction, including without limitation
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# and/or sell copies of the Software, and to permit persons to whom the
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Software is furnished to do so, subject to the following conditions:
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# The above copyright notice and this permission notice (including the next
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# paragraph) shall be included in all copies or substantial portions of the
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Software.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# DEALINGS IN THE SOFTWARE.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane#
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Package name used in tarballs
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_NAME=xterm
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montane# pkg(5) name we deliver the files in (override default)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_PKGNAME=terminal/xterm
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_PKGNAME_SET=yes
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# resize goes into a separate package so it can be installed in zones without
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# X, but which you login to from a resizable GUI terminal window.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneRESIZE_PKGNAME=terminal/resize
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Package classification (override default)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_PKGCLASS=Applications/System Utilities
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_PKGCLASS_SET=yes
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# ARC cases that covered this module
a771fcaf1dc80a6c7ea29bde04adba0179f420d8Jean-Noel Rouvignac# PSARC/2015/308 xterm 318
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_ARC_CASES += PSARC/2015/308
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montane# Package metadata
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-MontaneUPSTREAM = Thomas Dickey
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-MontaneUPSTREAM_URL = http://invisible-island.net/xterm/
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-MontaneUPSTREAM_SET = yes
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-MontaneMODULE_DESC = the xterm terminal emulator application
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-MontaneORACLE_TPNO = 23284
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Version number (used in path names)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_VERSION=320
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Checksums for upstream tarball
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneTARBALL_MD5 = 0d7f0e6390d132ae59876b3870e5783d
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneTARBALL_SHA1 = b1d2a1698430eb96530aa7c7bb7a6c562dcecf72
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneTARBALL_SHA256= a60dbb574334c081425fa30f011cd9f571e3be7a91e2a84e252461798bce24a7
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Source tarball
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_URL=ftp://invisible-island.net/xterm/$(SOURCE_TARBALL_NAME:.tar.gz=.tgz)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_URL_SET=yes
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Source tarball
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_TARBALL_NAME_SET=yes
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Patches to apply to source after unpacking, in order
a771fcaf1dc80a6c7ea29bde04adba0179f420d8Jean-Noel RouvignacSOURCE_PATCHES = desktop-icon.patch,-p1
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_PATCHES += solaris-ia.patch,-p1
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSOURCE_PATCHES += xpg-open.patch,-p1
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Man pages to apply Sun footer to & attributes to list
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSUNTOUCHED_MANPAGES=koi8rxterm.man resize.man uxterm.man xterm.man
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_STABILITY=Committed
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Fix man page footers to not say "Last changed: X Window System"
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneXORGRELSTRING = $(MODULE_NAME) $(MODULE_VERSION)
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montane XORGMANNAME = X Version 11
26be68e00675fe922e55d5fbb893ba58e2eb2f50Violette Roche-Montane XVENDORVERS = "$(XORGRELSTRING)" "$(XORGMANNAME)"
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_SUNTOUCH_MAN_FLAGS = -r '{__vendorversion__, $(XVENDORVERS)}'
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Override specific attributes for specific man pages
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_SUNTOUCH_MAN_FLAGS += \
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneSUNTOUCH_MAN_FLAGS_resize = -o '{Availability, $(RESIZE_PKGNAME)}'
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# xterm's configure script will set _XOPEN_SOURCE to the old XPG5 version
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# if we don't override it with a newer version (700 for S12, 600 for S11)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_CPPFLAGS = -D_XOPEN_SOURCE=700 -D__EXTENSIONS__
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Paths to find Xft/fontconfig/freetype headers libraries at build time
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# and run time
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneFT_CFLAGS= -I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/include/freetype2
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneFT_LIBS= -L$(PROTODIR)/usr/lib$(LIBSUBDIR) -lXft -lfontconfig
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Override the flags xterm's configure script generates, since it incorrectly
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# adds -R flags pointing to the build proto area, which are not wanted.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_BUILD_MAKEFLAGS = \
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_CFLAGS) $(MODTYPE_LDFLAGS)"
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane# Additional flags to pass to configure script
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-MontaneMODULE_CONFIG_OPTS = --enable-256-color --enable-88-color --enable-wide-chars \
--with-freetype-cflags="$(FT_CFLAGS)" --with-freetype-libs="$(FT_LIBS)" \
--disable-setuid --disable-setgid --enable-luit --disable-imake \
--x-includes=$(PROTODIR)$(X11_INCLUDES_DIR) --x-libraries=$(X11_LIB_DIR) \
--with-app-defaults=/usr/share/X11/app-defaults \
--with-icondir=/usr/share/pixmaps --enable-logging
# Sort-of emulate automake silent rules - run make configure V=1 to see
# full compiler flags
MODULE_CONFIG_OPTS_VERBOSE_0 = --disable-echo
MODULE_CONFIG_OPTS_VERBOSE_1 = --enable-echo
MODULE_CONFIG_OPTS_VERBOSE_ = $(MODULE_CONFIG_OPTS_VERBOSE_0)
MODULE_CONFIG_OPTS += $(MODULE_CONFIG_OPTS_VERBOSE_$(V))
# Tell configure where to find luit binary
MODULE_CONFIG_ENV = LUIT=$(X11_BIN_DIR)/luit
# xterm's configure script checks for $CC having extra flags & breaks if it
# does, so we need to force CC to be set to just the compiler, and pass the
# rest of the flags via CFLAGS & CPPFLAGS
JUST_CC = $(CC_$(CHOSEN_COMPILER))
MODULE_CONFIG_ENV += CC="$(JUST_CC)"
MODULE_CFLAGS += $(CC:$(JUST_CC)=)
MODULE_CPPFLAGS += $(CC:$(JUST_CC)=)
# Compatibility links from /usr/X11/bin to /usr/bin
MODULE_X11_BINCOMPAT_LINKS = xterm resize
MODULE_ADD_INSTALL_TARGETS=install_docs install_desktop
include ../Makefile.inc
# Install documentation of xterm control sequences for packaging
MODULE_DOCDIR=/usr/share/doc/xterm
PROTO_CTLSEQS=$(PROTODIR)$(MODULE_DOCDIR)/ctlseqs.txt
install_docs: $(PROTO_CTLSEQS)
# Install desktop file to allow starting xterm from GNOME menu
DESKTOP_DIR=/usr/share/applications
PROTO_DESKTOP=$(PROTODIR)$(DESKTOP_DIR)/xterm.desktop
install_desktop: $(PROTO_DESKTOP)
$(PROTO_CTLSEQS) $(PROTO_DESKTOP): $(UNPACK_TARGET)
mkdir -p $(@D)
cp -pf $(SOURCE_DIR)/$(@F) $@
# Metadata for separate package for resize
RESIZE_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%xterm=%resize)
RESIZE_PKG_ATTRDATA_FILE = $(RESIZE_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
RESIZE_PKG_LICENSE_FILE = $(RESIZE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
RESIZE_METADATA_TARGETS = \
$(RESIZE_PKG_METADATA_DIR) \
$(RESIZE_PKG_ATTRDATA_FILE) \
$(RESIZE_PKG_LICENSE_FILE)
install_metadata: $(RESIZE_METADATA_TARGETS)
$(RESIZE_PKG_METADATA_DIR):
mkdir -p $@
$(RESIZE_PKG_ATTRDATA_FILE) $(RESIZE_PKG_LICENSE_FILE): $(RESIZE_PKG_METADATA_DIR)