Makefile revision 1360
9c4e79e1c3fce91054fd3d00750a48f79d123341niq###############################################################################
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Xorg server Makefile
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Permission is hereby granted, free of charge, to any person obtaining a
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# copy of this software and associated documentation files (the "Software"),
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# to deal in the Software without restriction, including without limitation
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# and/or sell copies of the Software, and to permit persons to whom the
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Software is furnished to do so, subject to the following conditions:
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# The above copyright notice and this permission notice (including the next
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# paragraph) shall be included in all copies or substantial portions of the
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Software.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
74a027db9e9476e96b37e22c0b06407e23335e3csf# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# DEALINGS IN THE SOFTWARE.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Package name used in tarballs
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Package metadata
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Version number (used in path names) - set in open-src/common/Makefile.init
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Checksums for upstream tarball
9c4e79e1c3fce91054fd3d00750a48f79d123341niqTARBALL_SHA256= a5adb02571efb7d7459dde83286a3adb77dfd1a52a7348e75d2dc72d6f8d28aa
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Patches to apply to source after unpacking, in order
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
1861c6caddf9043aff6d7b1a9e2ffb515be652ffniq# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# to allow for different source layouts
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# ARC cases that covered this module
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2004/187 Xorg Server for Solaris
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2004/685 Xorg server upgrade to X11R6.8 release
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2004/829 Xorg 6.8.2 server upgrade for Solaris
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2005/450 Xorg 6.9 for Solaris
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2006/609 Xserver provider for DTrace
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2007/051 Xorg server upgrade to 7.2
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2007/434 Xorg server 1.3
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2007/500 X11 MIT-SHM Extension across zones
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2008/294 Xorg driver selection based on VIS_GETIDENTIFIER
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# PSARC/2009/021 Xorg server 1.5
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2009/292 Xorg server 1.6
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2009/679 Xorg server 1.7
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2010/109 Introduce libXcb in Solaris
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2011/008 Xorg server 1.9
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2010/382 Removal of 32-bit X servers
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# PSARC/2011/214 Xorg server 1.10
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# PSARC/2012/144 Xorg server 1.12
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# PSARC/2012/320 Xorg server 1.13
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# PSARC/2013/091 Xorg server 1.14
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Man pages to apply Sun footer to & attributes to list
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Override specific attributes for specific man pages
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Xephyr, Xvfb, and Xdmx are split out into their own packages
9c4e79e1c3fce91054fd3d00750a48f79d123341niqSUNTOUCH_MAN_FLAGS_Xephyr = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xephyr)}'
9c4e79e1c3fce91054fd3d00750a48f79d123341niqSUNTOUCH_MAN_FLAGS_Xvfb = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xvfb)}'
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonSUNTOUCH_MAN_FLAGS_Xdmx = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xdmx)}'
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonSUNTOUCH_MAN_FLAGS_Xserver = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xserver-common)}'
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Binary built in tree
9c4e79e1c3fce91054fd3d00750a48f79d123341niqBUILD_TARGETS=$(XORGSERVER_BIN) build_mdb set-elf-comments \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Need to convert dtrace docs from xml to text/html ourselves, since
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Solaris doesn't bundle the xmlto tool used upstream
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Need to regenerate autoconf/automake files after patching
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Command line options to GNU autoconf configure script
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# XXX: --disable-dga
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Pass linker mapfile listing symbols that modules can count on resolving
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# from the Xorg binary itself
9c4e79e1c3fce91054fd3d00750a48f79d123341niqMODULE_BUILD_ENV = XORG_EXTERNS_FLAG='$(XORG_EXTERNS_FLAG)'
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Optimization doesn't always remove unused inline functions, leaving many
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# binaries referencing pixman symbols that normally don't need them. Using
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# -z ignore should ensure that it's not added when not really needed.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Adding -z muldefs for 16418361 - which should be removed once we fix that
9c4e79e1c3fce91054fd3d00750a48f79d123341niqMODULE_CONFIG_OPTS += LIBS="-z ignore -lpixman-1 -z muldefs"
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# pkg-config files that need to have -R added
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Remove compiler specific visibility flag that breaks builds of drivers
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# with other compilers
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Need to use GNU Make to build due to hw/xfree86/loader
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Additional configure time targets beyond the defaults
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Additional install targets beyond the defaults
9c4e79e1c3fce91054fd3d00750a48f79d123341niqMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Have to avoid dependency loop between install_pc_common and
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# install_pkgconfig_uninstalled
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_common=)
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Merge in additional sources from sun-src directory
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Only needed for programs that were in /usr/X11/bin before we moved
9c4e79e1c3fce91054fd3d00750a48f79d123341niqMODULE_X11_BINCOMPAT_LINKS += $(MODULE_X11_BINCOMPAT_LINKS_$(MACH))
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Binaries that were linked to isaexec on x86 to choose 32-bit or 64-bit,
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# now just symlinks from amd64 to parent directory
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Don't include build date & time in delivered binaries as it just causes
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# unnecessary binary differences to be pulled into package updates, but
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# leave it in debug builds for developer convenience
9c4e79e1c3fce91054fd3d00750a48f79d123341niq$(BUILD_DEBUG:yes=$(POUND_SIGN)) CBD_TARGET = actually_clear_build_date
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor/10-x11-input.fdi
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# builds, and install xorg-server.pc in 32-bit pkgconfig dir too
9c4e79e1c3fce91054fd3d00750a48f79d123341niqinstall_pc_common: default_install install_pkgconfig_uninstalled
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
74a027db9e9476e96b37e22c0b06407e23335e3csf ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Generate a list of exported functions & data objects so that we can verify
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# loadable modules don't reference symbols that have been deleted or renamed.
9c4e79e1c3fce91054fd3d00750a48f79d123341niq'BEGIN { print "\043 Functions exported by Xorg server to loadable modules" ; \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq print "\n\044mapfile_version 2\n\nSYMBOL_SCOPE {\n\tglobal:" } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq END { print "};" } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $$7 ~ /UNDEF|\.tdata/ { next } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $$5 !~ /GLOB/ { next } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $$8 ~ /^(__|_edata|_end|_etext|_start|_environ|_lib_version)/ { next } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $$4 ~ /FUNC/ && $$7 ~ /\.text/ { printf "\t\t%-40s { FLAGS = EXTERN };\n", $$8 } \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $$4 ~ /OBJT/ && $$7 ~ /data|bss/ { printf "\t\t%-40s { FLAGS = EXTERN };\n", $$8}'
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Fix paths in proto area to match paths in packages / installed systems
9c4e79e1c3fce91054fd3d00750a48f79d123341niq ln -s ../../../../../system/volatile/opengl/server/libglx.so \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# Install metadata for Xephyr, Xvfb, Xdmx, & xtsol packages too
9c4e79e1c3fce91054fd3d00750a48f79d123341niqXCOMMON_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xserver-common)
9c4e79e1c3fce91054fd3d00750a48f79d123341niqXEPHYR_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xephyr)
9c4e79e1c3fce91054fd3d00750a48f79d123341niqXVFB_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xvfb)
fc42512879dd0504532f52fe5d0d0383dda96a1eniqXDMX_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xdmx)
fc42512879dd0504532f52fe5d0d0383dda96a1eniqXTSOL_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-server-xorg=%-trusted-trusted-xorg)
fc42512879dd0504532f52fe5d0d0383dda96a1eniqEXTRA_ATTRDATA_FILES = $(EXTRA_METADATA_DIRS:%=%/$(ATTRDATA_FILE_NAME))
fc42512879dd0504532f52fe5d0d0383dda96a1eniqEXTRA_LICENSE_FILES = $(EXTRA_METADATA_DIRS:%=%/$(LICENSE_FILE_NAME))
fc42512879dd0504532f52fe5d0d0383dda96a1eniq$(EXTRA_ATTRDATA_FILES) $(EXTRA_LICENSE_FILES): $(EXTRA_METADATA_DIRS)
fc42512879dd0504532f52fe5d0d0383dda96a1eniq# Xtsol module is covered only by Oracle copyright/license
fc42512879dd0504532f52fe5d0d0383dda96a1eniqXTSOL_LICENSE = $(XTSOL_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton$(XTSOL_LICENSE):= LICENSE_INSERT = $(ORACLE_LICENSE_INSERT)
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Special compatibility links from /usr/X11/include to /usr/include
9c4e79e1c3fce91054fd3d00750a48f79d123341niqX11_INCLUDE_COMPAT_LINKS = $(X11_INCLUDE_COMPAT_DIR)/drm \
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton## mdb module rules
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Build & install mdb modules & scripts that aren't integrated to
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# normal build process.
9c4e79e1c3fce91054fd3d00750a48f79d123341niqBUILT_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(MDB_SOURCE_DIR)/scripts/%)
ef82e8fa164e0a1f8b813f7deb6b7ead96018c94niqINSTALLED_MDB_LINKS=$(MDB_MODULE_NAMES:%=$(PROTODIR)$(MDB_MODULE_DIR)/%.so)
9c4e79e1c3fce91054fd3d00750a48f79d123341niqINSTALLED_MDB_MODULE=$(PROTODIR)$(MDB_MODULE_DIR)/Xserver.so
9c4e79e1c3fce91054fd3d00750a48f79d123341niqINSTALLED_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(PROTODIR)$(MDB_SCRIPT_DIR)/%)
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jortonINSTALLED_MDB_ALL=$(INSTALLED_MDB_MODULE) $(INSTALLED_MDB_LINKS) \
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton# Since configure options aren't used to build the mdb modules, pass
9c4e79e1c3fce91054fd3d00750a48f79d123341niq# those variables at build time
9c4e79e1c3fce91054fd3d00750a48f79d123341niqMDB_BUILD_ENV += CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)"
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $(MDB_BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
9c4e79e1c3fce91054fd3d00750a48f79d123341niq$(PROTODIR)$(MDB_MODULE_DIR) $(PROTODIR)$(MDB_SCRIPT_DIR):
9c4e79e1c3fce91054fd3d00750a48f79d123341niq$(INSTALLED_MDB_MODULE): $(PROTODIR)$(MDB_MODULE_DIR) $(BUILT_MDB_MODULE)
9c4e79e1c3fce91054fd3d00750a48f79d123341niq$(INSTALLED_MDB_SCRIPTS): $(BUILT_MDB_SCRIPTS) $(PROTODIR)$(MDB_SCRIPT_DIR)
9c4e79e1c3fce91054fd3d00750a48f79d123341niq $(INSTALL_SCRIPT) -c -m 0555 $(MDB_SOURCE_DIR)/scripts/$(@F) \
9c4e79e1c3fce91054fd3d00750a48f79d123341niq## Dtrace docs rules
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton$(DTRACE_DOC_DIR)/Xserver-DTrace.xml: $(AUTOCONF_TARGET)
9c4e79e1c3fce91054fd3d00750a48f79d123341niqinstall_docs: $(DTRACE_DOCS) $(PROTODIR)$(MODULE_DOC_DIR)
6449c17ae9e13c61628f5f4da8c9a95768f0e9e9jorton $(INSTALL_SCRIPT) -c -m 0444 $(DTRACE_DOCS) $(PROTODIR)$(MODULE_DOC_DIR)