Makefile revision 203
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff###############################################################################
7d98a1783f222964bcde7d56dab77b822706204dBob Halley#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# Xorg server Makefile
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# Use subject to license terms.
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# Permission is hereby granted, free of charge, to any person obtaining a
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# copy of this software and associated documentation files (the
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# "Software"), to deal in the Software without restriction, including
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# without limitation the rights to use, copy, modify, merge, publish,
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# distribute, and/or sell copies of the Software, and to permit persons
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# to whom the Software is furnished to do so, provided that the above
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# copyright notice(s) and this permission notice appear in all copies of
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# the Software and that both the above copyright notice(s) and this
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# permission notice appear in supporting documentation.
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44fee668021c7ceef4ee1c848031d883a508b359James Brister# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
44fee668021c7ceef4ee1c848031d883a508b359James Brister# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
44fee668021c7ceef4ee1c848031d883a508b359James Brister# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
b8257bd2d872546e7cc358fdf32331ce8850bca4Bob Halley#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# Except as contained in this notice, the name of a copyright holder
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson# shall not be used in advertising or otherwise to promote the sale, use
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# or other dealings in this Software without prior written authorization
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# of the copyright holder.
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff# @(#)Makefile 1.52 07/08/10
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas GustafssonPWD:sh=pwd
1840745dd553b2ff5b114a03cde40a2a404aa559Michael GraffTOP=$(PWD)/../..
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas GustafssonBUILD_TYPES_SET=yes
1840745dd553b2ff5b114a03cde40a2a404aa559Michael GraffBUILD_TYPES_sparc=64
440be4c866f6935ac069db79a414304507a664c2Michael GraffBUILD_TYPES_i386=32 64
1840745dd553b2ff5b114a03cde40a2a404aa559Michael GraffBUILD_TYPES=$(BUILD_TYPES_$(MACH))
a1747570262ed336c213aaf6bd31bc91993a46deAndreas Gustafsson
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson# Package name used in tarballs
fd15c8e32ed0c1cfd3ed737858a81966e7fbaeacAndreas GustafssonMODULE_NAME=xorg-server
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson# Version number (used in path names)
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas GustafssonXORGSERVER_VERS=1.3.0.0
c6e10b826ec1df8da01a7b1b4620d7e0adfcb247James Brister
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson# Source tarball
c14c6f86ae1607eb39b8b37be25599b8cb923062Bob HalleySOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas GustafssonSOURCE_TARBALL_DIR=xserver
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# Patches to apply to source after unpacking, in order
173b32c660c1e4d5141b5ca740e8fab3c593652fBob HalleySOURCE_PATCHES = \
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff xephyr.patch,-p1 \
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff dtrace.patch \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson automake-1.10.patch,-p1 \
f5facdfc297825bbd99adf45421dd2ba13a1132eBob Halley render-security.patch,-p1 \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson ramdac-symbols.patch,-p1 \
8f16e457f722681f67ee6af9c1cd39553f6dcc9aAndreas Gustafsson RandR-1.2-man.patch,-p1 \
f93d33e24fdf76eb2558168f018b8992bcfc5681Andreas Gustafsson sun-paths.patch \
f93d33e24fdf76eb2558168f018b8992bcfc5681Andreas Gustafsson sun-extramodes.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson sun-apm.patch \
173b32c660c1e4d5141b5ca740e8fab3c593652fBob Halley sun-kb-autodetect.patch \
c6e10b826ec1df8da01a7b1b4620d7e0adfcb247James Brister sun-keymappings.patch \
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson sun-manpage.patch \
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff cli-nolock.patch \
b03758b04ea5134c805d44fcc5315c878c6f7996Andreas Gustafsson cli-nobanner.patch \
533b0475054882ea1c81cb1ec4aa3e6750711bbcBob Halley keep-aperture-open.patch \
a55d0a9080c8ef4117d2fc27f63220a56afb2434Andreas Gustafsson sun-virtual-mouse.patch \
a55d0a9080c8ef4117d2fc27f63220a56afb2434Andreas Gustafsson dtlogin-userinfo.patch \
a4b6a1622b1b6672a6e0c7186167bbe3997568c6Bob Halley IA.patch \
353dcaf1cc77d122d9b4b750bbbfc4c96b4b292bAndreas Gustafsson xtsol.patch \
bcc1d6507b69be307fc1e0206827a0b09b10ba4bBob Halley sun-loginfo.patch \
533b0475054882ea1c81cb1ec4aa3e6750711bbcBob Halley xorgconfig.patch \
a55d0a9080c8ef4117d2fc27f63220a56afb2434Andreas Gustafsson xorgcfg.patch \
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff amd64-loader-path.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson Xorg-mapfile.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson bitstream.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson xevie.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson wsfb.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson sparc-probe.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson glx-byteswap.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson glx-impure.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson dri.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson nvidia-autoconfig.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson autoconfig.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson autoconfig2.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6406044.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson cfbmskbits.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson lg3d.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6535006.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6540484.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson signal-handler.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson kbd-driver.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6559710.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6561019.patch \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson 6577124.patch
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson# Directory created by unpacking source
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas GustafssonSOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson# Prefix for installation
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas GustafssonXORGSERVER_PREFIX=$(X11_DIR)
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
016326d111130b2810cb453d6bf2ff94f398b050Bob Halley# Man pages to apply Sun footer to & attributes to list
016326d111130b2810cb453d6bf2ff94f398b050Bob Halley# XXX: Need to adjust some of these to correct packages/stability
016326d111130b2810cb453d6bf2ff94f398b050Bob HalleySUNTOUCHED_MANPAGES= \
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson hw/xfree86/utils/gtf/gtf.man.pre \
016326d111130b2810cb453d6bf2ff94f398b050Bob Halley hw/xfree86/utils/cvt/cvt.man.pre \
c6e10b826ec1df8da01a7b1b4620d7e0adfcb247James Brister hw/xfree86/utils/pcitweak/pcitweak.man.pre \
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson hw/xfree86/utils/scanpci/scanpci.man.pre \
b45b364f2255f4abfec674e5ff94b803e34b3e83Andreas Gustafsson hw/xfree86/utils/xorgcfg/xorgcfg.man.pre \
44fee668021c7ceef4ee1c848031d883a508b359James Brister hw/xfree86/utils/xorgconfig/xorgconfig.man.pre \
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson hw/xfree86/doc/man/Xorg.man.pre \
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson hw/xfree86/doc/man/xorg.conf.man.pre
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas GustafssonSUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas Gustafsson# Binary built in tree
f5f38e9930344a30db725816e2f1c5edb9c2ac55Andreas GustafssonXORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
c0564c15e73fc366a9200fc47dfcc7894382aa98Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonBUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafssoninclude $(TOP)/common/Makefile.inc
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson# Merge in additional sources from sun-src directory
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafssonsource_gen:: $(LNDIR)
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson (cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonFONTDIR=$(X11_DIR)/lib/X11/fonts
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonMESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonMODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonDRI_MODULES_DIR='$${libdir}/modules/dri$(MODULE_subdir)'
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson# Command line options to GNU autoconf configure script
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson# XXX: --disable-dga
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonCONFIG_OPTS_COMMON = \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --enable-shared --disable-static \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --enable-kdrive --enable-xephyr --disable-xsdl \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --disable-install-setuid --enable-xorgcfg \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-vendor-name="Sun Microsystems, Inc." \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-vendor-web="http://sunsolve.sun.com/" \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-os-name="`uname -srmv`" \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-module-dir=$(MODULES_DIR) \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-dri-driver-path=$(DRI_MODULES_DIR) \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-xkb-path='$${libdir}/X11/xkb' \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-rgb-path='$${libdir}/X11/rgb' \
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson --with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/"
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas Gustafsson
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonCONFIG_OPTS_sparc=$(CONFIG_OPTS_COMMON)
1921b4f61906c1e0f1a708dd82fd9e430a0e1af8Andreas GustafssonCONFIG_OPTS_i386=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_OPTS=$(CONFIG_OPTS_$(MACH))
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# Need to append header path with gcc headers for MMX/SSE intrinsics
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonGCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# Default DPMS settings for Solaris
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonDPMS_DEFINES= -DDEFAULT_STANDBY_TIME=1440000 \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -DDEFAULT_SUSPEND_TIME=1620000 \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -DDEFAULT_OFF_TIME=1800000
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonXORG_CPPFLAGS= \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -I $(MESA_SRC_DIR)/include \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -I $(PROTODIR)$(X11_INCLUDES_DIR) \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -I $(PROTODIR)$(X11_INCLUDES_DIR)/drm \
3ca4d70c58fdb5b0e2d4a1f6fe1f02d68744e567Brian Wellington -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson $(DPMS_DEFINES) -DSUNSOFT -DTSOL
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# Uncomment to build debug
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# OPT_CFLAGS = -g
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# Environment variable options to GNU autoconf configure script
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# - XSERVERCFLAGS_CFLAGS - force CFLAGS to avoid -I /usr/X11/include breaking
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson# use of headers from proto area
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV_common = \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson XSERVERCFLAGS_CFLAGS="-DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DXTHREADS -DXUSE_MTSAFE_API" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson PATH=$(PATH):/usr/sbin
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonLDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson LDFLAGS="$(PROG_LDFLAGS) $(LDPATH_ADD)" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson CPPFLAGS="$(XORG_CPPFLAGS)"
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV_sparc= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV_i386= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonCONFIG_ENV= $(CONFIG_ENV_$(MACH))
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonBUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
65e117d576ffa9588abc070c570c84d6c258e3baAndreas Gustafsson
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonBUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
65e117d576ffa9588abc070c570c84d6c258e3baAndreas GustafssonBUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas GustafssonBUILD_64_FLAGS=$(BUILD_64_FLAGS_$(MACH))
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson# Run configure script
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/configure
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson (cd $(SOURCE_DIR) && \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson (cd $(SOURCE_DIR)/hw/xfree86/xf1bpp && \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson $(MAKE) $(MFLAGS) maintainer-clean-generic)
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson$(SOURCE_DIR)/configure: $(UNPACK_TARGET) $(SOURCE_DIR)/configure.ac
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson $(MAKE) $(MFLAGS) autoreconf
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson# Environment variable options to use when building
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas GustafssonBUILD_ENV= PATH=$(PATH):/usr/sbin \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson#LD_OPTIONS="-z textwarn"
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson$(XORGSERVER_BIN): $(SOURCE_DIR)/Makefile
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafssoninstall_gen: $(XORGSERVER_BIN)
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson (cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson DESTDIR=$(PROTODIR) CPPROG="cp -p" \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig )
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson sed -e 's%#define XF86DRI 1%/* #define XF86DRI 1 */%' \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson -e 's%^.* _XSERVER64 .*$$%#include <sys/isa_defs.h>\
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson#ifdef _LP64\
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson#define _XSERVER64 1\
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson#endif%' \
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson $(SOURCE_DIR)/include/xorg-server.h > $(PROTODIR)$(X11_INCLUDES_DIR)/xorg/xorg-server.h
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson mkdir -p $(PROTODIR)$(X11_DOC_DIR)
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson cp -p $(SOURCE_DIR)/hw/xfree86/doc/README.* $(PROTODIR)$(X11_DOC_DIR)/
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson$(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson -rm -f $@
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson printf '{\n global:\n' >> $@
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson /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' >> $@
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson printf '};\n' >> $@
864a05fa261c3b0b5d16d2d494f00afff8a3080bAndreas Gustafsson