wl1251: use DRIVER_NAME macro in wl1251_spi_driver
[pandora-wifi.git] / scripts / check_config.sh
1 #!/bin/bash
2 # This script checks the compat-wireless configuration file and if changes were made
3 # regenerates the compat_autoconf header.
4
5 # These variables are expected to be exported:
6 #COMPAT_CONFIG="config"
7 #CONFIG_CHECK=".${COMPAT_CONFIG}.md5"
8 #COMPAT_AUTOCONF="include/linux/compat_autoconf.h"
9
10 function gen_compat_autoconf {
11         echo "./scripts/gen-compat-autoconf.sh $COMPAT_CONFIG > $COMPAT_AUTOCONF"
12         ./scripts/gen-compat-autoconf.sh $COMPAT_CONFIG > $COMPAT_AUTOCONF
13         md5sum $COMPAT_CONFIG > $CONFIG_CHECK
14 }
15
16 which md5sum 2>&1 > /dev/null
17 if [ $? -ne 0 ]; then
18         echo "md5sum required to detect changes on config file"
19         exit -1
20 fi
21
22 if [ ! -f $CONFIG_CHECK ]; then
23         gen_compat_autoconf
24         exit
25 fi
26
27 md5sum -c $CONFIG_CHECK 2> /dev/null 1>/dev/null
28
29 if [ $? -ne 0 ]; then
30         echo "Changes to compat-wireless's configuration was detected, regenerating autoconf..."
31         gen_compat_autoconf
32 fi
33