Makefile revision 1425
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################################################################
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# TigerVNC (Xvnc server & vncviewer) Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Based on Fedora's tigervnc.spec revision 1.20 from
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the "Software"),
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# to deal in the Software without restriction, including without limitation
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the rights to use, copy, modify, merge, publish, distribute, sublicense,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and/or sell copies of the Software, and to permit persons to whom the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Software is furnished to do so, subject to the following conditions:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The above copyright notice and this permission notice (including the next
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater# paragraph) shall be included in all copies or substantial portions of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# DEALINGS IN THE SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package name used in tarballs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package metadata
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_LICENSE_DESC = portions of the TigerVNC software
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Version number (used in path names)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Checksums for upstream tarball
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARBALL_SHA1 = a678745c231a37eea92c7c7c259f7495061a9a0d
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Source tarball
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic UpdaterSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Xorg server source tarball to use sources from
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic UpdaterXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Java VNCviewer applet for connecting from a web browser
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinJAVA_SOURCE_DIR = $(SOURCE_DIR)/java/src/com/tigervnc/vncviewer
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater# Download site for source
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_URL=$(SF_DOWNLOADS_URL)/tigervnc/tigervnc/1.1.0/$(SOURCE_TARBALL_NAME)
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater# Patches to apply to source after unpacking, in order
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic UpdaterSOURCE_PATCHES += $(SOURCE_DIR)/unix/xserver114.patch,'-p0 -d unix'
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic UpdaterSOURCE_PATCHES += tigervnc11-xorg112.patch,'-p0 -d unix'
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic UpdaterSOURCE_PATCHES += tigervnc11-xorg114.patch,'-p0 -d unix'
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic Updater# Need to regenerate autoconf/automake files after patching
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# Disable parfait build with 1.3 - 17759056
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ARC cases that covered this module
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# PSARC/2007/545 Xvnc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# LSARC/2007/625 vncviewer
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater# PSARC/2009/592 TigerVNC 1.0
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Man pages to apply Sun footer to & attributes to list
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater unix/xserver/hw/vnc/Xvnc.man unix/vncviewer/vncviewer.man \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
1238b38c9f0ab563b762dc0fd00ac6c34c2b7295Automatic Updater unix/vncserver.man unix/x0vncserver/x0vncserver.man
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Additional pkg(5) package name used for vncviewer package
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVNCVIEWER_PKGNAME=desktop/remote-desktop/$(MODULE_NAME)
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater# Override specific attributes for specific man pages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUNTOUCH_MAN_FLAGS_vncviewer = -o '{Availability, $(VNCVIEWER_PKGNAME)}' \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews -o '{Interface Stability, Path: Committed, Options: Volatile}'
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Compiler to use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Make command to use
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Xvnc has to configure, build, and install in different directories due to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the mixed codebases and unusual directory layout
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(NO_RECURSE)MODULE_ADD_SOURCE_TARGETS = Xvnc_source_init
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(NO_RECURSE)MODULE_SOURCE_DEPS = Xvnc_source_init
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_ADD_CONFIGURE_TARGETS = $(XORG_BUILD_DIR)/Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinBUILD_TARGETS=Xvnc_build set-elf-comments java_build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinINSTALL_TARGETS=Xvnc_install_server Xvnc_install_programs \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews java_install Xvnc_install_data install_fix_paths
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Environment variable options to GNU autoconf configure script
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Have to remove CFLAGS entries from default LDFLAGS to avoid conflicts
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# with the C++ compiler we use instead
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Command line options to GNU autoconf configure script for vnc clients
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CONFIG_OPTS = --with-installed-zlib --with-system-jpeg --without-simd
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CONFIG_OPTS += --libdir='$${exec_prefix}/lib/vnc'
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Compatibility links from /usr/X11/bin to /usr/bin
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Binaries that were linked to isaexec on x86 to choose 32-bit or 64-bit,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# now just symlinks from amd64 to parent directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Merge in additional sources from Xorg tarball & sun-src directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This step has to be done before default_source, so that patches applied
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# in that step work correctly.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(NO_RECURSE)XORG_SOURCE_INIT_TARGET = $(XORG_BUILD_DIR)/$(SOURCE_INIT_TARGET_FILE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(NO_RECURSE)XORG_PATCHED_TARGET = $(XORG_BUILD_DIR)/$(PATCHED_TARGET_FILE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(XORG_PATCHED_TARGET): $(XORG_SOURCE_INIT_TARGET)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews SOURCE_PATCHES="$(XORG_SOURCE_PATCHES:%=../xorg/%)" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Command line options to GNU autoconf configure script for Xvnc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Disable all the things we don't need in the Xvnc build since we
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# get them in the normal Xorg build instead
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS += --disable-builddocs --disable-xfree86-utils
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS += --disable-xorg --disable-xnest --disable-xvfb --disable-dmx
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS += --disable-xwin --disable-xephyr --disable-kdrive
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Disable building Xorg hardware device support that Xvnc can't use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS += --without-int10 --disable-config-hal --disable-dga
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The X server unit tests currently depend on the Xorg ddx being built
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Include -lc as workaround for bug 17815318 so libm can actually go away
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater# if -xlibmil manages to inline all math functions.
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater -I$(PWD)/$(SOURCE_DIR)/unix/xserver/miext/damage \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater# Needed by unix/xorg-x11-server-source/hw/vnc/Makefile.am to find libpixman
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# headers in proto area after solaris-port.patch is applied
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Run configure script for Xvnc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(AUTORECONF_ENV) autoreconf --install --force && \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(CONFIG_ENV) $(CONFIG_SHELL) ./configure $(XVNC_CONFIG_OPTS) )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(PERL) -i -p -e 's{/usr/bin/env perl}{$(PERL)}' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(DEFAULT_BUILD_COMMAND:@DIR@=$(XORG_BUILD_DIR))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(DEFAULT_INSTALL_COMMAND:@DIR@=$(XORG_BUILD_DIR)/hw/vnc) install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein rm -f $(PROTODIR)/$(X11_SERVERMODS_DIR)/extensions/libvnc.so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(INSTALL_SCRIPT) -m 0755 $(SOURCE_DIR)/unix/vncserver \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncserver.man \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(SOURCE_DIR)/unix/x0vncserver/x0vncserver.man \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(PROTODIR)$(SMF_MANIFEST_DIR)/application/x11/
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews# Java VNCviewer applet for connecting from a web browser
ceeb18e6907a10547859faa340ecad83bedae90cMark AndrewsJAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
ceeb18e6907a10547859faa340ecad83bedae90cMark AndrewsJAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(DEFAULT_BUILD_COMMAND:@DIR@=$(JAVA_SOURCE_DIR)/../decoder)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(DEFAULT_BUILD_COMMAND:@DIR@=$(JAVA_SOURCE_DIR))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(DEFAULT_INSTALL_COMMAND:@DIR@=$(JAVA_SOURCE_DIR)) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(INSTALL_SCRIPT) -m 0444 $(JAVA_SOURCE_DIR)/README \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Metadata for vncviewer package
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVNCVIEWER_PKG_METADATA_DIR = $(PROTOMETA)/desktop-remote-desktop-tigervnc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVNCVIEWER_PKG_ATTRDATA_FILE = $(VNCVIEWER_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVNCVIEWER_PKG_LICENSE_FILE = $(VNCVIEWER_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)