Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 142 lines (131 sloc) 4.168 kB
eabe791 @jwatte initial release
jwatte authored
1 #!/bin/bash
2 # Simple configuration script for people who expect such a script to exist.
3 # Please do not convert istatd to autotools. We will likely not accept such
4 # a conversion. Thanks for your interest in istatd, and good luck!
5
6 set -e
7 set -o nounset
8
9 rm -f makevars.config
10 echo "# makevars.config for istatd generated on " `date` > makevars.config
11
12 BOOST_SYSTEM=""
13 BOOST_FILESYSTEM=""
14 STATGRAB=""
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
15 LIBRT=""
eabe791 @jwatte initial release
jwatte authored
16 DESTDIR=""
17 USR_PREFIX=""
18 VAR_PREFIX=""
19 ETC_PREFIX=""
20
21 while [ $# -gt 0 ]; do
22 case $1 in
23 --boost_system)
24 shift
25 BOOST_SYSTEM="$1"
26 ;;
27 --boost_filesystem)
28 shift
29 BOOST_FILESYSTEM="$1"
30 ;;
31 --statgrab)
32 shift
33 STATGRAB="$1"
34 ;;
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
35 --librt)
36 shift
37 LIBRT="$1"
38 ;;
eabe791 @jwatte initial release
jwatte authored
39 --prefix)
40 shift
41 DESTDIR="$1"
42 ;;
43 --usr-prefix)
44 shift
45 USR_PREFIX="$1"
46 ;;
47 --var-prefix)
48 shift
49 VAR_PREFIX="$1"
50 ;;
51 --etc-prefix)
52 shift
53 ETC_PREFIX="$1"
54 ;;
55 *)
56 echo "Options:"
57 echo "--boost_system -lboost_system-mt What is the boost_system library name?"
58 echo "--boost_filesystem -lboost_filesystem-mt What is the boost_filesystem library name?"
59 echo "--statgrab -lstatgrab What is the statgrab library name?"
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
60 echo "--librt -lrt What is the librt library name (if any)?"
eabe791 @jwatte initial release
jwatte authored
61 echo "--prefix / What is the root of the install?"
62 echo "--usr-prefix /usr What is the '/usr' directory for executables?"
63 echo "--var-prefix /var What is the '/var' directory for database data?"
64 echo "--etc-prefix /etc What is the '/etc/ directory for rc.d scripts?"
65 echo "No equal sign for option values."
66 exit 1
67 ;;
68 esac
69 shift
70 done
71
72 # see if we need to install boost
73 if [ ! -d /usr/include/boost -a ! -d /usr/local/include/boost ]; then
74 echo "You need to install libboost-all-dev for your distribution."
75 exit 1
76 fi
77
78 if [ ! -r /usr/include/statgrab.h -a ! -r /usr/local/include/statgrab.h ]; then
79 echo "You need to install libstatgrab-dev for your distribution, or "
80 echo "download and install it from source. See README.md"
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
81 exit 1
eabe791 @jwatte initial release
jwatte authored
82 fi
83
84
85 # boost_system is a pain across versions
86 if [ -z "$BOOST_SYSTEM" ]; then
87 if [ -r /usr/lib/libboost_system.so ]; then
88 BOOST_SYSTEM=-lboost_system
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
89 elif [ -r /usr/lib/libboost_system-mt.so ]; then
eabe791 @jwatte initial release
jwatte authored
90 BOOST_SYSTEM=-lboost_system-mt.so
91 fi
92 fi
93 # boost_filesystem is also somewhat a pain
94 if [ -z "$BOOST_FILESYSTEM" ]; then
95 if [ -r /usr/lib/libboost_filesystem.so ]; then
96 BOOST_FILESYSTEM=-lboost_filesystem
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
97 elif [ -r /usr/lib/libboost_filesystem-mt.so ]; then
eabe791 @jwatte initial release
jwatte authored
98 BOOST_FILESYSTEM=-lboost_filesystem-mt
99 fi
100 fi
101 if [ -z "$STATGRAB" ]; then
102 if [ -r /usr/lib/libstatgrab.so ]; then
103 STATGRAB=-lstatgrab
104 elif [ -r /usr/local/lib/libstatgrab.so ]; then
105 STATGRAB=-lstatgrab
106 fi
107 fi
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
108 if [ -z "$LIBRT" ]; then
109 if [ -r /usr/lib/librt.so ]; then
110 LIBRT=-lrt
111 elif [ -r /usr/local/lib/librt.so ]; then
112 LIBRT=-lrt
113 fi
114 fi
eabe791 @jwatte initial release
jwatte authored
115
116 if [ ! -z "$BOOST_SYSTEM" ]; then
117 echo "BOOST_SYSTEM=$BOOST_SYSTEM" >> makevars.config
118 fi
119 if [ ! -z "$BOOST_FILESYSTEM" ]; then
120 echo "BOOST_FILESYSTEM=$BOOST_FILESYSTEM" >> makevars.config
121 fi
122 if [ ! -z "$STATGRAB" ]; then
123 echo "STATGRAB=$STATGRAB" >> makevars.config
124 fi
b4be5df @jwatte builds on GCC 4.7.1
jwatte authored
125 if [ ! -z "$LIBRT" ]; then
126 echo "LIBRT=$LIBRT" >> makevars.config
127 fi
eabe791 @jwatte initial release
jwatte authored
128 if [ ! -z "$DESTDIR" ]; then
129 echo "DESTDIR=$DESTDIR" >> makevars.config
130 fi
131 if [ ! -z "$USR_PREFIX" ]; then
132 echo "USR_PREFIX=$USR_PREFIX" >> makevars.config
133 fi
134 if [ ! -z "$VAR_PREFIX" ]; then
135 echo "VAR_PREFIX=$VAR_PREFIX" >> makevars.config
136 fi
137 if [ ! -z "$ETC_PREFIX" ]; then
138 echo "ETC_PREFIX=$ETC_PREFIX" >> makevars.config
139 fi
140
141 echo "All done"
Something went wrong with that request. Please try again.