| 1 | #! /bin/sh -ex |
| 2 | |
| 3 | ## Set up compiler caching. This makes a big difference to build times. |
| 4 | PATH=/usr/lib/ccache:$PATH; export PATH |
| 5 | CCACHE_DIR=/build/.ccache; export CCACHE_DIR |
| 6 | unset CCACHE_HARDLINK |
| 7 | CCACHE_COMPRESS=t; export CCACHE_COMPRESS |
| 8 | CCACHE_UMASK=002; export CCACHE_UMASK |
| 9 | |
| 10 | ## Hack the build options. `sbuild' tries to turn off testing for |
| 11 | ## cross-builds, which is exactly wrong. Turn them back on unless I really |
| 12 | ## want them off. |
| 13 | old=$DEB_BUILD_OPTIONS new= force_nocheck=nil |
| 14 | for o in $old; do |
| 15 | case $o in x-mdw-nocheck) force_nocheck=t ;; esac |
| 16 | done |
| 17 | for o in $old; do |
| 18 | include=t |
| 19 | case $o in |
| 20 | x-mdw-nocheck) include=nil ;; |
| 21 | nocheck) include=$force_nocheck ;; |
| 22 | esac |
| 23 | case $include in |
| 24 | t) new=${new:+$new }$o ;; |
| 25 | esac |
| 26 | done |
| 27 | DEB_BUILD_OPTIONS=$new; export DEB_BUILD_OPTIONS |
| 28 | |
| 29 | ## Preset the library search path to find the tools version of `fakeroot'. |
| 30 | for i in /usr/lib/*/libfakeroot; do |
| 31 | LD_LIBRARY_PATH=${LD_LIBRARY_PATH+$LD_LIBRARY_PATH:}$i |
| 32 | done |
| 33 | export LD_LIBRARY_PATH |
| 34 | |
| 35 | ## We're ready to go. |
| 36 | exec "$@" |