[Rcpp-commits] r394 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 17 18:50:25 CET 2010


Author: edd
Date: 2010-01-17 18:50:24 +0100 (Sun, 17 Jan 2010)
New Revision: 394

Modified:
   pkg/R/RcppLdpath.R
Log:
a couple small fixes:
 - LdFlags() now actually takes an argument static (with default FALSE) and passes it on
 - CxxFlags() does likeweise cxx0x, also defaulting to FALSE
 - the test programs gets compiled via $RHOME/bin/R as Kurt always like to switch R engines


Modified: pkg/R/RcppLdpath.R
===================================================================
--- pkg/R/RcppLdpath.R	2010-01-17 14:28:06 UTC (rev 393)
+++ pkg/R/RcppLdpath.R	2010-01-17 17:50:24 UTC (rev 394)
@@ -35,22 +35,23 @@
 }
 
 ## Shorter names, and call cat() directly
-CxxFlags <- function() cat(RcppCxxFlags())
-LdFlags <- function() cat(RcppLdFlags())
+CxxFlags <- function(cxx0x=FALSE) cat(RcppCxxFlags(cxx0x=cxx0x))
+LdFlags <- function(static=FALSE) cat(RcppLdFlags(static=static))
 
 # capabilities
 RcppCapabilities <- capabilities <- function() .Call("capabilities", PACKAGE = "Rcpp")
 
-# compile, load and call the cxx0x.c script to identify whether 
+# compile, load and call the cxx0x.c script to identify whether
 # the compiler is GCC >= 4.3
 RcppCxx0xFlags <- function(){
 	td <- tempfile()
-	dir.create( td ) 
-	here <- getwd() 
-	setwd(td) 
+	dir.create( td )
+	here <- getwd()
+	setwd(td)
 	on.exit( { setwd(here) ; unlink( td, recursive = TRUE ) } )
 	file.copy( system.file( "discovery", "cxx0x.c", package = "Rcpp" ), td )
-	system( 'R CMD SHLIB cxx0x.c', intern = TRUE )
+        cmd <- paste(R.home(component="bin"), "/R CMD SHLIB cxx0x.c", sep="")
+	system( cmd, intern = TRUE )
 	dll <- sprintf( "cxx0x%s", .Platform$dynlib.ext )
 	dyn.load( dll )
 	res <- tryCatch( .Call( "cxx0x" ), error = "" )



More information about the Rcpp-commits mailing list