Skip to content

Commit 89a5954

Browse files
committed
The function RcppLdFlags, used to build packages using Rcpp, is now exported.
1 parent 5888d47 commit 89a5954

File tree

7 files changed

+85
-25
lines changed

7 files changed

+85
-25
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2013-09-17 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* NAMESPACE: Export RcppLdFlags which is often used to build Rcpp
4+
* man/RcppLdFlags.Rd: Added required manual page
5+
* R/Attributes.R: Call RcppLdFlags() via '::' instead of ':::'
6+
* R/SHLIB.R: Ditto
7+
* R/inline.R: Ditto
8+
19
2013-09-16 JJ Allaire <jj@rstudio.org>
210

311
* R/Attributes.R : Remove calls to non-exported functions from the tools package

NAMESPACE

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1+
12
useDynLib(Rcpp, .registration = TRUE)
23

3-
import( methods )
4-
importFrom( utils, capture.output, assignInNamespace, .DollarNames, prompt, packageDescription )
4+
import(methods)
5+
importFrom(utils, capture.output, assignInNamespace, .DollarNames, prompt, packageDescription)
56

6-
exportClasses( Module, "C++Field",
7-
"C++OverloadedMethods",
8-
"C++Constructor",
9-
"C++Class", "C++Object", "C++Function"
10-
)
7+
exportClasses(Module, "C++Field",
8+
"C++OverloadedMethods",
9+
"C++Constructor",
10+
"C++Class", "C++Object", "C++Function")
1111

12-
S3method( .DollarNames, "C++Object" )
13-
S3method( .DollarNames, "Module" )
14-
exportMethods( prompt, show, .DollarNames, initialize, "formals<-" )
12+
S3method(.DollarNames, "C++Object")
13+
S3method(.DollarNames, "Module")
14+
exportMethods(prompt, show, .DollarNames, initialize, "formals<-")
1515

16-
export(
17-
Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass,
18-
loadModule, cppFunction, evalCpp, sourceCpp, compileAttributes, registerPlugin
19-
)
16+
export(Module,
17+
Rcpp.package.skeleton,
18+
populate,
19+
loadRcppModules,
20+
setRcppClass,
21+
loadModule,
22+
cppFunction,
23+
evalCpp,
24+
sourceCpp,
25+
compileAttributes,
26+
registerPlugin,
27+
RcppLdFlags
28+
)
2029

2130
exportClass(RcppClass)
2231

R/Attributes.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
312312
pkgDesc <- read.dcf(descFile)[1,]
313313
pkgname = .readPkgDescField(pkgDesc, "Package")
314314
depends <- .readPkgDescField(pkgDesc, "Depends", character())
315-
depends <- unique(.splitDepends(depends))
315+
depends <- unique(.splitDepends(depends))
316316
depends <- depends[depends != "R"]
317-
317+
318318
# determine source directory
319319
srcDir <- file.path(pkgdir, "src")
320320
if (!file.exists(srcDir))
@@ -451,7 +451,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
451451

452452
# Split the depends field of a package description
453453
.splitDepends <- function(x) {
454-
if (!length(x))
454+
if (!length(x))
455455
return(character())
456456
x <- unlist(strsplit(x, ","))
457457
x <- sub("[[:space:]]+$", "", x)
@@ -566,7 +566,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
566566
# we are using a plugin -- confirm that the plugin includes the Rcpp
567567
# PKG_LIBS and if it doesn't then add them
568568
pkgLibs <- buildEnv$PKG_LIBS
569-
rcppLibs <- Rcpp:::RcppLdFlags()
569+
rcppLibs <- Rcpp::RcppLdFlags()
570570
if (is.null(pkgLibs) || !grepl(rcppLibs, pkgLibs, fixed = TRUE))
571571
buildEnv$PKG_LIBS <- paste(pkgLibs, rcppLibs)
572572
}

R/SHLIB.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#
1515
# You should have received a copy of the GNU General Public License
1616
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
17-
18-
SHLIB.maker <- function(env =
19-
list(
20-
PKG_LIBS = Rcpp:::RcppLdFlags(),
17+
18+
SHLIB.maker <- function(env =
19+
list(
20+
PKG_LIBS = Rcpp::RcppLdFlags(),
2121
PKG_CPPFLAGS = Rcpp:::RcppCxxFlags()
2222
)
2323
){
@@ -26,7 +26,7 @@ SHLIB.maker <- function(env =
2626
R <- file.path( R.home(component = "bin"), "R" )
2727
system( sprintf( "%s CMD SHLIB %s", R, cmd ) )
2828
}
29-
}
30-
29+
}
30+
3131
SHLIB <- SHLIB.maker()
3232

R/inline.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ using namespace Rcpp;
4242
", include.before, include.after )
4343

4444
list(
45-
env = list( PKG_LIBS = paste( libs, Rcpp:::RcppLdFlags() ) ),
45+
env = list( PKG_LIBS = paste( libs, Rcpp::RcppLdFlags() ) ),
4646
includes = includes,
4747
LinkingTo = LinkingTo ,
4848
body = function( x ){

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
if you expose a class \code{Foo} via modules, then you can wrap
3535
\code{vector<Foo>}, ... An example is included in the \code{wrap} unit test
3636
file
37+
\item \code{RcppLdFlags()}, often used in \code{Makevars} files of
38+
packages using \pkg{Rcpp}, is now exported from the package namespace.
3739
}
3840
\item Changes in Attributes:
3941
\itemize{

man/RcppLdFlags.Rd

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
\name{RcppLdFlags}
2+
\alias{RcppLdFlags}
3+
\title{Provide Rcpp Linker Flags}
4+
\description{
5+
\code{RcppLdFlags} returns the required flags and options for the the
6+
system linker. This allows portable use of \pkg{Rcpp} as package
7+
location as well as operating-system specific details are abstracted
8+
away behind the interface of this function.
9+
10+
It is commonly called from the files \code{Makevars} (or
11+
\code{Makevars.win}) rather than in an interactive session.
12+
}
13+
\usage{
14+
RcppLdFlags(static=staticLinking())
15+
}
16+
\arguments{
17+
\item{static}{A boolean determining use of static (as opposed to
18+
dynamic) linking; defaults to using the \code{staticLinking()}
19+
function which defaults to \code{FALSE} on Linux, and \code{TRUE}
20+
if the operating system is different from Linux.}
21+
}
22+
\value{
23+
A character vector suitable by use by the system linker in order to
24+
create a library based on \pkg{Rcpp}.
25+
}
26+
\details{
27+
This function is not meant to used interactively, and is intended
28+
solely for use by the build tools.
29+
}
30+
\references{
31+
Dirk Eddelbuettel and Romain Francois (2011). \pkg{Rcpp}: Seamless R
32+
and C++ Integration. \emph{Journal of Statistical Software},
33+
\bold{40(8)}, 1-18. URL http://www.jstatsoft.org/v40/i08/ and
34+
available as \code{vignette("Rcpp-introduction")}.
35+
}
36+
\seealso{
37+
The vignette \sQuote{Rcpp-package} has more details.
38+
}
39+
\author{Dirk Eddelbuettel and Romain Francois}
40+
\keyword{programming}
41+
\keyword{interface}

0 commit comments

Comments
 (0)