File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1010 exit 1
1111end
1212
13+ File . open ( "config.h" , "w" ) do |f |
14+ f . puts ( "#ifndef R_CONFIG_H" )
15+ f . puts ( "#define R_CONFIG_H" )
16+ r_home = $configure_args. has_key? ( '--with-R-dir' ) ? $configure_args[ '--with-R-dir' ] . inspect : 'NULL'
17+ f . puts ( "#define RSRUBY_R_HOME #{ r_home } " )
18+ f . puts ( "#endif" )
19+ end
20+
1321create_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 */
@@ -146,6 +148,9 @@ void init_R(int argc, char **argv){
146148
147149 char * defaultArgv [] = {"rsruby" ,"-q" ,"--vanilla" };
148150
151+ if (RSRUBY_R_HOME ) {
152+ setenv ("R_HOME" , RSRUBY_R_HOME , 0 );
153+ }
149154 Rf_initEmbeddedR (sizeof (defaultArgv ) / sizeof (defaultArgv [0 ]), defaultArgv );
150155 R_Interactive = FALSE; //Remove crash menu (and other interactive R features)
151156}
You can’t perform that action at this time.
0 commit comments