Makefile revision 493
98N/A###############################################################################
98N/A#
98N/A# Xvnc server Makefile
98N/A# Based on Fedora's vnc-4.1.2-21.fc8/vnc.spec
1447N/A#
98N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
98N/A# Use subject to license terms.
919N/A#
919N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the
919N/A# "Software"), to deal in the Software without restriction, including
919N/A# without limitation the rights to use, copy, modify, merge, publish,
919N/A# distribute, and/or sell copies of the Software, and to permit persons
919N/A# to whom the Software is furnished to do so, provided that the above
919N/A# copyright notice(s) and this permission notice appear in all copies of
919N/A# the Software and that both the above copyright notice(s) and this
919N/A# permission notice appear in supporting documentation.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
919N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
919N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
919N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
919N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
919N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
98N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
98N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
98N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
98N/A#
98N/A# Except as contained in this notice, the name of a copyright holder
98N/A# shall not be used in advertising or otherwise to promote the sale, use
1339N/A# or other dealings in this Software without prior written authorization
1339N/A# of the copyright holder.
1339N/A#
1265N/A# @(#)Makefile 1.11 08/08/08
493N/A#
98N/A
911N/A# Package name used in tarballs
1379N/AMODULE_NAME=vnc
1379N/A
1379N/A# Version number (used in path names)
911N/AMODULE_VERSION=4_1_2-unixsrc
98N/A
235N/A# Source tarball
493N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(MODULE_VERSION).tar.gz
98N/ASOURCE_TARBALL_NAME_SET=yes
916N/A
916N/A# Xorg server source tarball to use sources from
1422N/AXORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
1422N/AXORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
916N/AXORG_BUILD_DIR=$(SOURCE_DIR)/unix/xorg-x11-server-source
970N/A
970N/A# Download site for source
970N/A# - Master source site doesn't allow wget downloads, so we use a mirror
970N/A#SOURCE_URL=http://www.realvnc.com/dist/$(SOURCE_TARBALL_NAME)
970N/ASOURCE_URL=http://ltsp.mirrors.tds.net/pub/ltsp/tarballs/$(SOURCE_TARBALL_NAME)
970N/ASOURCE_URL_SET=yes
970N/ASOURCE_UNCOMPRESS=gzcat
970N/A
970N/A# Patches to apply to source after unpacking, in order
970N/ASOURCE_PATCHES = \
970N/A vnc-use-fb.patch,-p1 \
970N/A vnc-restart.patch,-p1 \
970N/A vnc-modular-xorg.patch,-p1 \
970N/A vnc-nohttpd.patch,-p1 \
970N/A vnc-int10.patch,-p1 \
970N/A vnc-64bit.patch,-p1 \
970N/A vnc-render.patch,-p1 \
970N/A vnc-autotools.patch,-p1 \
970N/A vnc-autotools-compile.patch,-p1 \
970N/A vnc-always_use_fb.patch,-p1 \
970N/A vnc-24bit.patch,-p1 \
970N/A vnc-ipv6.patch,-p1 \
970N/A c++public.patch \
970N/A build-without-Xorg.patch \
970N/A solaris-port.patch
1029N/A
1029N/A# Man pages to apply Sun footer to & attributes to list
1124N/A# Common ones are here - source_gen target below has more with
1124N/A# different attributes/path set
1124N/ASUNTOUCHED_MANPAGES= \
1124N/A unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
1124N/A unix/vncserver.man unix/x0vncserver/x0vncserver.man
1124N/ASUNTOUCH_MAN_FLAGS= -p /usr/bin/ \
1303N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}'
1303N/A
1351N/A# Compiler to use
1351N/AMODULE_COMPILER=suncc
1351N/AMODULE_COMPILER_SET=yes
1351N/A
970N/A# Xvnc has to configure, build, and install in different directories due to
98N/A# the mixed codebases and unusual directory layout
98N/ACONFIGURE_TARGETS=$(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
1265N/ACONFIGURE_TARGETS_SET=yes
1402N/ABUILD_TARGETS=Xvnc_build
1402N/ABUILD_TARGETS_SET=yes
1402N/AINSTALL_TARGETS=Xvnc_install
1402N/AINSTALL_TARGETS_SET=yes
1124N/A
1402N/A# Default rule to make, so that the source_gen rule below doesn't become
1402N/A# default by virtue of being first
1124N/AXvnc_default: all
1124N/A
1265N/A# Merge in additional sources from Xorg tarball & sun-src directory
1265N/A# Use layout from Fedora RPM so their patches apply
1265N/A# This step has to be done before including common/Makefile.inc so
1124N/A# that patches applied in that step work correctly.
98N/Asource_gen:: $(LNDIR)
493N/A mkdir -p $(SOURCE_DIR)/unix
98N/A bzcat $(XORG_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )
970N/A @if [ "x$(XORG_SOURCE_PATCHES)" != "x" ] ; then \
970N/A for p in $(XORG_SOURCE_PATCHES) x ; do \
970N/A if [ "$$p" != "x" ] ; then \
1026N/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}'` ; \
970N/A echo "$${PATCH_CMD}" ; \
970N/A eval $${PATCH_CMD} ; \
1026N/A fi ; \
1124N/A done ; \
1458N/A fi
1458N/A mv $(XORG_SOURCE_DIR) $(XORG_BUILD_DIR)
1402N/A (cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
1402N/A
1402N/A
1003N/Ainclude ../Makefile.inc
98N/A
1422N/A# Merge in additional sources from Xorg tarball & sun-src directory
98N/A# Use layout from Fedora RPM so their patches apply
908N/A# This step has to be done after including common/Makefile.inc since
591N/A# it depends on files created in that stage
493N/Asource_gen::
493N/A (cd $(SOURCE_DIR) ; \
1201N/A cp -p unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc \
1201N/A unix/xc/programs/Xserver/Xvnc.man \
1201N/A unix/xc/programs/Xserver/vnc/*.h \
1201N/A unix/xc/programs/Xserver/vnc/*.cc \
1265N/A unix/xorg-x11-server-source/hw/vnc/ ; \
1265N/A cp -p unix/xorg-x11-server-source/cfb/cfb.h \
1201N/A unix/xorg-x11-server-source/fb/fb.h \
1201N/A unix/xorg-x11-server-source/fb/fbrop.h \
1201N/A unix/xorg-x11-server-source/hw/vnc/ ; \
1201N/A perl -i -p -e 's,\b(xor|and)\b,c_$$1,g' \
493N/A unix/xorg-x11-server-source/hw/vnc/cfb.h \
493N/A unix/xorg-x11-server-source/hw/vnc/fb.h \
493N/A unix/xorg-x11-server-source/hw/vnc/fbrop.h )
493N/A (cd $(SOURCE_DIR) && \
493N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
493N/A -a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
1026N/A -p /usr/bin/ unix/vncviewer/vncviewer.man )
705N/A (cd $(SOURCE_DIR) && \
493N/A /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
557N/A -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
1176N/A -p /usr/X11/bin/ unix/xc/programs/Xserver/Xvnc.man )
493N/A
965N/A# Command line options to GNU autoconf configure script for vnc clients
965N/AVNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
965N/A --mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc' \
1196N/A --localstatedir=/var
1196N/A
1470N/A# Command line options to GNU autoconf configure script for Xvnc
1196N/AXVNC_CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) $(XSERVER_CONFIG_OPTS) \
1196N/A --disable-builddocs --with-int10=stub \
1447N/A --disable-dga --disable-xfree86-utils --disable-dri \
1447N/A --disable-xorg --disable-dmx --disable-xvfb --disable-xnest \
1447N/A --disable-xprint --disable-kdrive
1447N/A
1196N/AMODULE_CPPFLAGS = \
1196N/A -D__extension__=\"\" \
1447N/A -I$(PWD)/$(SOURCE_DIR)/common \
1447N/A -I$(PWD)/$(SOURCE_DIR)/unix/vncconfig
1447N/A
1447N/ACFLAGS_gcc += -fPIC
1196N/A
606N/A# Environment variable options to GNU autoconf configure script
606N/AXVNC_CONFIG_ENV = LIBS="-lsocket -lnsl" \
851N/A LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_LDFLAGS)"
851N/ACONFIG_ENV += $(XVNC_CONFIG_ENV)
851N/A
851N/ALDPATH_ADDITIONS_sparc = \
851N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
851N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
851N/ALDPATH_ADDITIONS_i386 = \
98N/A -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
1193N/A -R$(X11_SERVERMODS_DIR)/extensions/mesa/$(ARCHLIBSUBDIR) \
1193N/A -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
1193N/ALDPATH_ADDITIONS=$(LDPATH_ADDITIONS_$(MACH))
591N/A
963N/AMODULE_LDFLAGS = $(LDPATH_ADDITIONS)
1201N/A
910N/A# Run configure scripts for vnc sources
1097N/A$(SOURCE_DIR)/unix/Makefile: $(UNPACK_TARGET)
910N/A (cd $(SOURCE_DIR)/common && autoreconf --install --force && \
1097N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
910N/A (cd $(SOURCE_DIR)/unix && autoreconf --install --force && \
98N/A $(CONFIG_ENV) $(SHELL) ./configure $(VNC_CONFIG_OPTS) )
98N/A
910N/A# Run configure script for Xvnc
910N/A# Need to run delibtoolize to fix libtool interference with our linker
970N/A# flags, but need to make sure we use large pic flags (-KPIC/-fPIC)
1030N/A$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/unix/Makefile
1030N/A (cd $(XORG_BUILD_DIR) && \
970N/A ACLOCAL="$(ACLOCAL_PATH)" autoreconf --install --force && \
970N/A $(CONFIG_ENV) $(SHELL) ./configure $(XVNC_CONFIG_OPTS) )
970N/A
1097N/A# $(TOP)/common/delibtoolize.pl -P $(SOURCE_DIR)
1097N/A
1030N/AXvnc_build: $(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
1030N/A (cd $(SOURCE_DIR)/common ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
910N/A (cd $(SOURCE_DIR)/unix ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
98N/A (cd $(XORG_BUILD_DIR) ; $(BUILD_ENV) $(MAKE) $(MAKEFLAGS))
1193N/A
1193N/AXvnc_install::
1193N/A (cd $(XORG_BUILD_DIR)/hw/vnc \
1193N/A && $(BUILD_ENV) $(MAKE) $(MAKEFLAGS) -e install \
1193N/A DESTDIR=$(PROTODIR) CPPROG="cp -p" )
1193N/A mkdir -p $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR) \
1193N/A $(PROTODIR)/usr/share/man/man1 \
1193N/A $(PROTODIR)$(X11_MAN_DIR)/man/man1 \
1193N/A $(PROTODIR)/usr/share/vnc \
1422N/A $(PROTODIR)/var/svc/manifest/application/x11
1193N/A cp -pf $(SOURCE_DIR)/unix/vncserver \
606N/A $(SOURCE_DIR)/unix/vncpasswd/vncpasswd \
98N/A $(SOURCE_DIR)/unix/vncconfig/vncconfig \
606N/A $(SOURCE_DIR)/unix/vncviewer/vncviewer \
98N/A $(PROTODIR)/usr/bin/$(ARCHLIBSUBDIR)
591N/A cp -pf $(SOURCE_DIR)/unix/vncserver.man \
851N/A $(PROTODIR)/usr/share/man/man1/vncserver.1
111N/A cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
1422N/A $(PROTODIR)/usr/share/man/man1/vncconfig.1
1088N/A cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
1088N/A $(PROTODIR)/usr/share/man/man1/vncpasswd.1
1088N/A cp -pf $(SOURCE_DIR)/unix/vncviewer/vncviewer.man \
733N/A $(PROTODIR)/usr/share/man/man1/vncviewer.1
1265N/A cp -pf $(SOURCE_DIR)/common/javabin/index.vnc \
1265N/A $(PROTODIR)/usr/share/vnc
733N/A cp -pf $(XORG_BUILD_DIR)/hw/vnc/Xvnc.man \
963N/A $(PROTODIR)$(X11_MAN_DIR)/man1/Xvnc.1
851N/A cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/
963N/A