Skip to content

HTTPS clone URL

Subversion checkout URL

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