]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/buildtest.sh
3 ## Copyright (C) 1996-2017 The Squid Software Foundation and contributors
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
10 # Configure and run a test build against any given set of configure options
11 # or compile-time flags.
13 # Should be run from the source package root directory with paths relative to there.
20 # cache_file may be set by environment variable
22 if [ -n "$cache_file" ]; then
23 configcache
="--cache-file=$cache_file"
26 #if we are on Linux, let's try parallelizing
27 if [ -z "$pjobs" -a -e /proc
/cpuinfo
]; then
28 ncpus
=`grep '^processor' /proc/cpuinfo | tail -1|awk '{print $3}'`
29 ncpus
=`expr ${ncpus} + 1`
32 #if we are on FreeBSD, let's try parallelizing
33 if [ -z "$pjobs" -a -x /sbin
/sysctl
]; then
34 ncpus
=`sysctl kern.smp.cpus | cut -f2 -d" "`
35 if [ $?
-eq 0 -a -n "$ncpus" -a "$ncpus" -gt 1 ]; then
40 if test -e ${config} ; then
41 echo "BUILD: ${config}"
44 echo -n "BUILD ERROR: Unable to locate test configuration '${config}' from " && pwd
48 # override the layers MAKETEST default
49 if test "x${action}" != "x"; then
54 # empty all the existing code, reconfigure and builds test code
55 # but skip if we have no files to remove.
56 FILECOUNT
=`ls -1 | grep -c .`
57 if test "${FILECOUNT}" != "0" ; then
58 ${MAKE:-make} -k distclean ||
echo "distclean done. errors are unwanted but okay here."
60 rm -fr .
/src
/fs
/aufs
/.deps src
/fs
/diskd
/.deps
64 # above command currently encounters dependancy problems on cleanup.
66 # do not build any of the install's ...
68 # eval is need to correctly handle quoted arguments
69 eval "$base/../configure ${DISTCHECK_CONFIGURE_FLAGS} ${configcache}" \
71 ${MAKE:-make} ${pjobs} ${MAKETEST} 2>&1
73 # Remember and then explicitly return the result of the last command
74 # to the script caller. Probably not needed on most or all platforms.