Makefile revision 527
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews###############################################################################
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Xorg server Makefile
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Use subject to license terms.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# copy of this software and associated documentation files (the
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# "Software"), to deal in the Software without restriction, including
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# to whom the Software is furnished to do so, provided that the above
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# the Software and that both the above copyright notice(s) and this
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# permission notice appear in supporting documentation.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
f41405d21249e11c1636301b1324ac1937b455aaMark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Except as contained in this notice, the name of a copyright holder
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# or other dealings in this Software without prior written authorization
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# of the copyright holder.
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# @(#)Makefile 1.65 08/09/05
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews#
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Build 32-bit or 64-bit?
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsBUILD_TYPES_SET=yes
33518843817dd9cf127eb09c5952227f1972af55Mark AndrewsBUILD_TYPES_sparc=64
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsBUILD_TYPES_i386=32 64
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsBUILD_TYPES=$(BUILD_TYPES_$(MACH))
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
7e8f841d085cbd14b270f7bb9e2a2b7c5bc22565Mark Andrews# Package name used in tarballs
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsMODULE_NAME=xorg-server
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Version number (used in path names)
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsMODULE_VERSION=$(XORGSERVER_VERS)
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Patches to apply to source after unpacking, in order
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsSOURCE_PATCHES=$(XORG_SOURCE_PATCHES)
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# Man pages to apply Sun footer to & attributes to list
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews# XXX: Need to adjust some of these to correct packages/stability
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark AndrewsSUNTOUCHED_MANPAGES= \
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence hw/xfree86/utils/gtf/gtf.man.pre \
d39690e5a9b4a9a084d984abd193bed4395db41aDavid Lawrence hw/xfree86/utils/cvt/cvt.man.pre \
105f5a65b1f680f4cb6f897b8b0f7ee7e09e41ebDavid Lawrence hw/xfree86/utils/pcitweak/pcitweak.man.pre \
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews hw/xfree86/utils/scanpci/scanpci.man.pre \
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews hw/xfree86/utils/xorgcfg/xorgcfg.man.pre \
88b3bc12b5570aae77e5963204e9111a2875915eAndreas Gustafsson hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews hw/xfree86/doc/man/Xorg.man.pre \
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews hw/xfree86/doc/man/xorg.conf.man.pre
8886caf5dc3db70638022ddfd5442c0930bd43b5Mark Andrews
e2bb1e3de4d132b82005eca9fb30a5edbe8745e4Andreas GustafssonSUN_PACKAGE=SUNWxorg-server
b0ec080043c586a6be6a7f88151d7df61fd22009Andreas GustafssonMODULE_STABILITY=Volatile
c05a979fda35c83d7fba16fee7859644e98a7450Mark AndrewsMODULE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
c05a979fda35c83d7fba16fee7859644e98a7450Mark Andrews
2a313f56e78e19ae6dc2315bb53bd32fad13ae29Mark Andrews# Compiler to use - x86 MMX code only builds with gcc, not Sun Studio, so use
60c2c8814f838f503333da5b2fd7e6792ca39c14Mark Andrews# gcc on x86 for now, but keep Sun Studio on SPARC
c58088e3a0fd9e553db750cd4b08d3e621d0ded4Mark AndrewsMODULE_COMPILER_sparc=suncc
b9858c2efcee324745a1b8d7b099baf540bc695bMark AndrewsMODULE_COMPILER_i386=gcc
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark AndrewsMODULE_COMPILER=$(MODULE_COMPILER_$(MACH))
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark AndrewsMODULE_COMPILER_SET=yes
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews
5a020bc04be73df06735da0ec1abb1dd71c755e5Mark Andrews# Binary built in tree
a69a77ddfef58e93036cf6173dc7f91ed864d103Mark AndrewsXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
ea37c1a7780311cc7076ff54f09774b2296aebe5Mark Andrews
de90c0b2efac159580365beaa761a14bdb74330cMark AndrewsBUILD_TARGETS=fix-xf1bpp $(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
49aa1303a7cf1ec2a06cde11e46a039dddfca8feMark AndrewsBUILD_TARGETS_SET=yes
e20eae14fc554bae394f535067e80884b59d0684Mark Andrews
e03d4ecce3b62bb0a02d2f5e2cc1a9549df08498Mark Andrews# Need to regenerate autoconf/automake files after patching
e03d4ecce3b62bb0a02d2f5e2cc1a9549df08498Mark AndrewsAUTORECONF=yes
# Command line options to GNU autoconf configure script
# Need to override LD setting to add -xarch flags that libtool strips
# XXX: --disable-dga
MODULE_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
--enable-builddocs --enable-xorgcfg \
--enable-kdrive --enable-xephyr --disable-xsdl \
LD="$(CC) $(ARCH_FLAGS)"
# Need specific ordering of CPPFLAGS for Mesa headers for now
USE_DEFAULT_CONFIG_CPPFLAGS=no
MODULE_CPPFLAGS= \
-I$(PROTODIR)$(X11_INCLUDES_DIR)/drm \
-I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri
include ../Makefile.inc
# Merge in additional sources from sun-src directory
source_gen:: $(LNDIR)
-$(RM) -f $(SOURCE_DIR)/hw/xfree86/scanpci/pci.ids \
$(SOURCE_DIR)/hw/xfree86/scanpci/xf86PciIds.h
(mkdir -p $(SOURCE_DIR)/GL/mesa/vbo)
(cp ./sun-src/mesa/Makefile.am $(SOURCE_DIR)/GL/mesa/vbo)
(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
# Force broken xf1bpp sources in 1.3 to be regenerated
fix-xf1bpp: $(SOURCE_DIR)/Makefile
(cd $(SOURCE_DIR)/hw/xfree86/xf1bpp && \
$(MAKE) $(MAKEFLAGS) maintainer-clean-generic)
$(XORGSERVER_BIN): default_build
EXTRA_INSTALL_sparc=install_pc
EXTRA_INSTALL_i386=
EXTRA_INSTALL=$(EXTRA_INSTALL_$(MACH))
install_gen:: default_install $(EXTRA_INSTALL)
sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
-e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
#ifdef _LP64\
#define _XSERVER64 1\
#endif%' \
$(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
cp -p $(SOURCE_DIR)/mi/mioverlay.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/mioverlay.h
cp -p $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xf86Sbus.h
mkdir -p $(PROTODIR)$(X11_DOC_DIR)
cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
install_pc:
cp -p $(SOURCE_DIR)/xorg-server.pc $(PROTODIR)/usr/lib/pkgconfig/
$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
-rm -f $@
printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
printf '{\n global:\n' >> $@
/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' >> $@
printf '};\n' >> $@