Makefile revision 1089
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews###############################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# copy of this software and associated documentation files (the "Software"),
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# to deal in the Software without restriction, including without limitation
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and/or sell copies of the Software, and to permit persons to whom the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Software is furnished to do so, subject to the following conditions:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The above copyright notice and this permission notice (including the next
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# paragraph) shall be included in all copies or substantial portions of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b49958b502ee45022010a0b1bed3968f598895a4Automatic Updater# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# DEALINGS IN THE SOFTWARE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Package name used in tarballs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Package metadata
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_LICENSE = Mesa License (Mixed: MIT, LGPLv2, others)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ARC cases that covered this module
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# LSARC/2005/109 MESA, Open Source OpenGL clone
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Version number (used in path names)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Checksums for upstream tarball
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTARBALL_SHA1 = 21de672a1cbe307135d7f172dc6952041a38e1c7
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Source tarball
7329012471d165cd3dc4180ad2a0a43de91e7f01Mark AndrewsSOURCE_TARBALL_NAME=MesaLib-$(MODULE_VERSION).tar.bz2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Download site for source
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_URL=ftp://ftp.freedesktop.org/pub/mesa/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Directory created by unpacking source
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Patches to apply to source after unpacking, in order
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# File created by running configure script
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDRI_DRIVER_LIST= $(DRI_DRIVER_LIST_$(MACH)) swrast
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Command line options to GNU autoconf configure script
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_CONFIG_OPTS = --with-driver=dri --disable-egl --disable-gallium \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews --with-dri-driverdir='$(X11_SERVERMODS_DIR)/dri$(SERVERMOD_subdir)' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Override LDFLAGS passed to configure to not include CFLAGS, since that
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# breaks building libGLU with Sun Studio C++ compiler
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_CONFIG_ENV = LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(ARCH_FLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Put /usr/xpg4/bin first in path so that grep -q works (CR 4843344)
b3cbb2f1ad021349e89807f3492df6e4e679cd56Mark Andrews# Need to use GNU Make to build
b49958b502ee45022010a0b1bed3968f598895a4Automatic Updater# To build with gcc, uncomment these lines and comment out the MODULE_CFLAGS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Tell Sun compiler to not apply optimizations that increase binary sizes
b49958b502ee45022010a0b1bed3968f598895a4Automatic Updater# Without this flag, Studio 12 binaries are almost 2x bigger (CR 6808868)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#MODULE_CFLAGS = -xspace
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Add include paths and linker paths needed for DRM modules
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_CPPFLAGS = -I$(PROTODIR)/usr/include/libdrm
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Merge in additional sources from sun-src directory
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# pkg-config files that need to have -R added
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsFIX_PC_FILES=src/*/*.pc.in src/mesa/drivers/dri/dri.pc.in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### Include common rulesets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Mesa makefiles use a different variable name/method for pkgconfig path
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews echo 'INSTALL_PC_DIR=$(PKGCONFIG_DIR)' >> $(AUTOCONF_TARGET)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Move installed files to mesa subdirs and make links back
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLIBRARIES_TO_DIRECT_LINK = libGLU.so.1 libGLw.so.1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLIBRARIES_TO_MOVE = $(LIBRARIES_TO_DIRECT_LINK) $(LIBRARIES_TO_RUNTIME_LINK)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMESA_LIBDIR = $(PROTODIR)/usr/lib/mesa$(ARCHLIBSUBDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHEADERS_TO_MOVE = GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews glu.h glu_mangle.h glx.h glx_mangle.h glxext.h \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mesa_wgl.h mglmesa.h osmesa.h vms_x_fix.h wglext.h wmesa.h
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHEADERS_TO_DIRECT_LINK = GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHEADERS_TO_RUNTIME_LINK = gl.h glext.h glx.h glxext.h
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Run just once after all other install steps are done for both 32/64-bit
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mv $(HEADERS_TO_MOVE:%=$(PROTODIR)/usr/include/GL/%) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mv $(PROTODIR)/usr/include/GL/internal/dri_interface.h \
b49958b502ee45022010a0b1bed3968f598895a4Automatic Updater ln -s ../../mesa/internal/dri_interface.h \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(HEADERS_TO_DIRECT_LINK:%=$(PROTODIR)/usr/include/GL/%) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HEADERS_TO_RUNTIME_LINK:%=$(PROTODIR)/usr/include/GL/%)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HEADERS_TO_RUNTIME_LINK:%=../../../var/run/opengl/include/%) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(PROTODIR)/usr/lib/GL/64 $(PROTODIR)/usr/lib/mesa/64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/mesa/%) \
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/%)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mv $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/%) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews mv $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/$(SUBDIR64)/%) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/$${l%.1} \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $${l} $(PROTODIR)/usr/lib/mesa/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $${l} $(PROTODIR)/usr/lib/GL/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $${l} $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $${l} $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(PROTODIR)/usr/lib ; ln -s $(LIBRARIES_TO_MOVE:%=GL/%) .)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $(LIBRARIES_TO_MOVE:%=../GL/$(SUBDIR64)/%) .)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(LIBRARIES_TO_DIRECT_LINK:%=$(PROTODIR)/usr/lib/GL/%)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $(LIBRARIES_TO_DIRECT_LINK:%=../mesa/%) .)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(LIBRARIES_TO_DIRECT_LINK:%=$(PROTODIR)/usr/lib/GL/$(SUBDIR64)/%)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s $(LIBRARIES_TO_DIRECT_LINK:%=../../mesa/$(SUBDIR64)/%) .)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../../../../var/run/opengl/lib/$(SUBDIR64)/libGL.so.1 \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(PROTODIR)/usr/X11/lib/GL $(PROTODIR)/usr/X11/lib/mesa
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../../lib/mesa $(PROTODIR)/usr/X11/lib/mesa
8c9957e63274e6ea44d182703116307b1a65dabbMark Andrews $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l%.1} ; \
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews ln -s $${l} $(PROTODIR)/usr/X11/lib/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s GL/$${l} $(PROTODIR)/usr/X11/lib/$${l} ; \
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews ln -s $${l} $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l%.1} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../GL/$(SUBDIR64)/$${l} $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l} ; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -rm -f $(PROTODIR)/usr/X11/include/GL $(PROTODIR)/usr/X11/include/mesa
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ln -s ../../include/GL ../../include/mesa $(PROTODIR)/usr/X11/include/