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