Makefile revision 851
c40265eba0c99708887d68e67901924065ba2514Brian Wellington###############################################################################
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Xorg server Makefile
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Use is subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# copy of this software and associated documentation files (the
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# "Software"), to deal in the Software without restriction, including
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without limitation the rights to use, copy, modify, merge, publish,
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# to whom the Software is furnished to do so, provided that the above
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# the Software and that both the above copyright notice(s) and this
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# permission notice appear in supporting documentation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Except as contained in this notice, the name of a copyright holder
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# shall not be used in advertising or otherwise to promote the sale, use
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or other dealings in this Software without prior written authorization
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# of the copyright holder.
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# ident "@(#)Makefile 1.79 09/12/05 SMI"
557a0ad5156aefc96dce27978a920eadf85c9d55Mark Andrews# Build 32-bit or 64-bit?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package name used in tarballs
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Version number (used in path names)
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Patches to apply to source after unpacking, in order
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# Man pages to apply Sun footer to & attributes to list
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews# XXX: Need to adjust some of these to correct packages/stability
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Binary built in tree
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinBUILD_TARGETS=$(XORGSERVER_BIN) set-elf-comments \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Need to regenerate autoconf/automake files after patching
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Command line options to GNU autoconf configure script
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Need to override LD setting to add -xarch flags that libtool strips
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# XXX: --disable-dga
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews --enable-kdrive --enable-xephyr --disable-xsdl \
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews# pkg-config files that need to have -R added
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# Remove compiler specific visibility flag that breaks builds of drivers
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# with other compilers
3a3705ef7747327df182bf8d009333d2472253d5Mark AndrewsMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# Need to use GNU Make to build due to hw/xfree86/loader
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# Additional install targets beyond the defaults
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# - install_pc can't be in INSTALL_TARGETS or MODULE_ADD_INSTALL_TARGETS
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# without causing a dependency loop that breaks dmake
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrewsinstall_gen:: install_extras install_pc_common $(EXTRA_INSTALL_$(MACH))
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews# Merge in additional sources from sun-src directory
a057e8e33baa5fa369be28a9680585200ce3ff73Mark AndrewsSDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews#ifdef _LP64\
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews#define _XSERVER64 1\
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews cp -pf $(SOURCE_DIR)/mi/mioverlay.h $(SDK_INCLUDES_DIR)/mioverlay.h
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews cp -pf $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(SDK_INCLUDES_DIR)/xf86Sbus.h
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews cp -pf $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews -rm -f $(SDK_INCLUDES_DIR)/xf1bpp.h $(SDK_INCLUDES_DIR)/xf4bpp.h
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews cp -pf $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews $(SOURCE_DIR)/hw/xfree86/doc/man/xorgconfig.1 \
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews mkdir -p $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor/10-x11-input.fdi
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Workaround bug in installing pkgconfig file to wrong directory in 64-bit
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews -rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininstall_pc_copy: install_pc_common install_pkgconfig_uninstalled
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server.pc \
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server-uninstalled.pc \
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
3a3705ef7747327df182bf8d009333d2472253d5Mark Andrews$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark 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' >> $@