Makefile revision 1193
98N/A###############################################################################
98N/A#
98N/A# Xorg server Makefile
98N/A#
908N/A# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
733N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
98N/A# copy of this software and associated documentation files (the "Software"),
98N/A# to deal in the Software without restriction, including without limitation
98N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
98N/A# and/or sell copies of the Software, and to permit persons to whom the
98N/A# Software is furnished to do so, subject to the following conditions:
98N/A#
98N/A# The above copyright notice and this permission notice (including the next
98N/A# paragraph) shall be included in all copies or substantial portions of the
98N/A# Software.
98N/A#
98N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
98N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
98N/A# DEALINGS IN THE SOFTWARE.
98N/A#
98N/A#
98N/A
98N/A# Package name used in tarballs
98N/AMODULE_NAME=xorg-server
98N/A
98N/A# Version number (used in path names)
98N/AMODULE_VERSION=$(XORGSERVER_VERS)
98N/A
98N/A# Checksums for upstream tarball
235N/ATARBALL_MD5 = fc1bb18a09244cd43a998625a6a1b071
156N/ATARBALL_SHA1 = 1699be5c0edeca553cfa3ee6caa228483465136b
156N/ATARBALL_SHA256 = 05ec05fbc8ec336127071db38cfb61c618e43b720edbd8d51d171c0cd359e290
156N/A
156N/A# Patches to apply to source after unpacking, in order
98N/A# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
98N/ASOURCE_PATCHES=$(XORG_SOURCE_PATCHES)
98N/A
98N/A# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
493N/A# to allow for different source layouts
493N/AXORG_BUILD_DIR=$(SOURCE_DIR)
98N/A
98N/A# ARC cases that covered this module
235N/A# PSARC/2004/187 Xorg Server for Solaris
493N/AMODULE_ARC_CASES = PSARC/2004/187
98N/A# PSARC/2004/685 Xorg server upgrade to X11R6.8 release
98N/AMODULE_ARC_CASES += PSARC/2004/685
98N/A# PSARC/2004/829 Xorg 6.8.2 server upgrade for Solaris
98N/AMODULE_ARC_CASES += PSARC/2004/829
606N/A# PSARC/2005/450 Xorg 6.9 for Solaris
98N/AMODULE_ARC_CASES += PSARC/2005/450
98N/A# PSARC/2006/609 Xserver provider for DTrace
98N/AMODULE_ARC_CASES += PSARC/2006/609
606N/A# PSARC/2007/051 Xorg server upgrade to 7.2
606N/AMODULE_ARC_CASES += PSARC/2007/051
98N/A# PSARC/2007/434 Xorg server 1.3
493N/AMODULE_ARC_CASES += PSARC/2007/434
493N/A# PSARC/2007/500 X11 MIT-SHM Extension across zones
493N/AMODULE_ARC_CASES += PSARC/2007/500
98N/A# PSARC/2008/294 Xorg driver selection based on VIS_GETIDENTIFIER
98N/AMODULE_ARC_CASES += PSARC/2008/294
98N/A# PSARC/2009/021 Xorg server 1.5
98N/AMODULE_ARC_CASES += PSARC/2009/021
908N/A# PSARC/2009/292 Xorg server 1.6
591N/AMODULE_ARC_CASES += PSARC/2009/292
493N/A# PSARC/2009/679 Xorg server 1.7
493N/AMODULE_ARC_CASES += PSARC/2009/679
493N/A# PSARC/2010/109 Introduce libXcb in Solaris
493N/AMODULE_ARC_CASES += PSARC/2010/109
493N/A# PSARC/2011/008 Xorg server 1.9
493N/AMODULE_ARC_CASES += PSARC/2011/008
493N/A# PSARC/2010/382 Removal of 32-bit X servers
493N/AMODULE_ARC_CASES += PSARC/2010/382
493N/A# PSARC/2011/214 Xorg server 1.10
705N/AMODULE_ARC_CASES += PSARC/2011/214
493N/A
557N/A# Man pages to apply Sun footer to & attributes to list
557N/ASUNTOUCHED_MANPAGES= \
493N/A doc/man/Xserver.man \
493N/A hw/kdrive/ephyr/man/Xephyr.man \
606N/A hw/xfree86/utils/man/cvt.man \
606N/A hw/xfree86/utils/man/gtf.man \
851N/A hw/xfree86/doc/man/Xorg.man \
851N/A hw/xfree86/doc/man/xorg.conf.man \
851N/A hw/xfree86/doc/man/xorg.conf.d.man \
851N/A hw/vfb/man/Xvfb.man
851N/A
851N/AMODULE_STABILITY=Volatile
851N/A
98N/A# Override specific attributes for specific man pages
591N/AMODULE_SUNTOUCH_MAN_FLAGS= \
910N/A $(SUNTOUCH_MAN_FLAGS_$(@F:%.man.$(FIXED_MAN_SUFFIX)=%))
851N/A# Xephyr, Xvfb, and Xdmx are split out into their own packages
591N/ASUNTOUCH_MAN_FLAGS_Xephyr = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xephyr)}'
910N/ASUNTOUCH_MAN_FLAGS_Xvfb = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xvfb)}'
910N/ASUNTOUCH_MAN_FLAGS_Xdmx = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xdmx)}'
910N/ASUNTOUCH_MAN_FLAGS_Xserver = -o '{Availability, $(MODULE_PKGNAME:%xorg=%xserver-common)}'
910N/A
910N/A# Binary built in tree
910N/AXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
98N/A
98N/ABUILD_TARGETS=$(XORGSERVER_BIN) build_mdb set-elf-comments \
910N/A $(BUILD_DIR)/mapfile-Xorg-externs
910N/ABUILD_TARGETS_SET=yes
910N/A
98N/A# Need to regenerate autoconf/automake files after patching
606N/AAUTORECONF=yes
98N/A
606N/A# Command line options to GNU autoconf configure script
98N/A# XXX: --disable-dga
591N/AMODULE_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
851N/A --enable-dmx \
111N/A --enable-builddocs \
111N/A --enable-kdrive --enable-xephyr --disable-xsdl \
111N/A MKFONTDIR="$(MKFONTDIR)" \
111N/A MKFONTSCALE="$(MKFONTSCALE)"
111N/A
606N/AMODULE_LDFLAGS = $(XSERVER_LDFLAGS)
851N/AMODULE_LD_OPTIONS = $(MAPFILES_FOR_ALL)
851N/A
851N/A# pkg-config files that need to have -R added
606N/AFIX_PC_FILES=xorg-server.pc.in
98N/A# Remove compiler specific visibility flag that breaks builds of drivers
851N/A# with other compilers
733N/AMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
733N/A
733N/A# Need to use GNU Make to build due to hw/xfree86/loader
733N/AMODULE_MAKE=$(GNUMAKE)
733N/AMODULE_MAKE_SET=yes
606N/A
851N/A# Additional configure time targets beyond the defaults
606N/AMODULE_ADD_CONFIGURE_TARGETS=clear_build_date
98N/A
851N/A# Additional install targets beyond the defaults
851N/AMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common \
851N/A install_fix_paths
851N/A
851N/A# Have to avoid dependency loop between install_pc_common and
851N/A# install_pkgconfig_uninstalled
851N/AINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_common=)
212N/AINSTALL_PCU_DEPS_SET=yes
851N/A
606N/A# Merge in additional sources from sun-src directory
606N/AADDITIONAL_SOURCE_DIR=sun-src
606N/A
606N/A# Compatibility links from /usr/X11/bin to /usr/bin
212N/A# Only needed for programs that were in /usr/X11/bin before we moved
98N/AMODULE_X11_BINCOMPAT_LINKS = Xorg Xephyr Xvfb cvt gtf
98N/AMODULE_X11_BINCOMPAT_LINKS_i386 = amd64
98N/AMODULE_X11_BINCOMPAT_LINKS += $(MODULE_X11_BINCOMPAT_LINKS_$(MACH))
98N/A
182N/A# Binaries that were linked to isaexec on x86 to choose 32-bit or 64-bit,
98N/A# now just symlinks from amd64 to parent directory
908N/ALINKED_TO_ISAEXEC = Xorg Xephyr Xvfb Xdmx
908N/A
908N/Ainclude ../Makefile.inc
908N/A
908N/A# Debug builds disable optimization that removes unused inline functions,
908N/A# leaving many binaries referencing pixman symbols that normally don't
908N/A# need them.
908N/A$(BUILD_DEBUG:yes=) DEBUG_CONFIG_OPTS = LIBS="-lpixman-1"
908N/A$(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_CONFIG_OPTS =
908N/AMODULE_CONFIG_OPTS += $(DEBUG_CONFIG_OPTS)
908N/A
908N/A# Don't include build date & time in delivered binaries as it just causes
908N/A# unnecessary binary differences to be pulled into package updates, but
908N/A# leave it in debug builds for developer convenience
908N/A$(BUILD_DEBUG:yes=$(POUND_SIGN)) CBD_TARGET = actually_clear_build_date
908N/A
908N/Aclear_build_date: $(CBD_TARGET)
908N/A
908N/Aactually_clear_build_date: $(AUTOCONF_TARGET)
908N/A printf '#undef BUILD_DATE\n#undef BUILD_TIME\n' > \
908N/A $(SOURCE_DIR)/hw/xfree86/common/xf86Build.h
908N/A
908N/A$(XORGSERVER_BIN): default_build
908N/A
908N/ASDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
908N/A
908N/Ainstall_extras: default_install
908N/A -rm -f $(SDK_INCLUDES_DIR)/xorg-server.h
908N/A sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
$(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
cp -pf $(SOURCE_DIR)/mi/mioverlay.h \
$(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h \
$(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
mkdir -p $(PROTODIR)$(X11_MAN_DIR)/man1
cp -pf $(SOURCE_DIR)/hw/xfree86/doc/man/xorgcfg.1 \
$(SOURCE_DIR)/hw/xfree86/doc/man/xorgconfig.1 \
$(PROTODIR)$(X11_MAN_DIR)/man1
mkdir -p $(PROTODIR)/etc/hal/fdi/preprobe/10osvendor
cp -pf $(SOURCE_DIR)/config/x11-input.fdi \
$(PROTODIR)/etc/hal/fdi/preprobe/10osvendor/10-x11-input.fdi
mkdir -p $(PROTODIR)/etc/X11/xorg.conf.d \
$(PROTODIR)/etc/X11/xorg.conf.avail \
$(PROTODIR)/usr/share/X11/xorg.conf.d
cp -pf 90-zap.conf $(PROTODIR)/etc/X11/xorg.conf.avail
# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
# builds, and install xorg-server.pc in 32-bit pkgconfig dir too
install_pc_common: default_install install_pkgconfig_uninstalled
-rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
mkdir -p $(PROTODIR)$(PKGCONFIG_DIR)
cp -pf $(SOURCE_DIR)/xorg-server.pc \
$(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
-rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
$(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
mkdir -p $(PROTODIR)$(PKGCONFIG_DIR_32)
ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
$(PROTODIR)$(PKGCONFIG_DIR_32)/
# Generate a list of exported functions & data objects so that we can verify
# loadable modules don't reference symbols that have been deleted or renamed.
SYMBOL_AWK_SCRIPT = \
'BEGIN { print "\043 Functions exported by Xorg server to loadable modules" ; \
print "\n{\n global:" } \
END { print "};" } \
$$7 ~ /UNDEF|\.tdata/ { next } \
$$5 !~ /GLOB/ { next } \
$$8 ~ /^(__|_end|_etext|_start|_environ|_lib_version)/ { next } \
$$4 ~ /FUNC/ && $$7 ~ /\.text/ { printf " %s = FUNCTION extern;\n", $$8 } \
$$4 ~ /OBJT/ && $$7 ~ /data|bss/ { printf " %s = DATA extern;\n", $$8}'
$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
-rm -f $@
/usr/bin/nm -gs $(XORGSERVER_BIN) \
$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)/libXfont.so | \
gawk -F\| $(SYMBOL_AWK_SCRIPT) > $@
# Fix paths in proto area to match paths in packages / installed systems
install_fix_paths_X: default_install
rm -f $(PROTODIR)$(MODULE_PREFIX)/bin/X \
$(PROTODIR)$(MODULE_PREFIX)/bin/$(ARCHBINSUBDIR)/X
ln -s Xserver $(PROTODIR)$(MODULE_PREFIX)/bin/X
install_fix_paths: install_fix_paths_X
MESA_MODULE_DIR = /usr/lib/mesa/modules/extensions
EXT_MODULE_DIR = $(X11_SERVERMODS_DIR)/extensions
install_fix_paths_glxmodule: default_install
@rm -f $(PROTODIR)$(MESA_MODULE_DIR)/libglx.so
mkdir -p $(PROTODIR)$(MESA_MODULE_DIR)/
mv -f $(PROTODIR)$(EXT_MODULE_DIR)/libglx.so \
$(PROTODIR)$(MESA_MODULE_DIR)/libglx.so
ln -s ../../../../../system/volatile/opengl/server/libglx.so \
$(PROTODIR)$(EXT_MODULE_DIR)/libglx.so
install_fix_paths: install_fix_paths_glxmodule
# Install metadata for Xephyr, Xvfb, Xdmx, & xtsol packages too
XCOMMON_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xserver-common)
XEPHYR_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xephyr)
XVFB_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xvfb)
XDMX_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-xorg=%-xdmx)
XTSOL_PKG_METADATA_DIR = $(MODULE_PKG_METADATA_DIR:%-server-xorg=%-trusted-trusted-xorg)
EXTRA_METADATA_DIRS = $(XCOMMON_PKG_METADATA_DIR) \
$(XEPHYR_PKG_METADATA_DIR) \
$(XVFB_PKG_METADATA_DIR) \
$(XDMX_PKG_METADATA_DIR) \
$(XTSOL_PKG_METADATA_DIR)
EXTRA_ATTRDATA_FILES = $(EXTRA_METADATA_DIRS:%=%/$(ATTRDATA_FILE_NAME))
EXTRA_LICENSE_FILES = $(EXTRA_METADATA_DIRS:%=%/$(LICENSE_FILE_NAME))
EXTRA_METADATA_TARGETS= $(EXTRA_METADATA_DIRS) \
$(EXTRA_ATTRDATA_FILES) \
$(EXTRA_LICENSE_FILES)
install_metadata: $(EXTRA_METADATA_TARGETS)
$(EXTRA_ATTRDATA_FILES) $(EXTRA_LICENSE_FILES): $(EXTRA_METADATA_DIRS)
$(EXTRA_METADATA_DIRS):
mkdir -p $@
# Xtsol module is covered only by Oracle copyright/license
XTSOL_LICENSE = $(XTSOL_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
$(XTSOL_LICENSE):= LICENSE_NAME = $(ORACLE_LICENSE_NAME)
$(XTSOL_LICENSE):= LICENSE_FILE = COPYING.tsol
$(XTSOL_LICENSE):= LICENSE_APPEND = $(ORACLE_LICENSE_APPEND)
# Special compatibility links from /usr/X11/include to /usr/include
X11_INCLUDE_COMPAT_DIR = $(PROTODIR)/usr/X11/include
X11_INCLUDE_COMPAT_LINKS = $(X11_INCLUDE_COMPAT_DIR)/drm \
$(X11_INCLUDE_COMPAT_DIR)/xorg
install: $(X11_INCLUDE_COMPAT_LINKS)
$(X11_INCLUDE_COMPAT_DIR):
mkdir -p $@
$(X11_INCLUDE_COMPAT_LINKS): $(X11_INCLUDE_COMPAT_DIR)
@rm -f $@
ln -s ../../include/$(@F) $@
## mdb module rules
# Build & install mdb modules & scripts that aren't integrated to
# normal build process.
MDB_SOURCE_DIR=$(XORG_BUILD_DIR)/os/solaris/mdb
MDB_MODULE_DIR=/usr/lib/mdb/proc/$(ARCHLIBSUBDIR)
MDB_SCRIPT_DIR=/usr/demo/Xserver/mdb
MDB_SCRIPTS=list_Xserver_clients \
list_Xserver_devicegrab_client \
list_Xserver_servergrab_client
MDB_MODULE_NAMES=Xephyr Xorg Xvfb Xvnc Xdmx
BUILT_MDB_MODULE=$(MDB_SOURCE_DIR)/modules/Xserver.so
BUILT_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(MDB_SOURCE_DIR)/scripts/%)
INSTALLED_MDB_LINKS=$(MDB_MODULE_NAMES:%=$(PROTODIR)$(MDB_MODULE_DIR)/%.so)
INSTALLED_MDB_MODULE=$(PROTODIR)$(MDB_MODULE_DIR)/Xserver.so
INSTALLED_MDB_SCRIPTS=$(MDB_SCRIPTS:%=$(PROTODIR)$(MDB_SCRIPT_DIR)/%)
INSTALLED_MDB_ALL=$(INSTALLED_MDB_MODULE) $(INSTALLED_MDB_LINKS) \
$(INSTALLED_MDB_SCRIPTS)
# Since configure options aren't used to build the mdb modules, pass
# those variables at build time
MDB_BUILD_ENV=$(CONFIG_ENV) $(BUILD_ENV)
MDB_BUILD_ENV += CFLAGS="$(LIB_CFLAGS)" LDFLAGS="$(LIB_LDFLAGS)"
build_mdb: $(BUILT_MDB_MODULE)
$(BUILT_MDB_SCRIPTS): $(SOURCE_TARGETS)
$(BUILT_MDB_MODULE): $(CONFIGURE_TARGETS)
(cd $(MDB_SOURCE_DIR) ; \
$(MDB_BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
$(PROTODIR)$(MDB_MODULE_DIR) $(PROTODIR)$(MDB_SCRIPT_DIR):
mkdir -p $@
$(INSTALLED_MDB_MODULE): $(PROTODIR)$(MDB_MODULE_DIR) $(BUILT_MDB_MODULE)
$(INSTALL_SCRIPT) -c -m 0555 $(BUILT_MDB_MODULE) $@
$(INSTALLED_MDB_LINKS): $(PROTODIR)$(MDB_MODULE_DIR)
@rm -f $@
ln -s Xserver.so $@
$(INSTALLED_MDB_SCRIPTS): $(BUILT_MDB_SCRIPTS) $(PROTODIR)$(MDB_SCRIPT_DIR)
$(INSTALL_SCRIPT) -c -m 0555 $(MDB_SOURCE_DIR)/scripts/$(@F) \
$(PROTODIR)$(MDB_SCRIPT_DIR)/
install_mdb: $(INSTALLED_MDB_ALL)
$(INSTALL_SCRIPT) -c -m 0444 $(MDB_SOURCE_DIR)/README \
$(PROTODIR)$(MDB_SCRIPT_DIR)/