Makefile revision 1428
f808c858fa61e7769218966759510a8b1190dfcfraf###############################################################################
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf# TigerVNC (Xvnc server & vncviewer) Makefile
f808c858fa61e7769218966759510a8b1190dfcfraf# Based on Fedora's tigervnc.spec revision 1.20 from
f808c858fa61e7769218966759510a8b1190dfcfraf# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf# Permission is hereby granted, free of charge, to any person obtaining a
f808c858fa61e7769218966759510a8b1190dfcfraf# copy of this software and associated documentation files (the "Software"),
f808c858fa61e7769218966759510a8b1190dfcfraf# to deal in the Software without restriction, including without limitation
f808c858fa61e7769218966759510a8b1190dfcfraf# the rights to use, copy, modify, merge, publish, distribute, sublicense,
f808c858fa61e7769218966759510a8b1190dfcfraf# and/or sell copies of the Software, and to permit persons to whom the
f808c858fa61e7769218966759510a8b1190dfcfraf# Software is furnished to do so, subject to the following conditions:
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf# The above copyright notice and this permission notice (including the next
f808c858fa61e7769218966759510a8b1190dfcfraf# paragraph) shall be included in all copies or substantial portions of the
f808c858fa61e7769218966759510a8b1190dfcfraf# Software.
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f808c858fa61e7769218966759510a8b1190dfcfraf# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f808c858fa61e7769218966759510a8b1190dfcfraf# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
f808c858fa61e7769218966759510a8b1190dfcfraf# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
f808c858fa61e7769218966759510a8b1190dfcfraf# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f808c858fa61e7769218966759510a8b1190dfcfraf# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
f808c858fa61e7769218966759510a8b1190dfcfraf# DEALINGS IN THE SOFTWARE.
f808c858fa61e7769218966759510a8b1190dfcfraf#
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Package name used in tarballs
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_NAME=tigervnc
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Package metadata
f808c858fa61e7769218966759510a8b1190dfcfrafUPSTREAM = TigerVNC
f808c858fa61e7769218966759510a8b1190dfcfrafUPSTREAM_URL = http://www.tigervnc.com/
f808c858fa61e7769218966759510a8b1190dfcfrafUPSTREAM_SET = yes
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_LICENSE = GPLv2
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_LICENSE_SET = yes
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_LICENSE_PREPEND = $(GPL_CHOICE_FILE)
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_LICENSE_DESC = portions of the TigerVNC software
f808c858fa61e7769218966759510a8b1190dfcfrafORACLE_TPNO = 9801
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Version number (used in path names)
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_VERSION=1.1.0
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Checksums for upstream tarball
f808c858fa61e7769218966759510a8b1190dfcfrafTARBALL_MD5 = 1a5598b4a2ac530fb51411438959e11e
f808c858fa61e7769218966759510a8b1190dfcfrafTARBALL_SHA1 = a678745c231a37eea92c7c7c259f7495061a9a0d
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Source tarball
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_TARBALL_NAME_SET=yes
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Xorg server source tarball to use sources from
f808c858fa61e7769218966759510a8b1190dfcfrafXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
f808c858fa61e7769218966759510a8b1190dfcfrafXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
f808c858fa61e7769218966759510a8b1190dfcfrafXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xserver
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Java VNCviewer applet for connecting from a web browser
f808c858fa61e7769218966759510a8b1190dfcfrafJAVA_SOURCE_DIR = $(SOURCE_DIR)/java/src/com/tigervnc/vncviewer
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Download site for source
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_URL=$(SF_DOWNLOADS_URL)/tigervnc/tigervnc/1.1.0/$(SOURCE_TARBALL_NAME)
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_URL_SET=yes
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Patches to apply to source after unpacking, in order
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += $(SOURCE_DIR)/unix/xserver114.patch,'-p0 -d unix'
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += tigervnc11-xorg111.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += tigervnc11-xorg112.patch,'-p0 -d unix'
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += tigervnc11-xorg114.patch,'-p0 -d unix'
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += xorg-1.12.1.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += no-nasm.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += applet-html.patch
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += icon.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += jdk17.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += solaris-libraries.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += vnc-nobuildtime.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += vnc-nohttpd.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += solaris-port.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += solaris-audit.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfrafSOURCE_PATCHES += 17950657.patch,-p1
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Need to regenerate autoconf/automake files after patching
f808c858fa61e7769218966759510a8b1190dfcfrafAUTORECONF=yes
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Disable parfait build with 1.3 - 17759056
f808c858fa61e7769218966759510a8b1190dfcfrafUSE_PARFAIT=no
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# ARC cases that covered this module
f808c858fa61e7769218966759510a8b1190dfcfraf# PSARC/2007/545 Xvnc
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_ARC_CASES = PSARC/2007/545
f808c858fa61e7769218966759510a8b1190dfcfraf# LSARC/2007/625 vncviewer
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_ARC_CASES += LSARC/2007/625
f808c858fa61e7769218966759510a8b1190dfcfraf# PSARC/2009/592 TigerVNC 1.0
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_ARC_CASES += PSARC/2009/592
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Man pages to apply Sun footer to & attributes to list
f808c858fa61e7769218966759510a8b1190dfcfrafSUNTOUCHED_MANPAGES= \
f808c858fa61e7769218966759510a8b1190dfcfraf unix/xserver/hw/vnc/Xvnc.man unix/vncviewer/vncviewer.man \
f808c858fa61e7769218966759510a8b1190dfcfraf unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
f808c858fa61e7769218966759510a8b1190dfcfraf unix/vncserver.man unix/x0vncserver/x0vncserver.man
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_STABILITY = Volatile
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Additional pkg(5) package name used for vncviewer package
f808c858fa61e7769218966759510a8b1190dfcfrafVNCVIEWER_PKGNAME=desktop/remote-desktop/$(MODULE_NAME)
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Override specific attributes for specific man pages
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_SUNTOUCH_MAN_FLAGS= \
f808c858fa61e7769218966759510a8b1190dfcfraf $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
f808c858fa61e7769218966759510a8b1190dfcfrafSUNTOUCH_MAN_FLAGS_vncviewer = -o '{Availability, $(VNCVIEWER_PKGNAME)}' \
f808c858fa61e7769218966759510a8b1190dfcfraf -o '{Interface Stability, Path: Committed, Options: Volatile}'
f808c858fa61e7769218966759510a8b1190dfcfraf
f808c858fa61e7769218966759510a8b1190dfcfraf# Compiler to use
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_COMPILER=suncc
f808c858fa61e7769218966759510a8b1190dfcfrafMODULE_COMPILER_SET=yes
f808c858fa61e7769218966759510a8b1190dfcfraf
# Make command to use
MODULE_MAKE=$(GNUMAKE)
MODULE_MAKE_SET=yes
# Xvnc has to configure, build, and install in different directories due to
# the mixed codebases and unusual directory layout
$(NO_RECURSE)MODULE_ADD_SOURCE_TARGETS = Xvnc_source_init
$(NO_RECURSE)MODULE_SOURCE_DEPS = Xvnc_source_init
$(NO_RECURSE)ADDITIONAL_SOURCE_DIR = sun-src
MODULE_ADD_CONFIGURE_TARGETS = $(XORG_BUILD_DIR)/Makefile
BUILD_TARGETS=Xvnc_build set-elf-comments java_build
BUILD_TARGETS_SET=yes
INSTALL_TARGETS=Xvnc_install_server Xvnc_install_programs \
java_install Xvnc_install_data install_fix_paths
INSTALL_TARGETS_SET=yes
# Environment variable options to GNU autoconf configure script
# Have to remove CFLAGS entries from default LDFLAGS to avoid conflicts
# with the C++ compiler we use instead
MODULE_CONFIG_ENV = \
LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
# Command line options to GNU autoconf configure script for vnc clients
MODULE_CONFIG_OPTS = --with-installed-zlib --with-system-jpeg --without-simd
MODULE_CONFIG_OPTS += --libdir='$${exec_prefix}/lib/vnc'
# Compatibility links from /usr/X11/bin to /usr/bin
MODULE_X11_BINCOMPAT_LINKS = Xvnc
# Binaries that were linked to isaexec on x86 to choose 32-bit or 64-bit,
# now just symlinks from amd64 to parent directory
LINKED_TO_ISAEXEC = Xvnc
include ../Makefile.inc
# Merge in additional sources from Xorg tarball & sun-src directory
# This step has to be done before default_source, so that patches applied
# in that step work correctly.
$(NO_RECURSE)XORG_SOURCE_INIT_TARGET = $(XORG_BUILD_DIR)/$(SOURCE_INIT_TARGET_FILE)
$(NO_RECURSE)XORG_PATCHED_TARGET = $(XORG_BUILD_DIR)/$(PATCHED_TARGET_FILE)
Xvnc_source_init: $(XORG_PATCHED_TARGET)
$(XORG_TARBALL):
(cd ../xorg && $(MAKE) $(MAKEFLAGS) download)
$(XORG_SOURCE_INIT_TARGET): $(XORG_TARBALL)
mkdir -p $(SOURCE_DIR)/unix
$(MAKE) $(MAKEFLAGS) init_source \
NO_RECURSE="$(POUND_SIGN)" \
BUILD_TYPE="$(BUILD_TYPE)" \
SOURCE_TARBALL="$(XORG_TARBALL)" \
SOURCE_DEPS="$(XORG_TARBALL)" \
SOURCE_DIR="$(XORG_BUILD_DIR)" \
BUILD_DIR="$(XORG_BUILD_DIR)" \
ADD_TAR_FLAGS="--strip-components=1"
(cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
touch $(XORG_SOURCE_INIT_TARGET)
$(XORG_PATCHED_TARGET): $(XORG_SOURCE_INIT_TARGET)
$(MAKE) $(MAKEFLAGS) patched_source \
NO_RECURSE="$(POUND_SIGN)" \
BUILD_TYPE="$(BUILD_TYPE)" \
SOURCE_PATCHES="$(XORG_SOURCE_PATCHES:%=../xorg/%)" \
SOURCE_DIR="$(XORG_BUILD_DIR)" \
XORG_BUILD_DIR="$(XORG_BUILD_DIR)"
(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
touch $(XORG_PATCHED_TARGET)
# Command line options to GNU autoconf configure script for Xvnc
XVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS)
# Disable all the things we don't need in the Xvnc build since we
# get them in the normal Xorg build instead
XVNC_CONFIG_OPTS += --disable-builddocs --disable-xfree86-utils
XVNC_CONFIG_OPTS += --disable-xorg --disable-xnest --disable-xvfb --disable-dmx
XVNC_CONFIG_OPTS += --disable-xwin --disable-xephyr --disable-kdrive
# Disable building Xorg hardware device support that Xvnc can't use
XVNC_CONFIG_OPTS += --without-int10 --disable-config-hal --disable-dga
# The X server unit tests currently depend on the Xorg ddx being built
XVNC_CONFIG_OPTS += --disable-unit-tests
# Include -lc as workaround for bug 17815318 so libm can actually go away
# if -xlibmil manages to inline all math functions.
MODULE_LDFLAGS += -lc -lm
MODULE_CPPFLAGS = \
-D_XOPEN_SOURCE=500 -D__EXTENSIONS__ \
-D__extension__=\"\" \
-I$(PWD)/$(SOURCE_DIR)/common \
-I$(PWD)/$(SOURCE_DIR)/unix/vncconfig \
-I$(PWD)/$(SOURCE_DIR)/unix/xserver/miext/damage \
CFLAGS_gcc += -fPIC
# Needed by unix/xorg-x11-server-source/hw/vnc/Makefile.am to find libpixman
# headers in proto area after solaris-port.patch is applied
MODULE_MAKEFLAGS = PROTODIR=$(PROTODIR)
# Run configure script for Xvnc
$(XORG_BUILD_DIR)/Makefile: $(SOURCE_TARGETS)
(cd $(XORG_BUILD_DIR) && \
$(AUTORECONF_ENV) autoreconf --install --force && \
$(CONFIG_ENV) $(CONFIG_SHELL) ./configure $(XVNC_CONFIG_OPTS) )
Xvnc_build: $(CONFIGURE_TARGETS)
$(PERL) -i -p -e 's{/usr/bin/env perl}{$(PERL)}' \
$(SOURCE_DIR)/unix/vncserver
$(DEFAULT_BUILD_COMMAND:@DIR@=$(SOURCE_DIR))
$(DEFAULT_BUILD_COMMAND:@DIR@=$(XORG_BUILD_DIR))
Xvnc_install_server: $(BUILD_TARGETS)
$(DEFAULT_INSTALL_COMMAND:@DIR@=$(XORG_BUILD_DIR)/hw/vnc) install
rm -f $(PROTODIR)/$(X11_SERVERMODS_DIR)/extensions/libvnc.so
Xvnc_install_programs: $(BUILD_TARGETS)
mkdir -p $(PROTODIR)/usr/bin/$(ARCHBINSUBDIR)
$(INSTALL_SCRIPT) -m 0755 $(SOURCE_DIR)/unix/vncserver \
$(SOURCE_DIR)/unix/vncpasswd/vncpasswd \
$(SOURCE_DIR)/unix/vncconfig/vncconfig \
$(SOURCE_DIR)/unix/vncviewer/vncviewer \
$(SOURCE_DIR)/unix/x0vncserver/x0vncserver \
$(PROTODIR)/usr/bin/$(ARCHBINSUBDIR)
Xvnc_install_data: $(SOURCE_TARGETS)
mkdir -p $(PROTODIR)/usr/share/man/man1 \
$(PROTODIR)$(SMF_MANIFEST_DIR)/application/x11
$(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncserver.man \
$(PROTODIR)/usr/share/man/man1/vncserver.1
$(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
$(PROTODIR)/usr/share/man/man1/vncconfig.1
$(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
$(PROTODIR)/usr/share/man/man1/vncpasswd.1
$(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
$(PROTODIR)/usr/share/man/man1/vncviewer.1
$(INSTALL_SCRIPT) -m 0444 \
$(SOURCE_DIR)/unix/x0vncserver/x0vncserver.man \
$(PROTODIR)/usr/share/man/man1/x0vncserver.1
$(INSTALL_SCRIPT) -m 0444 xvnc-inetd.xml \
$(PROTODIR)$(SMF_MANIFEST_DIR)/application/x11/
# Java VNCviewer applet for connecting from a web browser
JAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
JAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
java_build: $(JAVA_JAR_FILE)
$(JAVA_JAR_FILE): $(SOURCE_TARGETS)
$(DEFAULT_BUILD_COMMAND:@DIR@=$(JAVA_SOURCE_DIR)/../decoder)
$(DEFAULT_BUILD_COMMAND:@DIR@=$(JAVA_SOURCE_DIR))
java_install: $(JAVA_JAR_FILE)
-rm -rf $(JAVA_INSTALL_DIR)
mkdir -p $(JAVA_INSTALL_DIR)
$(DEFAULT_INSTALL_COMMAND:@DIR@=$(JAVA_SOURCE_DIR)) \
install INSTALL_DIR=$(JAVA_INSTALL_DIR)
$(INSTALL_SCRIPT) -m 0444 $(JAVA_SOURCE_DIR)/README \
$(JAVA_SOURCE_DIR)/LICENCE.TXT \
$(JAVA_INSTALL_DIR)
chmod a+x $(JAVA_INSTALL_DIR)/VncViewer.jar
rm -f $(JAVA_INSTALL_DIR)/*.class
# Metadata for vncviewer package
VNCVIEWER_PKG_METADATA_DIR = $(PROTOMETA)/desktop-remote-desktop-tigervnc
VNCVIEWER_PKG_ATTRDATA_FILE = $(VNCVIEWER_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
VNCVIEWER_PKG_LICENSE_FILE = $(VNCVIEWER_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
VNCVIEWER_METADATA_TARGETS = \
$(VNCVIEWER_PKG_METADATA_DIR) \
$(VNCVIEWER_PKG_ATTRDATA_FILE) \
$(VNCVIEWER_PKG_LICENSE_FILE)
install_metadata: $(VNCVIEWER_METADATA_TARGETS)
$(VNCVIEWER_PKG_METADATA_DIR):
mkdir -p $@
$(VNCVIEWER_PKG_ATTRDATA_FILE) $(VNCVIEWER_PKG_LICENSE_FILE): $(VNCVIEWER_PKG_METADATA_DIR)