Makefile revision 177
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein###############################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Xorg server Makefile
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Use subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Permission is hereby granted, free of charge, to any person obtaining a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copy of this software and associated documentation files (the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "Software"), to deal in the Software without restriction, including
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# without limitation the rights to use, copy, modify, merge, publish,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# distribute, and/or sell copies of the Software, and to permit persons
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# to whom the Software is furnished to do so, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# copyright notice(s) and this permission notice appear in all copies of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the Software and that both the above copyright notice(s) and this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# @(#)Makefile 1.47 07/06/15
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Package name used in tarballs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Version number (used in path names)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Source tarball
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic UpdaterSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Patches to apply to source after unpacking, in order
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Directory created by unpacking source
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Prefix for installation
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Man pages to apply Sun footer to & attributes to list
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# XXX: Need to adjust some of these to correct packages/stability
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Binary built in tree
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Merge in additional sources from sun-src directory
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserMESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserMODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserDRI_MODULES_DIR='$${libdir}/modules/dri$(MODULE_subdir)'
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Command line options to GNU autoconf configure script
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# XXX: --disable-dga
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User --prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --enable-kdrive --enable-xephyr --disable-xsdl \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --with-vendor-name="Sun Microsystems, Inc." \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --with-vendor-web="http://sunsolve.sun.com/" \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User --with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCONFIG_OPTS_i386=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Need to append header path with gcc headers for MMX/SSE intrinsics
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserGCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Default DPMS settings for Solaris
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserDPMS_DEFINES= -DDEFAULT_STANDBY_TIME=1440000 \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Uncomment to build debug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# OPT_CFLAGS = -g
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Environment variable options to GNU autoconf configure script
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserLDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserCONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserCONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCONFIG_ENV_sparc= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserCONFIG_ENV_i386= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserACLOCAL_PATH=aclocal -I $(PROTODIR)/usr/X11/share/aclocal
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Run configure script
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User (cd $(SOURCE_DIR) && ACLOCAL="$(ACLOCAL_PATH)" autoreconf \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User && $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Environment variable options to use when building
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User#LD_OPTIONS="-z textwarn"
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews#ifdef _LP64\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#define _XSERVER64 1\
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
71c66a876ecca77923638d3f94cc0783152b2f03Mark 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' >> $@