Makefile revision 1379
372N/A###############################################################################
372N/A#
372N/A# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
372N/A#
943N/A# Permission is hereby granted, free of charge, to any person obtaining a
372N/A# copy of this software and associated documentation files (the "Software"),
372N/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
919N/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
919N/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
919N/A# DEALINGS IN THE SOFTWARE.
919N/A#
919N/A#
372N/A
372N/A# Package name used in tarballs
372N/AMODULE_NAME=mesa
493N/A
493N/A# Package metadata
372N/AUPSTREAM = The Mesa 3-D Graphics Library
970N/AUPSTREAM_URL = http://mesa3d.org/
970N/AUPSTREAM_SET = yes
970N/A
970N/AMODULE_LICENSE = Mesa License (Mixed: MIT, LGPLv2, others)
970N/AMODULE_LICENSE_SET = yes
970N/AMODULE_LICENSE_PREPEND = $(GPL_CHOICE_FILE)
970N/AMODULE_DESC = the Mesa 3-D Graphics Libraries
970N/AORACLE_TPNO = 9926
372N/A
541N/A# ARC cases that covered this module
372N/A# LSARC/2005/109 MESA, Open Source OpenGL clone
911N/AMODULE_ARC_CASES = LSARC/2005/109
911N/A# PSARC/2013/264 Mesa 9.0.3
911N/AMODULE_ARC_CASES += PSARC/2013/264
911N/A
372N/A# Version number (used in path names)
493N/AMODULE_VERSION=9.0.3
493N/A
372N/A# Checksums for upstream tarball
372N/ATARBALL_MD5 = d7515cc5116c72ac63d735655bd63689
460N/ATARBALL_SHA1 = c4d88d83d8dbe243e30dc07195888e19ddb1c402
372N/A
372N/A# Source tarball
372N/ASOURCE_TARBALL_NAME=MesaLib-$(MODULE_VERSION).tar.bz2
372N/ASOURCE_TARBALL_NAME_SET=yes
372N/A
372N/A# Download site for source
372N/ASOURCE_URL=ftp://ftp.freedesktop.org/pub/mesa/$(MODULE_VERSION)/$(SOURCE_TARBALL_NAME)
372N/ASOURCE_URL_SET=yes
372N/AGIT_URL=$(FDO_GIT_URL)/mesa/mesa
372N/AGIT_URL_SET=yes
837N/A
837N/A# Directory created by unpacking source
372N/ASOURCE_DIRNAME=Mesa-$(MODULE_VERSION)
372N/ASOURCE_DIRNAME_SET=yes
372N/ASOURCE_DIR = $(BUILD_DIR)/$(SOURCE_DIRNAME)
372N/A
372N/A# Patches to apply to source after unpacking, in order
372N/ASOURCE_PATCHES= \
372N/A CVE-2013-1993.patch,-p1 \
372N/A install-pc-dir.patch \
372N/A solaris-port.patch \
372N/A mesa9-port.patch
372N/A
372N/A# File created by running configure script
372N/AAUTOCONF_TARGET=$(SOURCE_DIR)/configs/autoconf
837N/AAUTOCONF_TARGET_SET=yes
837N/AMODULE_ADD_CONFIGURE_TARGETS=set_pc_dir
837N/AMODULE_INSTALL_DEPS=set_pc_dir
651N/A
837N/ADRI_DRIVER_LIST_sparc=
837N/ADRI_DRIVER_LIST_i386=i915 i965 radeon r200
837N/ADRI_DRIVER_LIST= $(DRI_DRIVER_LIST_$(MACH)) swrast
970N/A
970N/A# Command line options to GNU autoconf configure script
970N/AMODULE_CONFIG_OPTS = --with-driver=dri --disable-egl --disable-gallium \
970N/A --with-dri-driverdir='$(X11_SERVERMODS_DIR)/dri$(ARCHLIBSUBDIR)' \
970N/A --with-dri-drivers='$(DRI_DRIVER_LIST)' \
970N/A --with-gallium-drivers= --disable-gallium-llvm
970N/A
# Build mesa with this define (CR 7032292)
MODULE_CFLAGS = -D__EXTENSIONS__
# Override LDFLAGS passed to configure to not include CFLAGS, since that
# breaks building libGLU with Sun Studio C++ compiler
MODULE_CONFIG_ENV = LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(ARCH_FLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)"
# Add proto area to path to find makedepend
MODULE_BUILD_ENV = PATH="$(PROTODIR)/$(X11_BIN_DIR):$(PATH)"
MODULE_CONFIG_ENV += $(MODULE_BUILD_ENV)
# Need to use GNU Make to build
MODULE_MAKE=$(GNUMAKE)
MODULE_MAKE_SET=yes
# To build with gcc, uncomment these lines and comment out the MODULE_CFLAGS
MODULE_COMPILER=gcc
MODULE_COMPILER_SET=yes
# Tell Sun compiler to not apply optimizations that increase binary sizes
# Without this flag, Studio 12 binaries are almost 2x bigger (CR 6808868)
#MODULE_CFLAGS = -xspace
# Add include paths and linker paths needed for DRM modules
MODULE_CPPFLAGS = -I$(PROTODIR)/usr/include/libdrm
MODULE_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) -z ignore
MODULE_LD_OPTIONS += -M $(PWD)/mapfile.externs
# Merge in additional sources from sun-src directory
ADDITIONAL_SOURCE_DIR=sun-src
# pkg-config files that need to have -R added
FIX_PC_FILES=src/*/*.pc.in src/mesa/drivers/dri/dri.pc.in
### Include common rulesets
include ../Makefile.inc
# Mesa makefiles use a different variable name/method for pkgconfig path
set_pc_dir: $(AUTOCONF_TARGET)
echo 'INSTALL_PC_DIR=$(PKGCONFIG_DIR)' >> $(AUTOCONF_TARGET)
# Move installed files to mesa subdirs and make links back
LIBRARIES_TO_LINK = libGL.so.1.2.0 libdricore9.0.3.so.1.0.0 libglapi.so.0.0.0
MESA_LIBDIR = $(PROTODIR)/usr/lib/mesa$(ARCHLIBSUBDIR)
HEADERS_TO_MOVE = gl.h gl_mangle.h glext.h \
glx.h glx_mangle.h glxext.h \
osmesa.h vms_x_fix.h wglext.h wmesa.h
HEADERS_TO_DIRECT_LINK = osmesa.h
HEADERS_TO_RUNTIME_LINK = gl.h glext.h glx.h glxext.h
# Run just once after all other install steps are done for both 32/64-bit
install: install_ogl_layout
install_ogl_layout:
-rm -rf $(PROTODIR)/usr/include/mesa
mkdir -p $(PROTODIR)/usr/include/mesa/internal
mkdir -p $(PROTODIR)/system/volatile/opengl/include
mkdir -p $(PROTODIR)/system/volatile/opengl/lib/$(SUBDIR64)
mv $(HEADERS_TO_MOVE:%=$(PROTODIR)/usr/include/GL/%) \
$(PROTODIR)/usr/include/mesa
mv $(PROTODIR)/usr/include/GL/internal/dri_interface.h \
$(PROTODIR)/usr/include/mesa/internal
ln -s ../../mesa/internal/dri_interface.h \
$(PROTODIR)/usr/include/GL/internal/
-rm -f $(HEADERS_TO_DIRECT_LINK:%=$(PROTODIR)/usr/include/GL/%) \
$(HEADERS_TO_RUNTIME_LINK:%=$(PROTODIR)/usr/include/GL/%)
ln -s $(HEADERS_TO_DIRECT_LINK:%=../mesa/%) \
$(HEADERS_TO_RUNTIME_LINK:%=../../../system/volatile/opengl/include/%) \
$(PROTODIR)/usr/include/GL
mkdir -p $(PROTODIR)/usr/lib/GL/$(SUBDIR64) \
$(PROTODIR)/usr/lib/mesa/$(SUBDIR64)
-rm -f $(PROTODIR)/usr/lib/GL/64 $(PROTODIR)/usr/lib/mesa/64
ln -s $(SUBDIR64) $(PROTODIR)/usr/lib/GL/64
ln -s $(SUBDIR64) $(PROTODIR)/usr/lib/mesa/64
-rm -f $(LIBRARIES_TO_LINK:%=$(PROTODIR)/usr/lib/mesa/%) \
$(LIBRARIES_TO_LINK:%=$(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/%)
mv $(LIBRARIES_TO_LINK:%=$(PROTODIR)/usr/lib/%) \
$(PROTODIR)/usr/lib/mesa/
mv $(LIBRARIES_TO_LINK:%=$(PROTODIR)/usr/lib/$(SUBDIR64)/%) \
$(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/
-rm -f $(PROTODIR)/usr/lib/mesa/libGL.so.1
-rm -f $(PROTODIR)/usr/lib/mesa/libGL.so
-rm -f $(PROTODIR)/usr/lib/mesa/libGLU.so.1
-rm -f $(PROTODIR)/usr/lib/GL/libGL.so.1
-rm -f $(PROTODIR)/usr/lib/GL/libGLU.so.1
-rm -f $(PROTODIR)/usr/lib/GL/libGL.so
-rm -f $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libGL.so.1
-rm -f $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libGLU.so.1
-rm -f $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
-rm -f $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so
-rm -f $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGLU.so.1
ln -s libGL.so.1.2.0 $(PROTODIR)/usr/lib/mesa/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/lib/mesa/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/mesa/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/mesa/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/mesa/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/mesa/libglapi.so
ln -s libGL.so.1.2.0 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)/libglapi.so
rm -f $(PROTODIR)/usr/lib/*libglapi*
rm -f $(PROTODIR)/usr/lib/*dricore9.0.3*
rm -f $(PROTODIR)/usr/lib/*libGL.*
rm -f $(PROTODIR)/usr/lib/$(SUBDIR64)/*libglapi*
rm -f $(PROTODIR)/usr/lib/$(SUBDIR64)/*libdricore*
rm -f $(PROTODIR)/usr/lib/$(SUBDIR64)/*libGL.*
rm -f $(PROTODIR)/usr/lib/xorg/modules/dri/*.la
rm -f $(PROTODIR)/usr/lib/xorg/modules/dri/$(SUBDIR64)/*.la
(cd $(PROTODIR)/usr/lib/GL; ln -s $(LIBRARIES_TO_LINK:%=../mesa/%) .)
rm -f $(PROTODIR)/usr/lib/GL/libGL.so.1.2.0
ln -s libGL.so.1 $(PROTODIR)/usr/lib/GL/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/GL/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/GL/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/GL/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/GL/libglapi.so
(cd $(PROTODIR)/usr/lib/GL/$(SUBDIR64); ln -s $(LIBRARIES_TO_LINK:%=../../mesa/$(SUBDIR64)/%) .)
rm -f $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1.2.0
ln -s libGL.so.1 $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libglapi.so
(cd $(PROTODIR)/usr/lib; ln -s $(LIBRARIES_TO_LINK:%=GL/%) .)
rm -f $(PROTODIR)/usr/lib/libGL.so.1.2.0
ln -s GL/libGL.so.1 $(PROTODIR)/usr/lib/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/lib/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/libglapi.so
(cd $(PROTODIR)/usr/lib/$(SUBDIR64); ln -s $(LIBRARIES_TO_LINK:%=../GL/$(SUBDIR64)/%) .)
rm -f $(PROTODIR)/usr/lib/$(SUBDIR64)/libGL.so.1.2.0
ln -s ../GL/$(SUBDIR64)/libGL.so.1 $(PROTODIR)/usr/lib/$(SUBDIR64)/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/lib/$(SUBDIR64)/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/lib/$(SUBDIR64)/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/lib/$(SUBDIR64)/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/lib/$(SUBDIR64)/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/lib/$(SUBDIR64)/libglapi.so
ln -s ../../../system/volatile/opengl/lib/libGL.so.1 \
$(PROTODIR)/usr/lib/GL/libGL.so.1
ln -s ../../../../system/volatile/opengl/lib/$(SUBDIR64)/libGL.so.1 \
$(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
mkdir -p $(PROTODIR)/usr/X11/lib/$(SUBDIR64) \
$(PROTODIR)/usr/X11/include
-rm -f $(PROTODIR)/usr/X11/lib/GL $(PROTODIR)/usr/X11/lib/mesa
ln -s ../../lib/GL $(PROTODIR)/usr/X11/lib/GL
ln -s ../../lib/mesa $(PROTODIR)/usr/X11/lib/mesa
-rm -f $(PROTODIR)/usr/X11/lib/64
ln -s $(SUBDIR64) $(PROTODIR)/usr/X11/lib/64
(cd $(PROTODIR)/usr/X11/lib; ln -s $(LIBRARIES_TO_LINK:%=GL/%) .)
rm -f $(PROTODIR)/usr/X11/lib/libGL.so.1.2.0
ln -s ../../lib/GL/libGL.so.1 $(PROTODIR)/usr/X11/lib/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/X11/lib/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/X11/lib/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/X11/lib/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/X11/lib/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/X11/lib/libglapi.so
(cd $(PROTODIR)/usr/X11/lib/$(SUBDIR64); ln -s $(LIBRARIES_TO_LINK:%=../GL/$(SUBDIR64)/%) .)
rm -f $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libGL.so.1.2.0
ln -s ../../../lib/GL/$(SUBDIR64)/libGL.so.1 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libGL.so.1
ln -s libGL.so.1 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libGL.so
ln -s libdricore9.0.3.so.1.0.0 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libdricore9.0.3.so.1
ln -s libdricore9.0.3.so.1 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libdricore9.0.3.so
ln -s libglapi.so.0.0.0 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libglapi.so.0
ln -s libglapi.so.0 $(PROTODIR)/usr/X11/lib/$(SUBDIR64)/libglapi.so
-rm -f $(PROTODIR)/usr/X11/include/GL $(PROTODIR)/usr/X11/include/mesa
ln -s ../../include/GL ../../include/mesa $(PROTODIR)/usr/X11/include/
$(TOP)/open-src/data/ogl-select/mesa_vendor_select root="$(PROTODIR)"