Makefile revision 1088
98N/A###############################################################################
98N/A#
98N/A# Xorg server Makefile
98N/A#
1088N/A# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
98N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
98N/A#
98N/A#
98N/A
235N/A# Build 32-bit or 64-bit?
156N/ABUILD_TYPES_SET=yes
156N/ABUILD_TYPES_sparc=64
156N/ABUILD_TYPES_i386=32 64
156N/ABUILD_TYPES=$(BUILD_TYPES_$(MACH))
98N/A
98N/A# Package name used in tarballs
98N/AMODULE_NAME=xorg-server
98N/A
493N/A# Version number (used in path names)
493N/AMODULE_VERSION=$(XORGSERVER_VERS)
98N/A
911N/A# Checksums for upstream tarball
1088N/ATARBALL_MD5 = 040f091dfdfb4e335116eb0032cc690b
1088N/ATARBALL_SHA1 = e8d5776fe973f15c0e907fd827106f8d296acf7e
911N/A
98N/A# Patches to apply to source after unpacking, in order
235N/A# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
493N/ASOURCE_PATCHES=$(XORG_SOURCE_PATCHES)
98N/A
916N/A# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
916N/A# to allow for different source layouts
916N/AXORG_BUILD_DIR=$(SOURCE_DIR)
916N/A
970N/A# ARC cases that covered this module
970N/A# PSARC/2004/187 Xorg Server for Solaris
970N/AMODULE_ARC_CASES = PSARC/2004/187
970N/A# PSARC/2004/685 Xorg server upgrade to X11R6.8 release
970N/AMODULE_ARC_CASES += PSARC/2004/685
970N/A# PSARC/2004/829 Xorg 6.8.2 server upgrade for Solaris
970N/AMODULE_ARC_CASES += PSARC/2004/829
970N/A# PSARC/2005/450 Xorg 6.9 for Solaris
970N/AMODULE_ARC_CASES += PSARC/2005/450
970N/A# PSARC/2006/609 Xserver provider for DTrace
970N/AMODULE_ARC_CASES += PSARC/2006/609
970N/A# PSARC/2007/051 Xorg server upgrade to 7.2
970N/AMODULE_ARC_CASES += PSARC/2007/051
970N/A# PSARC/2007/434 Xorg server 1.3
970N/AMODULE_ARC_CASES += PSARC/2007/434
970N/A# PSARC/2007/500 X11 MIT-SHM Extension across zones
970N/AMODULE_ARC_CASES += PSARC/2007/500
970N/A# PSARC/2008/294 Xorg driver selection based on VIS_GETIDENTIFIER
970N/AMODULE_ARC_CASES += PSARC/2008/294
970N/A# PSARC/2009/021 Xorg server 1.5
970N/AMODULE_ARC_CASES += PSARC/2009/021
970N/A# PSARC/2009/292 Xorg server 1.6
970N/AMODULE_ARC_CASES += PSARC/2009/292
970N/A# PSARC/2009/679 Xorg server 1.7
970N/AMODULE_ARC_CASES += PSARC/2009/679
1029N/A# PSARC/2010/109 Introduce libXcb in Solaris
1029N/AMODULE_ARC_CASES += PSARC/2010/109
970N/A
98N/A# Man pages to apply Sun footer to & attributes to list
98N/A# XXX: Need to adjust some of these to correct packages/stability
98N/ASUNTOUCHED_MANPAGES= \
606N/A hw/kdrive/ephyr/Xephyr.man.pre \
98N/A hw/xfree86/utils/gtf/gtf.man.pre \
98N/A hw/xfree86/utils/cvt/cvt.man.pre \
98N/A hw/xfree86/doc/man/Xorg.man.pre \
606N/A hw/xfree86/doc/man/xorg.conf.man.pre \
606N/A hw/vfb/Xvfb.man.pre
98N/A
493N/AMODULE_STABILITY=Volatile
98N/A
970N/A# Override specific attributes for specific man pages
970N/AMODULE_SUNTOUCH_MAN_FLAGS= \
970N/A $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
1026N/A# Xephyr, Xvfb, and Xdmx are split out into their own packages
970N/ASUNTOUCH_MAN_FLAGS_Xephyr = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xephyr)}'
970N/ASUNTOUCH_MAN_FLAGS_Xvfb = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xvfb)}'
1026N/ASUNTOUCH_MAN_FLAGS_Xdmx = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xdmx)}'
970N/A
1003N/A# Used in sun-manpage.patch to set distro name in Xserver man page
1003N/A# DISTRO_NAME is set in open-src/common/Makefile.options.*
1003N/AMODULE_BUILD_ENV = DISTRO_NAME="$(DISTRO_NAME)"
1003N/A
98N/A# Binary built in tree
98N/AXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
98N/A
908N/ABUILD_TARGETS=$(XORGSERVER_BIN) build_mdb set-elf-comments \
591N/A $(BUILD_DIR)/mapfile-Xorg-externs
493N/ABUILD_TARGETS_SET=yes
493N/A
493N/A# Need to regenerate autoconf/automake files after patching
493N/AAUTORECONF=yes
493N/A
493N/A# Command line options to GNU autoconf configure script
493N/A# Need to override LD setting to add -xarch flags that libtool strips
493N/A# XXX: --disable-dga
493N/AMODULE_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
1026N/A --enable-dmx \
705N/A --enable-builddocs \
493N/A --enable-kdrive --enable-xephyr --disable-xsdl \
557N/A MKFONTDIR="$(MKFONTDIR)" \
557N/A MKFONTSCALE="$(MKFONTSCALE)" \
493N/A LD="$(CC) $(ARCH_FLAGS)"
493N/A
965N/AMODULE_LDFLAGS = $(XSERVER_LDFLAGS)
965N/AMODULE_LD_OPTIONS = $(MAPFILES_FOR_ALL)
965N/A
606N/A# pkg-config files that need to have -R added
606N/AFIX_PC_FILES=xorg-server.pc.in
851N/A# Remove compiler specific visibility flag that breaks builds of drivers
851N/A# with other compilers
851N/AMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
851N/A
851N/A# Need to use GNU Make to build due to hw/xfree86/loader
851N/AMODULE_MAKE=$(GNUMAKE)
851N/AMODULE_MAKE_SET=yes
98N/A
591N/A# Additional install targets beyond the defaults
963N/AMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common \
963N/A install_fix_paths
851N/AEXTRA_INSTALL_sparc=install_pc_copy
970N/AEXTRA_INSTALL_i386=install_i386_bincompat_link
910N/AMODULE_ADD_INSTALL_TARGETS += $(EXTRA_INSTALL_$(MACH))
910N/A
910N/A# Have to avoid dependency loop between install_pc_copy and
910N/A# install_pkgconfig_uninstalled
910N/AINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_copy=)
910N/AINSTALL_PCU_DEPS_SET=yes
98N/A
98N/A# Merge in additional sources from sun-src directory
910N/AADDITIONAL_SOURCE_DIR=sun-src
910N/A
970N/A# Compatibility links from /usr/X11/bin to /usr/bin
1030N/A# Only needed for programs that were in /usr/X11/bin before we moved
1030N/AMODULE_X11_BINCOMPAT_LINKS = Xorg Xephyr Xvfb cvt gtf
970N/AMODULE_X11_BINCOMPAT_LINKS_i386 = amd64
970N/AMODULE_X11_BINCOMPAT_LINKS += $(MODULE_X11_BINCOMPAT_LINKS_$(MACH))
970N/A
1030N/A# Binaries that are linked to isaexec on x86 to choose 32-bit or 64-bit
1030N/ALINKED_TO_ISAEXEC = Xorg Xephyr Xvfb Xdmx
1030N/A
1030N/A# When both 32-bit & 64-bit are built, only one copy of these programs (mostly
1030N/A# scripts) are needed, so move the 32-bit one to /usr/bin instead of linking
1030N/A# to isaexec.
1030N/ANOT_LINKED_TO_ISAEXEC = cvt gtf \
1088N/A dmxaddinput dmxaddscreen dmxinfo dmxreconfig dmxresize dmxrminput \
1088N/A dmxrmscreen dmxtodmx dmxwininfo vdltodmx xdmxconfig
1030N/A
1030N/A# Steps that need to complete before the install_fix_paths in ../Makefile.inc
1030N/A# is run to do the above isaexec fixes
1030N/AINSTALL_FIX_PATHS_DEPS = default_install
1030N/A
910N/Ainclude ../Makefile.inc
98N/A
606N/A$(XORGSERVER_BIN): default_build
98N/A
606N/ASDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
98N/A
591N/Ainstall_extras: default_install
851N/A -rm -f $(SDK_INCLUDES_DIR)/xorg-server.h
111N/A sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
606N/A $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
1088N/A cp -pf $(SOURCE_DIR)/mi/mioverlay.h \
1088N/A $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h \
1088N/A $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
733N/A mkdir -p $(PROTODIR)$(X11_MAN_DIR)/man1
970N/A cp -pf $(SOURCE_DIR)/hw/xfree86/doc/man/xorgcfg.1 \
733N/A $(SOURCE_DIR)/hw/xfree86/doc/man/xorgconfig.1 \
733N/A $(PROTODIR)$(X11_MAN_DIR)/man1
963N/A mkdir -p $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor
851N/A cp -pf $(SOURCE_DIR)/config/x11-input.fdi \
963N/A $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor/10-x11-input.fdi
1088N/A mkdir -p $(PROTODIR)/etc/X11/xorg.conf.d \
1088N/A $(PROTODIR)/etc/X11/xorg.conf.avail \
1088N/A $(PROTODIR)/usr/share/X11/xorg.conf.d
1088N/A cp -pf 90-zap.conf $(PROTODIR)/etc/X11/xorg.conf.avail
98N/A
851N/A# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
851N/A# builds
851N/Ainstall_pc_common: default_install
851N/A -rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
935N/A mkdir -p $(PROTODIR)$(PKGCONFIG_DIR)
851N/A cp -pf $(SOURCE_DIR)/xorg-server.pc \
851N/A $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
851N/A
212N/A# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
851N/Ainstall_pc_copy: install_pc_common install_pkgconfig_uninstalled
935N/A -rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
606N/A $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
935N/A mkdir -p $(PROTODIR)$(PKGCONFIG_DIR_32)
935N/A ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
935N/A ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
935N/A $(PROTODIR)$(PKGCONFIG_DIR_32)/
212N/A
98N/A$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
98N/A -rm -f $@
98N/A printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
98N/A printf '{\n global:\n' >> $@
182N/A /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' >> $@
98N/A printf '};\n' >> $@
908N/A
963N/A# Fix paths in proto area to match paths in packages / installed systems
963N/Ainstall_fix_paths_X: default_install
963N/A rm -f $(PROTODIR)$(MODULE_PREFIX)/bin/X \
963N/A $(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/X
963N/A ln -s Xserver $(PROTODIR)$(MODULE_PREFIX)/bin/X
963N/A
1030N/Ainstall_fix_paths: install_fix_paths_X
970N/A
970N/AMESA_MODULE_DIR = /usr/lib/mesa/modules/extensions$(SERVERMOD_subdir)
970N/AEXT_MODULE_DIR = $(X11_SERVERMODS_DIR)/extensions$(SERVERMOD_subdir)
970N/A
970N/Ainstall_fix_paths_glxmodule: default_install
970N/A @rm -f $(PROTODIR)$(MESA_MODULE_DIR)/libglx.so
970N/A mkdir -p $(PROTODIR)$(MESA_MODULE_DIR)/
970N/A mv -f $(PROTODIR)$(EXT_MODULE_DIR)/libglx.so \
970N/A $(PROTODIR)$(MESA_MODULE_DIR)/libglx.so
970N/A ln -s ../../../../..$(SERVERMOD_subdir:$(SUBDIR64)=..)/var/run/opengl/server/$(SERVERMOD_subdir)/libglx.so \
970N/A $(PROTODIR)$(EXT_MODULE_DIR)/libglx.so
970N/A
970N/Ainstall_fix_paths: install_fix_paths_glxmodule
970N/A
1026N/A# Install metadata for Xephyr, Xvfb, Xdmx, & xtsol packages too
974N/AXCOMMON_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xserver-common)
970N/AXEPHYR_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xephyr)
970N/AXVFB_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xvfb)
1026N/AXDMX_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xdmx)
970N/AXTSOL_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-server-xorg=%-trusted-trusted-xorg)
970N/A
974N/AEXTRA_METADATA_DIRS = $(XCOMMON_PKG_METADATA_DIR) \
974N/A $(XEPHYR_PKG_METADATA_DIR) \
970N/A $(XVFB_PKG_METADATA_DIR) \
1026N/A $(XDMX_PKG_METADATA_DIR) \
970N/A $(XTSOL_PKG_METADATA_DIR)
970N/A
970N/AEXTRA_ATTRDATA_FILES = $(EXTRA_METADATA_DIRS:%=%/$(ATTRDATA_FILE_NAME))
970N/AEXTRA_LICENSE_FILES = $(EXTRA_METADATA_DIRS:%=%/$(LICENSE_FILE_NAME))
970N/A
970N/AEXTRA_METADATA_TARGETS= $(EXTRA_METADATA_DIRS) \
970N/A $(EXTRA_ATTRDATA_FILES) \
970N/A $(EXTRA_LICENSE_FILES)
970N/A
970N/Ainstall_metadata: $(EXTRA_METADATA_TARGETS)
970N/A
970N/A$(EXTRA_ATTRDATA_FILES) $(EXTRA_LICENSE_FILES): $(EXTRA_METADATA_DIRS)
970N/A
970N/A$(EXTRA_METADATA_DIRS):
970N/A mkdir -p $@
970N/A
1003N/A# Xtsol module is covered only by Oracle copyright/license
1003N/AXTSOL_LICENSE = $(XTSOL_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
1003N/A$(XTSOL_LICENSE):= LICENSE_NAME = $(ORACLE_LICENSE_NAME)
1003N/A$(XTSOL_LICENSE):= LICENSE_FILE = COPYING.tsol
1003N/A$(XTSOL_LICENSE):= LICENSE_APPEND = $(ORACLE_LICENSE_APPEND)
1003N/A
970N/A# Special compatibility link from /usr/X11/bin/i386 to /usr/bin/i86
970N/Ainstall_i386_bincompat_link: $(X11_BINCOMPAT_DIR)/i386
970N/A
970N/A$(X11_BINCOMPAT_DIR)/i386: $(X11_BINCOMPAT_DIR)
970N/A @rm -f $@
970N/A ln -s ../../bin/i86 $@
970N/A
970N/A# Special compatibility links from /usr/X11/include to /usr/include
970N/AX11_INCLUDE_COMPAT_DIR = $(PROTODIR)/usr/X11/include
970N/AX11_INCLUDE_COMPAT_LINKS = $(X11_INCLUDE_COMPAT_DIR)/drm \
970N/A $(X11_INCLUDE_COMPAT_DIR)/xorg
970N/A
970N/Ainstall: $(X11_INCLUDE_COMPAT_LINKS)
970N/A
970N/A$(X11_INCLUDE_COMPAT_DIR):
970N/A mkdir -p $@
970N/A
970N/A$(X11_INCLUDE_COMPAT_LINKS): $(X11_INCLUDE_COMPAT_DIR)
970N/A @rm -f $@
970N/A ln -s ../../include/$(@F) $@
1030N/A
1030N/A## mdb module rules
1030N/A# Build & install mdb modules & scripts that aren't integrated to
1030N/A# normal build process.
1030N/AMDB_SOURCE_DIR=$(XORG_BUILD_DIR)/os/solaris/mdb
1030N/AMDB_MODULE_DIR=/usr/lib/mdb/proc/$(ARCHLIBSUBDIR)
1030N/AMDB_SCRIPT_DIR=/usr/demo/Xserver/mdb
1030N/AMDB_SCRIPTS=list_Xserver_clients \
1030N/A list_Xserver_devicegrab_client \
1030N/A list_Xserver_servergrab_client
1030N/AMDB_MODULE_NAMES=Xephyr Xorg Xvfb Xvnc Xdmx
1030N/A
1030N/ABUILT_MDB_MODULE=$(MDB_SOURCE_DIR)/modules/Xserver.so
1030N/ABUILT_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(MDB_SOURCE_DIR)/scripts/%)
1030N/A
1030N/AINSTALLED_MDB_LINKS=$(MDB_MODULE_NAMES:%=$(PROTODIR)$(MDB_MODULE_DIR)/%.so)
1030N/AINSTALLED_MDB_MODULE=$(PROTODIR)$(MDB_MODULE_DIR)/Xserver.so
1030N/AINSTALLED_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(PROTODIR)$(MDB_SCRIPT_DIR)/%)
1030N/AINSTALLED_MDB_ALL=$(INSTALLED_MDB_MODULE) $(INSTALLED_MDB_LINKS) \
1030N/A $(INSTALLED_MDB_SCRIPTS)
1030N/A
1030N/A# Since configure options aren't used to build the mdb modules, pass
1030N/A# those variables at build time
1030N/AMDB_BUILD_ENV=$(CONFIG_ENV) $(BUILD_ENV)
1030N/A
1030N/Abuild_mdb: $(BUILT_MDB_MODULE)
1030N/A
1030N/A$(BUILT_MDB_SCRIPTS): $(SOURCE_TARGETS)
1030N/A
1030N/A$(BUILT_MDB_MODULE): $(CONFIGURE_TARGETS)
1030N/A (cd $(MDB_SOURCE_DIR) ; \
1030N/A $(MDB_BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
1030N/A
1030N/A$(PROTODIR)$(MDB_MODULE_DIR) $(PROTODIR)$(MDB_SCRIPT_DIR):
1030N/A mkdir -p $@
1030N/A
1030N/A$(INSTALLED_MDB_MODULE): $(PROTODIR)$(MDB_MODULE_DIR) $(BUILT_MDB_MODULE)
1030N/A $(INSTALL_SCRIPT) -c -m 0555 $(BUILT_MDB_MODULE) $@
1030N/A
1030N/A$(INSTALLED_MDB_LINKS): $(PROTODIR)$(MDB_MODULE_DIR)
1030N/A @rm -f $@
1030N/A ln -s Xserver.so $@
1030N/A
1030N/A$(INSTALLED_MDB_SCRIPTS): $(BUILT_MDB_SCRIPTS) $(PROTODIR)$(MDB_SCRIPT_DIR)
1030N/A $(INSTALL_SCRIPT) -c -m 0555 $(MDB_SOURCE_DIR)/scripts/$(@F) \
1030N/A $(PROTODIR)$(MDB_SCRIPT_DIR)/
1030N/A
1030N/Ainstall_mdb: $(INSTALLED_MDB_ALL)
1030N/A $(INSTALL_SCRIPT) -c -m 0444 $(MDB_SOURCE_DIR)/README \
1030N/A $(PROTODIR)$(MDB_SCRIPT_DIR)/