Makefile revision 6691
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or http://www.opensolaris.org/os/licensing.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_BITS= 64_and_32
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/shared-macros.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_NAME= graphviz
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_VERSION= 2.28.0
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PROJECT_URL= http://www.graphviz.org/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sha256:d3aa7973c578cae4cc26d9d6498c57ed06680cab9a4e940d0357a3c6527afc76
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)pub/graphviz/stable/SOURCES/$(COMPONENT_ARCHIVE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTPNO= 17707
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# publish for only one version of perl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPERL_VERSIONS = $(PERL_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# There are tests, but they fail consistently because the test samples are out
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# of date and not generated with a known configuration. See
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# http://graphviz.org/bugs/b2063.html
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST_TARGET= $(SKIP_TEST)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifneq ($(BUILD_TYPE), evaluation)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# We want to build a couple of extra things after the installs are done, so set
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the install targets appropriately.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_TARGET = $(INSTALL_$(MK_BITS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_TARGET += $(PROTOUSRLIBDIR)/graphviz/config6
52ece689e0265f9a3e518de5b2539e749f6d35acMark AndrewsINSTALL_TARGET += $(PROTO_DIR)/$(PYTHON.2.7.VENDOR_PACKAGES)/gv.pyc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews# Depends on newer cairo, which cannot be updated in S11.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(WS_MAKE_RULES)/no-evaluation.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(WS_MAKE_RULES)/common.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPATH = /usr/php/5.6/bin:/usr/bin:/usr/gnu/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# GMP header files for the guile extension (no --with- flag)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The guile build is broken with studio (15732452), so we disable this for now.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CPPFLAGS += -I/usr/include/gmp
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Java header files (--with-javaincludedir allows for only one directory)
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark AndrewsCPPFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/solaris
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# PHP header files (no --with- flag)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCPPFLAGS += $(shell PATH=$(PATH) php-config --includes)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCXX += $(studio_NORUNPATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Make sure to use the right python, depending on the 32/64-bit build.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += PYTHON27=$(PYTHON.2.7)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS += --without-included-ltdl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS += --enable-python=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS += --enable-python27=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS += --x-libraries=$(CONFIGURE_LIBDIR.$(BITS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUILD_ARGS += GREP=$(USRBINDIR)/ggrep
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifneq ($(BUILD_TYPE), evaluation)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# perl, ruby, php ship 64-bit only.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_32): CONFIGURE_OPTIONS += --enable-perl=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_32): CONFIGURE_OPTIONS += --enable-ruby=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_32): CONFIGURE_OPTIONS += --enable-php=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_64): CONFIGURE_ENV += PERL=$(PERL)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_64): CONFIGURE_ENV += RUBY=$(RUBY.2.1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INSTALL_64): COMPONENT_INSTALL_ARGS += PHP_INSTALL_DIR=$(shell PATH=$(PATH) php-config --extension-dir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# tcl ships both 32 and 64 bit, but even though /usr/bin/tclsh is 64-bit, there
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# is no place to stick 64-bit modules, so skip it. On the other hand, make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# sure to find the right tcl bits when building 32-bit.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_64): CONFIGURE_OPTIONS += --enable-tcl=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_32): CONFIGURE_OPTIONS += --with-tclsh=$(USRBINDIR)/$(MACH32)/tclsh
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(CONFIGURE_32): CONFIGURE_ENV += TCLCONFIG=$(USRLIBDIR)/tclConfig.sh
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Put the 64-bit lua module in a 64-bit directory.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INSTALL_32): COMPONENT_INSTALL_ARGS += LUA_INSTALL_DIR=$(USRLIBDIR)/lua/5.2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INSTALL_64): COMPONENT_INSTALL_ARGS += LUA_INSTALL_DIR=$(USRLIBDIR)/lua/5.2/64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use GNU ln, which supports the -r (--relative) option.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_INSTALL_ARGS += LN_S="gln -s"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Create the config file once the 32-bit build is complete. This runs the bits
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# we just built, so we have to set a handful of variables to the right place.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The 32-bit executables are in their own directory, so we have to point to
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# that version of dot explicitly.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(PROTOUSRLIBDIR)/graphviz/config6: $(INSTALL_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews env LD_LIBRARY_PATH=$(PROTOUSRLIBDIR) GVBINDIR=$(PROTOUSRLIBDIR)/graphviz \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTOUSRBINDIR)/$(MACH32)/dot -c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Once the build is complete, compile the .py file. There's no need to compile
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the one in the "64" directory, so don't recurse. And make sure that the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# build path doesn't get embedded in the .pyc file.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(PROTO_DIR)/$(PYTHON.2.7.VENDOR_PACKAGES)/gv.pyc: $(INSTALL_32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PYTHON.2.7.32) -m compileall -l -d $(PYTHON.2.7.VENDOR_PACKAGES) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PROTO_DIR)/$(PYTHON.2.7.VENDOR_PACKAGES)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPKG_MACROS += PERL_PKG=$(PERL_PKG)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPKG_MACROS += PERL_VERSION_NODOT=$(PERL_VERSION_NODOT)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The test infrastructure doesn't run in a VPATHed environment.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PRE_TEST_ACTION = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(@D)/rtest; ln -s $(SOURCE_DIR)/rtest/* .)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += image/graphviz
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += image/library/libjpeg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += image/library/libpng
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += image/library/librsvg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/desktop/atk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/desktop/cairo
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/desktop/gdk-pixbuf
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/desktop/gtk2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/desktop/pango
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/expat
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/gd
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/glib2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/libtool/libltdl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += library/zlib
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += print/filter/ghostscript
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += runtime/lua
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += runtime/ocaml
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += $(PERL_PKG)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += runtime/ruby-21
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += runtime/tk-8
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += shell/ksh93
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += system/library/c++-runtime
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += system/library/fontconfig
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += system/library/freetype-2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += system/library/math
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += web/php-56
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/libx11
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/libxcursor
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/libxmu
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/libxrender
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/toolkit/libxaw7
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/toolkit/libxt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews