Skip to content

Commit 5af5019

Browse files
committed
cleanup configure
1 parent f04c062 commit 5af5019

File tree

9 files changed

+31
-27
lines changed

9 files changed

+31
-27
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ nanonext.Rcheck/00_pkg_src/nanonext/
88
nanonext.Rcheck/
99
*.gz
1010
docs
11-
temp
11+
install

R/ncurl.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@
6262
#'
6363
#' In non-interactive sessions: redirects are never followed.
6464
#'
65-
#' Override these default behaviours by specifying TRUE or FALSE for the
65+
#' The above defaults can be overridden by specifying TRUE or FALSE for the
6666
#' argument 'follow'.
6767
#'
68+
#' If not followed, the redirect address is returned as a character string.
69+
#'
6870
#' For async requests, the redirect address will be returned as a character
6971
#' string at \code{$raw} and \code{$data} will be NULL.
7072
#'

cleanup

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
rm -rf src/Makevars temp
2+
rm -rf src/Makevars install

cleanup.ucrt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rm -rf temp
1+
rm -rf install

configure

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ else
6767
echo "Compiling 'libmbedtls' from source..."
6868
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_BUILD_TYPE=Release \
6969
-DENABLE_TESTING=0 -DENABLE_PROGRAMS=0 \
70-
-DCMAKE_INSTALL_PREFIX=../temp -DCMAKE_INSTALL_MESSAGE=NEVER .
70+
-DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_MESSAGE=NEVER .
7171
cmake --build .
7272
cmake --install .
7373
cd ..
@@ -77,20 +77,20 @@ else
7777
echo "Compiling 'libnng' from source..."
7878
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DNNG_ENABLE_TLS=1 \
7979
-DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 \
80-
-DCMAKE_INSTALL_PREFIX=../temp -DCMAKE_INSTALL_MESSAGE=NEVER .
80+
-DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_MESSAGE=NEVER .
8181
cmake --build .
8282
cmake --install .
8383
cd ..
8484
rm -rf nanomsg-nng-$LIB_VER
8585

86-
PKG_CFLAGS="-I`pwd`/temp/include $PKG_CFLAGS"
87-
if [ -d "temp/lib64" ]
86+
PKG_CFLAGS="-I`pwd`/install/include $PKG_CFLAGS"
87+
if [ -d "install/lib64" ]
8888
then
8989
PKG_LIBS="-L`pwd`/temp/lib64 $PKG_LIBS"
9090
fi
91-
if [ -d "temp/lib" ]
91+
if [ -d "install/lib" ]
9292
then
93-
PKG_LIBS="-L`pwd`/temp/lib $PKG_LIBS"
93+
PKG_LIBS="-L`pwd`/install/lib $PKG_LIBS"
9494
fi
9595
fi
9696

configure.ucrt

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo "Compiling 'libmbedtls' from source..."
2525
cmake -G "MSYS Makefiles" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -w" \
2626
-DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_BUILD_TYPE=Release \
2727
-DENABLE_TESTING=0 -DENABLE_PROGRAMS=0 -DMBEDTLS_FATAL_WARNINGS=0 \
28-
-DCMAKE_INSTALL_PREFIX=../temp -DCMAKE_INSTALL_MESSAGE=NEVER .
28+
-DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_MESSAGE=NEVER .
2929
cmake --build .
3030
cmake --install .
3131
cd ..
@@ -36,7 +36,7 @@ echo "Compiling 'libnng' from source..."
3636
cmake -G "MSYS Makefiles" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -w" \
3737
-DCMAKE_POSITION_INDEPENDENT_CODE=1 -DNNG_ELIDE_DEPRECATED=1 \
3838
-DNNG_ENABLE_TLS=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 \
39-
-DCMAKE_INSTALL_PREFIX=../temp -DCMAKE_INSTALL_MESSAGE=NEVER .
39+
-DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_MESSAGE=NEVER .
4040
cmake --build .
4141
cmake --install .
4242
cd ..

man/ncurl.Rd

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Makevars.ucrt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PKG_CFLAGS=-I../temp/include -DNNG_STATIC_LIB $(C_VISIBILITY)
2-
PKG_LIBS=-L../temp/lib -lnng -lmbedtls -lmbedx509 -lmbedcrypto -lws2_32
1+
PKG_CFLAGS=-I../install/include -DNNG_STATIC_LIB $(C_VISIBILITY)
2+
PKG_LIBS=-L../install/lib -lnng -lmbedtls -lmbedx509 -lmbedcrypto -lws2_32

src/tls.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ SEXP rnng_sha224(SEXP x, SEXP key, SEXP convert) {
120120

121121
if (key == R_NilValue) {
122122

123-
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR == 2
124-
xc = mbedtls_sha256_ret(xhash.buf, xhash.sz, output, 1);
125-
#else
123+
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR >= 3
126124
xc = mbedtls_sha256(xhash.buf, xhash.sz, output, 1);
125+
#else
126+
xc = mbedtls_sha256_ret(xhash.buf, xhash.sz, output, 1);
127127
#endif
128128
} else {
129129

@@ -165,10 +165,10 @@ SEXP rnng_sha256(SEXP x, SEXP key, SEXP convert) {
165165

166166
if (key == R_NilValue) {
167167

168-
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR == 2
169-
xc = mbedtls_sha256_ret(xhash.buf, xhash.sz, output, 0);
170-
#else
168+
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR >= 3
171169
xc = mbedtls_sha256(xhash.buf, xhash.sz, output, 0);
170+
#else
171+
xc = mbedtls_sha256_ret(xhash.buf, xhash.sz, output, 0);
172172
#endif
173173

174174
} else {
@@ -211,10 +211,10 @@ SEXP rnng_sha384(SEXP x, SEXP key, SEXP convert) {
211211

212212
if (key == R_NilValue) {
213213

214-
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR == 2
215-
xc = mbedtls_sha512_ret(xhash.buf, xhash.sz, output, 1);
216-
#else
214+
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR >= 3
217215
xc = mbedtls_sha512(xhash.buf, xhash.sz, output, 1);
216+
#else
217+
xc = mbedtls_sha512_ret(xhash.buf, xhash.sz, output, 1);
218218
#endif
219219

220220
} else {
@@ -257,10 +257,10 @@ SEXP rnng_sha512(SEXP x, SEXP key, SEXP convert) {
257257

258258
if (key == R_NilValue) {
259259

260-
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR == 2
261-
xc = mbedtls_sha512_ret(xhash.buf, xhash.sz, output, 0);
262-
#else
260+
#if defined(MBEDTLS_VERSION_MAJOR) && MBEDTLS_VERSION_MAJOR >= 3
263261
xc = mbedtls_sha512(xhash.buf, xhash.sz, output, 0);
262+
#else
263+
xc = mbedtls_sha512_ret(xhash.buf, xhash.sz, output, 0);
264264
#endif
265265

266266
} else {

0 commit comments

Comments
 (0)