Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / tests / hwsim / build.sh
1 #!/bin/sh
2
3 set -e
4
5 cd $(dirname $0)
6
7 usage()
8 {
9         echo "$0 [-c | --codecov] [-f | --force-config]"
10         exit 1
11 }
12
13 use_lcov=0
14 force_config=0
15 while [ "$1" != "" ]; do
16         case $1 in
17                 -c | --codecov ) shift
18                         echo "$0: use code coverage specified"
19                         use_lcov=1
20                         ;;
21                 -f | --force-config ) shift
22                         force_config=1
23                         echo "$0: force copy config specified"
24                         ;;
25                 * ) usage
26         esac
27 done
28
29 echo "Building TNC testing tools"
30 cd tnc
31 make clean > /dev/null
32 make QUIET=1 -j8
33
34 echo "Building wlantest"
35 cd ../../../wlantest
36 make clean > /dev/null
37 make QUIET=1 -j8 > /dev/null
38
39 echo "Building hostapd"
40 cd ../hostapd
41 if [ ! -e .config -o $force_config -eq 1 ]; then
42     cp ../tests/hwsim/example-hostapd.config .config
43 else
44     echo "hostapd config file exists"
45 fi
46
47 if [ $use_lcov -eq 1 ]; then
48     if ! grep -q CONFIG_CODE_COVERAGE .config; then
49             echo CONFIG_CODE_COVERAGE=y >> .config
50     else
51             echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore"
52     fi
53 fi
54
55 make clean > /dev/null
56 make QUIET=1 -j8 hostapd hostapd_cli hlr_auc_gw
57
58 echo "Building wpa_supplicant"
59 cd ../wpa_supplicant
60 if [ ! -e .config -o $force_config -eq 1 ]; then
61     cp ../tests/hwsim/example-wpa_supplicant.config .config
62 else
63     echo "wpa_supplicant config file exists"
64 fi
65
66 if [ $use_lcov -eq 1 ]; then
67     if ! grep -q CONFIG_CODE_COVERAGE .config; then
68             echo CONFIG_CODE_COVERAGE=y >> .config
69     else
70             echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore"
71     fi
72 fi
73
74 make clean > /dev/null
75 if [ -z $FIPSLD_CC ]; then
76 export FIPSLD_CC=gcc
77 fi
78 make QUIET=1 -j8