Makefile revision 1179
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews###############################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Xorg server Makefile
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# copy of this software and associated documentation files (the "Software"),
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# to deal in the Software without restriction, including without limitation
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and/or sell copies of the Software, and to permit persons to whom the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Software is furnished to do so, subject to the following conditions:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The above copyright notice and this permission notice (including the next
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# paragraph) shall be included in all copies or substantial portions of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# DEALINGS IN THE SOFTWARE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Package name used in tarballs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Version number (used in path names)
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Checksums for upstream tarball
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTARBALL_SHA1 = 1699be5c0edeca553cfa3ee6caa228483465136b
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTARBALL_SHA256 = 05ec05fbc8ec336127071db38cfb61c618e43b720edbd8d51d171c0cd359e290
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Patches to apply to source after unpacking, in order
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# to allow for different source layouts
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ARC cases that covered this module
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2004/187 Xorg Server for Solaris
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater# PSARC/2004/685 Xorg server upgrade to X11R6.8 release
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2004/829 Xorg 6.8.2 server upgrade for Solaris
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2005/450 Xorg 6.9 for Solaris
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2006/609 Xserver provider for DTrace
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2007/051 Xorg server upgrade to 7.2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2007/434 Xorg server 1.3
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2007/500 X11 MIT-SHM Extension across zones
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater# PSARC/2008/294 Xorg driver selection based on VIS_GETIDENTIFIER
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2009/021 Xorg server 1.5
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2009/292 Xorg server 1.6
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2009/679 Xorg server 1.7
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PSARC/2010/109 Introduce libXcb in Solaris
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# PSARC/2011/008 Xorg server 1.9
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# PSARC/2010/382 Removal of 32-bit X servers
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# PSARC/2011/214 Xorg server 1.10
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# Man pages to apply Sun footer to & attributes to list
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Override specific attributes for specific man pages
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Xephyr, Xvfb, and Xdmx are split out into their own packages
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterSUNTOUCH_MAN_FLAGS_Xephyr = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xephyr)}'
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterSUNTOUCH_MAN_FLAGS_Xvfb = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xvfb)}'
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterSUNTOUCH_MAN_FLAGS_Xdmx = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xdmx)}'
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterSUNTOUCH_MAN_FLAGS_Xserver = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xserver-common)}'
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater# Binary built in tree
64affc54f96a2c71cbd10ed71e246ce0746259aaAutomatic UpdaterXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterBUILD_TARGETS=$(XORGSERVER_BIN) build_mdb set-elf-comments \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Need to regenerate autoconf/automake files after patching
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Command line options to GNU autoconf configure script
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# XXX: --disable-dga
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterMODULE_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews --enable-kdrive --enable-xephyr --disable-xsdl \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# pkg-config files that need to have -R added
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Remove compiler specific visibility flag that breaks builds of drivers
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# with other compilers
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Need to use GNU Make to build due to hw/xfree86/loader
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Additional install targets beyond the defaults
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Have to avoid dependency loop between install_pc_common and
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# install_pkgconfig_uninstalled
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_common=)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Merge in additional sources from sun-src directory
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# Compatibility links from /usr/X11/bin to /usr/bin
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# Only needed for programs that were in /usr/X11/bin before we moved
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_X11_BINCOMPAT_LINKS = Xorg Xephyr Xvfb cvt gtf
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterMODULE_X11_BINCOMPAT_LINKS += $(MODULE_X11_BINCOMPAT_LINKS_$(MACH))
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# Binaries that were linked to isaexec on x86 to choose 32-bit or 64-bit,
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# now just symlinks from amd64 to parent directory
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterSDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater cp -pf $(SOURCE_DIR)/hw/xfree86/doc/man/xorgcfg.1 \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(SOURCE_DIR)/hw/xfree86/doc/man/xorgconfig.1 \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mkdir -p $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor/10-x11-input.fdi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -pf 90-zap.conf $(PROTODIR)/etc/X11/xorg.conf.avail
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# builds, and install xorg-server.pc in 32-bit pkgconfig dir too
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall_pc_common: default_install install_pkgconfig_uninstalled
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews /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' >> $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Fix paths in proto area to match paths in packages / installed systems
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/X
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s Xserver $(PROTODIR)$(MODULE_PREFIX)/bin/X
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMESA_MODULE_DIR = /usr/lib/mesa/modules/extensions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXT_MODULE_DIR = $(X11_SERVERMODS_DIR)/extensions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../../../../../system/volatile/opengl/server/libglx.so \
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews# Install metadata for Xephyr, Xvfb, Xdmx, & xtsol packages too
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsXCOMMON_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xserver-common)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsXEPHYR_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xephyr)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsXVFB_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xvfb)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsXDMX_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xdmx)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsXTSOL_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-server-xorg=%-trusted-trusted-xorg)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXTRA_METADATA_DIRS = $(XCOMMON_PKG_METADATA_DIR) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXTRA_ATTRDATA_FILES = $(EXTRA_METADATA_DIRS:%=%/$(ATTRDATA_FILE_NAME))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXTRA_LICENSE_FILES = $(EXTRA_METADATA_DIRS:%=%/$(LICENSE_FILE_NAME))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEXTRA_METADATA_TARGETS= $(EXTRA_METADATA_DIRS) \
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews$(EXTRA_ATTRDATA_FILES) $(EXTRA_LICENSE_FILES): $(EXTRA_METADATA_DIRS)
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews# Xtsol module is covered only by Oracle copyright/license
52ece689e0265f9a3e518de5b2539e749f6d35acMark AndrewsXTSOL_LICENSE = $(XTSOL_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews$(XTSOL_LICENSE):= LICENSE_NAME = $(ORACLE_LICENSE_NAME)
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews$(XTSOL_LICENSE):= LICENSE_APPEND = $(ORACLE_LICENSE_APPEND)
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews# Special compatibility links from /usr/X11/include to /usr/include
52ece689e0265f9a3e518de5b2539e749f6d35acMark AndrewsX11_INCLUDE_COMPAT_DIR = $(PROTODIR)/usr/X11/include
52ece689e0265f9a3e518de5b2539e749f6d35acMark AndrewsX11_INCLUDE_COMPAT_LINKS = $(X11_INCLUDE_COMPAT_DIR)/drm \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(X11_INCLUDE_COMPAT_LINKS): $(X11_INCLUDE_COMPAT_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews## mdb module rules
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Build & install mdb modules & scripts that aren't integrated to
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# normal build process.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMDB_MODULE_DIR=/usr/lib/mdb/proc/$(ARCHLIBSUBDIR)
6283056805887de88040698685b8e1936a1f7a2dAutomatic UpdaterMDB_MODULE_NAMES=Xephyr Xorg Xvfb Xvnc Xdmx
6283056805887de88040698685b8e1936a1f7a2dAutomatic UpdaterBUILT_MDB_MODULE=$(MDB_SOURCE_DIR)/modules/Xserver.so
6283056805887de88040698685b8e1936a1f7a2dAutomatic UpdaterBUILT_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(MDB_SOURCE_DIR)/scripts/%)
6283056805887de88040698685b8e1936a1f7a2dAutomatic UpdaterINSTALLED_MDB_LINKS=$(MDB_MODULE_NAMES:%=$(PROTODIR)$(MDB_MODULE_DIR)/%.so)
6283056805887de88040698685b8e1936a1f7a2dAutomatic UpdaterINSTALLED_MDB_MODULE=$(PROTODIR)$(MDB_MODULE_DIR)/Xserver.so
1c51f79aba598e5e20bde66aea0237e347f6d5ceAutomatic UpdaterINSTALLED_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(PROTODIR)$(MDB_SCRIPT_DIR)/%)
1c51f79aba598e5e20bde66aea0237e347f6d5ceAutomatic UpdaterINSTALLED_MDB_ALL=$(INSTALLED_MDB_MODULE) $(INSTALLED_MDB_LINKS) \
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater# Since configure options aren't used to build the mdb modules, pass
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater# those variables at build time
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater $(MDB_BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater$(PROTODIR)$(MDB_MODULE_DIR) $(PROTODIR)$(MDB_SCRIPT_DIR):
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater$(INSTALLED_MDB_MODULE): $(PROTODIR)$(MDB_MODULE_DIR) $(BUILT_MDB_MODULE)
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater $(INSTALL_SCRIPT) -c -m 0555 $(BUILT_MDB_MODULE) $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INSTALLED_MDB_LINKS): $(PROTODIR)$(MDB_MODULE_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INSTALLED_MDB_SCRIPTS): $(BUILT_MDB_SCRIPTS) $(PROTODIR)$(MDB_SCRIPT_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(INSTALL_SCRIPT) -c -m 0555 $(MDB_SOURCE_DIR)/scripts/$(@F) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(INSTALL_SCRIPT) -c -m 0444 $(MDB_SOURCE_DIR)/README \