Skip to content

Commit 87d3bf2

Browse files
authored
Merge pull request #19 from dcdillon/bugfix/plugin-and-stripper
Fixing plugin bugs as well as simplifying stripper
2 parents e862fbf + 492a741 commit 87d3bf2

File tree

4 files changed

+36
-26
lines changed

4 files changed

+36
-26
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: RcppHoney
22
Type: Package
33
Title: Iterator Based Expression Template Expansion of Standard Operators
4-
Version: 0.1.2
4+
Version: 0.1.2.1
55
Author: Daniel C. Dillon
66
Maintainer: Daniel C. Dillon <dcdillon@gmail.com>
77
URL: https://github.com/dcdillon/RcppHoney

R/plugin.R

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
.getLibs <- function() {
22
linker_pattern <- "gcc|clang|g\\+\\+"
33

4-
shlib_ld <- system("R CMD config SHLIB_LD", intern=TRUE)
5-
shlib_cxxld <- system("R CMD config SHLIB_CXXLD", intern=TRUE)
4+
shlib_ld <- system(paste0(file.path(R.home("bin"), "R"),
5+
" CMD config SHLIB_LD"), intern=TRUE)
6+
shlib_cxxld <- system(paste0(file.path(R.home("bin"), "R"),
7+
" CMD config SHLIB_CXXLD"), intern=TRUE)
68

7-
shlib_ld_results <- system(paste0(shlib_ld, " --version"), intern=TRUE)
8-
shlib_cxxld_results <- system(paste0(shlib_cxxld, " --version"), intern=TRUE)
9-
10-
shlib_ld_good <- any(grepl(linker_pattern, shlib_ld_results))
11-
shlib_cxxld_good <- any(grepl(linker_pattern, shlib_cxxld_results))
9+
shlib_ld_good <- FALSE
10+
shlib_cxxld_good <- FALSE
11+
12+
if (shlib_ld != "") {
13+
shlib_ld_good <- tryCatch({
14+
shlib_ld_results <- system(paste0(shlib_ld, " --version"), intern=TRUE)
15+
shlib_ld_good <- any(grepl(linker_pattern, shlib_ld_results))
16+
shlib_ld_good
17+
}, warning = function(w) {
18+
return(FALSE)
19+
}, error = function(e) {
20+
return(FALSE)
21+
})
22+
} else {
23+
shlib_ld_good <- TRUE
24+
}
25+
26+
if (shlib_cxxld != "") {
27+
shlib_cxxld_good <- tryCatch({
28+
shlib_cxxld_results <- system(paste0(shlib_ld, " --version"), intern=TRUE)
29+
shlib_cxxld_good <- any(grepl(linker_pattern, shlib_ld_results))
30+
shlib_cxxld_good
31+
}, warning = function(w) {
32+
return(FALSE)
33+
}, error = function(e) {
34+
return(FALSE)
35+
})
36+
} else {
37+
shlib_cxxld_good <- TRUE
38+
}
1239

1340
libs <- if (shlib_ld_good && shlib_cxxld_good) "-Wl,-S" else ""
1441

inst/tools/stripper

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,6 @@ if [ $SHLIB_LD_RESULTS -eq 1 ] && [ $SHLIB_CXXLD_RESULTS -eq 1 ]; then
9595
echo "PKG_LIBS = \$(R_STRIP_LINKER_OPTION)" \
9696
>> src/Makevars.R_STRIP_LINKER_OPTION
9797
fi
98-
else
99-
# We don't have a linker that we can tell to strip the debugging symbols
100-
# so simply remove any previous assignment to R_STRIP_LINKER_OPTION.
101-
# When we're done we'll add a line defining it as empty string (in case
102-
# there are references to it elsewhere)
103-
104-
if [ -f src/Makevars ]; then
105-
while read -r LINE || [ -n "$LINE" ]; do
106-
case "$LINE" in
107-
*PKG_LIBS*=*R_STRIP_LINKER_OPTION*)
108-
LINE=${LINE% \$(R_STRIP_LINKER_OPTION)}
109-
echo $LINE >> src/Makevars.R_STRIP_LINKER_OPTION ;;
110-
*R_STRIP_LINKER_OPTION=*) ;;
111-
*) echo $LINE >> src/Makevars.R_STRIP_LINKER_OPTION ;;
112-
esac
113-
done <src/Makevars
114-
fi
11598
fi
11699

117100
# If we created a src/Makevars.R_STRIP_LINKER_OPTION file, then backup the

vignettes/functions.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: Daniel C. Dillon
44
date: "`r Sys.Date()`"
55
output: html_document
66
vignette: >
7-
%\VignetteIndexEntry{RcppHoney Introduction}
7+
%\VignetteIndexEntry{RcppHoney - Custom Functions}
88
%\VignetteEngine{knitr::rmarkdown}
99
%\VignetteEncoding{UTF-8}
1010
---

0 commit comments

Comments
 (0)