Index: scripts/travis-build.sh |
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..60890deddcf827ea74931122e3bf4abb750c4a13 |
--- /dev/null |
+++ b/scripts/travis-build.sh |
@@ -0,0 +1,31 @@ |
+#!/bin/sh |
+ |
+set -ex |
+ |
+setup_env() { |
+ # Travis sets CC/CXX to the system toolchain, so our .travis.yml |
+ # exports USE_{CC,CXX} for this script to use. |
+ if test -n "$USE_CC"; then |
vapier
2016/04/11 17:13:35
more standard imo is to use [ instead of test
if
Ted Mielczarek
2016/04/12 10:03:06
Done.
|
+ export CC=$USE_CC |
+ fi |
+ if test -n "$USE_CXX"; then |
vapier
2016/04/11 17:13:35
same here
Ted Mielczarek
2016/04/12 10:03:06
Done.
|
+ export CXX=$USE_CXX |
+ fi |
+} |
+ |
+build() { |
+ ./configure |
+ # Use -jN for faster builds. Travis build machines under Docker |
+ # have a lot of cores, but resource limits will kill the build |
+ # if we try to use them all, so use at most 4. |
vapier
2016/04/11 17:13:35
you should reference this report:
https://github.
Ted Mielczarek
2016/04/11 17:30:17
Yeah, I understood the root cause, I may have just
Ted Mielczarek
2016/04/12 10:03:06
Done.
|
+ ncpus=$(getconf _NPROCESSORS_ONLN) |
+ jobs=$(($ncpus<4?$ncpus:4)) |
vapier
2016/04/11 17:13:35
there's no need to omit spaces ... that just makes
Ted Mielczarek
2016/04/12 10:03:06
Done.
|
+ make -j${jobs} check |
+} |
+ |
+main() { |
+ setup_env |
+ build |
+} |
+ |
+main "$@" |