File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 2626 exit 1
2727end
2828
29+ File . open ( "config.h" , "w" ) do |f |
30+ f . puts ( "#ifndef R_CONFIG_H" )
31+ f . puts ( "#define R_CONFIG_H" )
32+ r_home = $configure_args. has_key? ( '--with-R-dir' ) ? $configure_args[ '--with-R-dir' ] . inspect : 'NULL'
33+ f . puts ( "#define RSRUBY_R_HOME #{ r_home } " )
34+ f . puts ( "#endif" )
35+ end
36+ $extconf_h = 'config.h'
37+
2938create_makefile ( "rsruby_c" )
Original file line number Diff line number Diff line change 3030*/
3131
3232#include "rsruby.h"
33+ #include "config.h"
34+ #include <stdlib.h>
3335
3436/* Global list to protect R objects from garbage collection */
3537/* This is inspired in $R_SRC/src/main/memory.c */
@@ -139,6 +141,9 @@ void init_R(int argc, char **argv){
139141
140142 char * defaultArgv [] = {"rsruby" ,"-q" ,"--vanilla" };
141143
144+ if (RSRUBY_R_HOME ) {
145+ setenv ("R_HOME" , RSRUBY_R_HOME , 0 );
146+ }
142147 Rf_initEmbeddedR (sizeof (defaultArgv ) / sizeof (defaultArgv [0 ]), defaultArgv );
143148 R_Interactive = FALSE; //Remove crash menu (and other interactive R features)
144149}
You can’t perform that action at this time.
0 commit comments