configure
을 통해 재생할 수있는 다소 교활한 트릭이 있습니다. 실행 가능한 최상위 스크립트가 될 수 있습니다. 예를 들어 autoconf
이 있다면 두려워 할 필요가 없습니다.
그래서 configure
은 OS 및/또는 컴파일러를 테스트하는 쉘 스크립트 또는 #!/usr/bin/Rscript
을 통해 실행되는 R 스크립트 일 수 있습니다. 별들이 당신과 일치하는 경우에만 -mpopcnt
을 추가하십시오. 그렇지 않으면 그렇지 않습니다.
그리고 당신은 호환 가능합니다. 당신이 원하는 스위치을
#!/bin/bash
## Travis can let us run R 3.4.0 (from CRAN and the PPAs) but this R version
## does not know about C++14. Even though we can select CXX_STD = C++14, R
## will fail as the version we use there was built in too old an environment,
## namely Ubuntu "trusty" 14.04.
##
## So we install g++-6 from another repo and rely on the fact that is
## defaults to C++14. Sadly, we need R to not fail and hence, just on
## Travis, remove the C++14 instruction
if [[ "${CI}" == "true" ]]; then
if [[ "${TRAVIS}" == "true" ]]; then
echo "** Overriding src/Makevars and removing C++14 on Travis only"
sed -i 's|CXX_STD = CXX14||' src/Makevars
fi
fi
당신은 에 동일한 논리를 사용할 수있는 추가
내가 한 번 in this post이 예제가 이는 C++ (14) 스위치을 제거 같은 아이디어를 블로그에 더하다.