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