Makefile revision 970
1088N/A###############################################################################
1088N/A#
0N/A# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A#
919N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
0N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
0N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
606N/A# DEALINGS IN THE SOFTWARE.
0N/A#
0N/A#
606N/A
606N/A# Package name used in tarballs
98N/AMODULE_NAME=mesa
0N/A
0N/A# Package metadata
0N/AUPSTREAM = The Mesa 3-D Graphics Library
0N/AUPSTREAM_URL = http://mesa3d.org/
0N/AUPSTREAM_SET = yes
196N/A
0N/AMODULE_LICENSE = Mesa License (Mixed: MIT, LGPLv2, others)
0N/AMODULE_LICENSE_SET = yes
36N/A
168N/A# ARC cases that covered this module
0N/A# LSARC/2005/109 MESA, Open Source OpenGL clone
0N/AMODULE_ARC_CASES = LSARC/2005/109
851N/A
851N/A# Version number (used in path names)
606N/AMODULE_VERSION=7.4.4
0N/A
639N/A# Checksums for upstream tarball
168N/ATARBALL_MD5 = b66528d314c574dccbe0ed963cac5e93
0N/ATARBALL_SHA1 = 1cdcef24900489bc0a879013b2138c0d9aedffe3
0N/A
0N/A# Source tarball
633N/ASOURCE_TARBALL_NAME=MesaLib-$(MODULE_VERSION).tar.bz2
639N/ASOURCE_TARBALL_NAME_SET=yes
0N/A
0N/A# Download site for source
0N/ASOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
0N/ASOURCE_URL_SET=yes
0N/AGIT_URL=$(FDO_GIT_URL)/mesa/mesa
0N/AGIT_URL_SET=yes
0N/A
0N/A# Directory created by unpacking source
0N/ASOURCE_DIRNAME=Mesa-$(MODULE_VERSION)
0N/ASOURCE_DIRNAME_SET=yes
0N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME)
0N/A
0N/A# Patches to apply to source after unpacking, in order
0N/ASOURCE_PATCHES= \
0N/A install-pc-dir.patch,-p1 \
0N/A glu-no-mangled-exports.patch \
0N/A solaris-port.patch \
0N/A 6872597.patch 6866668.patch
0N/A
0N/A# File created by running configure script
633N/AAUTOCONF_TARGET=$(SOURCE_DIR)/configs/autoconf
0N/AAUTOCONF_TARGET_SET=yes
0N/AMODULE_ADD_CONFIGURE_TARGETS=set_pc_dir
0N/AMODULE_INSTALL_DEPS=set_pc_dir
0N/A
0N/ADRI_DRIVER_LIST_sparc=
0N/ADRI_DRIVER_LIST_i386=i915 i965 r200 r300 radeon
0N/ADRI_DRIVER_LIST= $(DRI_DRIVER_LIST_$(MACH)) swrast
0N/A
0N/A# Command line options to GNU autoconf configure script
0N/AMODULE_CONFIG_OPTS = --with-driver=dri \
0N/A --with-dri-driverdir='$(X11_SERVERMODS_DIR)/dri$(SERVERMOD_subdir)' \
0N/A --with-dri-drivers='$(DRI_DRIVER_LIST)'
633N/A
633N/A# Override LDFLAGS passed to configure to not include CFLAGS, since that
0N/A# breaks building libGLU with Sun Studio C++ compiler
0N/AMODULE_CONFIG_ENV = LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(ARCH_FLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)"
0N/A
0N/A# Put /usr/xpg4/bin first in path so that grep -q works (CR 4843344)
0N/AMODULE_BUILD_ENV = PATH="/usr/xpg4/bin:$(PATH)"
0N/A
0N/A# Need to use GNU Make to build
0N/AMODULE_MAKE=$(GNUMAKE)
0N/AMODULE_MAKE_SET=yes
0N/A
0N/A# To build with gcc, uncomment these lines and comment out the MODULE_CFLAGS
0N/A# MODULE_COMPILER=gcc
0N/A# MODULE_COMPILER_SET=yes
0N/A
0N/A# Tell Sun compiler to not apply optimizations that increase binary sizes
0N/A# Without this flag, Studio 12 binaries are almost 2x bigger (CR 6808868)
0N/AMODULE_CFLAGS = -xspace
0N/A
0N/A# Add include paths and linker paths needed for DRM modules
0N/AMODULE_CPPFLAGS = -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm
0N/A
0N/AMODULE_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
0N/A -R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
0N/A
0N/A# Merge in additional sources from sun-src directory
0N/AADDITIONAL_SOURCE_DIR=sun-src
0N/A
0N/A# pkg-config files that need to have -R added
0N/AFIX_PC_FILES=src/*/*.pc.in src/mesa/drivers/dri/dri.pc.in
0N/A
0N/A### Include common rulesets
0N/Ainclude ../Makefile.inc
0N/A
0N/A# Mesa makefiles use a different variable name/method for pkgconfig path
0N/Aset_pc_dir: $(AUTOCONF_TARGET)
0N/A echo 'INSTALL_PC_DIR=$(PKGCONFIG_DIR)' >> $(AUTOCONF_TARGET)
0N/A
0N/A# Move installed files to mesa subdirs and make links back
0N/ALIBRARIES_TO_DIRECT_LINK = libGLU.so.1 libGLw.so.1
0N/ALIBRARIES_TO_RUNTIME_LINK = libGL.so.1
0N/ALIBRARIES_TO_MOVE = $(LIBRARIES_TO_DIRECT_LINK) $(LIBRARIES_TO_RUNTIME_LINK)
0N/AMESA_LIBDIR = $(PROTODIR)/usr/lib/mesa$(ARCHLIBSUBDIR)
0N/A
0N/AHEADERS_TO_MOVE = GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h \
0N/A dmesa.h ggimesa.h \
0N/A gl.h gl_mangle.h glext.h glfbdev.h \
0N/A glu.h glu_mangle.h glx.h glx_mangle.h glxext.h \
0N/A mesa_wgl.h mglmesa.h osmesa.h svgamesa.h vms_x_fix.h wmesa.h
0N/AHEADERS_TO_DIRECT_LINK = GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h \
633N/A glu.h osmesa.h
0N/AHEADERS_TO_RUNTIME_LINK = gl.h glext.h glx.h glxext.h
0N/A
0N/A# Run just once after all other install steps are done for both 32/64-bit
0N/Ainstall: install_ogl_layout
0N/A
0N/Ainstall_ogl_layout: $(INSTALL_RULES)
0N/A -rm -rf $(PROTODIR)/usr/include/mesa
0N/A mkdir -p $(PROTODIR)/usr/include/mesa/internal
606N/A mv $(HEADERS_TO_MOVE:%=$(PROTODIR)/usr/include/GL/%) \
0N/A $(PROTODIR)/usr/include/mesa
0N/A mv $(PROTODIR)/usr/include/GL/internal/dri_interface.h \
0N/A $(PROTODIR)/usr/include/mesa/internal
0N/A ln -s ../../mesa/internal/dri_interface.h \
0N/A $(PROTODIR)/usr/include/GL/internal/
0N/A -rm -f $(HEADERS_TO_DIRECT_LINK:%=$(PROTODIR)/usr/include/GL/%) \
606N/A $(HEADERS_TO_RUNTIME_LINK:%=$(PROTODIR)/usr/include/GL/%)
606N/A ln -s $(HEADERS_TO_DIRECT_LINK:%=../mesa/%) \
0N/A $(HEADERS_TO_RUNTIME_LINK:%=../../../var/run/opengl/include/%) \
0N/A $(PROTODIR)/usr/include/GL
0N/A mkdir -p $(PROTODIR)/usr/lib/GL/$(SUBDIR64) \
0N/A $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)
0N/A -rm -f $(PROTODIR)/usr/lib/GL/64 $(PROTODIR)/usr/lib/mesa/64
0N/A ln -s $(SUBDIR64) $(PROTODIR)/usr/lib/GL/64
0N/A ln -s $(SUBDIR64) $(PROTODIR)/usr/lib/mesa/64
0N/A -rm -f $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/mesa/%) \
0N/A $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/%)
0N/A mv $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/%) \
606N/A $(PROTODIR)/usr/lib/mesa/
606N/A mv $(LIBRARIES_TO_MOVE:%=$(PROTODIR)/usr/lib/$(SUBDIR64)/%) \
0N/A $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/
0N/A @for l in $(LIBRARIES_TO_MOVE) ; do \
0N/A $(START_CMD_ECHO) ; \
0N/A rm -f $(PROTODIR)/usr/lib/mesa/$${l%.1} \
0N/A $(PROTODIR)/usr/lib/GL/$${l%.1} \
606N/A $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/$${l%.1} \
0N/A $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/$${l%.1} ; \
0N/A ln -s $${l} $(PROTODIR)/usr/lib/mesa/$${l%.1} ; \
606N/A ln -s $${l} $(PROTODIR)/usr/lib/GL/$${l%.1} ; \
0N/A ln -s $${l} $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/$${l%.1} ; \
0N/A ln -s $${l} $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/$${l%.1} ; \
0N/A done
0N/A (cd $(PROTODIR)/usr/lib ; ln -s $(LIBRARIES_TO_MOVE:%=GL/%) .)
0N/A (cd $(PROTODIR)/usr/lib/$(SUBDIR64) ; \
0N/A ln -s $(LIBRARIES_TO_MOVE:%=../GL/$(SUBDIR64)/%) .)
0N/A -rm -f $(LIBRARIES_TO_DIRECT_LINK:%=$(PROTODIR)/usr/lib/GL/%)
0N/A (cd $(PROTODIR)/usr/lib/GL ; \
0N/A ln -s $(LIBRARIES_TO_DIRECT_LINK:%=../mesa/%) .)
0N/A -rm -f $(LIBRARIES_TO_DIRECT_LINK:%=$(PROTODIR)/usr/lib/GL/$(SUBDIR64)/%)
0N/A (cd $(PROTODIR)/usr/lib/GL/$(SUBDIR64) ; \
0N/A ln -s $(LIBRARIES_TO_DIRECT_LINK:%=../../mesa/$(SUBDIR64)/%) .)
0N/A -rm -f $(PROTODIR)/usr/lib/GL/libGL.so.1 \
0N/A $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
606N/A ln -s ../../../var/run/opengl/lib/libGL.so.1 \
0N/A $(PROTODIR)/usr/lib/GL/libGL.so.1
0N/A ln -s ../../../../var/run/opengl/lib/$(SUBDIR64)/libGL.so.1 \
0N/A $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
0N/A mkdir -p $(PROTODIR)/usr/X11/lib/$(SUBDIR64) \
0N/A $(PROTODIR)/usr/X11/include
0N/A -rm -f $(PROTODIR)/usr/X11/lib/GL $(PROTODIR)/usr/X11/lib/mesa
0N/A ln -s ../../lib/GL $(PROTODIR)/usr/X11/lib/GL
0N/A ln -s ../../lib/mesa $(PROTODIR)/usr/X11/lib/mesa
0N/A -rm -f $(PROTODIR)/usr/X11/lib/64
0N/A ln -s $(SUBDIR64) $(PROTODIR)/usr/X11/lib/64
0N/A @for l in $(LIBRARIES_TO_MOVE) ; do \
0N/A $(START_CMD_ECHO) ; \
0N/A rm -f $(PROTODIR)/usr/X11/lib/$${l} \
0N/A $(PROTODIR)/usr/X11/lib/$${l%.1} \
0N/A $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l} \
0N/A $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l%.1} ; \
606N/A ln -s $${l} $(PROTODIR)/usr/X11/lib/$${l%.1} ; \
606N/A ln -s GL/$${l} $(PROTODIR)/usr/X11/lib/$${l} ; \
606N/A ln -s $${l} $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l%.1} ; \
0N/A ln -s ../GL/$(SUBDIR64)/$${l} $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/$${l} ; \
0N/A done
0N/A -rm -f $(PROTODIR)/usr/X11/include/GL $(PROTODIR)/usr/X11/include/mesa
0N/A ln -s ../../include/GL ../../include/mesa $(PROTODIR)/usr/X11/include/
0N/A $(TOP)/open-src/data/ogl-select/mesa_vendor_select root="$(PROTODIR)"
0N/A