Makefile revision 122
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews###############################################################################
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Xorg server Makefile
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Use subject to license terms.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# copy of this software and associated documentation files (the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# "Software"), to deal in the Software without restriction, including
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# to whom the Software is furnished to do so, provided that the above
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# copyright notice(s) and this permission notice appear in all copies of
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# the Software and that both the above copyright notice(s) and this
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# permission notice appear in supporting documentation.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Except as contained in this notice, the name of a copyright holder
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or other dealings in this Software without prior written authorization
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# of the copyright holder.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# @(#)Makefile 1.35 07/03/12
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserBUILD_TYPES:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_TYPES_\1\)/'
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Package name used in tarballs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Version number (used in path names)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Source tarball
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Download site for source
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSOURCE_URL=$(XORG_RELEASES_URL)/xserver/$(SOURCE_TARBALL_NAME)
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User# Patches to apply to source after unpacking, in order
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User# Directory created by unpacking source
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox UserSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User# Prefix for installation
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User# Man pages to apply Sun footer to & attributes to list
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# XXX: Need to adjust some of these to correct packages/stability
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater hw/xfree86/utils/pcitweak/pcitweak.man.pre \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater hw/xfree86/utils/scanpci/scanpci.man.pre \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Binary built in tree
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Merge in additional sources from sun-src directory
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox UserMESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox UserMODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox User# Command line options to GNU autoconf configure script
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox User# XXX: enable xorgcfg --disable-dga enable security
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox User --prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
0e1dece22e128f9dfa723316a35c4b3f06912381Tinderbox User --bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews --with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews --with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCONFIG_OPTS_i86pc=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIG_OPTS:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_OPTS_\1\)/'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Need to append header path with gcc headers for MMX/SSE intrinsics
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsGCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Default DPMS settings for Solaris
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterDPMS_DEFINES= -DDEFAULT_STANDBY_TIME=1440000 \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# Uncomment to build debug
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# OPT_CFLAGS = -g
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# Environment variable options to GNU autoconf configure script
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterLDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
2628293c6edaa41ed1407c42bb196083901e087bAutomatic UpdaterCONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
2628293c6edaa41ed1407c42bb196083901e087bAutomatic Updater LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
2628293c6edaa41ed1407c42bb196083901e087bAutomatic Updater CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCONFIG_ENV_sun4= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIG_ENV_i86pc= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCONFIG_ENV:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_ENV_\1\)/'
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
6f1205897504b8f50b1785975482c995888dd630Tinderbox UserBUILD_64_FLAGS_sun4=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserBUILD_64_FLAGS_i86pc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
6f1205897504b8f50b1785975482c995888dd630Tinderbox UserBUILD_64_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_64_FLAGS_\1\)/'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Run configure script
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User (cd $(SOURCE_DIR) && automake && autoconf && \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Environment variable options to use when building
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#LD_OPTIONS="-z textwarn"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#ifdef _LP64\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#define _XSERVER64 1\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews /usr/ccs/bin/nm -g $(XORGSERVER_BIN) | 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' >> $@