Makefile revision 908
98N/A###############################################################################
98N/A#
98N/A# Xorg server Makefile
98N/A#
908N/A# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
733N/A# Use is subject to license terms.
98N/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
98N/A# "Software"), to deal in the Software without restriction, including
98N/A# without limitation the rights to use, copy, modify, merge, publish,
98N/A# distribute, and/or sell copies of the Software, and to permit persons
98N/A# to whom the Software is furnished to do so, provided that the above
98N/A# copyright notice(s) and this permission notice appear in all copies of
98N/A# the Software and that both the above copyright notice(s) and this
98N/A# permission notice appear in supporting documentation.
98N/A#
98N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
98N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
98N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
98N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
98N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
98N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
98N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
98N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
98N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
98N/A#
98N/A# Except as contained in this notice, the name of a copyright holder
98N/A# shall not be used in advertising or otherwise to promote the sale, use
98N/A# or other dealings in this Software without prior written authorization
98N/A# of the copyright holder.
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
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
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/ASUN_PACKAGE=SUNWxorg-server
493N/AMODULE_STABILITY=Volatile
493N/AMODULE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
98N/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) \
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
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
810N/Ainclude ../Makefile.inc
810N/A
591N/A# Additional install targets beyond the defaults
810N/A# - install_pc can't be in INSTALL_TARGETS or MODULE_ADD_INSTALL_TARGETS
810N/A# without causing a dependency loop that breaks dmake
851N/AEXTRA_INSTALL_sparc=install_pc_copy
591N/AEXTRA_INSTALL_i386=
851N/Ainstall_gen:: install_extras install_pc_common $(EXTRA_INSTALL_$(MACH))
908N/Ainstall_gen:: install_mdb
98N/A
98N/A# Merge in additional sources from sun-src directory
98N/Asource_gen:: $(LNDIR)
98N/A (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
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 */%' \
111N/A -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
111N/A#ifdef _LP64\
111N/A#define _XSERVER64 1\
111N/A#endif%' \
606N/A $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
851N/A cp -pf $(SOURCE_DIR)/mi/mioverlay.h $(SDK_INCLUDES_DIR)/mioverlay.h
851N/A cp -pf $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(SDK_INCLUDES_DIR)/xf86Sbus.h
851N/A cp -pf $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
606N/A -rm -f $(SDK_INCLUDES_DIR)/xf1bpp.h $(SDK_INCLUDES_DIR)/xf4bpp.h
98N/A mkdir -p $(PROTODIR)$(X11_DOC_DIR)
851N/A cp -pf $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
733N/A mkdir -p $(PROTODIR)$(X11_MAN_DIR)/man1
733N/A cp -pf $(SOURCE_DIR)/doc/Xnest.1 \
733N/A $(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
606N/A mkdir -p $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor
851N/A cp -pf $(SOURCE_DIR)/config/x11-input.fdi \
606N/A $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor/10-x11-input.fdi
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
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
606N/A cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server.pc \
606N/A $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc
606N/A cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server-uninstalled.pc \
606N/A $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
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
908N/A
908N/A# Build & install mdb modules & scripts that aren't integrated to
908N/A# normal build process
908N/AMDB_SOURCE_DIR=$(SOURCE_DIR)/os/solaris/mdb
908N/AMDB_MODULE_DIR=/usr/lib/mdb/proc/$(ARCHLIBSUBDIR)
908N/AMDB_SCRIPT_DIR=/usr/demo/Xserver/mdb
908N/AMDB_SCRIPTS=list_Xserver_clients \
908N/A list_Xserver_devicegrab_client \
908N/A list_Xserver_servergrab_client
908N/A
908N/A# Since configure options aren't used to build the mdb modules, pass
908N/A# those variables at build tie
908N/AMDB_BUILD_ENV=$(CONFIG_ENV) $(BUILD_ENV)
908N/A
908N/Abuild_mdb: $(MDB_SOURCE_DIR)/modules/Xserver.so
908N/A
908N/A$(MDB_SOURCE_DIR)/modules/Xserver.so: $(CONFIGURE_TARGETS)
908N/A (cd $(MDB_SOURCE_DIR) ; \
908N/A $(MDB_BUILD_ENV) $(MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
908N/A
908N/Ainstall_mdb: $(MDB_SOURCE_DIR)/modules/Xserver.so
908N/A mkdir -p $(PROTODIR)$(MDB_MODULE_DIR) $(PROTODIR)$(MDB_SCRIPT_DIR)
908N/A cp -pf $(MDB_SOURCE_DIR)/modules/Xserver.so \
908N/A $(PROTODIR)$(MDB_MODULE_DIR)/
908N/A cp -pf $(MDB_SCRIPTS:%=$(MDB_SOURCE_DIR)/scripts/%) \
908N/A $(PROTODIR)$(MDB_SCRIPT_DIR)/
908N/A chmod 0755 $(MDB_SCRIPTS:%=$(PROTODIR)$(MDB_SCRIPT_DIR)/%)
908N/A cp -pf $(MDB_SOURCE_DIR)/README $(PROTODIR)$(MDB_SCRIPT_DIR)/