4737N/A#
4737N/A# CDDL HEADER START
4737N/A#
4737N/A# The contents of this file are subject to the terms of the
4737N/A# Common Development and Distribution License (the "License").
4737N/A# You may not use this file except in compliance with the License.
4737N/A#
4737N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4737N/A# or http://www.opensolaris.org/os/licensing.
4737N/A# See the License for the specific language governing permissions
4737N/A# and limitations under the License.
4737N/A#
4737N/A# When distributing Covered Code, include this CDDL HEADER in each
4737N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4737N/A# If applicable, add the following below this CDDL HEADER, with the
4737N/A# fields enclosed by brackets "[]" replaced with your own identifying
4737N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4737N/A#
4737N/A# CDDL HEADER END
4737N/A#
4737N/A
4737N/A#
5336N/A# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4737N/A#
5680N/ABUILD_BITS= 64
4737N/Ainclude ../../make-rules/shared-macros.mk
4737N/A
4737N/ACOMPONENT_NAME= R
6015N/ACOMPONENT_VERSION= 3.2.5
4737N/ACOMPONENT_PROJECT_URL= http://www.r-project.org/
4737N/ACOMPONENT_ARCHIVE_HASH= \
6015N/A sha256:60745672dce5ddc201806fa59f6d4e0ba6554d8ed78d0f9f0d79a629978f80b5
4737N/ACOMPONENT_ARCHIVE_URL= http://cran.mtu.edu/src/base/R-3/$(COMPONENT_ARCHIVE)
4737N/ACOMPONENT_BUGDB= utility/r
4737N/A
6015N/ATPNO= 28040
4737N/A
6011N/A# Requires newer version of system/linker from ON, available in S12 but not
6011N/A# 11.3, so do not publish.
6011N/Aifeq ($(BUILD_TYPE), evaluation)
6011N/ABUILD_64=
6011N/AINSTALL_64=
6011N/APUBLISH_STAMP=
6011N/Aendif
6011N/A
5680N/A# Need to build the tests before using them.
5680N/ASYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
4737N/A
4737N/ACOMPONENT_PRE_CONFIGURE_ACTION = \
4737N/A ($(CLONEY) $(SOURCE_DIR) $(@D))
4737N/A
5680N/ASTUDIO_LIBS_PATH = $(USRLIBDIR)/studio/64
5690N/A# R_LIBS_PATH is used when creating /usr/lib/64/R/etc/Makeconf
5690N/A# Using a resolved pathname here (rather than say $(USRLIBDIR64)/R/lib) so
5690N/A# that the Makeconf-GNU.patch patch used by the COMPONENT_POST_INSTALL_ACTION
5690N/A# will just work on both platforms.
5690N/AR_LIBS_PATH = /usr/lib/64/R/lib
4737N/AJAVA_LIBS_PATH = $(JAVA8_HOME)/jre/lib/$(MACH64)/server
4737N/A
5851N/ALDFLAGS += $(CC_BITS)
4737N/ALDFLAGS += -L$(STUDIO_LIBS_PATH) -R$(STUDIO_LIBS_PATH) \
4737N/A -lsunperf -lfsu -lmtsk -lpicl -lkstat
5851N/ALDFLAGS += -L$(R_LIBS_PATH) -R$(R_LIBS_PATH)
4737N/A
5851N/A# Augment the PATH and set CC/CXX/FC/F77 such that the build environment doesn't
5487N/A# leak into usr/lib/64/etc/Makeconf and force consumers to have a setup like
5487N/A# our build environment to build R modules.
5851N/Aexport PATH=$(GCC_ROOT)/bin:$(USRBINDIR):$(GNUBIN)
5851N/ACC = gcc
5851N/ACXX = g++
5851N/AFC = gfortran
5851N/AF77 = gfortran
5672N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
5680N/Aexport PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
5672N/Aendif
5672N/A
5851N/A# We can't use $(CC_PIC) here (which provides "-fPIC -DPIC" for the GNU
5851N/A# compilers), because we fail at configure time with:
5851N/A# configure: error: Building R requires the 'va_copy' system call
5851N/A# .../make-rules/configure.mk:170: recipe for target
5851N/A# '.../components/r/build/amd64/.configured' failed
5851N/AR_PIC = -fPIC
4737N/A
5851N/A# These CONFIGURE_ENV lines are here so that /usr/lib/64/R/etc/Makeconf (the
5851N/A# configuration file used when building/installing the R CRAN packages),
5851N/A# is in exactly the correct format to work properly with the GNU compilers for
5851N/A# all the R CRAN packages containing C, C++, Fortran or Java code.
5851N/ACONFIGURE_ENV += CC="$(CC) -std=gnu99 $(CC_BITS)"
5851N/ACONFIGURE_ENV += CXX="$(CXX) $(CC_BITS)"
5851N/ACONFIGURE_ENV += FC="$(FC) $(CC_BITS)"
5851N/ACONFIGURE_ENV += F77="$(F77) $(CC_BITS)"
5594N/A
5851N/ACONFIGURE_ENV += C_VISIBILITY="-fvisibility=hidden"
5851N/ACONFIGURE_ENV += CFLAGS="-g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
5851N/ACONFIGURE_ENV += CPICFLAGS="$(R_PIC)"
5680N/A
5851N/ACONFIGURE_ENV += CXXFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
5851N/ACONFIGURE_ENV += CXXPICFLAGS="$(R_PIC)"
5851N/ACONFIGURE_ENV += CXX1X="g++"
5851N/ACONFIGURE_ENV += CXX1XFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
5851N/ACONFIGURE_ENV += CXX1XPICFLAGS="$(R_PIC)"
5851N/ACONFIGURE_ENV += CXX1XSTD="-std=c++11"
5851N/A
5851N/ACONFIGURE_ENV += FCFLAGS="-g -O2 $(CC_BITS)"
5851N/ACONFIGURE_ENV += F77_VISIBILITY="-fvisibility=hidden"
5851N/ACONFIGURE_ENV += FFLAGS="-g -O2 $(CC_BITS)"
4737N/ACONFIGURE_ENV += FCLIBS="-lsunperf -lfsu -lsunmath"
5851N/ACONFIGURE_ENV += FLIBS="-lsunperf -lfsu -lsunmath -lgfortran -lm"
5851N/ACONFIGURE_ENV += FCPICFLAGS="$(R_PIC)"
5851N/ACONFIGURE_ENV += FPICFLAGS="$(R_PIC)"
4737N/A
4737N/A# Set the various Java variables otherwise it auto-detects the 32-bit ones.
4737N/ACONFIGURE_ENV += JAVA_CPPFLAGS="-I$(JAVA8_HOME)/jre/../include -I$(JAVA8_HOME)/jre/../include/solaris"
4737N/ACONFIGURE_ENV += JAVA_LIBS="-L$(JAVA_LIBS_PATH) -R$(JAVA_LIBS_PATH) -ljvm"
4737N/A
4737N/A# From Brian Whitney:
4737N/A# You need to define this option on SPARC, otherwise you will get quad
4737N/A# arithmetic on SPARC but not on x86. Really makes some R functions run
4737N/A# very slow on SPARC (COR path).
5680N/ACONFIGURE_OPTIONS.sparc += --disable-long-double
4737N/A
4737N/ACONFIGURE_OPTIONS += --enable-R-shlib
4737N/ACONFIGURE_OPTIONS += --with-blas='-lsunperf'
4737N/ACONFIGURE_OPTIONS += --with-ICU
4737N/ACONFIGURE_OPTIONS += --with-lapack
4737N/ACONFIGURE_OPTIONS += --with-recommended-packages
4737N/ACONFIGURE_OPTIONS += --with-tcltk
4737N/ACONFIGURE_OPTIONS += --enable-prebuilt-html
4737N/A
4737N/ACOMPONENT_PRE_TEST_ACTION = \
4737N/A $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
4737N/A
4897N/ACOMPONENT_PRE_SYSTEM_TEST_ACTION = \
4897N/A $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
4897N/A
4737N/A# Increase stack limit to allow the "infinite recursion" test to work.
4737N/ACOMPONENT_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
4897N/ACOMPONENT_SYSTEM_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
4737N/A
5336N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
4737N/A
4737N/ACOMPONENT_TEST_TRANSFORMS += \
4737N/A '-n ' \
4737N/A '-e "/^Testing examples for package /p" ' \
4737N/A '-e "/^running /p" ' \
5336N/A '-e "/^ expect some differences/p" ' \
5336N/A '-e "/comparing.*datetime.Rout/d" ' \
5336N/A '-e "/comparing.*reg-examples3.Rout/d" ' \
5336N/A '-e "/^ comparing /p" '
4737N/A
4897N/A# Use the installed version of R, not the one in the build area.
4897N/A# These definitions override those found in .../test/Makefile.
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R="LANGUAGE=en LC_ALL=C SRCDIR=$(BUILD_DIR_64)/tests R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R2="R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R3="$(USRBINDIR)/R CMD check"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += RDIFF="$(USRBINDIR)/R CMD Rdiff"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += RDCONV="LC_CTYPE=C $(USRBINDIR)/R CMD Rdconv"
4897N/A
4897N/ACOMPONENT_TEST_ARGS = -k -i
4897N/ACOMPONENT_SYSTEM_TEST_ARGS += -k -i
4737N/A
4737N/AREQUIRED_PACKAGES += image/library/libjpeg
4737N/AREQUIRED_PACKAGES += image/library/libpng
4737N/AREQUIRED_PACKAGES += image/library/libtiff
4737N/AREQUIRED_PACKAGES += library/desktop/cairo
4737N/AREQUIRED_PACKAGES += library/desktop/pango
4737N/AREQUIRED_PACKAGES += library/glib2
4737N/AREQUIRED_PACKAGES += library/zlib
4737N/AREQUIRED_PACKAGES += shell/bash
7250N/AREQUIRED_PACKAGES += system/library/fortran-runtime
4737N/AREQUIRED_PACKAGES += system/library/math
7250N/AREQUIRED_PACKAGES += system/library/openmp
4737N/AREQUIRED_PACKAGES += system/library/sunperf
7250N/AREQUIRED_PACKAGES += system/picl
4737N/AREQUIRED_PACKAGES += web/curl
4737N/AREQUIRED_PACKAGES += x11/library/libx11
4737N/AREQUIRED_PACKAGES += x11/library/libxmu
4737N/AREQUIRED_PACKAGES += x11/library/toolkit/libxt