OLD | NEW |
(Empty) | |
| 1 #!/bin/sh |
| 2 |
| 3 set -ex |
| 4 |
| 5 setup_env() { |
| 6 # Travis sets CC/CXX to the system toolchain, so our .travis.yml |
| 7 # exports USE_{CC,CXX} for this script to use. |
| 8 if [ -n "$USE_CC" ]; then |
| 9 export CC=$USE_CC |
| 10 fi |
| 11 if [ -n "$USE_CXX" ]; then |
| 12 export CXX=$USE_CXX |
| 13 fi |
| 14 # Use -jN for faster builds. Travis build machines under Docker |
| 15 # have a lot of cores, but are memory-limited, so the kernel |
| 16 # will OOM if we try to use them all, so use at most 4. |
| 17 # See https://github.com/travis-ci/travis-ci/issues/1972 |
| 18 export NCPUS=$(getconf _NPROCESSORS_ONLN) |
| 19 export JOBS=$(( $NCPUS < 4 ? $NCPUS : 4 )) |
| 20 } |
| 21 |
| 22 build() { |
| 23 ./configure |
| 24 make -j${JOBS} check |
| 25 } |
| 26 |
| 27 main() { |
| 28 setup_env |
| 29 build |
| 30 } |
| 31 |
| 32 main "$@" |
OLD | NEW |