-
Notifications
You must be signed in to change notification settings - Fork 44
/
configure.win
49 lines (40 loc) · 1.81 KB
/
configure.win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (c) 2013-2024, Marek Gagolewski <https://www.gagolewski.com/>
# This is an architecture-independent configure.win file
ICU_FOUND=0 # use our ICU bundle
ICUDT_DIR="icu74/data"
ICU_BUNDLE_VERSION=74
# some systems do not have ResolveLocaleName - this applies to mingw
# on 32-bit windows shipped with older Rtools (R < 4.2)
DISABLE_RESOLVE_LOCALE_NAME=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
cat(as.integer(getRversion() < "4.2"))
'`
echo "ICU_FOUND=${ICU_FOUND}"
echo "ICU_BUNDLE_VERSION=${ICU_BUNDLE_VERSION}"
echo "ICUDT_DIR=${ICUDT_DIR}"
echo "DISABLE_RESOLVE_LOCALE_NAME=${DISABLE_RESOLVE_LOCALE_NAME}"
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
fin <- "src/uconfig_local.h.in";
fout <- "src/uconfig_local.h";
f <- readLines(fin);
f <- gsub("@ICU_FOUND@", '"${ICU_FOUND}"', f, fixed = TRUE);
f <- gsub("@DISABLE_RESOLVE_LOCALE_NAME@", '"${DISABLE_RESOLVE_LOCALE_NAME}"', f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "'"${ICUDT_DIR}"'", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "'"${ICU_BUNDLE_VERSION}"'", f, fixed = TRUE);
f <- gsub("@ICUDT_ENDIANNESS@", .Platform$endian, f, fixed = TRUE);
con <- file(fout, "wb") # LF line ending
writeLines(f, con);
close(con)
'
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e '
fin <- "src/install.libs.R.in";
fout <- "src/install.libs.R";
f <- readLines(fin);
f <- gsub("@ICU_FOUND@", '"${ICU_FOUND}"', f, fixed = TRUE);
f <- gsub("@DISABLE_RESOLVE_LOCALE_NAME@", '"${DISABLE_RESOLVE_LOCALE_NAME}"', f, fixed = TRUE);
f <- gsub("@ICUDT_DIR@", "'"${ICUDT_DIR}"'", f, fixed = TRUE);
f <- gsub("@ICU_BUNDLE_VERSION@", "'"${ICU_BUNDLE_VERSION}"'", f, fixed = TRUE);
f <- gsub("@ICUDT_ENDIANNESS@", .Platform$endian, f, fixed = TRUE);
con <- file(fout, "wb") # LF line ending
writeLines(f, con);
close(con)
'