Makefile revision 5487
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
dcfda24abf565c442d058cbf81b2180d847a1b3eAutomatic Updater# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# 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
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater# 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) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/shared-macros.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_NAME= R
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_VERSION= 3.2.3
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PROJECT_URL= http://www.r-project.org/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater sha256:b93b7d878138279234160f007cb9b7f81b8a72c012a15566e9ec5395cfd9b6c1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_URL= http://cran.mtu.edu/src/base/R-3/$(COMPONENT_ARCHIVE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUGDB= utility/r
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTPNO= 26540
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(WS_MAKE_RULES)/prep.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(WS_MAKE_RULES)/configure.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(WS_MAKE_RULES)/ips.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PRE_CONFIGURE_ACTION = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ($(CLONEY) $(SOURCE_DIR) $(@D))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Get rid of compiler path set in RUNPATH
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLDFLAGS += $(studio_NORUNPATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic UpdaterLDFLAGS += $(CC_BITS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLDFLAGS += $(studio_PIC)
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic UpdaterLDFLAGS += $(LD_DEF_LIBS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSTUDIO_LIBS_PATH = /usr/lib/studio/64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsR_LIBS_PATH = /usr/lib/$(MACH64)/R/lib
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsJAVA_LIBS_PATH = $(JAVA8_HOME)/jre/lib/$(MACH64)/server
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLDFLAGS += -L$(STUDIO_LIBS_PATH) -R$(STUDIO_LIBS_PATH) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -lsunperf -lfsu -lmtsk -lpicl -lkstat
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Augment the PATH and set CC/CXX/F95 such that the build environment doesn't
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# leak into usr/lib/64/etc/Makeconf and force consumers to have a setup like
7717ec7a6a898cdd3c35cbfba66010b7304ffd9bAutomatic Updater# our build environment to build R modules.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsexport PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCC = cc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCXX = CC
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsF95 = f95
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += F77="$(F95) $(CC_BITS)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += FC="$(F95) $(CC_BITS)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_ENV += CPICFLAGS="$(studio_PIC)"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += CFLAGS="-xO3 -xc99 -xlibmieee $(CC_BITS)"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater# Needed to successfully compile R packages using C++ code.
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += CXX="$(CXX) -std=c++11"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) -std=c++11"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += FPICFLAGS="$(studio_PIC)"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += FFLAGS="-xO3 $(CC_BITS)"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += FCFLAGS="-xO3 $(CC_BITS)"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += FCLIBS="-lsunperf -lfsu -lsunmath"
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCONFIGURE_ENV += FLIBS="-lsunperf -lfsu -lsunmath"
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCONFIGURE_ENV += LDFLAGS="$(LDFLAGS) -L$(R_LIBS_PATH) -R$(R_LIBS_PATH)"
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Needed so that R packages using C++ code can link against the standard
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# C++ libraries.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCONFIGURE_ENV += SHLIB_CXXLDFLAGS="-lCrunG3"
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# Set the various Java variables otherwise it auto-detects the 32-bit ones.
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterCONFIGURE_ENV += JAVA_CPPFLAGS="-I$(JAVA8_HOME)/jre/../include -I$(JAVA8_HOME)/jre/../include/solaris"
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterCONFIGURE_ENV += JAVA_LIBS="-L$(JAVA_LIBS_PATH) -R$(JAVA_LIBS_PATH) -ljvm"
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# From Brian Whitney:
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# You need to define this option on SPARC, otherwise you will get quad
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# arithmetic on SPARC but not on x86. Really makes some R functions run
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic Updater# very slow on SPARC (COR path).
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterCONFIGURE_OPTIONS.i386 =
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterCONFIGURE_OPTIONS.sparc = --disable-long-double
be6c1c506161e6f45fcff5d0425f78801bc267c1Automatic UpdaterCONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic Updater
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterCONFIGURE_OPTIONS += --enable-R-shlib
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterCONFIGURE_OPTIONS += --with-blas='-lsunperf'
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterCONFIGURE_OPTIONS += --with-ICU
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterCONFIGURE_OPTIONS += --with-lapack
64affc54f96a2c71cbd10ed71e246ce0746259aaAutomatic UpdaterCONFIGURE_OPTIONS += --with-recommended-packages
8ec3c085233cedb22b05da36e2773c8f357a7e45Automatic UpdaterCONFIGURE_OPTIONS += --with-tcltk
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCONFIGURE_OPTIONS += --enable-prebuilt-html
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCOMPONENT_PRE_TEST_ACTION = \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCOMPONENT_PRE_SYSTEM_TEST_ACTION = \
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater# Increase stack limit to allow the "infinite recursion" test to work.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCOMPONENT_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic UpdaterCOMPONENT_SYSTEM_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_TRANSFORMS += \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-n ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/^Testing examples for package /p" ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/^running /p" ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/^ expect some differences/p" ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/comparing.*datetime.Rout/d" ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/comparing.*reg-examples3.Rout/d" ' \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '-e "/^ comparing /p" '
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsASLR_MODE = $(ASLR_ENABLE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use the installed version of R, not the one in the build area.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# These definitions override those found in .../test/Makefile.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R="LANGUAGE=en LC_ALL=C SRCDIR=$(BUILD_DIR_64)/tests R_DEFAULT_PACKAGES= /usr/bin/R --vanilla"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R2="R_DEFAULT_PACKAGES= /usr/bin/R --vanilla"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += R3="/usr/bin/R CMD check"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += RDIFF="/usr/bin/R CMD Rdiff"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += RDCONV="LC_CTYPE=C /usr/bin/R CMD Rdconv"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_ARGS = -k -i
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_ARGS += -k -i
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsconfigure: $(CONFIGURE_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsbuild: $(BUILD_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall: $(INSTALL_64)
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updater
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic Updatertest: $(TEST_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater# Need to build the tests before use them.
60a900e83bab52c3f023be66654f3ab023172778Automatic Updatersystem-test: build $(SYSTEM_TEST_64)
60a900e83bab52c3f023be66654f3ab023172778Automatic Updater
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += image/library/libjpeg
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += image/library/libpng
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += image/library/libtiff
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/desktop/cairo
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/desktop/pango
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/glib2
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/icu
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/pcre
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/readline
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += library/zlib
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += shell/bash
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += system/library
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += system/library/fortran-runtime
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += system/library/iconv
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += system/library/math
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += system/library/sunperf
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += web/curl
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += x11/library/libx11
60a900e83bab52c3f023be66654f3ab023172778Automatic UpdaterREQUIRED_PACKAGES += x11/library/libxmu
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREQUIRED_PACKAGES += x11/library/toolkit/libxt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews