Makefile revision 161
98N/A###############################################################################
98N/A#
98N/A# Xorg server Makefile
98N/A#
98N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
98N/A# Use subject to license terms.
98N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
98N/A# copy of this software and associated documentation files (the
98N/A# "Software"), to deal in the Software without restriction, including
98N/A# without limitation the rights to use, copy, modify, merge, publish,
98N/A# distribute, and/or sell copies of the Software, and to permit persons
98N/A# to whom the Software is furnished to do so, provided that the above
98N/A# copyright notice(s) and this permission notice appear in all copies of
98N/A# the Software and that both the above copyright notice(s) and this
98N/A# permission notice appear in supporting documentation.
98N/A#
98N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
98N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
98N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
98N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
98N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
98N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
98N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
98N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
98N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
98N/A#
98N/A# Except as contained in this notice, the name of a copyright holder
98N/A# shall not be used in advertising or otherwise to promote the sale, use
98N/A# or other dealings in this Software without prior written authorization
98N/A# of the copyright holder.
98N/A#
161N/A# @(#)Makefile 1.43 07/05/23
98N/A#
98N/A
98N/APWD:sh=pwd
98N/ATOP=$(PWD)/../..
98N/A
156N/ABUILD_TYPES_SET=yes
156N/ABUILD_TYPES_sparc=64
156N/ABUILD_TYPES_i386=32 64
156N/ABUILD_TYPES=$(BUILD_TYPES_$(MACH))
98N/A
98N/A# Package name used in tarballs
98N/AMODULE_NAME=xorg-server
98N/A
98N/A# Version number (used in path names)
98N/AXORGSERVER_VERS=1.2.0
98N/A
98N/A# Source tarball
98N/ASOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
156N/ASOURCE_TARBALL_DIR=xserver
98N/A
98N/A# Patches to apply to source after unpacking, in order
98N/ASOURCE_PATCHES = \
98N/A xf1bpp.patch,-p1 \
101N/A xephyr.patch,-p1 \
117N/A immu.h.patch,-p1 \
98N/A server-libs.patch \
98N/A dtrace.patch \
122N/A client-privates-leak.patch,-p1 \
127N/A ddc.patch,-p1 \
131N/A xcmisc-security.patch \
145N/A render-security.patch,-p1 \
98N/A ast-driver.patch \
98N/A sun-paths.patch \
98N/A sun-extramodes.patch \
98N/A sun-apm.patch \
98N/A sun-kb-autodetect.patch \
98N/A sun-keymappings.patch \
98N/A sun-manpage.patch \
98N/A cli-nolock.patch \
98N/A cli-nobanner.patch \
98N/A keep-aperture-open.patch \
98N/A sun-virtual-mouse.patch \
98N/A dtlogin-userinfo.patch \
98N/A IA.patch \
98N/A xtsol.patch \
98N/A sun-loginfo.patch \
98N/A xorgconfig.patch \
98N/A xorgcfg.patch \
98N/A amd64-loader-path.patch \
98N/A Xorg-mapfile.patch \
98N/A bitstream.patch \
98N/A xevie.patch \
98N/A sparc.patch,-p1 \
98N/A wsfb.patch \
98N/A sparc-probe.patch \
98N/A glx-byteswap.patch \
98N/A glx-impure.patch \
98N/A dri.patch \
98N/A nvidia-autoconfig.patch \
98N/A autoconfig.patch \
98N/A autoconfig2.patch \
98N/A 6406044.patch \
98N/A cfbmskbits.patch \
98N/A xf86ModesAdd.patch \
140N/A lg3d.patch \
154N/A 6535006.patch \
158N/A 6540484.patch \
161N/A signal-handler.patch \
161N/A kbd-driver.patch
98N/A
98N/A# Directory created by unpacking source
98N/ASOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
98N/A
98N/A# Prefix for installation
98N/AXORGSERVER_PREFIX=$(X11_DIR)
98N/A
98N/A# Man pages to apply Sun footer to & attributes to list
98N/A# XXX: Need to adjust some of these to correct packages/stability
98N/ASUNTOUCHED_MANPAGES= \
98N/A hw/xfree86/utils/gtf/gtf.man.pre \
98N/A hw/xfree86/utils/cvt/cvt.man.pre \
98N/A hw/xfree86/utils/pcitweak/pcitweak.man.pre \
98N/A hw/xfree86/utils/scanpci/scanpci.man.pre \
98N/A hw/xfree86/utils/xorgcfg/xorgcfg.man.pre \
98N/A hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
98N/A hw/xfree86/doc/man/Xorg.man.pre \
98N/A hw/xfree86/doc/man/xorg.conf.man.pre
98N/A
98N/ASUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
98N/A -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
98N/A
98N/A# Binary built in tree
98N/AXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
98N/A
98N/ABUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
98N/A
98N/Ainclude $(TOP)/common/Makefile.inc
98N/A
98N/A# Merge in additional sources from sun-src directory
98N/Asource_gen:: $(LNDIR)
98N/A (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
98N/A
98N/AFONTDIR=$(X11_DIR)/lib/X11/fonts
98N/A
98N/AMESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
98N/A
98N/AMODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
98N/A
98N/A# Command line options to GNU autoconf configure script
156N/A# XXX: --disable-dga
98N/ACONFIG_OPTS_COMMON = \
98N/A --prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
98N/A --bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
98N/A --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
98N/A --enable-shared --disable-static \
98N/A --enable-kdrive --enable-xephyr \
98N/A --disable-install-setuid --enable-xorgcfg \
98N/A --with-vendor-name="Sun Microsystems, Inc." \
98N/A --with-vendor-web="http://sunsolve.sun.com/" \
98N/A --with-os-name="`uname -srmv`" \
98N/A --with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
98N/A --with-module-dir=$(MODULES_DIR) \
98N/A --with-xkb-path='$${libdir}/X11/xkb' \
98N/A --with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/"
98N/A
156N/ACONFIG_OPTS_sparc=$(CONFIG_OPTS_COMMON)
156N/ACONFIG_OPTS_i386=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
156N/ACONFIG_OPTS=$(CONFIG_OPTS_$(MACH))
98N/A
98N/A
98N/A# Need to append header path with gcc headers for MMX/SSE intrinsics
98N/AGCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
98N/A
98N/A# Default DPMS settings for Solaris
98N/ADPMS_DEFINES= -DDEFAULT_STANDBY_TIME=1440000 \
98N/A -DDEFAULT_SUSPEND_TIME=1620000 \
98N/A -DDEFAULT_OFF_TIME=1800000
98N/A
98N/AXORG_CPPFLAGS= \
98N/A -I $(MESA_SRC_DIR)/include \
98N/A -I $(PROTODIR)$(X11_INCLUDES_DIR) \
98N/A -I $(PROTODIR)$(X11_INCLUDES_DIR)/drm \
98N/A -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri \
106N/A -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
98N/A $(DPMS_DEFINES) -DSUNSOFT -DTSOL
98N/A
98N/A# Uncomment to build debug
98N/A# OPT_CFLAGS = -g
98N/A# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
98N/A
98N/A# Environment variable options to GNU autoconf configure script
98N/ACONFIG_ENV_common = \
98N/A PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
98N/A INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
98N/A PATH=$(PATH):/usr/sbin
98N/A
98N/ALDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
98N/A -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
98N/A
98N/ACONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
98N/A LDFLAGS="$(PROG_LDFLAGS) $(LDPATH_ADD)" \
98N/A CPPFLAGS="$(XORG_CPPFLAGS)"
98N/A
98N/ACONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
98N/A LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
98N/A CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
98N/A
156N/ACONFIG_ENV_sparc= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
156N/ACONFIG_ENV_i386= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
156N/ACONFIG_ENV= $(CONFIG_ENV_$(MACH))
98N/A
98N/ABUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
98N/A
156N/ABUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
156N/ABUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
156N/ABUILD_64_FLAGS=$(BUILD_64_FLAGS_$(MACH))
98N/A
98N/A# Run configure script
98N/A$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET)
98N/A (cd $(SOURCE_DIR) && automake && autoconf && \
98N/A $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
98N/A (cd $(SOURCE_DIR)/hw/xfree86/xf1bpp && \
98N/A $(MAKE) $(MFLAGS) maintainer-clean-generic)
98N/A
98N/A# Environment variable options to use when building
98N/ABUILD_ENV= PATH=$(PATH):/usr/sbin \
98N/A LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
98N/A
98N/A#LD_OPTIONS="-z textwarn"
98N/A
98N/A$(XORGSERVER_BIN): $(SOURCE_DIR)/Makefile
98N/A (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
98N/A
98N/Ainstall_gen: $(XORGSERVER_BIN)
98N/A (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
98N/A DESTDIR=$(PROTODIR) CPPROG="cp -p" \
98N/A pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
111N/A sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
111N/A -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
111N/A#ifdef _LP64\
111N/A#define _XSERVER64 1\
111N/A#endif%' \
111N/A $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
98N/A mkdir -p $(PROTODIR)$(X11_DOC_DIR)
98N/A cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
98N/A
98N/A$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
98N/A -rm -f $@
98N/A printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
98N/A printf '{\n global:\n' >> $@
98N/A /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' >> $@
98N/A printf '};\n' >> $@