build-travis.sh 542 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # Give other users access to /root
  3. # (We probably should have just built the build tools somewhere else...)
  4. chmod o+x /root
  5. # Who owns this directory?
  6. NEWUID=`stat -c '%u' .`
  7. if [[ "$NEWUID" == "0" ]]; then
  8. echo "Are you running this on Docker for Mac? Owner UID is 0, going to use 501 instead."
  9. NEWUID=501
  10. fi
  11. # Create a fake user with this name
  12. useradd -u $NEWUID local
  13. # Map the build tools
  14. ln -s /root/gcc_local util/local
  15. # Run make as local
  16. runuser -u local -- make -j4
  17. # Remove the build tools
  18. rm util/local