Makefile revision 418
98N/A###############################################################################
98N/A#
98N/A# Xorg server Makefile
98N/A#
98N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
98N/A# Use subject to license terms.
98N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
98N/A# copy of this software and associated documentation files (the
98N/A# "Software"), to deal in the Software without restriction, including
98N/A# without limitation the rights to use, copy, modify, merge, publish,
98N/A# distribute, and/or sell copies of the Software, and to permit persons
98N/A# to whom the Software is furnished to do so, provided that the above
98N/A# copyright notice(s) and this permission notice appear in all copies of
98N/A# the Software and that both the above copyright notice(s) and this
98N/A# permission notice appear in supporting documentation.
98N/A#
98N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
98N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
98N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
98N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
98N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
98N/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
98N/A# or other dealings in this Software without prior written authorization
98N/A# of the copyright holder.
98N/A#
355N/A# @(#)Makefile 1.63 08/03/07
98N/A#
98N/A
235N/A# Build 32-bit or 64-bit?
156N/ABUILD_TYPES_SET=yes
156N/ABUILD_TYPES_sparc=64
156N/ABUILD_TYPES_i386=32 64
156N/ABUILD_TYPES=$(BUILD_TYPES_$(MACH))
98N/A
98N/A# Package name used in tarballs
98N/AMODULE_NAME=xorg-server
98N/A
235N/A# Name used in server-specific rules in ../Makefile.inc
235N/AXSERVER=XORG
98N/A
98N/A# Source tarball
98N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
156N/ASOURCE_TARBALL_DIR=xserver
98N/A
98N/A# Patches to apply to source after unpacking, in order
235N/A# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
261N/ASOURCE_PATCHES:sh=cat -s patch-list closed-src/patch-list | sed '/^\#/ d'
98N/A
98N/A# Directory created by unpacking source
98N/ASOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
98N/A
98N/A# Man pages to apply Sun footer to & attributes to list
98N/A# XXX: Need to adjust some of these to correct packages/stability
98N/ASUNTOUCHED_MANPAGES= \
98N/A hw/xfree86/utils/gtf/gtf.man.pre \
98N/A hw/xfree86/utils/cvt/cvt.man.pre \
98N/A hw/xfree86/utils/pcitweak/pcitweak.man.pre \
98N/A hw/xfree86/utils/scanpci/scanpci.man.pre \
98N/A hw/xfree86/utils/xorgcfg/xorgcfg.man.pre \
98N/A hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
98N/A hw/xfree86/doc/man/Xorg.man.pre \
98N/A hw/xfree86/doc/man/xorg.conf.man.pre
98N/A
235N/ASUNTOUCH_MAN_FLAGS= -p $(XSERVER_PREFIX)/bin/ \
98N/A -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
98N/A
235N/A# Compiler to use - x86 MMX code only builds with gcc, not Sun Studio, so use
235N/A# gcc on x86 for now, but keep Sun Studio on SPARC
235N/ACOMPILER_sparc=cc
235N/ACOMPILER_i386=gcc
235N/ACOMPILER=$(COMPILER_$(MACH))
235N/A
98N/A# Binary built in tree
98N/AXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
98N/A
98N/ABUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
98N/A
235N/Ainclude ../Makefile.inc
98N/A
98N/A# Merge in additional sources from sun-src directory
98N/Asource_gen:: $(LNDIR)
343N/A -$(RM) -f $(SOURCE_DIR)/hw/xfree86/scanpci/pci.ids \
343N/A $(SOURCE_DIR)/hw/xfree86/scanpci/xf86PciIds.h
98N/A (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
98N/A
98N/A# Command line options to GNU autoconf configure script
156N/A# XXX: --disable-dga
235N/ACONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
235N/A --enable-builddocs --enable-xorgcfg \
235N/A --enable-kdrive --enable-xephyr --disable-xsdl
98N/A
235N/AXORG_CPPFLAGS= $(XSERVER_CPPFLAGS) \
235N/A -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm \
235N/A -I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri
98N/A
98N/A# Run configure script
198N/A$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/configure
191N/A (cd $(SOURCE_DIR) && \
191N/A $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
98N/A (cd $(SOURCE_DIR)/hw/xfree86/xf1bpp && \
98N/A $(MAKE) $(MFLAGS) maintainer-clean-generic)
98N/A
198N/A$(SOURCE_DIR)/configure: $(UNPACK_TARGET) $(SOURCE_DIR)/configure.ac
198N/A $(MAKE) $(MFLAGS) autoreconf
198N/A
98N/A$(XORGSERVER_BIN): $(SOURCE_DIR)/Makefile
98N/A (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
98N/A
212N/AEXTRA_INSTALL_sparc=install_pc
212N/AEXTRA_INSTALL_i386=
212N/AEXTRA_INSTALL=$(EXTRA_INSTALL_$(MACH))
212N/A
355N/Ainstall_gen:: $(XORGSERVER_BIN) $(EXTRA_INSTALL)
98N/A (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
98N/A DESTDIR=$(PROTODIR) CPPROG="cp -p" \
98N/A pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
111N/A sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
111N/A -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
111N/A#ifdef _LP64\
111N/A#define _XSERVER64 1\
111N/A#endif%' \
111N/A $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
206N/A cp -p $(SOURCE_DIR)/mi/mioverlay.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/mioverlay.h
206N/A cp -p $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xf86Sbus.h
98N/A mkdir -p $(PROTODIR)$(X11_DOC_DIR)
98N/A cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
98N/A
212N/A# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
212N/Ainstall_pc:
212N/A cp -p $(SOURCE_DIR)/xorg-server.pc $(PROTODIR)/usr/lib/pkgconfig/
212N/A
98N/A$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
98N/A -rm -f $@
98N/A printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
98N/A printf '{\n global:\n' >> $@
182N/A /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' >> $@
98N/A printf '};\n' >> $@