Makefile revision 599
235N/A###############################################################################
235N/A#
235N/A# Xvnc server Makefile
590N/A# Based on Fedora's vnc.spec from
590N/A# http://cvs.fedoraproject.org/viewcvs/rpms/vnc/
235N/A#
493N/A# Copyright 2008 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#
599N/A# @(#)Makefile 1.16 08/12/19
235N/A#
235N/A
235N/A# Package name used in tarballs
235N/AMODULE_NAME=vnc
235N/A
235N/A# Version number (used in path names)
590N/AMODULE_VERSION=4_1_3-unixsrc
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/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)
590N/ASOURCE_URL=http://dlc.sun.com/osol/x/downloads/mirrors/$(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 = \
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-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 \
480N/A vnc-ipv6.patch,-p1 \
235N/A c++public.patch \
235N/A build-without-Xorg.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
493N/ACONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
493N/ACONFIGURE_TARGETS_SET=yes
591N/ABUILD_TARGETS=Xvnc_build set-elf-comments
493N/ABUILD_TARGETS_SET=yes
493N/AINSTALL_TARGETS=Xvnc_install
493N/AINSTALL_TARGETS_SET=yes
235N/A
493N/A# Default rule to make, so that the source_gen rule below doesn't become
493N/A# default by virtue of being first
493N/AXvnc_default: 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)
527N/A (mkdir -p $(XORG_BUILD_DIR)/GL/mesa/vbo)
527N/A (cp ../xorg/sun-src/mesa/Makefile.am $(XORG_BUILD_DIR)/GL/mesa/vbo)
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
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' \
493N/A --localstatedir=/var
235N/A
493N/A# Command line options to GNU autoconf configure script for Xvnc
493N/AXVNC_CONFIG_OPTS = $(DEFAULT_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
493N/AMODULE_CPPFLAGS = \
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/mesa/$(ARCHLIBSUBDIR) \
235N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
454N/ALDPATH_ADDITIONS=$(LDPATH_ADDITIONS_$(MACH))
454N/A
493N/AMODULE_LDFLAGS = $(LDPATH_ADDITIONS)
235N/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
235N/A# Run configure script for Xvnc
493N/A# Need to run delibtoolize to fix libtool interference with our linker
493N/A# flags, but need to make sure we use large pic flags (-KPIC/-fPIC)
493N/A$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/unix/Makefile
235N/A (cd $(XORG_BUILD_DIR) && \
599N/A $(AUTORECONF_ENV) autoreconf --install --force && \
599N/A $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
520N/A $(TOP)/common/delibtoolize.pl -P -s $(SOURCE_DIR)
235N/A
493N/AXvnc_build: $(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
493N/A (cd $(SOURCE_DIR)/common ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
493N/A (cd $(SOURCE_DIR)/unix ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
493N/A (cd $(XORG_BUILD_DIR) ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
235N/A
493N/AXvnc_install::
235N/A (cd $(XORG_BUILD_DIR)/hw/vnc \
493N/A && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) -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/