Makefile revision 5851
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews#
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# CDDL HEADER START
04428429c4e689333e3ef8d19a2debeb20d4d15dMark Andrews#
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.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews#
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# or http://www.opensolaris.org/os/licensing.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# and limitations under the License.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews#
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]
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews#
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews#
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# switching to parfait breaks a patch (23049278)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewsexport PARFAIT_BUILD=no
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsBUILD_BITS= 64
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssoninclude ../../make-rules/shared-macros.mk
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsCOMPONENT_NAME= R
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCOMPONENT_VERSION= 3.2.3
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsCOMPONENT_PROJECT_URL= http://www.r-project.org/
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCOMPONENT_ARCHIVE_HASH= \
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews sha256:b93b7d878138279234160f007cb9b7f81b8a72c012a15566e9ec5395cfd9b6c1
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_ARCHIVE_URL= http://cran.mtu.edu/src/base/R-3/$(COMPONENT_ARCHIVE)
c718d15a9a95054ee3c71540c02335426071fc6dMark AndrewsCOMPONENT_BUGDB= utility/r
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsTPNO= 26540
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Need to build the tests before using them.
c069a20053d41ae299eb9457e50ea44ae9f73ed2Mark AndrewsSYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrewsinclude $(WS_MAKE_RULES)/common.mk
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark AndrewsCOMPONENT_PRE_CONFIGURE_ACTION = \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews ($(CLONEY) $(SOURCE_DIR) $(@D))
3f6174bffe227be44e241a29d186add00c032ff6Mark Andrews
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsSTUDIO_LIBS_PATH = $(USRLIBDIR)/studio/64
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 AndrewsR_LIBS_PATH = /usr/lib/64/R/lib
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark AndrewsJAVA_LIBS_PATH = $(JAVA8_HOME)/jre/lib/$(MACH64)/server
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonLDFLAGS += $(CC_BITS)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsLDFLAGS += -L$(STUDIO_LIBS_PATH) -R$(STUDIO_LIBS_PATH) \
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews -lsunperf -lfsu -lmtsk -lpicl -lkstat
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonLDFLAGS += -L$(R_LIBS_PATH) -R$(R_LIBS_PATH)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
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)
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsCC = gcc
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCXX = g++
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsFC = gfortran
62ee2c9f460d2e2e45dcf1abc8b4b4a4a43f5618Mark AndrewsF77 = gfortran
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrewsifeq ($(strip $(PARFAIT_BUILD)),yes)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsexport PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
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 AndrewsR_PIC = -fPIC
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
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)"
80f9a970ae6681c08529ef209eaabbe078c27ca3Mark AndrewsCONFIGURE_ENV += CXX="$(CXX) $(CC_BITS)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FC="$(FC) $(CC_BITS)"
46e873c835bf7d9ec3e1097e0aceb8db5b1ae93aMark AndrewsCONFIGURE_ENV += F77="$(F77) $(CC_BITS)"
46e873c835bf7d9ec3e1097e0aceb8db5b1ae93aMark Andrews
dd9ad704c3800e3ab07ede8595871eac79984871Mark AndrewsCONFIGURE_ENV += C_VISIBILITY="-fvisibility=hidden"
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark AndrewsCONFIGURE_ENV += CFLAGS="-g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
45eca3a5d46ed15aee14d81f6cb6c9fb6f365344Mark AndrewsCONFIGURE_ENV += CPICFLAGS="$(R_PIC)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews
ab81f57ca0c3addfec3df3babdcea9644757cf23Mark AndrewsCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark AndrewsCONFIGURE_ENV += CXXPICFLAGS="$(R_PIC)"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += CXX1X="g++"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += CXX1XFLAGS="$(CC_BITS) -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2"
413988c8166976498250c0ebb2e3a645d0366bd3Mark AndrewsCONFIGURE_ENV += CXX1XPICFLAGS="$(R_PIC)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += CXX1XSTD="-std=c++11"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += FCFLAGS="-g -O2 $(CC_BITS)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += F77_VISIBILITY="-fvisibility=hidden"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FFLAGS="-g -O2 $(CC_BITS)"
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_ENV += FCLIBS="-lsunperf -lfsu -lsunmath"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FLIBS="-lsunperf -lfsu -lsunmath -lgfortran -lm"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FCPICFLAGS="$(R_PIC)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_ENV += FPICFLAGS="$(R_PIC)"
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark Andrews
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
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
ea935c46e8261ea10621e5b038426539fe8a7cc5Mark Andrews
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_OPTIONS += --enable-R-shlib
d56e188030368b835122d759ebbf8d9613c166f4Mark AndrewsCONFIGURE_OPTIONS += --with-blas='-lsunperf'
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_OPTIONS += --with-ICU
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_OPTIONS += --with-lapack
96ea71632887c58a9d00f47eb318bf76b35903c3Mark AndrewsCONFIGURE_OPTIONS += --with-recommended-packages
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCONFIGURE_OPTIONS += --with-tcltk
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCONFIGURE_OPTIONS += --enable-prebuilt-html
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews
b7aab05edae933e169d5f83c653935b17c7f0a8bMark AndrewsCOMPONENT_PRE_TEST_ACTION = \
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark AndrewsCOMPONENT_PRE_SYSTEM_TEST_ACTION = \
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
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)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsCOMPONENT_TEST_TRANSFORMS += \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews '-n ' \
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" '
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington
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"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsCOMPONENT_TEST_ARGS = -k -i
45eca3a5d46ed15aee14d81f6cb6c9fb6f365344Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += -k -i
ca12f7f4cf72e2368ee946f3eb4915ab73576cdcMark Andrews
7e1a8f402e3881388db37152f71c698cb1f1c426Mark AndrewsREQUIRED_PACKAGES += image/library/libjpeg
1eb1e1e838d2ea00b166c918bf50764a95826be8Mark AndrewsREQUIRED_PACKAGES += image/library/libpng
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonREQUIRED_PACKAGES += image/library/libtiff
0d3490f93bb980fde704055e74c1b508987a5fe4Mark AndrewsREQUIRED_PACKAGES += library/desktop/cairo
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += library/desktop/pango
c718d15a9a95054ee3c71540c02335426071fc6dMark AndrewsREQUIRED_PACKAGES += library/glib2
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsREQUIRED_PACKAGES += library/icu
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += library/pcre
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsREQUIRED_PACKAGES += library/readline
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonREQUIRED_PACKAGES += library/zlib
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsREQUIRED_PACKAGES += shell/bash
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonREQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
8ae412a86ed138263796195eed82a4716e7effcbMark AndrewsREQUIRED_PACKAGES += system/library/iconv
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsREQUIRED_PACKAGES += system/library/math
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += system/library/sunperf
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsREQUIRED_PACKAGES += web/curl
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark AndrewsREQUIRED_PACKAGES += x11/library/libx11
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += x11/library/libxmu
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsREQUIRED_PACKAGES += x11/library/toolkit/libxt
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews