diff --git a/src/Makevars.ucrt b/src/Makevars.ucrt new file mode 100644 index 00000000..1a2e1013 --- /dev/null +++ b/src/Makevars.ucrt @@ -0,0 +1,2 @@ +CRT=-ucrt +include Makevars.win diff --git a/src/Makevars.win b/src/Makevars.win index 735fb7b3..58e28104 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,25 +1,10 @@ -PKG_CPPFLAGS = -DS2_USE_EXACTFLOAT -D_USE_MATH_DEFINES -DNDEBUG -DIS_LITTLE_ENDIAN -I../windows/openssl-1.1.1/include -I../inst/include -PKG_LIBS = -L../windows/openssl-1.1.1/lib${R_ARCH} -lssl -lcrypto -lcrypt32 -lws2_32 +PKG_CPPFLAGS = -DS2_USE_EXACTFLOAT -D_USE_MATH_DEFINES -DNDEBUG -DIS_LITTLE_ENDIAN -I../windows/openssl-1.1.1k/include -I../inst/include +PKG_LIBS = -Ls2 -ls2static -L../windows/openssl-1.1.1k/lib${R_ARCH}${CRT} -lssl -lcrypto -lcrypt32 -lws2_32 CXX_STD = CXX11 -OBJECTS = cpp-compat.o \ - s2-accessors.o \ - s2-bounds.o \ - s2-cell.o \ - s2-constructors-formatters.o \ - s2-predicates.o \ - s2-transformers.o \ - init.o \ - RcppExports.o \ - s2-geography.o \ - s2-lnglat.o \ - s2-matrix.o \ - s2-point.o \ - s2-xptr.o \ - wk-impl.o \ - wk-c-utils.o \ - s2-c-api.o \ +STATLIB = s2/libs2static.a +S2LIBS = s2-c-api.o \ s2/base/stringprintf.o \ s2/base/strtoint.o \ s2/encoded_s2cell_id_vector.o \ @@ -131,13 +116,19 @@ OBJECTS = cpp-compat.o \ s2/util/math/mathutil.o \ s2/util/units/length-units.o -all: clean winlibs +$(SHLIB): $(STATLIB) + +$(STATLIB): $(S2LIBS) + +$(S2LIBS): winlibs + +#all: clean winlibs: mkdir -p ../inst "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" --vanilla "../tools/winlibs.R" clean: - rm -f $(SHLIB) $(OBJECTS) + rm -f $(SHLIB) $(STATLIB) $(OBJECTS) $(S2LIBS) .PHONY: all winlibs clean diff --git a/tools/winlibs.R b/tools/winlibs.R index 4d24f369..3e0ab9b8 100644 --- a/tools/winlibs.R +++ b/tools/winlibs.R @@ -1,7 +1,7 @@ # Build against openssl libraries that were compiled with the Rtools gcc toolchain. -if(!file.exists("../windows/openssl-1.1.1/include/openssl/ssl.h")){ +if(!file.exists("../windows/openssl-1.1.1k/include/openssl/ssl.h")){ if(getRversion() < "3.3.0") setInternet2() - download.file("https://github.com/rwinlib/openssl/archive/v1.1.1.zip", "lib.zip", quiet = TRUE) + download.file("https://github.com/rwinlib/openssl/archive/v1.1.1k.zip", "lib.zip", quiet = TRUE) dir.create("../windows", showWarnings = FALSE) unzip("lib.zip", exdir = "../windows") unlink("lib.zip")