2 #@(#) Configuration script for sysstat
3 # (C) 2000-2014 Sebastien GODARD (sysstat <at> orange.fr)
8 echo Welcome to sysstat\'s Interactive Configuration script!
10 echo This script enables you to set the parameters value used by ./configure.
11 echo Please enter the value for the parameters listed below.
12 echo Press Return to tell ./configure to use the default value or to try to guess the proper one.
13 echo "Defaut value for yes/no questions is no (parameter is NOT set)."
14 echo You can enter a ? to display a help message at any time...
17 # Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
19 # Installation directory
20 PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
21 if [ "${PREFIX}" != "" ]; then
22 PREFIX="--prefix=${PREFIX} "
26 SA_LIB_DIR=`${ASK} 'sadc directory:' "sa_lib_dir" "sa_lib_dir"`
27 if [ "${SA_LIB_DIR}" != "" ]; then
28 SA_LIB_DIR="sa_lib_dir=${SA_LIB_DIR} "
31 # System Activity directory
32 SA_DIR=`${ASK} 'System activity directory:' "sa_dir" "sa_dir"`
33 if [ "${SA_DIR}" != "" ]; then
34 SA_DIR="sa_dir=${SA_DIR} "
37 # sysstat configuration directory
38 SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"`
39 if [ "${SYSCONFIG_DIR}" != "" ]; then
40 SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} "
44 CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"`
45 if [ "${CLEAN_SA_DIR}" = "y" ]; then
46 CLEAN_SA_DIR="--enable-clean-sa-dir "
49 echo "Parameter --enable-clean-sa-dir is NOT set"
52 # National Language Support
53 NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"`
54 if [ "${NLS}" = "y" ]; then
58 echo "Parameter --disable-nls is NOT set"
62 SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"`
63 if [ "${SENSORS}" = "y" ]; then
64 SENSORS="--disable-sensors "
67 echo "Parameter --disable-sensors is NOT set"
70 # Data history to keep by sa2
71 HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"`
72 if [ "${HISTORY}" != "" ]; then
73 HISTORY="history=${HISTORY} "
76 # Delay after which datafiles are to be compressed
77 COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"`
78 if [ "${COMPRESSAFTER}" != "" ]; then
79 COMPRESSAFTER="compressafter=${COMPRESSAFTER} "
82 # Preallocation factor
83 PREALLOC_ANSWER=`${ASK} 'Preallocation factor value:' "prealloc" "prealloc"`
84 if [ "${PREALLOC_ANSWER}" != "" ]; then
85 PREALLOC_ANSWER="prealloc=${PREALLOC_ANSWER} "
89 MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"`
90 if [ "${MAN}" != "" ]; then
91 MAN="man_group=${MAN} "
94 # Don't set attributes on files being installed
95 IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
96 if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
97 IGNORE_FILE_ATTR="--disable-file-attr "
100 echo "Parameter --disable-file-attr is NOT set"
104 CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"`
105 if [ "${CRON}" = "y" ]; then
106 CRON="--enable-install-cron "
109 echo "Parameter --enable-install-cron is NOT set"
112 if [ "${CRON}" != "" ];
114 CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"`
115 if [ "${CRON_OWNER}" != "" ]; then
116 CRON="${CRON}cron_owner=${CRON_OWNER} "
120 if [ "${CRON}" != "" ];
122 CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
123 if [ "${CRON_INTERVAL}" != "" ]; then
124 CRON="${CRON}cron_interval=${CRON_INTERVAL} "
128 if [ "${CRON}" != "" ];
130 COLL_ALL=`${ASK} 'Should sadc collect optional activities? (y/n)' "--enable-collect-all" "collect-all"`
131 if [ "${COLL_ALL}" = "y" ]; then
132 CRON="${CRON}--enable-collect-all "
134 echo "Parameter --enable-collect-all is NOT set"
138 if [ "${CRON}" != "" -a "${COLL_ALL}" != "y" ];
140 # Optional args for sadc
141 SADC_OPT=`${ASK} 'Options to be passed to sadc:' "sadc_options" "sadc_options"`
146 if [ "${CRON}" != "" ];
149 RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"`
150 if [ "${RCDIR}" != "" ]; then
151 RCDIR="rcdir=${RCDIR} "
155 if [ "${CRON}" != "" ];
158 COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
159 if [ "${COPY_ONLY}" = "y" ]; then
160 COPY_ONLY="--enable-copy-only "
163 echo "Parameter --enable-copy-only is NOT set"
167 # Compress manual pages
168 COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"`
169 if [ "${COMPRESSMANPG}" = "y" ]; then
170 COMPRESSMANPG="--enable-compress-manpg "
173 echo "Parameter --enable-compress-manpg is NOT set"
176 # Install documentation
177 INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"`
178 if [ "${INSTALL_DOC}" = "y" ]; then
179 INSTALL_DOC="--disable-documentation "
182 echo "Parameter --disable-documentation is NOT set"
186 DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"`
187 if [ "${DEBUGINFO}" = "y" ]; then
188 DEBUGINFO="--enable-debuginfo "
191 echo "Parameter --enable-debuginfo is NOT set"
194 # Install isag script
195 INSTALL_ISAG=`${ASK} 'Install isag script? (y/n)' "--enable-install-isag" "install-isag"`
196 if [ "${INSTALL_ISAG}" = "y" ]; then
197 INSTALL_ISAG="--enable-install-isag "
200 echo "Parameter --enable-install-isag is NOT set"
204 STRIP=`${ASK} 'Do not strip object files? (y/n)' "--disable-stripping" "stripping"`
205 if [ "${STRIP}" = "y" ]; then
206 STRIP="--disable-stripping "
209 echo "Parameter --disable-stripping is NOT set"
213 echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
214 ${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR}"
215 if [ "${SADC_OPT}" != "" ];
217 echo -n "sadc_options=\"${SADC_OPT}\""
219 echo "${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
222 ./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
223 ${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
224 sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS} \