Makefile revision 963
12343c067e12be071a68bbb10d1d1c4870696769Tinderbox User###############################################################################
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# Xorg server Makefile
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# copy of this software and associated documentation files (the "Software"),
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# to deal in the Software without restriction, including without limitation
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# and/or sell copies of the Software, and to permit persons to whom the
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# Software is furnished to do so, subject to the following conditions:
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# The above copyright notice and this permission notice (including the next
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User# paragraph) shall be included in all copies or substantial portions of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2b7254075b883d70852a2757210793603085a0f1Tinderbox User# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews# DEALINGS IN THE SOFTWARE.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Build 32-bit or 64-bit?
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# Package name used in tarballs
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Version number (used in path names)
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# Checksums for upstream tarball
415d630b6309922caee8469384a6fab75cf05032Mark AndrewsTARBALL_SHA1 = 0f1b71363843b7e394d6de62d0db5b74d3e645ef
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Patches to apply to source after unpacking, in order
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# to allow for different source layouts
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Man pages to apply Sun footer to & attributes to list
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# XXX: Need to adjust some of these to correct packages/stability
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Binary built in tree
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox UserBUILD_TARGETS=$(XORGSERVER_BIN) build_mdb set-elf-comments \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Need to regenerate autoconf/automake files after patching
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Command line options to GNU autoconf configure script
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Need to override LD setting to add -xarch flags that libtool strips
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# XXX: --disable-dga
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews --enable-kdrive --enable-xephyr --disable-xsdl \
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews# pkg-config files that need to have -R added
ebe53509ca55a141131c104b6d722236b606e0efTinderbox User# Remove compiler specific visibility flag that breaks builds of drivers
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews# with other compilers
415d630b6309922caee8469384a6fab75cf05032Mark AndrewsMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Need to use GNU Make to build due to hw/xfree86/loader
7cc0a5d21ef046bfd630c4769943d896a7d7472cTinderbox User# Additional install targets beyond the defaults
3ccf87473f7cf6d9faac156df38a935a238f96fdTinderbox UserMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsMODULE_ADD_INSTALL_TARGETS += $(EXTRA_INSTALL_$(MACH))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Have to avoid dependency loop between install_pc_copy and
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# install_pkgconfig_uninstalled
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox UserINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_copy=)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Merge in additional sources from sun-src directory
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark AndrewsSDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews#define _XSERVER64 1\
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
415d630b6309922caee8469384a6fab75cf05032Mark Andrews cp -pf $(SOURCE_DIR)/mi/mioverlay.h $(SDK_INCLUDES_DIR)/mioverlay.h
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews cp -pf $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(SDK_INCLUDES_DIR)/xf86Sbus.h
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User cp -pf $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews -rm -f $(SDK_INCLUDES_DIR)/xf1bpp.h $(SDK_INCLUDES_DIR)/xf4bpp.h
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews $(SOURCE_DIR)/hw/xfree86/doc/man/xorgconfig.1 \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews mkdir -p $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor/10-x11-input.fdi
ebe53509ca55a141131c104b6d722236b606e0efTinderbox User# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews -rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
51aeb0ae19596e99b029cfa933e73b76ebec480aTinderbox User# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrewsinstall_pc_copy: install_pc_common install_pkgconfig_uninstalled
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont -rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
baeaed18341c015e9ad54ffa21973184c1bc432bMark Andrews ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
b378314925e78f21853a98cec924788ce1822c6cTinderbox User /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' >> $@
2b7254075b883d70852a2757210793603085a0f1Tinderbox User# Fix paths in proto area to match paths in packages / installed systems
66317da170ed35b08f5847db2d48b225826327cbTinderbox Userinstall_fix_paths: install_fix_paths_$(MACH)_$(BUILD_TYPE) install_fix_paths_X
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsinstall_fix_paths_$(MACH)_: $(BUILD_TYPES:%=install_fix_paths_$(MACH)_%)
b625bdae12277225b076a002dd4af80902529181Tinderbox Userinstall_fix_paths_i386_32: install_fix_paths_use_utilities
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsinstall_fix_paths_i386_64: install_fix_paths_remove_utilities
33b0d10552ea5f7716385b2cedff64daa1486c50Tinderbox Userinstall_fix_paths_use_utilities: default_install
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews mv -f $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/cvt \
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/gtf \
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updaterinstall_fix_paths_remove_utilities: default_install
415d630b6309922caee8469384a6fab75cf05032Mark Andrews rm -f $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/cvt \
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/gtf
fa0326cc2cf428f67575b6ba3b97b528a31b0010Tinderbox User $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/X
415d630b6309922caee8469384a6fab75cf05032Mark Andrews ln -s Xserver $(PROTODIR)$(MODULE_PREFIX)/bin/X
0eb371ca0dab50ae3462e98794a6126198c52f4bMark AndrewsXSERVER_LINKS = $(XSERVERS:%=$(PROTODIR)$(MODULE_PREFIX)/bin/%)
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrewsinstall_fix_paths_i386_32: install_fix_paths_Xservers_isaexec