Makefile revision 355
235N/A###############################################################################
235N/A#
235N/A# Xvnc server Makefile
235N/A# Based on Fedora's vnc-4.1.2-21.fc8/vnc.spec
235N/A#
235N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
235N/A# Use 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#
355N/A# @(#)Makefile 1.7 08/03/07
235N/A#
235N/A
235N/A# Package name used in tarballs
235N/AMODULE_NAME=vnc
235N/A
235N/A# Name used in server-specific rules in ../Makefile.inc
235N/AXSERVER=XVNC
235N/A
235N/A# Version number (used in path names)
235N/AVNC_VERS=4.1.2
235N/AVNC_TARBALL_VERS=4_1_2-unixsrc
235N/A
235N/A# Source tarball
235N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(VNC_TARBALL_VERS).tar.gz
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/xorg-x11-server-source
235N/A
235N/A# Download site for source
235N/A# - Master source site doesn't allow wget downloads, so we use a mirror
235N/A#SOURCE_URL=http://www.realvnc.com/dist/$(SOURCE_TARBALL_NAME)
235N/ASOURCE_URL=http://ltsp.mirrors.tds.net/pub/ltsp/tarballs/$(SOURCE_TARBALL_NAME)
235N/ASOURCE_URL_SET=yes
235N/ASOURCE_UNCOMPRESS=gzcat
235N/A
235N/A# Directory created by unpacking source
235N/ASOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(VNC_TARBALL_VERS)
235N/A
235N/A# Patches to apply to source after unpacking, in order
235N/ASOURCE_PATCHES = \
235N/A vnc-use-fb.patch,-p1 \
235N/A vnc-restart.patch,-p1 \
235N/A vnc-modular-xorg.patch,-p1 \
235N/A vnc-nohttpd.patch,-p1 \
235N/A vnc-int10.patch,-p1 \
235N/A vnc-64bit.patch,-p1 \
235N/A vnc-ipv6.patch,-p1 \
235N/A vnc-render.patch,-p1 \
235N/A vnc-autotools.patch,-p1 \
235N/A vnc-autotools-compile.patch,-p1 \
235N/A vnc-always_use_fb.patch,-p1 \
235N/A vnc-24bit.patch,-p1 \
235N/A c++public.patch \
235N/A build-without-Xorg.patch \
235N/A solaris-port.patch
235N/A
261N/A# Patches shared between Xorg & Xvnc builds
261N/AXORG_SOURCE_PATCHES:sh=cat -s ../xorg/patch-list ../xorg/closed-src/patch-list | sed '/^\#/ d'
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
241N/ACOMPILER=cc
235N/A
235N/A# Binary built in tree
235N/AXVNCSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
235N/A
235N/ABUILD_TARGETS=$(XVNCSERVER_BIN)
235N/A
355N/A# License file
355N/ALICENSE_FILE=LICENCE.txt
355N/ALICENSE_FILE_SET=yes
355N/A
235N/Adefault: all
235N/A
235N/A# Merge in additional sources from Xorg tarball & sun-src directory
235N/A# Use layout from Fedora RPM so their patches apply
235N/A# This step has to be done before including common/Makefile.inc so
235N/A# that patches applied in that step work correctly.
235N/Asource_gen:: $(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
235N/Ainclude ../Makefile.inc
235N/A
235N/A# Merge in additional sources from Xorg tarball & sun-src directory
235N/A# Use layout from Fedora RPM so their patches apply
235N/A# This step has to be done after including common/Makefile.inc since
235N/A# it depends on files created in that stage
235N/Asource_gen::
235N/A (cd $(SOURCE_DIR) ; \
235N/A cp -p unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc \
235N/A unix/xc/programs/Xserver/Xvnc.man \
235N/A unix/xc/programs/Xserver/vnc/*.h \
235N/A unix/xc/programs/Xserver/vnc/*.cc \
235N/A unix/xorg-x11-server-source/hw/vnc/ ; \
235N/A cp -p unix/xorg-x11-server-source/cfb/cfb.h \
235N/A unix/xorg-x11-server-source/fb/fb.h \
235N/A unix/xorg-x11-server-source/fb/fbrop.h \
235N/A unix/xorg-x11-server-source/hw/vnc/ ; \
235N/A perl -i -p -e 's,\b(xor|and)\b,c_$$1,g' \
235N/A unix/xorg-x11-server-source/hw/vnc/cfb.h \
235N/A unix/xorg-x11-server-source/hw/vnc/fb.h \
235N/A unix/xorg-x11-server-source/hw/vnc/fbrop.h )
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}' \
247N/A -p /usr/X11/bin/ unix/xc/programs/Xserver/Xvnc.man )
235N/A
235N/A# Command line options to GNU autoconf configure script for vnc
235N/AVNC_CONFIG_OPTS= --with-installed-zlib --prefix=$(XVNCSERVER_PREFIX) \
235N/A --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc'
235N/A
235N/A# Command line options to GNU autoconf configure script for Xorg
235N/AXVNC_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
235N/A --disable-builddocs --with-int10=stub \
235N/A --disable-dga --disable-xfree86-utils --disable-dri \
235N/A --disable-xorg --disable-dmx --disable-xvfb --disable-xnest \
235N/A --disable-xprint --disable-kdrive
235N/A
235N/AXVNC_CPPFLAGS = \
241N/A -D__extension__=\"\" \
235N/A -I$(PWD)/$(SOURCE_DIR)/common \
235N/A -I$(PWD)/$(SOURCE_DIR)/unix/vncconfig \
235N/A $(XSERVER_CPPFLAGS)
235N/A
235N/A# Uncomment to build debug
235N/A# OPT_CFLAGS = -g
235N/A# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
235N/A
235N/ADEFAULT_GCC_CFLAGS += -fPIC
235N/A
235N/A# Environment variable options to GNU autoconf configure script
235N/AXVNC_CONFIG_ENV = LIBS="-lsocket -lnsl"
235N/ACONFIG_ENV += $(XVNC_CONFIG_ENV)
235N/A
235N/ALDPATH_ADD += -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
235N/A -R$(X11_SERVERMODS_DIR)/extensions/mesa/$(ARCHLIBSUBDIR) \
235N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
235N/A
235N/A# Run configure scripts for vnc sources
235N/A$(SOURCE_DIR)/unix/Makefile: $(UNPACK_TARGET)
235N/A (cd $(SOURCE_DIR)/common && autoreconf --install --force && \
235N/A $(CONFIG_ENV) ./configure $(VNC_CONFIG_OPTS) )
235N/A (cd $(SOURCE_DIR)/unix && autoreconf --install --force && \
235N/A $(CONFIG_ENV) ./configure $(VNC_CONFIG_OPTS) )
235N/A
235N/A# Run configure script for Xvnc
235N/A$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET)
235N/A (cd $(XORG_BUILD_DIR) && \
235N/A ACLOCAL="$(ACLOCAL_PATH)" autoreconf --install --force && \
235N/A $(CONFIG_ENV) ./configure $(XVNC_CONFIG_OPTS) )
241N/A $(TOP)/common/delibtoolize.pl -P $(SOURCE_DIR)
235N/A
235N/A$(XVNCSERVER_BIN): $(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
235N/A (cd $(SOURCE_DIR)/common ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
235N/A (cd $(SOURCE_DIR)/unix ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
235N/A (cd $(XORG_BUILD_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
235N/A
355N/Ainstall_gen:: $(XVNCSERVER_BIN)
235N/A (cd $(XORG_BUILD_DIR)/hw/vnc \
235N/A && $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
235N/A DESTDIR=$(PROTODIR) CPPROG="cp -p" )
247N/A mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
235N/A $(PROTODIR)/usr/share/man/man1 \
235N/A $(PROTODIR)$(X11_MAN_DIR)/man/man1 \
235N/A $(PROTODIR)/usr/share/vnc \
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 \
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
235N/A cp -pf $(SOURCE_DIR)/common/javabin/index.vnc \
235N/A $(PROTODIR)/usr/share/vnc
235N/A cp -pf $(XORG_BUILD_DIR)/hw/vnc/Xvnc.man \
235N/A $(PROTODIR)$(X11_MAN_DIR)/man1/Xvnc.1
235N/A cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/