2 #@(#) Configuration script for sysstat
3 # (C) 2000-2022 Sebastien GODARD (sysstat <at> orange.fr)
8 echo -n "./configure sa_lib_dir=. sa_dir=. conf_dir=. conf_file=sysstat.sysconfig"
10 ./configure sa_lib_dir=. sa_dir=. sar_dir=. conf_dir=. conf_file=sysstat.sysconfig
12 elif [ "$1" = "local" ]
14 # This mode is just to make sure that sar will call sadc located in current directory
16 echo -n "./configure sa_lib_dir=."
18 ./configure sa_lib_dir=.
20 elif [ "$1" = "debug" ]
23 echo -n "./configure sa_lib_dir=. --enable-debuginfo --disable-stripping"
25 ./configure sa_lib_dir=. --enable-debuginfo --disable-stripping
32 echo Welcome to sysstat\'s Interactive Configuration script!
34 echo This script enables you to set the parameters value used by ./configure.
35 echo Please enter the value for the parameters listed below.
36 echo Press Return to tell ./configure to use the default value or to try to guess the proper one.
37 echo "Default value for yes/no questions is no (parameter is NOT set)."
38 echo You can enter a ? to display a help message at any time...
41 # Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
43 # Installation directory
44 PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
45 if [ "${PREFIX}" != "" ]; then
46 PREFIX="--prefix=${PREFIX} "
50 SA_LIB_DIR=`${ASK} 'sadc directory:' "sa_lib_dir" "sa_lib_dir"`
51 if [ "${SA_LIB_DIR}" != "" ]; then
52 SA_LIB_DIR="sa_lib_dir=${SA_LIB_DIR} "
55 # System Activity directory
56 SA_DIR=`${ASK} 'System activity directory:' "sa_dir" "sa_dir"`
57 if [ "${SA_DIR}" != "" ]; then
58 SA_DIR="sa_dir=${SA_DIR} "
61 # sysstat configuration directory
62 SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"`
63 if [ "${SYSCONFIG_DIR}" != "" ]; then
64 SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} "
67 # sysstat configuration file
68 SYSCONFIG_FILE=`${ASK} 'sysstat configuration file:' "conf_file" "conf_file"`
69 if [ "${SYSCONFIG_FILE}" != "" ]; then
70 SYSCONFIG_FILE="conf_file=${SYSCONFIG_FILE} "
74 CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"`
75 if [ "${CLEAN_SA_DIR}" = "y" ]; then
76 CLEAN_SA_DIR="--enable-clean-sa-dir "
79 echo "Parameter --enable-clean-sa-dir is NOT set"
82 # National Language Support
83 NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"`
84 if [ "${NLS}" = "y" ]; then
88 echo "Parameter --disable-nls is NOT set"
91 # Link Time Optimization support
92 LTO=`${ASK} 'Compile with Link Time Optimizations (LTO)? (y/n)' "--enable-lto" "lto"`
93 if [ "${LTO}" = "y" ]; then
97 echo "Parameter --enable-lto is NOT set"
101 SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"`
102 if [ "${SENSORS}" = "y" ]; then
103 SENSORS="--disable-sensors "
106 echo "Parameter --disable-sensors is NOT set"
110 PCP=`${ASK} 'Disable PCP support? (y/n)' "--disable-pcp" "pcp"`
111 if [ "${PCP}" = "y" ]; then
115 echo "Parameter --disable-pcp is NOT set"
118 # Data history to keep by sa2
119 HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"`
120 if [ "${HISTORY}" != "" ]; then
121 HISTORY="history=${HISTORY} "
124 # Random delay before sa2 script generates its reports files
125 DELAY_RANGE=`${ASK} 'Maximum delay in seconds to wait before sa2 script runs:' "delay_range" "delay_range"`
126 if [ "${DELAY_RANGE}" != "" ]; then
127 DELAY_RANGE="delay_range=${DELAY_RANGE} "
130 # Delay after which datafiles are to be compressed
131 COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"`
132 if [ "${COMPRESSAFTER}" != "" ]; then
133 COMPRESSAFTER="compressafter=${COMPRESSAFTER} "
137 MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"`
138 if [ "${MAN}" != "" ]; then
139 MAN="man_group=${MAN} "
142 # Don't set attributes on files being installed
143 IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
144 if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
145 IGNORE_FILE_ATTR="--disable-file-attr "
148 echo "Parameter --disable-file-attr is NOT set"
152 CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"`
153 if [ "${CRON}" = "y" ]; then
154 CRON="--enable-install-cron "
157 echo "Parameter --enable-install-cron is NOT set"
160 if [ "${CRON}" != "" ];
162 CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"`
163 if [ "${CRON_OWNER}" != "" ]; then
164 CRON="${CRON}cron_owner=${CRON_OWNER} "
168 if [ "${CRON}" != "" ];
170 USE_CROND=`${ASK} 'Use standard cron daemon? (y/n)' "--enable-use-crond" "use-crond"`
171 if [ "${USE_CROND}" = "y" ]; then
172 USE_CROND="--enable-use-crond "
175 echo "Parameter --enable-use-crond is NOT set"
179 if [ "${CRON}" != "" ];
181 CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
182 if [ "${CRON_INTERVAL}" != "" ]; then
183 CRON="${CRON}cron_interval=${CRON_INTERVAL} "
187 if [ "${CRON}" != "" ];
189 COLL_ALL=`${ASK} 'Should sadc collect optional activities? (y/n)' "--enable-collect-all" "collect-all"`
190 if [ "${COLL_ALL}" = "y" ]; then
191 CRON="${CRON}--enable-collect-all "
193 echo "Parameter --enable-collect-all is NOT set"
197 if [ "${CRON}" != "" -a "${COLL_ALL}" != "y" ];
199 # Optional args for sadc
200 SADC_OPT=`${ASK} 'Options to be passed to sadc:' "sadc_options" "sadc_options"`
205 if [ "${CRON}" != "" ];
208 RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"`
209 if [ "${RCDIR}" != "" ]; then
210 RCDIR="rcdir=${RCDIR} "
214 if [ "${CRON}" != "" ];
217 COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
218 if [ "${COPY_ONLY}" = "y" ]; then
219 COPY_ONLY="--enable-copy-only "
222 echo "Parameter --enable-copy-only is NOT set"
226 # Compress manual pages
227 COMPRESSMANPG=`${ASK} 'Do not compress manual pages? (y/n)' "--disable-compress-manpg" "compress-manpg"`
228 if [ "${COMPRESSMANPG}" = "y" ]; then
229 COMPRESSMANPG="--disable-compress-manpg "
232 echo "Parameter --disable-compress-manpg is NOT set"
235 # Install documentation
236 INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"`
237 if [ "${INSTALL_DOC}" = "y" ]; then
238 INSTALL_DOC="--disable-documentation "
241 echo "Parameter --disable-documentation is NOT set"
245 DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"`
246 if [ "${DEBUGINFO}" = "y" ]; then
247 DEBUGINFO="--enable-debuginfo "
250 echo "Parameter --enable-debuginfo is NOT set"
254 STRIP=`${ASK} 'Do not strip object files? (y/n)' "--disable-stripping" "stripping"`
255 if [ "${STRIP}" = "y" ]; then
256 STRIP="--disable-stripping "
259 echo "Parameter --disable-stripping is NOT set"
263 echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
264 ${CLEAN_SA_DIR}${NLS}${LTO}${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR} \
265 ${CRON}${USE_CROND}${RCDIR}"
266 if [ "${SADC_OPT}" != "" ];
268 echo -n "sadc_options=\"${SADC_OPT}\""
270 echo "${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS}${PCP}${STRIP}${COPY_ONLY}"
273 ./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
274 ${CLEAN_SA_DIR}${NLS}${LTO} \
275 ${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR} \
276 sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS} \
277 ${PCP}${STRIP}${COPY_ONLY}