Skip to content

Commit a350053

Browse files
rm Makevars and Makevars.win from skeleton package
1 parent 31a3223 commit a350053

File tree

6 files changed

+9
-163
lines changed

6 files changed

+9
-163
lines changed

R/Rcpp.package.skeleton.R

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
134134
dir.create( src )
135135
}
136136
skeleton <- system.file( "skeleton", package = "Rcpp" )
137-
Makevars <- file.path( src, "Makevars" )
138-
if( !file.exists( Makevars ) ){
139-
file.copy( file.path( skeleton, "Makevars" ), Makevars )
140-
message( " >> added Makevars file with Rcpp settings" )
141-
}
142-
143-
Makevars.win <- file.path( src, "Makevars.win" )
144-
if( !file.exists( Makevars.win ) ){
145-
file.copy( file.path( skeleton, "Makevars.win" ), Makevars.win )
146-
message( " >> added Makevars.win file with Rcpp settings" )
147-
}
148-
137+
149138
if ( length(cpp_files) > 0L ) {
150139
for (file in cpp_files) {
151140
file.copy(file, src)

R/RcppLdpath.R

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -20,22 +20,10 @@ Rcpp.system.file <- function(...){
2020
tools::file_path_as_absolute( base::system.file( ..., package = "Rcpp" ) )
2121
}
2222

23-
## identifies if the default linking on the platform should be static
24-
## or dynamic. Currently only linux uses dynamic linking by default
25-
## although it works fine on mac osx as well
26-
staticLinking <- function() {
27-
! grepl( "^linux", R.version$os )
28-
}
29-
3023
## Use R's internal knowledge of path settings to find the lib/ directory
3124
## plus optinally an arch-specific directory on system building multi-arch
3225
RcppLdPath <- function() {
33-
if (nzchar(.Platform$r_arch)) { ## eg amd64, ia64, mips
34-
path <- Rcpp.system.file("lib",.Platform$r_arch)
35-
} else {
36-
path <- Rcpp.system.file("lib")
37-
}
38-
path
26+
""
3927
}
4028

4129
## Provide linker flags -- i.e. -L/path/to/libRcpp -- as well as an
@@ -45,34 +33,15 @@ RcppLdPath <- function() {
4533
## Updated Jan 2010: We now default to static linking but allow the use
4634
## of rpath on Linux if static==FALSE has been chosen
4735
## Note that this is probably being called from LdFlags()
48-
RcppLdFlags <- function(static=staticLinking()) {
49-
rcppdir <- RcppLdPath()
50-
if (static) { # static is default on Windows and OS X
51-
flags <- paste(rcppdir, "/libRcpp.a", sep="")
52-
if (.Platform$OS.type=="windows") {
53-
flags <- asBuildPath(flags)
54-
}
55-
} else { # else for dynamic linking
56-
flags <- paste("-L", rcppdir, " -lRcpp", sep="") # baseline setting
57-
if ((.Platform$OS.type == "unix") && # on Linux, we can use rpath to encode path
58-
(length(grep("^linux",R.version$os)))) {
59-
flags <- paste(flags, " -Wl,-rpath,", rcppdir, sep="")
60-
}
61-
}
62-
invisible(flags)
63-
}
36+
## Updated Nov 2013: We no longer build a library. This should be deprecated.
37+
RcppLdFlags <- function() { "" }
6438

6539
# indicates if Rcpp was compiled with GCC >= 4.3
6640
canUseCXX0X <- function() .Call( "canUseCXX0X", PACKAGE = "Rcpp" )
6741

6842
## Provide compiler flags -- i.e. -I/path/to/Rcpp.h
6943
RcppCxxFlags <- function(cxx0x=FALSE) {
70-
# path <- RcppLdPath()
71-
path <- Rcpp.system.file( "include" )
72-
if (.Platform$OS.type=="windows") {
73-
path <- asBuildPath(path)
74-
}
75-
paste("-I", path, if( cxx0x && canUseCXX0X() ) " -std=c++0x" else "", sep="")
44+
""
7645
}
7746

7847
## Shorter names, and call cat() directly
@@ -81,8 +50,8 @@ CxxFlags <- function(cxx0x=FALSE) {
8150
cat(RcppCxxFlags(cxx0x=cxx0x))
8251
}
8352
## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X
84-
LdFlags <- function(static=staticLinking()) {
85-
cat(RcppLdFlags(static=static))
53+
LdFlags <- function() {
54+
cat(RcppLdFlags())
8655
}
8756

8857
# capabilities

inst/skeleton/Makevars

Lines changed: 0 additions & 27 deletions
This file was deleted.

inst/skeleton/Makevars.win

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/Makevars

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,2 @@
1-
# -*- mode: Makefile; tab-width: 8 -*-
2-
#
3-
# Makevars for Rcpp
4-
#
5-
# Copyright (C) 2008 - 2009 Dirk Eddelbuettel <edd@debian.org>
6-
# Copyright (C) 2008, 2013 Simon Urbanek <simon.urbanek@r-project.org>
7-
# Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois
8-
9-
## $(SHLIB) is the usual default target that is built automatically from all source
10-
## files in this directory. userLibrary is an additional target for the second library
11-
## that will be installed in ../inst/lib$(R_ARCH) and which users can link against.
12-
13-
## uncomment this to enable c++0x features (experimental)
14-
## CLINK_CPPFLAGS=-std=c++0x
15-
16-
all: $(SHLIB) userLibrary
17-
18-
## we place it inside the inst/ directory so that it gets installed by the package
19-
USERDIR = ../inst/lib
20-
21-
USERLIB = libRcpp$(DYLIB_EXT)
22-
USERLIBST = libRcpp.a
23-
24-
PKG_CPPFLAGS += -I../inst/include/
25-
26-
userLibrary: $(USERLIB) $(USERLIBST)
27-
-@if test ! -e $(USERDIR)$(R_ARCH); then mkdir -p $(USERDIR)$(R_ARCH); fi
28-
cp $(USERLIB) $(USERDIR)$(R_ARCH)
29-
cp $(USERLIBST) $(USERDIR)$(R_ARCH)
30-
rm $(USERLIB) $(USERLIBST)
31-
32-
$(USERLIB): $(OBJECTS)
33-
$(SHLIB_CXXLD) -o $(USERLIB) $(OBJECTS) $(SHLIB_CXXLDFLAGS) $(ALL_LIBS)
34-
@: $${INSTALL_NAME_TOOL=/usr/bin/install_name_tool}; if test -e "$$INSTALL_NAME_TOOL"; then "$$INSTALL_NAME_TOOL" -id '$(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB)' '$(USERLIB)'; fi
35-
36-
$(USERLIBST): $(OBJECTS)
37-
$(AR) qc $(USERLIBST) $(OBJECTS)
38-
@if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
39-
40-
.PHONY: all clean userLibrary
41-
42-
clean:
43-
rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST)
1+
PKG_CPPFLAGS = -I../inst/include/
442

src/Makevars.win

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,2 @@
1-
# Emacs please make this -*- mode: makefile; tab-width: 8 -*-
2-
#
3-
# Makefile.win for Rcpp
4-
#
5-
# Copyright (C) 2008 - 2009 Dirk Eddelbuettel <edd@debian.org>
6-
# Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
7-
#
8-
# Contributions from an older Makefile.win are
9-
# (C) Dominick Samperi and Uwe Ligges and gratefully acknowledged
10-
#
11-
# Contributions from Brian D Ripley are also gratefully acknowledged
12-
131
PKG_CPPFLAGS = -I../inst/include/
142

15-
## we place it inside the inst/ directory so that it gets installed by the package
16-
USERDIR = ../inst/lib$(R_ARCH)
17-
STATICLIB = libRcpp.a
18-
USERLIB = $(USERDIR)/$(STATICLIB)
19-
20-
## uncomment this to enable c++0x features (experimental)
21-
## CLINK_CPPFLAGS=-std=c++0x
22-
23-
## the 'package' library contains both Rcpp.{cpp,h} and the RcppExample used to demonstrate the package
24-
## it is loaded via library(Rcpp) but is not used for compiling / linking against
25-
26-
RM = rm -f
27-
28-
.PHONY: all clean
29-
30-
all: userlib $(SHLIB)
31-
32-
clean:
33-
${RM} $(OBJECTS) $(SHLIB)
34-
35-
$(USERLIB): $(OBJECTS)
36-
37-
userlib: $(STATICLIB)
38-
-mkdir -p $(USERDIR)
39-
-mv $(STATICLIB) $(USERLIB)
40-
41-
$(STATICLIB): $(OBJECTS)
42-

0 commit comments

Comments
 (0)