File tree Expand file tree Collapse file tree 2 files changed +2
-27
lines changed
Expand file tree Collapse file tree 2 files changed +2
-27
lines changed Original file line number Diff line number Diff line change 88
99CC_ALONE=` $R_HOME /bin/R CMD config CC | awk ' {print $1}' `
1010
11- # On macOS, detect the deployment target so that C code compiled by the Rust
12- # cc crate (e.g. savvy's unwind_protect_wrapper.c) uses the same target as
13- # R's linker. Without this, the cc crate defaults to the host OS version,
14- # which may be newer than R's deployment target, triggering linker warnings.
15- MACOSX_DT=" "
16- if [ " $( uname) " = " Darwin" ]; then
17- # 1) Environment variable (set by CRAN builders and R CMD INSTALL)
18- if [ -n " ${MACOSX_DEPLOYMENT_TARGET} " ]; then
19- MACOSX_DT=" ${MACOSX_DEPLOYMENT_TARGET} "
20- fi
21- # 2) Fallback: extract -mmacosx-version-min from R's CC, CFLAGS, or LDFLAGS
22- if [ -z " ${MACOSX_DT} " ]; then
23- for var in CC CFLAGS LDFLAGS; do
24- MACOSX_DT=` " ${R_HOME} /bin/R" CMD config $var | \
25- sed -n ' s/.*-mmacosx-version-min=\([^ ]*\).*/\1/p' `
26- if [ -n " ${MACOSX_DT} " ]; then break ; fi
27- done
28- fi
29- fi
30-
31- sed -e " s/@TARGET@/${TARGET} /" \
32- -e " s|@R_HOME@|${R_HOME} |" \
33- -e " s|@CC_ALONE@|${CC_ALONE} |" \
34- -e " s|@MACOSX_DT@|${MACOSX_DT} |" \
35- src/Makevars.in > src/Makevars
11+ sed -e " s/@TARGET@/${TARGET} /" -e " s|@R_HOME@|${R_HOME} |" -e " s|@CC_ALONE@|${CC_ALONE} |" src/Makevars.in > src/Makevars
Original file line number Diff line number Diff line change 11TARGET = @TARGET@
22R_HOME = @R_HOME@
33CC_ALONE = @CC_ALONE@
4- MACOSX_DT = @MACOSX_DT@
54VENDORING = yes
65VENDOR_SRC = ./rust/vendor.tar.xz
76VENDOR_DIR = ./rust/vendor
@@ -38,7 +37,7 @@ $(STATLIB):
3837 export R_HOME=$(R_HOME); \
3938 export PATH="$(PATH):$(HOME)/.cargo/bin"; \
4039 export RUSTFLAGS="-C linker=${CC_ALONE}"; \
41- if [ -n "$(MACOSX_DT)" ]; then export MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DT)"; fi ; \
40+ export MACOSX_DEPLOYMENT_TARGET; \
4241 cargo build $(CARGO_BUILD_ARGS) --release --offline; \
4342 else \
4443 cargo build $(CARGO_BUILD_ARGS); \
You can’t perform that action at this time.
0 commit comments