Skip to content

Commit d753495

Browse files
committed
Use libmariadbclient from Rtools if found
1 parent 0846edd commit d753495

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.github/workflows/R-CMD-check.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
- {os: macos-14, r: 'release'}
2323
- {os: windows-latest, r: '4.1'}
2424
- {os: windows-latest, r: '4.2'}
25-
- {os: windows-latest, r: 'release'}
25+
- {os: windows-latest, r: '4.3'}
26+
- {os: windows-latest, r: '4.4'}
2627
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2728
- {os: ubuntu-latest, r: 'release'}
2829
- {os: ubuntu-latest, r: 'oldrel-1'}

RMySQL.Rproj

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: df551388-4dd3-412f-ac41-f4c0a0c8a880
23

34
RestoreWorkspace: Default
45
SaveWorkspace: Default

src/Makevars.win

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
RWINLIB = ../windows/libmariadbclient
1+
PKG_CONFIG_NAME = libmariadbclient
2+
PKG_CONFIG ?= $(BINPREF)pkg-config
3+
PKG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME))
24

5+
# Remove hack when dropping support for R-4.1
36
ifeq ($(R_COMPILED_BY),gcc 8.3.0)
4-
TLS_LIBS = -lssl -lcrypto
7+
RTOOLS40_LIBS = -lssl -lcrypto
58
endif
69

10+
ifneq ($(PKG_LIBS),)
11+
$(info using $(PKG_CONFIG_NAME) from Rtools)
12+
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME))
13+
else
14+
RWINLIB = ../windows/libmariadbclient
715
PKG_CPPFLAGS = -I$(RWINLIB)/include/mariadb
8-
PKG_LIBS = \
9-
-L$(RWINLIB)/lib$(R_ARCH) \
10-
-L$(RWINLIB)/lib \
11-
-lmariadbclient $(TLS_LIBS) -lz -lbcrypt -lsecur32 -lshlwapi -lcrypt32 -lgdi32 -lws2_32 -pthread
16+
PKG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib \
17+
-lmariadbclient $(RTOOLS40_LIBS) -lz -lbcrypt -lsecur32 -lshlwapi -lcrypt32 -lgdi32 -lws2_32 -pthread
18+
endif
1219

13-
all: clean winlibs
20+
all: $(SHLIB)
21+
22+
$(OBJECTS): $(RWINLIB)
23+
24+
$(RWINLIB):
25+
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"
1426

1527
clean:
1628
rm -f $(SHLIB) $(OBJECTS)
17-
18-
winlibs:
19-
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)

0 commit comments

Comments
 (0)