Makefile revision 875
235N/A###############################################################################
235N/A#
235N/A# TigerVNC (Xvnc server & vncviewer) Makefile
590N/A# Based on Fedora's tigervnc.spec revision 1.20 from
590N/A# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
235N/A#
493N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
235N/A# Use is subject to license terms.
235N/A#
235N/A# Permission is hereby granted, free of charge, to any person obtaining a
235N/A# copy of this software and associated documentation files (the
235N/A# "Software"), to deal in the Software without restriction, including
235N/A# without limitation the rights to use, copy, modify, merge, publish,
235N/A# distribute, and/or sell copies of the Software, and to permit persons
235N/A# to whom the Software is furnished to do so, provided that the above
235N/A# copyright notice(s) and this permission notice appear in all copies of
235N/A# the Software and that both the above copyright notice(s) and this
235N/A# permission notice appear in supporting documentation.
235N/A#
235N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
235N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
235N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
235N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
235N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
235N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
235N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
235N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
235N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
235N/A#
235N/A# Except as contained in this notice, the name of a copyright holder
235N/A# shall not be used in advertising or otherwise to promote the sale, use
235N/A# or other dealings in this Software without prior written authorization
235N/A# of the copyright holder.
235N/A#
590N/A# ident "@(#)Makefile 1.23 09/12/17 SMI"
235N/A#
235N/A
235N/A# Package name used in tarballs
235N/AMODULE_NAME=tigervnc
235N/A
235N/A# Version number (used in path names)
590N/AMODULE_VERSION=1.0.0
235N/A
235N/A# Source tarball
493N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
493N/ASOURCE_TARBALL_NAME_SET=yes
235N/A
235N/A# Xorg server source tarball to use sources from
235N/AXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
235N/AXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
235N/AXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xserver
235N/A
235N/A# Download site for source
235N/ASOURCE_URL=$(SF_DOWNLOADS_URL)/project/tigervnc/tigervnc/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
235N/ASOURCE_URL_SET=yes
590N/ASOURCE_UNCOMPRESS=gzcat
235N/A
235N/A# Patches to apply to source after unpacking, in order
235N/ASOURCE_PATCHES = \
235N/A upstream-xorg-version.patch,-p1 \
235N/A upstream-input-refactor.patch,-p1 \
235N/A tigervnc-port-to-1.7.patch \
235N/A tigervnc-xserver17.patch \
235N/A vnc-samemachine-ipv6.patch,-p1 \
235N/A c++public.patch,-p1 \
235N/A vncserver-urandom.patch,-p1 \
235N/A vnc-nobuildtime.patch \
235N/A vnc-nohttpd.patch \
235N/A vncviewer-connect.patch,-p1 \
235N/A upstream-modkeystick.patch,-p0 \
235N/A solaris-port.patch
235N/A
480N/A# Man pages to apply Sun footer to & attributes to list
235N/A# Common ones are here - source_gen target below has more with
235N/A# different attributes/path set
235N/ASUNTOUCHED_MANPAGES= \
235N/A unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
235N/A unix/vncserver.man unix/x0vncserver/x0vncserver.man
247N/ASUNTOUCH_MAN_FLAGS= -p /usr/bin/ \
247N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}'
247N/A
235N/A# Compiler to use
247N/AMODULE_COMPILER=suncc
247N/AMODULE_COMPILER_SET=yes
235N/A
235N/A# Xvnc has to configure, build, and install in different directories due to
241N/A# the mixed codebases and unusual directory layout
493N/AMODULE_ADD_SOURCE_TARGETS=Xvnc_source_init Xvnc_source_fini
493N/AMODULE_SOURCE_DEPS=Xvnc_source_init
235N/ACONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
493N/ACONFIGURE_TARGETS_SET=yes
493N/ABUILD_TARGETS_common=Xvnc_build set-elf-comments
493N/ABUILD_TARGETS_32=java_build
493N/ABUILD_TARGETS=$(BUILD_TARGETS_common) $(BUILD_TARGETS_$(BUILD_TYPE))
493N/ABUILD_TARGETS_SET=yes
493N/AINSTALL_TARGETS_common=Xvnc_install_module
493N/AINSTALL_TARGETS_32=Xvnc_install_programs java_install
493N/AINSTALL_TARGETS=$(INSTALL_TARGETS_common) $(INSTALL_TARGETS_$(BUILD_TYPE))
235N/AINSTALL_TARGETS_SET=yes
493N/A
493N/Ainclude ../Makefile.inc
493N/A
235N/A# Merge in additional sources from Xorg tarball & sun-src directory
235N/A# This step has to be done before default_source, so that patches applied
235N/A# in that step work correctly.
235N/AXvnc_source_init: $(LNDIR)
235N/A mkdir -p $(SOURCE_DIR)/unix
235N/A bzcat $(XORG_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )
235N/A @if [ "x$(XORG_SOURCE_PATCHES)" != "x" ] ; then \
235N/A for p in $(XORG_SOURCE_PATCHES) x ; do \
235N/A if [ "$$p" != "x" ] ; then \
235N/A PATCH_CMD=`echo $$p | awk -F, '{if (NF > 1) FLAGS = $$2; else FLAGS="-p0" ; printf "gpatch -d $(XORG_SOURCE_DIR) %s < ../xorg/%s\n", FLAGS, $$1}'` ; \
235N/A echo "$${PATCH_CMD}" ; \
235N/A eval $${PATCH_CMD} ; \
235N/A fi ; \
235N/A done ; \
235N/A fi
235N/A mv $(XORG_SOURCE_DIR) $(XORG_BUILD_DIR)
235N/A (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
235N/A
235N/A# Apply specific sets of Solaris attributes to various man pages
527N/A# This step has to be done after default_source, since it depends
527N/A# on files created in that stage
235N/AXvnc_source_fini: default_source
235N/A (cd $(SOURCE_DIR) && \
235N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
235N/A -a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
235N/A -p /usr/bin/ unix/vncviewer/vncviewer.man )
235N/A (cd $(SOURCE_DIR) && \
235N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
235N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
235N/A -p $(X11_DIR)/bin/ unix/xserver/hw/vnc/Xvnc.man )
235N/A
235N/A# Command line options to GNU autoconf configure script for vnc clients
235N/AVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
235N/A --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
235N/A --localstatedir=/var --with-system-jpeg --without-simd
235N/A
235N/A# Command line options to GNU autoconf configure script for Xvnc
235N/AXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
235N/A --disable-builddocs --without-int10 \
235N/A --disable-dga --disable-xfree86-utils --disable-config-hal \
235N/A --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
235N/A --disable-xwin --disable-xephyr --disable-kdrive
235N/A
235N/A
247N/AMODULE_CPPFLAGS = \
247N/A -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ \
247N/A -D__extension__=\"\" \
247N/A -I$(PWD)/$(SOURCE_DIR)/common \
247N/A -I$(PWD)/$(SOURCE_DIR)/unix/vncconfig
247N/A
247N/ACFLAGS_gcc += -fPIC
247N/A
235N/A# Environment variable options to GNU autoconf configure script
493N/AXVNC_CONFIG_ENV = LIBS="-lsocket -lnsl" \
493N/A LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
493N/ACONFIG_ENV += $(XVNC_CONFIG_ENV)
493N/A
235N/ALDPATH_ADDITIONS_sparc = \
493N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
493N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
235N/ALDPATH_ADDITIONS_i386 = \
235N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
235N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
235N/ALDPATH_ADDITIONS=$(LDPATH_ADDITIONS_$(MACH))
235N/A
493N/AMODULE_LDFLAGS = $(LDPATH_ADDITIONS)
241N/A
235N/A# Needed by unix/xorg-x11-server-source/hw/vnc/Makefile.am to find libpixman
493N/A# headers in proto area after solaris-port.patch is applied
235N/AMODULE_MAKEFLAGS = PROTODIR=$(PROTODIR)
493N/A
235N/A# Run configure scripts for vnc sources
235N/A$(SOURCE_DIR)/unix/Makefile: $(UNPACK_TARGET)
493N/A (cd $(SOURCE_DIR)/common && \
493N/A $(AUTORECONF_ENV) autoreconf --install --force && \
493N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
235N/A (cd $(SOURCE_DIR)/unix && \
454N/A $(AUTORECONF_ENV) autoreconf --install --force && \
454N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
454N/A
454N/A
454N/A# Run configure script for Xvnc
235N/A$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET)
235N/A (cd $(XORG_BUILD_DIR) && \
454N/A $(AUTORECONF_ENV) autoreconf --install --force && \
454N/A $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
493N/A
235N/AXvnc_build: $(CONFIGURE_TARGETS)
235N/A (cd $(SOURCE_DIR)/unix ; \
235N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
235N/A (cd $(XORG_BUILD_DIR) ; \
493N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
235N/A
493N/AXvnc_install_module: $(BUILD_TARGETS)
235N/A (cd $(XORG_BUILD_DIR)/hw/vnc \
235N/A && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
493N/A CPPROG="cp -p" install)
493N/A
493N/AXvnc_install_programs: $(BUILD_TARGETS)
235N/A mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
235N/A $(PROTODIR)/usr/share/man/man1 \
493N/A $(PROTODIR)/var/svc/manifest/application/x11
520N/A cp -pf $(SOURCE_DIR)/unix/vncserver \
235N/A $(SOURCE_DIR)/unix/vncpasswd/vncpasswd \
493N/A $(SOURCE_DIR)/unix/vncconfig/vncconfig \
493N/A $(SOURCE_DIR)/unix/vncviewer/vncviewer \
493N/A $(SOURCE_DIR)/unix/x0vncserver/x0vncserver \
493N/A $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR)
235N/A cp -pf $(SOURCE_DIR)/unix/vncserver.man \
493N/A $(PROTODIR)/usr/share/man/man1/vncserver.1
235N/A cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
493N/A $(PROTODIR)/usr/share/man/man1/vncconfig.1
235N/A cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
247N/A $(PROTODIR)/usr/share/man/man1/vncpasswd.1
235N/A cp -pf $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
235N/A $(PROTODIR)/usr/share/man/man1/vncviewer.1
235N/A cp -pf $(SOURCE_DIR)/unix/x0vncserver/x0vncserver.man \
235N/A $(PROTODIR)/usr/share/man/man1/x0vncserver.1
235N/A cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/
235N/A
235N/A# Java VNCviewer applet for connecting from a web browser
247N/AJAVA_SOURCE_DIR = $(SOURCE_DIR)/java/src
247N/AJAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
235N/AJAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
235N/A
235N/A# Temporary special handling of Java build fix submitted upstream
235N/AJAVA_MAKEFILE = $(JAVA_SOURCE_DIR)/Makefile
235N/ABUILD_TARGETS += $(JAVA_MAKEFILE)
235N/A
247N/A$(JAVA_MAKEFILE): $(UNPACK_TARGETS)
247N/A cp $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/Makefile $@
235N/A gpatch -d $(SOURCE_DIR) -p0 < applet-build.patch
235N/A gpatch -d $(SOURCE_DIR) -p0 < icon.patch
235N/A cp tigervnc_16.gif $(JAVA_SOURCE_DIR)
235N/A
235N/Ajava_build: $(JAVA_JAR_FILE)
$(JAVA_JAR_FILE): $(UNPACK_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)