Makefile revision 851
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen###############################################################################
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Xorg server Makefile
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Use is subject to license terms.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Permission is hereby granted, free of charge, to any person obtaining a
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# copy of this software and associated documentation files (the
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# "Software"), to deal in the Software without restriction, including
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# without limitation the rights to use, copy, modify, merge, publish,
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# distribute, and/or sell copies of the Software, and to permit persons
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# to whom the Software is furnished to do so, provided that the above
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# copyright notice(s) and this permission notice appear in all copies of
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# the Software and that both the above copyright notice(s) and this
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# permission notice appear in supporting documentation.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# Except as contained in this notice, the name of a copyright holder
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# shall not be used in advertising or otherwise to promote the sale, use
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# or other dealings in this Software without prior written authorization
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# of the copyright holder.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# ident "@(#)Makefile 1.79 09/12/05 SMI"
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Build 32-bit or 64-bit?
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# Package name used in tarballs
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Version number (used in path names)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Patches to apply to source after unpacking, in order
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Man pages to apply Sun footer to & attributes to list
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# XXX: Need to adjust some of these to correct packages/stability
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoMODULE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Binary built in tree
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoBUILD_TARGETS=$(XORGSERVER_BIN) set-elf-comments \
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Need to regenerate autoconf/automake files after patching
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Command line options to GNU autoconf configure script
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Need to override LD setting to add -xarch flags that libtool strips
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# XXX: --disable-dga
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco --enable-kdrive --enable-xephyr --disable-xsdl \
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# pkg-config files that need to have -R added
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Remove compiler specific visibility flag that breaks builds of drivers
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# with other compilers
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Need to use GNU Make to build due to hw/xfree86/loader
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Additional install targets beyond the defaults
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# - install_pc can't be in INSTALL_TARGETS or MODULE_ADD_INSTALL_TARGETS
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# without causing a dependency loop that breaks dmake
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerinstall_gen:: install_extras install_pc_common $(EXTRA_INSTALL_$(MACH))
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Merge in additional sources from sun-src directory
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenSDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#ifdef _LP64\
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco#define _XSERVER64 1\
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
60281ca3d1db22f5d2204e1be4975504853072a7Lubos Kosco cp -pf $(SOURCE_DIR)/mi/mioverlay.h $(SDK_INCLUDES_DIR)/mioverlay.h
4fd421f78fa03a25d6771c9347f33699ae8ca20cLubos Kosco cp -pf $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(SDK_INCLUDES_DIR)/xf86Sbus.h
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco cp -pf $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen -rm -f $(SDK_INCLUDES_DIR)/xf1bpp.h $(SDK_INCLUDES_DIR)/xf4bpp.h
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen cp -pf $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen mkdir -p $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen cp -pf $(SOURCE_DIR)/config/x11-input.fdi \
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor/10-x11-input.fdi
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen -rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatleninstall_pc_copy: install_pc_common install_pkgconfig_uninstalled
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server.pc \
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server-uninstalled.pc \
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
99b4056e2c5b0a51f7f480ebcefb1f917613ce2aLubos Kosco /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' >> $@