Makefile revision 949
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley###############################################################################
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# TigerVNC (Xvnc server & vncviewer) Makefile
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# Based on Fedora's tigervnc.spec revision 1.20 from
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# copy of this software and associated documentation files (the "Software"),
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# to deal in the Software without restriction, including without limitation
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# and/or sell copies of the Software, and to permit persons to whom the
281bfa2a98f1d1721538086e1b550185559f1d8bMark Andrews# Software is furnished to do so, subject to the following conditions:
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# The above copyright notice and this permission notice (including the next
5b02fc32d693bb811199308a40143df0adf818c1Mark Andrews# paragraph) shall be included in all copies or substantial portions of the
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# DEALINGS IN THE SOFTWARE.
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# Package name used in tarballs
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Version number (used in path names)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Checksums for upstream tarball
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyTARBALL_SHA1 = 2435ea2e3c34a4055350f7680a94cea580b92979
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# Source tarball
30c76944175c52f947d268329ff815aadeea6306Mark AndrewsSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Xorg server source tarball to use sources from
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
30c76944175c52f947d268329ff815aadeea6306Mark AndrewsXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Download site for source
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark AndrewsSOURCE_URL=$(SF_DOWNLOADS_URL)/project/tigervnc/tigervnc/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Patches to apply to source after unpacking, in order
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Man pages to apply Sun footer to & attributes to list
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews unix/xserver/hw/vnc/Xvnc.man unix/vncviewer/vncviewer.man \
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews unix/vncserver.man unix/x0vncserver/x0vncserver.man
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Additional package name used for vncviewer package
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Override specific attributes for specific man pages
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan HuntSUNTOUCH_MAN_FLAGS_vncviewer = -o '{Availability, $(VNCVIEWER_PKGNAME)}' \
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews -o '{Interface Stability, Path: Committed, Options: Volatile}'
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Compiler to use
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Xvnc has to configure, build, and install in different directories due to
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# the mixed codebases and unusual directory layout
8b7d3aeda264513ca83961fb752703cc3c85451dMark AndrewsCONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
8b7d3aeda264513ca83961fb752703cc3c85451dMark AndrewsBUILD_TARGETS=$(BUILD_TARGETS_common) $(BUILD_TARGETS_$(BUILD_TYPE))
8b7d3aeda264513ca83961fb752703cc3c85451dMark AndrewsINSTALL_TARGETS_32=Xvnc_install_programs java_install
8b7d3aeda264513ca83961fb752703cc3c85451dMark AndrewsINSTALL_TARGETS=$(INSTALL_TARGETS_common) $(INSTALL_TARGETS_$(BUILD_TYPE))
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Since we only build 64-bit versions of the Xorg servers on SPARC,
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# need to build a 32-bit version of the Xserver mdb module to allow
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# use with Xvnc on SPARC
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# Merge in additional sources from Xorg tarball & sun-src directory
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# This step has to be done before default_source, so that patches applied
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# in that step work correctly.
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsXORG_SOURCE_INIT_TARGET = $(XORG_BUILD_DIR)/$(SOURCE_INIT_TARGET_FILE)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsXORG_PATCHED_TARGET = $(XORG_BUILD_DIR)/$(PATCHED_TARGET_FILE)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews$(XORG_PATCHED_TARGET): $(XORG_SOURCE_INIT_TARGET)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews SOURCE_PATCHES="$(XORG_SOURCE_PATCHES:%=../xorg/%)" \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Command line options to GNU autoconf configure script for vnc clients
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews --localstatedir=/var --with-system-jpeg --without-simd
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Command line options to GNU autoconf configure script for Xvnc
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews --disable-dga --disable-xfree86-utils --disable-config-hal \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews --disable-xwin --disable-xephyr --disable-kdrive
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews# Environment variable options to GNU autoconf configure script
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# Needed by unix/xorg-x11-server-source/hw/vnc/Makefile.am to find libpixman
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# headers in proto area after solaris-port.patch is applied
30c76944175c52f947d268329ff815aadeea6306Mark Andrews# Run configure scripts for vnc sources
8b7d3aeda264513ca83961fb752703cc3c85451dMark Andrews $(AUTORECONF_ENV) autoreconf --install --force && \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(AUTORECONF_ENV) autoreconf --install --force && \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Run configure script for Xvnc
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(AUTORECONF_ENV) autoreconf --install --force && \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
30c76944175c52f947d268329ff815aadeea6306Mark Andrews mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp -pf $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
30c76944175c52f947d268329ff815aadeea6306Mark Andrews cp -pf $(SOURCE_DIR)/unix/x0vncserver/x0vncserver.man \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Java VNCviewer applet for connecting from a web browser
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsJAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark AndrewsJAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews# Temporary special handling of Java build fix submitted upstream
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/Makefile $@
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews gpatch -d $(SOURCE_DIR) -p0 < applet-build.patch
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews$(JAVA_JAR_FILE): $(SOURCE_TARGETS) $(JAVA_MAKEFILE)
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) \
c16aed9c469a986f1b84e457db4a8c4d2da01ca3Mark Andrews cp -pf $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/README \