Makefile revision 5851
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# CDDL HEADER START
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# The contents of this file are subject to the terms of the
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# Common Development and Distribution License (the "License").
2a40fdc2d34adb8a5c72a748449699666032d461Mark Andrews# You may not use this file except in compliance with the License.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
d56e188030368b835122d759ebbf8d9613c166f4Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# If applicable, add the following below this CDDL HEADER, with the
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# CDDL HEADER END
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# switching to parfait breaks a patch (23049278)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsCOMPONENT_PROJECT_URL= http://www.r-project.org/
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews sha256:b93b7d878138279234160f007cb9b7f81b8a72c012a15566e9ec5395cfd9b6c1
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_ARCHIVE_URL= http://cran.mtu.edu/src/base/R-3/$(COMPONENT_ARCHIVE)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Need to build the tests before using them.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# R_LIBS_PATH is used when creating /usr/lib/64/R/etc/Makeconf
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Using a resolved pathname here (rather than say $(USRLIBDIR64)/R/lib) so
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# that the Makeconf-GNU.patch patch used by the COMPONENT_POST_INSTALL_ACTION
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# will just work on both platforms.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark AndrewsJAVA_LIBS_PATH = $(JAVA8_HOME)/jre/lib/$(MACH64)/server
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsLDFLAGS += -L$(STUDIO_LIBS_PATH) -R$(STUDIO_LIBS_PATH) \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonLDFLAGS += -L$(R_LIBS_PATH) -R$(R_LIBS_PATH)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Augment the PATH and set CC/CXX/FC/F77 such that the build environment doesn't
26a77b80bb7ee886c6fa704348d5e80a011d8811Mark Andrews# leak into usr/lib/64/etc/Makeconf and force consumers to have a setup like
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# our build environment to build R modules.
6f046a065e5543f8cd7e2f24991c65d2372f4c8dMark Andrewsexport PATH=$(GCC_ROOT)/bin:$(USRBINDIR):$(GNUBIN)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsexport PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# We can't use $(CC_PIC) here (which provides "-fPIC -DPIC" for the GNU
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# compilers), because we fail at configure time with:
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# configure: error: Building R requires the 'va_copy' system call
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# .../make-rules/configure.mk:170: recipe for target
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# '.../components/r/build/amd64/.configured' failed
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# These CONFIGURE_ENV lines are here so that /usr/lib/64/R/etc/Makeconf (the
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# configuration file used when building/installing the R CRAN packages),
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# is in exactly the correct format to work properly with the GNU compilers for
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews# all the R CRAN packages containing C, C++, Fortran or Java code.
45eca3a5d46ed15aee14d81f6cb6c9fb6f365344Mark AndrewsCONFIGURE_ENV += CC="$(CC) -std=gnu99 $(CC_BITS)"
dd9ad704c3800e3ab07ede8595871eac79984871Mark AndrewsCONFIGURE_ENV += C_VISIBILITY="-fvisibility=hidden"
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark AndrewsCONFIGURE_ENV += CFLAGS="-g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
ab81f57ca0c3addfec3df3babdcea9644757cf23Mark AndrewsCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += CXX1XFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += F77_VISIBILITY="-fvisibility=hidden"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += FCLIBS="-lsunperf -lfsu -lsunmath"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FLIBS="-lsunperf -lfsu -lsunmath -lgfortran -lm"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Set the various Java variables otherwise it auto-detects the 32-bit ones.
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += JAVA_CPPFLAGS="-I$(JAVA8_HOME)/jre/../include -I$(JAVA8_HOME)/jre/../include/solaris"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += JAVA_LIBS="-L$(JAVA_LIBS_PATH) -R$(JAVA_LIBS_PATH) -ljvm"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews# From Brian Whitney:
45eca3a5d46ed15aee14d81f6cb6c9fb6f365344Mark Andrews# You need to define this option on SPARC, otherwise you will get quad
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# arithmetic on SPARC but not on x86. Really makes some R functions run
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# very slow on SPARC (COR path).
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_OPTIONS.sparc += --disable-long-double
96ea71632887c58a9d00f47eb318bf76b35903c3Mark AndrewsCONFIGURE_OPTIONS += --with-recommended-packages
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Increase stack limit to allow the "infinite recursion" test to work.
46e873c835bf7d9ec3e1097e0aceb8db5b1ae93aMark AndrewsCOMPONENT_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_SYSTEM_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
0d3490f93bb980fde704055e74c1b508987a5fe4Mark Andrews '-e "/^Testing examples for package /p" ' \
5147281cb8e25c599d759dfa65fdb6f9125efefbMark Andrews '-e "/^running /p" ' \
6a78eb0a8677dca8817233799a715de27f9c2cbbMark Andrews '-e "/^ expect some differences/p" ' \
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews '-e "/comparing.*datetime.Rout/d" ' \
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews '-e "/comparing.*reg-examples3.Rout/d" ' \
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark Andrews '-e "/^ comparing /p" '
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Use the installed version of R, not the one in the build area.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# These definitions override those found in .../test/Makefile.
62ee2c9f460d2e2e45dcf1abc8b4b4a4a43f5618Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R="LANGUAGE=en LC_ALL=C SRCDIR=$(BUILD_DIR_64)/tests R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
1eb1e1e838d2ea00b166c918bf50764a95826be8Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R2="R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R3="$(USRBINDIR)/R CMD check"
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += RDIFF="$(USRBINDIR)/R CMD Rdiff"
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += RDCONV="LC_CTYPE=C $(USRBINDIR)/R CMD Rdconv"