Makefile revision 400
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt###############################################################################
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Xorg server Makefile
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Use subject to license terms.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Permission is hereby granted, free of charge, to any person obtaining a
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# copy of this software and associated documentation files (the
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# "Software"), to deal in the Software without restriction, including
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# without limitation the rights to use, copy, modify, merge, publish,
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# distribute, and/or sell copies of the Software, and to permit persons
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# to whom the Software is furnished to do so, provided that the above
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# copyright notice(s) and this permission notice appear in all copies of
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# the Software and that both the above copyright notice(s) and this
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# permission notice appear in supporting documentation.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d7be2b79ed0934483d550e17e2bd09de4eaff8f5Evan Hunt# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Except as contained in this notice, the name of a copyright holder
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# shall not be used in advertising or otherwise to promote the sale, use
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# or other dealings in this Software without prior written authorization
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# of the copyright holder.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# @(#)Makefile 1.63 08/03/07
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt#
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Build 32-bit or 64-bit?
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntBUILD_TYPES_SET=yes
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntBUILD_TYPES_sparc=64
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntBUILD_TYPES_i386=32 64
f1c89cb4f5c72c54bb67dc48cd6f2b332eab9e92Automatic UpdaterBUILD_TYPES=$(BUILD_TYPES_$(MACH))
207cee019eb5cbbe7c905f7c52f7b5d11f8c0305Automatic Updater
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User# Package name used in tarballs
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntMODULE_NAME=xorg-server
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Name used in server-specific rules in ../Makefile.inc
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntXSERVER=XORG
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Source tarball
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
b843f577bbcd6660fbaa506d9e55b156c689a5a8Evan HuntSOURCE_TARBALL_DIR=xserver
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# Patches to apply to source after unpacking, in order
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntSOURCE_PATCHES:sh=cat -s patch-list closed-src/patch-list | sed '/^\#/ d'
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
b843f577bbcd6660fbaa506d9e55b156c689a5a8Evan Hunt# Directory created by unpacking source
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Man pages to apply Sun footer to & attributes to list
8b78c993cb475cc94e88560941b28c37684789d9Francis Dupont# XXX: Need to adjust some of these to correct packages/stability
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntSUNTOUCHED_MANPAGES= \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/gtf/gtf.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/cvt/cvt.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/pcitweak/pcitweak.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/scanpci/scanpci.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/xorgcfg/xorgcfg.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/doc/man/Xorg.man.pre \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt hw/xfree86/doc/man/xorg.conf.man.pre
b843f577bbcd6660fbaa506d9e55b156c689a5a8Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntSUNTOUCH_MAN_FLAGS= -p $(XSERVER_PREFIX)/bin/ \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Compiler to use - x86 MMX code only builds with gcc, not Sun Studio, so use
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# gcc on x86 for now, but keep Sun Studio on SPARC
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCOMPILER_sparc=cc
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCOMPILER_i386=gcc
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCOMPILER=$(COMPILER_$(MACH))
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Binary built in tree
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntBUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Huntinclude ../Makefile.inc
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
d7be2b79ed0934483d550e17e2bd09de4eaff8f5Evan Hunt# Merge in additional sources from sun-src directory
d7be2b79ed0934483d550e17e2bd09de4eaff8f5Evan Huntsource_gen:: $(LNDIR)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt -$(RM) -f $(SOURCE_DIR)/hw/xfree86/scanpci/pci.ids \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt $(SOURCE_DIR)/hw/xfree86/scanpci/xf86PciIds.h
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Command line options to GNU autoconf configure script
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# XXX: --disable-dga
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt --enable-builddocs --enable-xorgcfg \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt --enable-kdrive --enable-xephyr --disable-xsdl
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntXORG_CPPFLAGS= $(XSERVER_CPPFLAGS) \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt -I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Run configure script
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/configure
10a759cee69dcc3ce3a4d65e6e263c66e7f60ee8Evan Hunt (cd $(SOURCE_DIR) && \
10a759cee69dcc3ce3a4d65e6e263c66e7f60ee8Evan Hunt $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
10a759cee69dcc3ce3a4d65e6e263c66e7f60ee8Evan Hunt (cd $(SOURCE_DIR)/hw/xfree86/xf1bpp && \
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt $(MAKE) $(MFLAGS) maintainer-clean-generic)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(SOURCE_DIR)/configure: $(UNPACK_TARGET) $(SOURCE_DIR)/configure.ac
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt $(MAKE) $(MFLAGS) autoreconf
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(XORGSERVER_BIN): $(SOURCE_DIR)/Makefile
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntEXTRA_INSTALL_sparc=install_pc
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntEXTRA_INSTALL_i386=
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntEXTRA_INSTALL=$(EXTRA_INSTALL_$(MACH))
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Huntinstall_gen:: $(XORGSERVER_BIN) $(EXTRA_INSTALL)
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt DESTDIR=$(PROTODIR) CPPROG="cp -p" \
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt#ifdef _LP64\
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt#define _XSERVER64 1\
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt#endif%' \
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt cp -p $(SOURCE_DIR)/mi/mioverlay.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/mioverlay.h
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt cp -p $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xf86Sbus.h
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt mkdir -p $(PROTODIR)$(X11_DOC_DIR)
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Huntinstall_pc:
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt cp -p $(SOURCE_DIR)/xorg-server.pc $(PROTODIR)/usr/lib/pkgconfig/
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt -rm -f $@
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt printf '{\n global:\n' >> $@
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt /usr/ccs/bin/nm -g $(XORGSERVER_BIN) $(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)/libXfont.so | grep -v UNDEF | sed -n -e 's/^.*\|FUNC \|GLOB \|.*\|\([A-Za-z].*\)$$/ \1 = FUNCTION extern;/p' -e 's/^.*\|OBJT \|GLOB \|.*\|\([A-Za-z].*\)$$/ \1 = DATA extern;/p' >> $@
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt printf '};\n' >> $@
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt