]> git.stg.codes - stg.git/blob - projects/traffcounter/configure
Implemented daily fee charge with backward compatibility.
[stg.git] / projects / traffcounter / configure
1 #!/bin/sh
2
3 echo -n "checking os type... "
4 OS=`uname`
5 echo $OS
6
7 echo -n "checking stdint.h... "
8 if [ -f /usr/include/stdint.h ]
9 then
10     DEFINES="$DEFINES -DHAVE_STDINT"
11     echo "ok"
12 else
13     echo "fail"
14
15     echo -n "checking inttypes.h... "
16     if [ -f /usr/include/inttypes.h ]
17     then
18         DEFINES="$DEFINES -DHAVE_INTTYPES"
19         echo "ok"
20     else
21         echo "fail"
22         echo "You need either stdint.h or inttypes.h to compile this"
23         exit 1
24     fi
25 fi
26
27 if [ "$OS"=="Linux" ]
28 then
29     DEFINES="$DEFINES -DLINUX"
30     echo -n "checking gmake... "
31     gmake --version > /dev/null 2> /dev/null
32     if [ $? -eq 0 ]
33     then
34         MAKE="gmake"
35         echo "ok"
36     else
37         echo "fail"
38         echo -n "checking make... "
39         make --version > /dev/null 2> /dev/null
40         if [ $? -eq 0 ]
41         then
42             echo "ok"
43             MAKE="make"
44         else
45             echo "fail"
46             echo "You need a GNU Make to compile this"
47             exit 1
48         fi
49     fi
50 else
51     if [ "$OS"=="FreeBSD" ]
52     then
53         DEFINES="$DEFINES -DFREEBSD"
54         echo -n "checking gmake... "
55         gmake --version > /dev/null 2> /dev/null
56         if [ $? -eq 0 ]
57         then
58             echo "ok"
59             MAKE="gmake"
60         else
61             echo "fail"
62             echo "You need a GNU Make to use this"
63             exit 1
64         fi
65     else
66         echo "This version of software is only compatible with Linux and FreeBSD"
67         exit 1
68     fi
69 fi
70
71 echo "Configuration successfull. Details:"
72 echo -e "\tOS: $OS"
73 echo -e "\tGNU Make utility: $MAKE"
74 echo -e "\nType $MAKE and $MAKE install now"
75
76 rm -f make.conf
77 echo "OS = $OS" >> make.conf
78 echo "DEFINES = $DEFINES" >> make.conf