Makefile revision 128
3bf783a6d4627266d76b0ebdc05afdccb3d06ad0Mark Andrews###############################################################################
3bf783a6d4627266d76b0ebdc05afdccb3d06ad0Mark Andrews# Xorg server Makefile
a37e44f107f5f60d7e84de77eb33b13139bca03fMark Andrews# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
a37e44f107f5f60d7e84de77eb33b13139bca03fMark Andrews# Use subject to license terms.
2a35dc09d6c14f4041116766c0f7b60f41be0c9eMark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
2a35dc09d6c14f4041116766c0f7b60f41be0c9eMark Andrews# copy of this software and associated documentation files (the
2a35dc09d6c14f4041116766c0f7b60f41be0c9eMark Andrews# "Software"), to deal in the Software without restriction, including
d53520b78d4a8726396efdbaa71f86f687a6f308Mark Andrews# without limitation the rights to use, copy, modify, merge, publish,
d53520b78d4a8726396efdbaa71f86f687a6f308Mark Andrews# distribute, and/or sell copies of the Software, and to permit persons
d53520b78d4a8726396efdbaa71f86f687a6f308Mark Andrews# to whom the Software is furnished to do so, provided that the above
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews# copyright notice(s) and this permission notice appear in all copies of
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews# the Software and that both the above copyright notice(s) and this
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews# permission notice appear in supporting documentation.
c2b2bd69faabd83143ffb30a132a2f20ebd9abdaMark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
d140ae28347065500e7efb1ebe884f1606f9ac7bMark Andrews# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d140ae28347065500e7efb1ebe884f1606f9ac7bMark Andrews# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
d3bcf7adca7fc4a019364b0195818673448072f7Mark Andrews# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
d3bcf7adca7fc4a019364b0195818673448072f7Mark Andrews# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
d3bcf7adca7fc4a019364b0195818673448072f7Mark Andrews# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
cf029c9369548e598379490a039cfbc2b83527eeMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
cf029c9369548e598379490a039cfbc2b83527eeMark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
cf029c9369548e598379490a039cfbc2b83527eeMark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
c6d4f781529d2f28693546b25b2967d44ec89e60Mark Andrews# Except as contained in this notice, the name of a copyright holder
c6d4f781529d2f28693546b25b2967d44ec89e60Mark Andrews# shall not be used in advertising or otherwise to promote the sale, use
c9eaf357a31ea5eaeeed24f2f4e800a6ef9512e0Mark Andrews# or other dealings in this Software without prior written authorization
c9eaf357a31ea5eaeeed24f2f4e800a6ef9512e0Mark Andrews# of the copyright holder.
3fc7753efdc33559978ce61785961b1305944077Mark Andrews# @(#)Makefile 1.36 07/03/19
d14e4f3a9916f2159de4c5995006195072e05085Mark AndrewsBUILD_TYPES:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_TYPES_\1\)/'
fde1a334ee0d437ccbada347ff09e8ea0eaff221Mark Andrews# Package name used in tarballs
a957b9ccdccf519018e06213a27e1b70b8dc4640Mark Andrews# Version number (used in path names)
9a33e2d135b0de7d2e2d768f2b9c45b2627fe4e6Mark Andrews# Source tarball
9a33e2d135b0de7d2e2d768f2b9c45b2627fe4e6Mark AndrewsSOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
dc6da18ccbb808d21f123cc6bda399b44ad11445Mark Andrews# Download site for source
dc6da18ccbb808d21f123cc6bda399b44ad11445Mark AndrewsSOURCE_URL=$(XORG_RELEASES_URL)/xserver/$(SOURCE_TARBALL_NAME)
94b58e01ae98764a045e18581d7aaf05d2889e60Mark Andrews# Patches to apply to source after unpacking, in order
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews# Directory created by unpacking source
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark AndrewsSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
e9733bc599f30033ffe7af69f5fca254fb59d46eMark Andrews# Prefix for installation
332ed11af0e9837421160ab67619e025520a73f4Mark Andrews# Man pages to apply Sun footer to & attributes to list
332ed11af0e9837421160ab67619e025520a73f4Mark Andrews# XXX: Need to adjust some of these to correct packages/stability
1c91b0a6516319d81670da2325e2bd08a7703707Mark Andrews hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
2a90390deeff6ba07125bfb2c81ab4b582eb2777Mark AndrewsSUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
2a90390deeff6ba07125bfb2c81ab4b582eb2777Mark Andrews -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
be2c2c29a88db96bd51f11d671ec207f0b6b0d45Mark Andrews# Binary built in tree
01db0feafa67200a07ff8f81dde9029f675bbb5cMark AndrewsBUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
cf224bbf7bab87bc28b12f5b30f5ca3f3e5bf604Mark Andrews# Merge in additional sources from sun-src directory
2674e1a455d4f71de09b2b60e7a8304b9a305588Mark AndrewsMESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
2674e1a455d4f71de09b2b60e7a8304b9a305588Mark AndrewsMODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews# Command line options to GNU autoconf configure script
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews# XXX: enable xorgcfg --disable-dga enable security
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews --prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews --bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
60ab03125c137c48a6b2ed6df1d2c8657757e09dMark Andrews --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
faa4af28cff84d7ac45c1da98e40c00f65a24aa3Mark Andrews --with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
faa4af28cff84d7ac45c1da98e40c00f65a24aa3Mark Andrews --with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/"
8af4e7aa4e2a6fe84bf4ebe09ca1d4ef1d8ab593Mark AndrewsCONFIG_OPTS_i86pc=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
8af4e7aa4e2a6fe84bf4ebe09ca1d4ef1d8ab593Mark AndrewsCONFIG_OPTS:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_OPTS_\1\)/'
982a2cfef37a39842ff53dc2e00b947c554fa78eTatuya JINMEI 神明達哉# Need to append header path with gcc headers for MMX/SSE intrinsics
16ee4fe11bad616a76c79e9f626a7e04a88ef4abMark AndrewsGCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
16ee4fe11bad616a76c79e9f626a7e04a88ef4abMark Andrews# Default DPMS settings for Solaris
6f3c2ee187d690f96ffef3ba5a6c2e112bb3798cMark Andrews -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
9de05727e334336ceb0abcca404d770abd23b876Mark Andrews# Uncomment to build debug
9de05727e334336ceb0abcca404d770abd23b876Mark Andrews# OPT_CFLAGS = -g
7c61d798f54f7c19f87d46a0df775e0e58fe7d30Mark Andrews# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
e23932d3c8c154cff3fea0ecff64e26c6ac6f5d8Mark Andrews# Environment variable options to GNU autoconf configure script
72160d9b51d902a7cf18de84953bc651941f73c2Mark Andrews PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
72160d9b51d902a7cf18de84953bc651941f73c2Mark Andrews INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
8ec056723666c71a499880ffa415661f37ffd08eMark AndrewsLDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
80a609bf44ee09766aeb9ae02cfbf7f9fe86dd83Mark AndrewsCONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
b89095ba15e9163f2bacc46239d8f69d1a2b9ad3Tatuya JINMEI 神明達哉CONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
b89095ba15e9163f2bacc46239d8f69d1a2b9ad3Tatuya JINMEI 神明達哉 LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
bd5c8a564b21781fe6b608fe6a75c2e7152200acTatuya JINMEI 神明達哉 CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
85708f9aabbfe31fc648c90258ae18ce0edc3488Mark AndrewsCONFIG_ENV_sun4= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
49732e4d6008d7d99dfce596a17e17aa13425502Mark AndrewsCONFIG_ENV_i86pc= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
49732e4d6008d7d99dfce596a17e17aa13425502Mark AndrewsCONFIG_ENV:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_ENV_\1\)/'
cae2cb086244dfb883739edbe79e34756079f70eMark AndrewsBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
cf0bcc2c80ca99f1e6e53dcdd0eba03fe70723dfMark AndrewsBUILD_64_FLAGS_sun4=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
cf0bcc2c80ca99f1e6e53dcdd0eba03fe70723dfMark AndrewsBUILD_64_FLAGS_i86pc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
0da29be670f6fa5b2a6320d9d843bc8b802c153aMark AndrewsBUILD_64_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_64_FLAGS_\1\)/'
0da29be670f6fa5b2a6320d9d843bc8b802c153aMark Andrews# Run configure script
74f261bd2b7846d8e730ca3a1b28d6503de5c74aMark Andrews# Environment variable options to use when building
5be3685b0e57677c0cc03113099cb8f99f9a070bMark Andrews LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
5be3685b0e57677c0cc03113099cb8f99f9a070bMark Andrews#LD_OPTIONS="-z textwarn"
715361d0c3800e5ad886e5df971936ce6cd1ca89Mark Andrews (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
715361d0c3800e5ad886e5df971936ce6cd1ca89Mark Andrews (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
3d711f2f75cb9a9ddcbf1fca9b2de192e75340e6Mark Andrews pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
3d711f2f75cb9a9ddcbf1fca9b2de192e75340e6Mark Andrews sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
539f477cd03db1ac173bcb5257da136283e57849Mark Andrews -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
a268fec7f54a89a0772a91da0511c8eae09e6157Mark Andrews#ifdef _LP64\
a268fec7f54a89a0772a91da0511c8eae09e6157Mark Andrews#define _XSERVER64 1\
4e1d3e67cdc76609bad5f0310ac48de10b442b9fMark Andrews $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
4e1d3e67cdc76609bad5f0310ac48de10b442b9fMark Andrews cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
539f477cd03db1ac173bcb5257da136283e57849Mark Andrews$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
6b79e960e6ba2991aeb02a6c39af255ab7f06d99Mark Andrews printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
6b79e960e6ba2991aeb02a6c39af255ab7f06d99Mark 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' >> $@