Makefile revision 844
235N/A###############################################################################
235N/A#
822N/A# TigerVNC (Xvnc server & vncviewer) Makefile
822N/A# Based on Fedora's tigervnc.spec revision 1.20 from
822N/A# http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
235N/A#
606N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
810N/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#
822N/A# ident "@(#)Makefile 1.21 09/11/06 SMI"
235N/A#
235N/A
235N/A# Package name used in tarballs
822N/AMODULE_NAME=tigervnc
235N/A
235N/A# Version number (used in path names)
822N/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)
822N/AXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xserver
235N/A
235N/A# Download site for source
822N/ASOURCE_URL=$(SF_DOWNLOADS_URL)/project/tigervnc/tigervnc/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
235N/ASOURCE_URL_SET=yes
235N/ASOURCE_UNCOMPRESS=gzcat
235N/A
235N/A# Patches to apply to source after unpacking, in order
235N/ASOURCE_PATCHES = \
822N/A tigervnc-xserver16.patch \
822N/A vnc-config-subdirs.patch,-p1 \
822N/A vnc-samemachine-ipv6.patch,-p1 \
235N/A c++public.patch \
822N/A vnc-nobuildtime.patch \
822N/A vnc-nohttpd.patch \
822N/A vncviewer-connect.patch,-p1 \
822N/A vncserver-urandom.patch \
235N/A solaris-port.patch
235N/A
235N/A# Man pages to apply Sun footer to & attributes to list
247N/A# Common ones are here - source_gen target below has more with
247N/A# different attributes/path set
247N/ASUNTOUCHED_MANPAGES= \
235N/A unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
247N/A unix/vncserver.man unix/x0vncserver/x0vncserver.man
247N/ASUNTOUCH_MAN_FLAGS= -p /usr/bin/ \
235N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}'
235N/A
241N/A# Compiler to use
493N/AMODULE_COMPILER=suncc
493N/AMODULE_COMPILER_SET=yes
235N/A
493N/A# Xvnc has to configure, build, and install in different directories due to
493N/A# the mixed codebases and unusual directory layout
822N/AMODULE_ADD_SOURCE_TARGETS=Xvnc_source_init Xvnc_source_fini
822N/AMODULE_SOURCE_DEPS=Xvnc_source_init
493N/ACONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
493N/ACONFIGURE_TARGETS_SET=yes
822N/ABUILD_TARGETS_common=Xvnc_build set-elf-comments
822N/ABUILD_TARGETS_32=java_build
822N/ABUILD_TARGETS=$(BUILD_TARGETS_common) $(BUILD_TARGETS_$(BUILD_TYPE))
493N/ABUILD_TARGETS_SET=yes
822N/AINSTALL_TARGETS_common=Xvnc_install_module
822N/AINSTALL_TARGETS_32=Xvnc_install_programs java_install
822N/AINSTALL_TARGETS=$(INSTALL_TARGETS_common) $(INSTALL_TARGETS_$(BUILD_TYPE))
493N/AINSTALL_TARGETS_SET=yes
235N/A
822N/Ainclude ../Makefile.inc
235N/A
235N/A# Merge in additional sources from Xorg tarball & sun-src directory
822N/A# This step has to be done before default_source, so that patches applied
822N/A# in that step work correctly.
822N/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
822N/A# Apply specific sets of Solaris attributes to various man pages
822N/A# This step has to be done after default_source, since it depends
822N/A# on files created in that stage
822N/AXvnc_source_fini: default_source
247N/A (cd $(SOURCE_DIR) && \
247N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
247N/A -a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
247N/A -p /usr/bin/ unix/vncviewer/vncviewer.man )
247N/A (cd $(SOURCE_DIR) && \
247N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
247N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
822N/A -p $(X11_DIR)/bin/ unix/xserver/hw/vnc/Xvnc.man )
235N/A
493N/A# Command line options to GNU autoconf configure script for vnc clients
493N/AVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
493N/A --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
822N/A --localstatedir=/var --with-system-jpeg
235N/A
493N/A# Command line options to GNU autoconf configure script for Xvnc
493N/AXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
822N/A --disable-builddocs --without-int10 \
606N/A --disable-dga --disable-xfree86-utils --disable-config-hal \
822N/A --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
822N/A --disable-xwin --disable-xephyr --disable-kdrive
822N/A
235N/A
493N/AMODULE_CPPFLAGS = \
822N/A -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ \
241N/A -D__extension__=\"\" \
235N/A -I$(PWD)/$(SOURCE_DIR)/common \
493N/A -I$(PWD)/$(SOURCE_DIR)/unix/vncconfig
235N/A
493N/ACFLAGS_gcc += -fPIC
235N/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)
235N/A
454N/ALDPATH_ADDITIONS_sparc = \
454N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
454N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
454N/ALDPATH_ADDITIONS_i386 = \
454N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
235N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
454N/ALDPATH_ADDITIONS=$(LDPATH_ADDITIONS_$(MACH))
454N/A
493N/AMODULE_LDFLAGS = $(LDPATH_ADDITIONS)
235N/A
606N/A# Needed by unix/xorg-x11-server-source/hw/vnc/Makefile.am to find libpixman
606N/A# headers in proto area after solaris-port.patch is applied
606N/AMODULE_MAKEFLAGS = PROTODIR=$(PROTODIR)
606N/A
235N/A# Run configure scripts for vnc sources
235N/A$(SOURCE_DIR)/unix/Makefile: $(UNPACK_TARGET)
599N/A (cd $(SOURCE_DIR)/common && \
599N/A $(AUTORECONF_ENV) autoreconf --install --force && \
493N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
599N/A (cd $(SOURCE_DIR)/unix && \
599N/A $(AUTORECONF_ENV) autoreconf --install --force && \
493N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
235N/A
822N/A
235N/A# Run configure script for Xvnc
822N/A$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET)
235N/A (cd $(XORG_BUILD_DIR) && \
599N/A $(AUTORECONF_ENV) autoreconf --install --force && \
599N/A $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
235N/A
822N/AXvnc_build: $(CONFIGURE_TARGETS)
606N/A (cd $(SOURCE_DIR)/unix ; \
606N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
606N/A (cd $(XORG_BUILD_DIR) ; \
606N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
235N/A
822N/AXvnc_install_module: $(BUILD_TARGETS)
235N/A (cd $(XORG_BUILD_DIR)/hw/vnc \
606N/A && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
606N/A CPPROG="cp -p" install)
822N/A
822N/AXvnc_install_programs: $(BUILD_TARGETS)
247N/A mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
235N/A $(PROTODIR)/usr/share/man/man1 \
235N/A $(PROTODIR)/var/svc/manifest/application/x11
235N/A cp -pf $(SOURCE_DIR)/unix/vncserver \
235N/A $(SOURCE_DIR)/unix/vncpasswd/vncpasswd \
235N/A $(SOURCE_DIR)/unix/vncconfig/vncconfig \
247N/A $(SOURCE_DIR)/unix/vncviewer/vncviewer \
822N/A $(SOURCE_DIR)/unix/x0vncserver/x0vncserver \
247N/A $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR)
235N/A cp -pf $(SOURCE_DIR)/unix/vncserver.man \
235N/A $(PROTODIR)/usr/share/man/man1/vncserver.1
235N/A cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
235N/A $(PROTODIR)/usr/share/man/man1/vncconfig.1
235N/A cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
235N/A $(PROTODIR)/usr/share/man/man1/vncpasswd.1
247N/A cp -pf $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
247N/A $(PROTODIR)/usr/share/man/man1/vncviewer.1
822N/A cp -pf $(SOURCE_DIR)/unix/x0vncserver/x0vncserver.man \
822N/A $(PROTODIR)/usr/share/man/man1/x0vncserver.1
235N/A cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/
822N/A
822N/A# Java VNCviewer applet for connecting from a web browser
822N/AJAVA_SOURCE_DIR = $(SOURCE_DIR)/java/src
822N/AJAVA_INSTALL_DIR = $(PROTODIR)/usr/share/vnc/classes
822N/AJAVA_JAR_FILE = $(JAVA_SOURCE_DIR)/VncViewer.jar
822N/A
822N/A# Temporary special handling of Java build fix submitted upstream
822N/AJAVA_MAKEFILE = $(JAVA_SOURCE_DIR)/Makefile
822N/ABUILD_TARGETS += $(JAVA_MAKEFILE)
822N/A
822N/A$(JAVA_MAKEFILE): $(UNPACK_TARGETS)
822N/A cp $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/Makefile $@
822N/A gpatch -d $(SOURCE_DIR) -p0 < applet-build.patch
822N/A gpatch -d $(SOURCE_DIR) -p0 < icon.patch
822N/A cp tigervnc_16.gif $(JAVA_SOURCE_DIR)
822N/A
822N/Ajava_build: $(JAVA_JAR_FILE)
822N/A
822N/A$(JAVA_JAR_FILE): $(UNPACK_TARGETS) $(JAVA_MAKEFILE)
822N/A (cd $(JAVA_SOURCE_DIR) ; \
822N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
822N/A
822N/Ajava_install: $(JAVA_JAR_FILE)
822N/A -rm -rf $(JAVA_INSTALL_DIR)
822N/A mkdir -p $(JAVA_INSTALL_DIR)
822N/A (cd $(JAVA_SOURCE_DIR) ; \
822N/A $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS) \
822N/A install INSTALL_DIR=$(JAVA_INSTALL_DIR))
822N/A cp -pf $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/README \
822N/A $(JAVA_SOURCE_DIR)/com/tigervnc/vncviewer/LICENCE.TXT \
822N/A $(JAVA_INSTALL_DIR)