The R Project SVN R

Rev

Rev 89004 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89004 Rev 89368
Line 87... Line 87...
87
static const char  * const R_FileSep = FILESEP;
87
static const char  * const R_FileSep = FILESEP;
88
 
88
 
89
static void Init_R_Platform(SEXP rho)
89
static void Init_R_Platform(SEXP rho)
90
{
90
{
91
    SEXP value, names;
91
    SEXP value, names;
-
 
92
    char *pkgType;
92
 
93
 
93
    PROTECT(value = allocVector(VECSXP, 8));
94
    PROTECT(value = allocVector(VECSXP, 8));
94
    PROTECT(names = allocVector(STRSXP, 8));
95
    PROTECT(names = allocVector(STRSXP, 8));
95
    SET_STRING_ELT(names, 0, mkChar("OS.type"));
96
    SET_STRING_ELT(names, 0, mkChar("OS.type"));
96
    SET_STRING_ELT(names, 1, mkChar("file.sep"));
97
    SET_STRING_ELT(names, 1, mkChar("file.sep"));
Line 110... Line 111...
110
    SET_VECTOR_ELT(value, 4, mkString("little"));
111
    SET_VECTOR_ELT(value, 4, mkString("little"));
111
#endif
112
#endif
112
/* pkgType should be "mac.binary" for CRAN build *only*, not for all
113
/* pkgType should be "mac.binary" for CRAN build *only*, not for all
113
   AQUA builds. Also we want to be able to use "mac.binary.mavericks",
114
   AQUA builds. Also we want to be able to use "mac.binary.mavericks",
114
   "mac.binary.el-capitan" and similar. */
115
   "mac.binary.el-capitan" and similar. */
-
 
116
/* since R 4.6.0 we extend the support to other platforms, so we allow
-
 
117
   R_PLATFORM_PKGTYPE env var to override this such that other builds can
-
 
118
   set this in their Renviron */
-
 
119
    if ((pkgType = getenv("R_PLATFORM_PKGTYPE")) && *pkgType)
-
 
120
	SET_VECTOR_ELT(value, 5, mkString(pkgType));
-
 
121
    else
115
#ifdef PLATFORM_PKGTYPE
122
#ifdef PLATFORM_PKGTYPE
116
    SET_VECTOR_ELT(value, 5, mkString(PLATFORM_PKGTYPE));
123
    SET_VECTOR_ELT(value, 5, mkString(PLATFORM_PKGTYPE));
117
#else /* unix default */
124
#else /* unix default */
118
    SET_VECTOR_ELT(value, 5, mkString("source"));
125
    SET_VECTOR_ELT(value, 5, mkString("source"));
119
#endif
126
#endif