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