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