Makefile revision 970
0N/A###############################################################################
0N/A#
3516N/A# TigerVNC (Xvnc server & vncviewer) Makefile
3516N/A# Based on Fedora's tigervnc.spec revision 1.20 from
3516N/A# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
3516N/A#
3516N/A# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
3516N/A#
3516N/A# Permission is hereby granted, free of charge, to any person obtaining a
3516N/A# copy of this software and associated documentation files (the "Software"),
0N/A# to deal in the Software without restriction, including without limitation
3516N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
0N/A# and/or sell copies of the Software, and to permit persons to whom the
3516N/A# Software is furnished to do so, subject to the following conditions:
3516N/A#
0N/A# The above copyright notice and this permission notice (including the next
4986N/A# paragraph) shall be included in all copies or substantial portions of the
0N/A# Software.
4986N/A#
4986N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4986N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
0N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3516N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3516N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
3516N/A# DEALINGS IN THE SOFTWARE.
3516N/A#
3516N/A#
3516N/A
0N/A# Package name used in tarballs
3516N/AMODULE_NAME=tigervnc
4986N/A
4986N/A# Package metadata
4986N/AUPSTREAM = TigerVNC
4986N/AUPSTREAM_URL = http://www.tigervnc.com/
3516N/AUPSTREAM_SET = yes
3516N/A
4986N/AMODULE_LICENSE = GPLv2
4986N/AMODULE_LICENSE_SET = yes
3516N/A
4986N/A# Version number (used in path names)
0N/AMODULE_VERSION=1.0.0
0N/A
4986N/A# Checksums for upstream tarball
4986N/ATARBALL_MD5 = 622c6689a66651419b5431efdee99d5a
4986N/ATARBALL_SHA1 = 2435ea2e3c34a4055350f7680a94cea580b92979
4986N/A
0N/A# Source tarball
4986N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
4986N/ASOURCE_TARBALL_NAME_SET=yes
4986N/A
4986N/A# Xorg server source tarball to use sources from
4986N/AXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
4986N/AXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
4986N/AXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xserver
4986N/A
4986N/A# Download site for source
4986N/ASOURCE_URL=$(SF_DOWNLOADS_URL)/project/tigervnc/tigervnc/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
4986N/ASOURCE_URL_SET=yes
4986N/ASOURCE_UNCOMPRESS=gzcat
4986N/A
4986N/A# Patches to apply to source after unpacking, in order
0N/ASOURCE_PATCHES = \
0N/A upstream-xorg-version.patch,-p1 \
4986N/A upstream-input-refactor.patch,-p1 \
4986N/A tigervnc-port-to-1.7.patch \
4986N/A tigervnc-xserver17.patch \
0N/A vnc-samemachine-ipv6.patch,-p1 \
3516N/A c++public.patch,-p1 \
3516N/A vncserver-urandom.patch,-p1 \
0N/A vnc-nobuildtime.patch \
0N/A vnc-nohttpd.patch \
5056N/A vncviewer-connect.patch,-p1 \
0N/A upstream-modkeystick.patch,-p0 \
0N/A solaris-port.patch \
0N/A capslock.patch
0N/A
0N/A# ARC cases that covered this module
0N/A# PSARC/2007/545 Xvnc
0N/AMODULE_ARC_CASES = PSARC/2007/545
0N/A# LSARC/2007/625 vncviewer
0N/AMODULE_ARC_CASES += LSARC/2007/625
0N/A# PSARC/2009/592 TigerVNC 1.0
0N/AMODULE_ARC_CASES += PSARC/2009/592
0N/A
0N/A# Man pages to apply Sun footer to & attributes to list
0N/ASUNTOUCHED_MANPAGES= \
0N/A unix/xserver/hw/vnc/Xvnc.man unix/vncviewer/vncviewer.man \
0N/A unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
0N/A unix/vncserver.man unix/x0vncserver/x0vncserver.man
0N/AMODULE_STABILITY = Volatile
0N/A
0N/A# Additional pkg(5) package name used for vncviewer package
0N/AVNCVIEWER_PKGNAME=desktop/remote-desktop/$(MODULE_NAME)
0N/A
0N/A# Override specific attributes for specific man pages
0N/AMODULE_SUNTOUCH_MAN_FLAGS= \
0N/A $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
0N/ASUNTOUCH_MAN_FLAGS_vncviewer = -o '{Availability, $(VNCVIEWER_PKGNAME)}' \
0N/A -o '{Interface Stability, Path: Committed, Options: Volatile}'
0N/A
0N/A# Compiler to use
0N/AMODULE_COMPILER=suncc
0N/AMODULE_COMPILER_SET=yes
0N/A
0N/A# Xvnc has to configure, build, and install in different directories due to
0N/A# the mixed codebases and unusual directory layout
0N/A$(NO_RECURSE)MODULE_ADD_SOURCE_TARGETS=Xvnc_source_init
0N/A$(NO_RECURSE)MODULE_SOURCE_DEPS = Xvnc_source_init
0N/ACONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
0N/ACONFIGURE_TARGETS_SET=yes
0N/ABUILD_TARGETS_common=Xvnc_build set-elf-comments
0N/ABUILD_TARGETS_32=java_build
0N/ABUILD_TARGETS=$(BUILD_TARGETS_common) $(BUILD_TARGETS_$(BUILD_TYPE))
0N/ABUILD_TARGETS_SET=yes
0N/AINSTALL_TARGETS_common=Xvnc_install_module
0N/AINSTALL_TARGETS_32=Xvnc_install_programs java_install
0N/AINSTALL_TARGETS=$(INSTALL_TARGETS_common) $(INSTALL_TARGETS_$(BUILD_TYPE))
0N/AINSTALL_TARGETS_SET=yes
0N/A
0N/A# Since we only build 64-bit versions of the Xorg servers on SPARC,
3516N/A# need to build a 32-bit version of the Xserver mdb module to allow
3516N/A# use with Xvnc on SPARC
3516N/ABUILD_TARGETS_sparc = build_mdb
3516N/ABUILD_TARGETS += $(BUILD_TARGETS_$(MACH))
3516N/AINSTALL_TARGETS_sparc = install_mdb
3516N/AINSTALL_TARGETS += $(INSTALL_TARGETS_$(MACH))
3516N/A
3516N/A# Since we only build Xvnc in 32-bit mode, don't need ARCHBINSUBDIR set
3516N/A# like in the Xorg builds
3516N/AMODULE_BUILD_32_FLAGS = ARCHBINSUBDIR=""
3516N/A
3516N/A# Compatibility links from /usr/X11/bin to /usr/bin
3516N/AMODULE_X11_BINCOMPAT_LINKS = Xvnc
3516N/A
3516N/Ainclude ../Makefile.inc
3516N/A
3516N/A# Merge in additional sources from Xorg tarball & sun-src directory
3516N/A# This step has to be done before default_source, so that patches applied
3516N/A# in that step work correctly.
3516N/A$(NO_RECURSE)XORG_SOURCE_INIT_TARGET = $(XORG_BUILD_DIR)/$(SOURCE_INIT_TARGET_FILE)
3516N/A$(NO_RECURSE)XORG_PATCHED_TARGET = $(XORG_BUILD_DIR)/$(PATCHED_TARGET_FILE)
3516N/AXvnc_source_init: $(XORG_PATCHED_TARGET)
3516N/A
3516N/A$(XORG_TARBALL):
3516N/A (cd ../xorg && $(MAKE) $(MAKEFLAGS) download)
3516N/A
3516N/A$(XORG_SOURCE_INIT_TARGET): $(XORG_TARBALL)
3516N/A mkdir -p $(SOURCE_DIR)/unix
3516N/A $(MAKE) $(MAKEFLAGS) init_source \
3516N/A NO_RECURSE="$(POUND_SIGN)" \
3516N/A BUILD_TYPE="$(BUILD_TYPE)" \
3516N/A SOURCE_TARBALL="$(XORG_TARBALL)" \
3516N/A SOURCE_DEPS="$(XORG_TARBALL)" \
3516N/A SOURCE_UNCOMPRESS="bzcat" \
3516N/A SOURCE_DIR="$(XORG_BUILD_DIR)" \
0N/A BUILD_DIR="$(XORG_BUILD_DIR)" \
0N/A ADD_TAR_FLAGS="--strip-components=1"
0N/A (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
3516N/A touch $(XORG_SOURCE_INIT_TARGET)
3516N/A
3516N/A$(XORG_PATCHED_TARGET): $(XORG_SOURCE_INIT_TARGET)
3516N/A $(MAKE) $(MAKEFLAGS) patched_source \
3516N/A NO_RECURSE="$(POUND_SIGN)" \
3516N/A BUILD_TYPE="$(BUILD_TYPE)" \
3516N/A SOURCE_PATCHES="$(XORG_SOURCE_PATCHES:%=../xorg/%)" \
3516N/A SOURCE_DIR="$(XORG_BUILD_DIR)" \
0N/A XORG_BUILD_DIR="$(XORG_BUILD_DIR)"
0N/A touch $(XORG_PATCHED_TARGET)
3516N/A
3516N/A# Command line options to GNU autoconf configure script for vnc clients
3516N/AVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
3516N/A --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
3516N/A --localstatedir=/var --with-system-jpeg --without-simd
3516N/A
3516N/A# Command line options to GNU autoconf configure script for Xvnc
0N/AXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
5056N/A --disable-builddocs --without-int10 \
0N/A --disable-dga --disable-xfree86-utils --disable-config-hal \
0N/A --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
3516N/A --disable-xwin --disable-xephyr --disable-kdrive
3516N/A
MODULE_CPPFLAGS = \
-D_XOPEN_SOURCE=500 -D__EXTENSIONS__ \
-D__extension__=\"\" \
-I$(PWD)/$(SOURCE_DIR)/common \
-I$(PWD)/$(SOURCE_DIR)/unix/vncconfig
CFLAGS_gcc += -fPIC
# 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
VNC_CONFIG_ENV = $(CONFIG_ENV) LIBS="-lsocket -lnsl" \
LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
XVNC_CONFIG_ENV = $(CONFIG_ENV) \
LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(XSERVER_LDFLAGS)"
# 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 scripts for vnc sources
$(SOURCE_DIR)/unix/Makefile: $(SOURCE_TARGETS)
(cd $(SOURCE_DIR)/common && \
$(AUTORECONF_ENV) autoreconf --install --force && \
$(VNC_CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
(cd $(SOURCE_DIR)/unix && \
$(AUTORECONF_ENV) autoreconf --install --force && \
$(VNC_CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
# Run configure script for Xvnc
$(XORG_BUILD_DIR)/Makefile: $(SOURCE_TARGETS)
(cd $(XORG_BUILD_DIR) && \
$(AUTORECONF_ENV) autoreconf --install --force && \
$(XVNC_CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
Xvnc_build: $(CONFIGURE_TARGETS)
(cd $(SOURCE_DIR)/unix ; \
$(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
(cd $(XORG_BUILD_DIR) ; \
$(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
Xvnc_install_module: $(BUILD_TARGETS)
(cd $(XORG_BUILD_DIR)/hw/vnc \
&& $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
CPPROG="cp -p" install)
Xvnc_install_programs: $(BUILD_TARGETS)
mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
$(PROTODIR)/usr/share/man/man1 \
$(PROTODIR)/var/svc/manifest/application/x11
$(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/$(ARCHLIBSUBDIR)
$(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)/var/svc/manifest/application/x11/
# Java VNCviewer applet for connecting from a web browser
JAVA_SOURCE_DIR = $(SOURCE_DIR)/java/src
JAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
JAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
# Temporary special handling of Java build fix submitted upstream
JAVA_MAKEFILE = $(JAVA_SOURCE_DIR)/Makefile
BUILD_TARGETS += $(JAVA_MAKEFILE)
$(JAVA_MAKEFILE): $(SOURCE_TARGETS)
cp $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/Makefile $@
gpatch -d $(SOURCE_DIR) -p0 < applet-build.patch
gpatch -d $(SOURCE_DIR) -p0 < icon.patch
cp tigervnc_16.gif $(JAVA_SOURCE_DIR)
java_build: $(JAVA_JAR_FILE)
$(JAVA_JAR_FILE): $(SOURCE_TARGETS) $(JAVA_MAKEFILE)
(cd $(JAVA_SOURCE_DIR) ; \
$(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
java_install: $(JAVA_JAR_FILE)
-rm -rf $(JAVA_INSTALL_DIR)
mkdir -p $(JAVA_INSTALL_DIR)
(cd $(JAVA_SOURCE_DIR) ; \
$(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) \
install INSTALL_DIR=$(JAVA_INSTALL_DIR))
cp -pf $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/README \
$(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/LICENCE.TXT \
$(JAVA_INSTALL_DIR)
chmod a+x $(JAVA_INSTALL_DIR)/VncViewer.jar
# 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)