Makefile revision 935
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley###############################################################################
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Xorg server Makefile
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the "Software"),
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# to deal in the Software without restriction, including without limitation
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and/or sell copies of the Software, and to permit persons to whom the
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# Software is furnished to do so, subject to the following conditions:
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# The above copyright notice and this permission notice (including the next
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# paragraph) shall be included in all copies or substantial portions of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# DEALINGS IN THE SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Build 32-bit or 64-bit?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Package name used in tarballs
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Version number (used in path names)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Checksums for upstream tarball
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARBALL_SHA1 = 77a8c3dec86960e1be818df3a75d69b5fad6a3c0
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Patches to apply to source after unpacking, in order
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Used in rules shared between Xorg & Xvnc builds in Makefile.inc
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews# to allow for different source layouts
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Man pages to apply Sun footer to & attributes to list
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# XXX: Need to adjust some of these to correct packages/stability
b0e8629055a766d4555a005a283c2889a5974945Mark AndrewsMODULE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Binary built in tree
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinBUILD_TARGETS=$(XORGSERVER_BIN) build_mdb 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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein --enable-kdrive --enable-xephyr --disable-xsdl \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# pkg-config files that need to have -R added
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Remove compiler specific visibility flag that breaks builds of drivers
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# with other compilers
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_FIX_PC_FLAGS= -e 's|\@symbol_visibility\@||'
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Need to use GNU Make to build due to hw/xfree86/loader
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Additional install targets beyond the defaults
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_ADD_INSTALL_TARGETS += $(EXTRA_INSTALL_$(MACH))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Have to avoid dependency loop between install_pc_copy and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# install_pkgconfig_uninstalled
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinINSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_copy=)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Merge in additional sources from sun-src directory
c247e3f281613fabe1af362e9f3157e35ebbe52cMark AndrewsSDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#ifdef _LP64\
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#define _XSERVER64 1\
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(SOURCE_DIR)/include/xorg-server.h > $(SDK_INCLUDES_DIR)/xorg-server.h
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/mi/mioverlay.h $(SDK_INCLUDES_DIR)/mioverlay.h
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/hw/xfree86/os-support/bus/xf86Sbus.h $(SDK_INCLUDES_DIR)/xf86Sbus.h
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/hw/xfree86/dri/*.h $(SDK_INCLUDES_DIR)/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -rm -f $(SDK_INCLUDES_DIR)/xf1bpp.h $(SDK_INCLUDES_DIR)/xf4bpp.h
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cp -pf $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein mkdir -p $(PROTODIR)$(X11_DIR)/share/hal/fdi/policy/10osvendor
b0e8629055a766d4555a005a283c2889a5974945Mark 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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
b0e8629055a766d4555a005a283c2889a5974945Mark 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' >> $@