Makefile revision 599
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################################################################
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Xvnc server Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Based on Fedora's vnc.spec from
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# http://cvs.fedoraproject.org/viewcvs/rpms/vnc/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "Software"), to deal in the Software without restriction, including
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without limitation the rights to use, copy, modify, merge, publish,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# distribute, and/or sell copies of the Software, and to permit persons
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# to whom the Software is furnished to do so, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copyright notice(s) and this permission notice appear in all copies of
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# the Software and that both the above copyright notice(s) and this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# permission notice appear in supporting documentation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Except as contained in this notice, the name of a copyright holder
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or other dealings in this Software without prior written authorization
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# of the copyright holder.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# @(#)Makefile 1.16 08/12/19
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package name used in tarballs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Version number (used in path names)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Source tarball
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Xorg server source tarball to use sources from
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
8f70b6b48364b58f2823e735c35bf77787de0860Tinderbox UserXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xorg-x11-server-source
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Download site for source
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - Master source site doesn't allow wget downloads, so we use a mirror
8f70b6b48364b58f2823e735c35bf77787de0860Tinderbox User#SOURCE_URL=http://www.realvnc.com/dist/$(SOURCE_TARBALL_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_URL=http://dlc.sun.com/osol/x/downloads/mirrors/$(SOURCE_TARBALL_NAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Patches to apply to source after unpacking, in order
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Man pages to apply Sun footer to & attributes to list
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Common ones are here - source_gen target below has more with
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic Updater unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater unix/vncserver.man unix/x0vncserver/x0vncserver.man
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}'
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater# Compiler to use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Xvnc has to configure, build, and install in different directories due to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the mixed codebases and unusual directory layout
8f70b6b48364b58f2823e735c35bf77787de0860Tinderbox UserCONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
8f70b6b48364b58f2823e735c35bf77787de0860Tinderbox User# Default rule to make, so that the source_gen rule below doesn't become
8f70b6b48364b58f2823e735c35bf77787de0860Tinderbox User# default by virtue of being first
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Merge in additional sources from Xorg tarball & sun-src directory
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater# Use layout from Fedora RPM so their patches apply
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic Updater# This step has to be done before including common/Makefile.inc so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# that patches applied in that step work correctly.
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews bzcat $(XORG_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews @if [ "x$(XORG_SOURCE_PATCHES)" != "x" ] ; then \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews 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}'` ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "$${PATCH_CMD}" ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cp ../xorg/sun-src/mesa/Makefile.am $(XORG_BUILD_DIR)/GL/mesa/vbo)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Merge in additional sources from Xorg tarball & sun-src directory
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Use layout from Fedora RPM so their patches apply
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This step has to be done after including common/Makefile.inc since
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# it depends on files created in that stage
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -p unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -p /usr/X11/bin/ unix/xc/programs/Xserver/Xvnc.man )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Command line options to GNU autoconf configure script for vnc clients
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Command line options to GNU autoconf configure script for Xvnc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein --disable-dga --disable-xfree86-utils --disable-dri \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein --disable-xorg --disable-dmx --disable-xvfb --disable-xnest \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Environment variable options to GNU autoconf configure script
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -R$(X11_SERVERMODS_DIR)/extensions/mesa/$(ARCHLIBSUBDIR) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Run configure scripts for vnc sources
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(AUTORECONF_ENV) autoreconf --install --force && \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(AUTORECONF_ENV) autoreconf --install --force && \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater# Run configure script for Xvnc
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater# Need to run delibtoolize to fix libtool interference with our linker
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater# flags, but need to make sure we use large pic flags (-KPIC/-fPIC)
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/unix/Makefile
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(AUTORECONF_ENV) autoreconf --install --force && \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(TOP)/common/delibtoolize.pl -P -s $(SOURCE_DIR)
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic UpdaterXvnc_build: $(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cd $(SOURCE_DIR)/common ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cd $(SOURCE_DIR)/unix ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cd $(XORG_BUILD_DIR) ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) -e install \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \