]> granicus.if.org Git - sysstat/blobdiff - configure.in
Starting sysstat-12.5.5
[sysstat] / configure.in
index c66b000732cb6d5726464f92cee3cace9f87e2de..7a42cf9d8950c8592b32a865d999764efe66a605 100644 (file)
@@ -4,7 +4,7 @@
 # Modified by Sebastien Godard (sysstat <at> orange.fr)
 
 # Initialization of $PACKAGE_VERSION and $PACKAGE_NAME variables
-AC_INIT(sysstat, 11.5.2)
+AC_INIT(sysstat, 12.5.5)
 
 # Ensure that a recent enough version of Autoconf is being used
 AC_PREREQ(2.53)
@@ -30,12 +30,17 @@ AC_CHECK_PROG(INSTALL, install, install)
 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
+AC_CHECK_PROG(VER_XML, xmllint, xmllint)
+AC_CHECK_PROGS(VER_JSON, json_verify json_pp, true)
 AC_CHECK_PROGS(ZIP, xz bzip2 gzip, gzip)
 INSTALL_DATA="\${INSTALL} -m 644"
 AC_SUBST(INSTALL_DATA)
 INSTALL_BIN="\${INSTALL} -m 755"
 AC_SUBST(INSTALL_BIN)
 
+AC_SUBST(VER_JSON)
+AC_SUBST(VER_XML)
+
 AC_PATH_PROG(PATH_CP, cp)
 AC_PATH_PROG(PATH_CHKCONFIG, chkconfig)
 
@@ -48,6 +53,12 @@ AC_ARG_WITH([systemdsystemunitdir],
 if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
     AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
 fi
+AC_ARG_WITH([systemdsleepdir],
+    AS_HELP_STRING([--with-systemdsleepdir=DIR],[Directory for systemd suspend/resume scripts]),
+    [], [with_systemdsleepdir=$($PKG_CONFIG --variable=systemdsleepdir systemd)])
+if test -n "$with_systemdsleepdir" -a "x$with_systemdsleepdir" != xno ; then
+    AC_SUBST([SYSTEMD_SLEEP_DIR], [$with_systemdsleepdir])
+fi
 
 # Check libraries
 
@@ -59,21 +70,33 @@ HAVE_LIBINTL_H=
 HAVE_LOCALE_H=
 HAVE_SYS_SYSMACROS_H=
 HAVE_SYS_PARAM_H=
-AC_HEADER_STDC
-AC_HEADER_DIRENT
 AC_CHECK_HEADERS(ctype.h)
 AC_CHECK_HEADERS(errno.h)
 AC_CHECK_HEADERS(libintl.h, HAVE_LIBINTL_H=1)
 AC_CHECK_HEADERS(locale.h, HAVE_LOCALE_H=1)
+AC_CHECK_HEADERS(linux/sched.h, HAVE_LINUX_SCHED_H=1)
 AC_CHECK_HEADERS(net/if.h)
 AC_CHECK_HEADERS(regex.h)
 AC_CHECK_HEADERS(signal.h)
 AC_CHECK_HEADERS(stdio.h)
+AC_CHECK_HEADERS(stdint.h)
+AC_CHECK_HEADERS(fcntl.h)
+AC_CHECK_HEADERS(inttypes.h)
+AC_CHECK_HEADERS(libgen.h)
+AC_CHECK_HEADERS(pwd.h)
+AC_CHECK_HEADERS(time.h)
+AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(pcp/pmapi.h, HAVE_PCP_PMAPI_H=1)
+AC_CHECK_HEADERS(pcp/impl.h, HAVE_PCP_IMPL_H=1)
+AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_HEADERS(sys/statvfs.h)
+AC_CHECK_HEADERS(sys/types.h)
 AC_CHECK_HEADERS(sys/file.h)
 AC_CHECK_HEADERS(sys/ioctl.h)
 AC_CHECK_HEADERS(sys/param.h, HAVE_SYS_PARAM_H=1)
 AC_CHECK_HEADERS(sys/stat.h)
 AC_CHECK_HEADERS(sys/sysmacros.h, HAVE_SYS_SYSMACROS_H=1)
+AC_CHECK_HEADERS(sys/utsname.h)
 
 echo .
 echo Check typedefs, structures and compiler characteristics:
@@ -90,6 +113,47 @@ AC_CHECK_FUNCS(strcspn)
 AC_CHECK_FUNCS(strspn)
 AC_CHECK_FUNCS(strstr)
 
+# Should we check for PCP support?
+AC_MSG_CHECKING(for PCP support)
+AC_ARG_ENABLE(pcp,
+             AC_HELP_STRING([--disable-pcp],
+                            [disable PCP support]),
+                            PCP=$enableval,PCP=yes)
+if test $PCP != "yes"; then
+       HAVE_PCP="n"
+else
+       HAVE_PCP="y"
+fi
+
+if test ! $HAVE_PCP_PMAPI_H; then
+       HAVE_PCP="n"
+       PCP=no
+fi
+AC_MSG_RESULT($PCP)
+
+# Check for PCP libraries
+LFPCP=""
+DFPCP=""
+if test $HAVE_PCP = "y"; then
+       PCP=no
+       AC_CHECK_LIB(pcp, pmGetVersion, LFPCP="-lpcp -lpcp_import", HAVE_PCP="n")
+       AC_MSG_CHECKING(for PCP libraries)
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pcp/pmapi.h>
+                                            #include <pcp/import.h>]],
+                                          [[pmiEnd();]])],PCP=yes; DFPCP="-DHAVE_PCP", HAVE_PCP="n"; PCP=no)
+       AC_MSG_RESULT($PCP)
+fi
+AC_SUBST(HAVE_PCP)
+AC_SUBST(LFPCP)
+AC_SUBST(DFPCP)
+
+if test $HAVE_PCP_IMPL_H; then
+   PCP_IMPL="y"
+else
+   PCP_IMPL="n"
+fi
+AC_SUBST(PCP_IMPL)
+
 # Should we check for lm_sensors?
 AC_MSG_CHECKING(for sensors support)
 AC_ARG_ENABLE(sensors,
@@ -97,26 +161,62 @@ AC_ARG_ENABLE(sensors,
                             [disable sensors support]),
                             SENSORS=$enableval,SENSORS=yes)
 if test $SENSORS != "yes"; then
-   HAVE_SENSORS="n"
+       SENSORS_SUPPORT="n"
 else
-   HAVE_SENSORS="y"
+       SENSORS_SUPPORT="y"
 fi
 AC_MSG_RESULT($SENSORS)
 
-# Check for lm_sensors
-SENSORS=no
+# Check for lm_sensors library
 LFSENSORS=""
 DFSENSORS=""
-AC_CHECK_LIB(sensors, sensors_get_detected_chips, LFSENSORS="-lsensors", HAVE_SENSORS="n")
-AC_MSG_CHECKING(for sensors lib)
-AC_TRY_COMPILE(#include <sensors/sensors.h>
-#include <sensors/error.h>
-               , sensors_cleanup();,SENSORS=yes; DFSENSORS="-DHAVE_SENSORS", HAVE_SENSORS="n"; SENSORS=no)
-AC_MSG_RESULT($SENSORS)
+HAVE_SENSORS="n"
+if test $SENSORS_SUPPORT = "y"; then
+       SENSORS=no
+       AC_CHECK_LIB(sensors, sensors_get_detected_chips, LFSENSORS="-lsensors", HAVE_SENSORS="n")
+       AC_MSG_CHECKING(for sensors library)
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sensors/sensors.h>
+                                            #include <sensors/error.h>]],
+                                          [[sensors_cleanup();]])], SENSORS=yes; HAVE_SENSORS="y"; DFSENSORS="-DHAVE_SENSORS", HAVE_SENSORS="n"; SENSORS=no)
+       AC_MSG_RESULT($SENSORS)
+fi
 AC_SUBST(HAVE_SENSORS)
 AC_SUBST(LFSENSORS)
 AC_SUBST(DFSENSORS)
 
+# Check for 32-bit version of lm_sensors library
+LFSENSORS32=""
+DFSENSORS32=""
+HAVE_SENSORS32="n"
+if test $SENSORS_SUPPORT = "y"; then
+       CFLAGS_SAVE=$CFLAGS
+       CFLAGS+=" -m32"
+       LDFLAGS=" -lsensors"
+       SENSORS=no
+#      Check for another function to avoid using cached result
+       AC_CHECK_LIB(sensors, sensors_cleanup, LFSENSORS32="-lsensors", HAVE_SENSORS32="n")
+       AC_MSG_CHECKING(for sensors 32-bit library)
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sensors/sensors.h>
+                                         #include <sensors/error.h>]],
+                                       [[sensors_cleanup();]])], SENSORS=yes; HAVE_SENSORS32="y"; DFSENSORS32="-DHAVE_SENSORS32", HAVE_SENSORS32="n"; SENSORS=no)
+       AC_MSG_RESULT($SENSORS)
+       CFLAGS=$CFLAGS_SAVE
+fi
+AC_SUBST(HAVE_SENSORS32)
+AC_SUBST(LFSENSORS32)
+AC_SUBST(DFSENSORS32)
+
+# Check for 32-bit system libraries
+TGLIB32=no
+CFLAGS_SAVE=$CFLAGS
+CFLAGS+=" -m32"
+AC_MSG_CHECKING(for 32-bit system libraries)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+                                  [[printf("%d\n", sizeof(long));]])],TGLIB32=yes, TGLIB32=no)
+AC_MSG_RESULT($TGLIB32)
+CFLAGS=$CFLAGS_SAVE
+AC_SUBST(TGLIB32)
+
 echo .
 echo Check system services:
 echo .
@@ -128,28 +228,33 @@ echo .
 # Check arguments used
 #
 # Optional Features:
-#  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-#  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-#  --disable-largefile     omit support for large files
-#  --disable-nls           disable National Language Support
-#  --disable-file-attr     don't set attributes on files being installed
-#  --enable-install-cron   tell sysstat to install cron scripts
-#  --collect-all           tell sadc to collect all possible data    
-#  --enable-clean-sa-dir   clean system activity directory
-#  --enable-compress-manpg compress manual pages
-#  --enable-install-isag   install isag script
-#  --enable-debuginfo      enable debug output (--debuginfo option)
-#  --disable-documentation do not install documentation (man pages...)
-#  --disable-sensors      do not link against libsensors even if available
-#  --disable-stripping     do not strip object files
-#  --enablle-copy-only     only copy files when installing sysstat
+#  --disable-FEATURE        do not include FEATURE (same as --enable-FEATURE=no)
+#  --enable-FEATURE[=ARG]   include FEATURE [ARG=yes]
+#  --disable-largefile      omit support for large files
+#  --disable-nls            disable National Language Support
+#  --disable-file-attr      don't set attributes on files being installed
+#  --enable-install-cron    tell sysstat to install cron scripts
+#  --collect-all            tell sadc to collect all possible data
+#  --enable-clean-sa-dir    clean system activity directory
+#  --disable-compress-manpg do not compress manual pages when installed
+#  --enable-debuginfo       enable debug output (--debuginfo option)
+#  --disable-documentation  do not install documentation (man pages...)
+#  --disable-sensors        do not link against libsensors even if available
+#  --disable-pcp            do not link against PCP libraries even if available
+#  --disable-stripping      do not strip object files
+#  --enable-copy-only       only copy files when installing sysstat
+#  --enable-use-crond       use standard cron daemon
+#  --enable-lto                    compile with Link Time Optimizations
 #
 # Some influential environment variables:
-#  rcdir        directory where startup scripts are installed
+#  rcdir         directory where startup scripts are installed
 #  sa_lib_dir    sadc, sa1 and sa2 directory
 #  sa_dir        system activity daily datafiles directory
-#  conf_dir     sysstat configuration directory (default is /etc/sysconfig)
+#  sar_dir       sar binary location. Used only in sa2 shell script
+#  conf_dir      sysstat configuration directory (default is /etc/sysconfig)
+#  conf_file     sysstat configuration file (default is sysstat)
 #  history       number of daily datafiles to keep (default value is 7)
+#  delay_range   maximum delay (in seconds) to wait before sa2 script generates its reports
 #  compressafter number of days after which datafiles are compressed
 #  man_group     group for man pages
 #  cron_owner    crontab owner
@@ -158,7 +263,7 @@ echo .
 #
 # Fine tuning the installation directories:
 #  --mandir=DIR           man documentation directory [PREFIX/man]
-#  --docdir=DIR                  other documentation directory [PREFIX/share/doc]
+#  --docdir=DIR           other documentation directory [PREFIX/share/doc]
 #
 # Installation directories:
 #  --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -211,6 +316,13 @@ else
 fi
 AC_SUBST(SYSMACROS)
 
+if test $HAVE_LINUX_SCHED_H; then
+   LINUX_SCHED="y"
+else
+   LINUX_SCHED="n"
+fi
+AC_SUBST(LINUX_SCHED)
+
 if test $HAVE_SYS_PARAM_H; then
    SYSPARAM="y"
 else
@@ -269,6 +381,17 @@ if test ! -d $SA_DIR; then
 fi
 AC_SUBST(SA_DIR)
 
+# sar binary location. Used only in sa2 shell script
+AC_MSG_CHECKING(sar directory)
+AC_ARG_VAR([sar_dir],[sar directory])
+if test x$sar_dir != x""; then
+   SAR_DIR=$sar_dir
+else
+   SAR_DIR=
+fi
+AC_MSG_RESULT($SAR_DIR)
+AC_SUBST(SAR_DIR)
+
 # Set configuration directory
 AC_MSG_CHECKING(sysstat configuration directory)
 AC_ARG_VAR([conf_dir],[sysstat configuration directory])
@@ -283,6 +406,17 @@ if test ! -d $SYSCONFIG_DIR; then
 fi
 AC_SUBST(SYSCONFIG_DIR)
 
+# Set configuration directory
+AC_MSG_CHECKING(sysstat configuration file)
+AC_ARG_VAR([conf_file],[sysstat configuration file])
+if test x$conf_file != x""; then
+   SYSCONFIG_FILE=$conf_file
+else
+   SYSCONFIG_FILE=sysstat
+fi
+AC_MSG_RESULT($SYSCONFIG_FILE)
+AC_SUBST(SYSCONFIG_FILE)
+
 # National Language Support
 AC_MSG_CHECKING(National Language Support)
 AC_ARG_ENABLE(nls,
@@ -297,6 +431,8 @@ else
    NLS="n"
 fi
 AC_MSG_RESULT($AUX_NLS)
+AC_CHECK_LIB(intl, gettext, LFINTL="-lintl")
+AC_SUBST(LFINTL)
 LACKING_GETTEXT="n"
 if test $AUX_NLS = "yes" &&  test x$MSGFMT != x"msgfmt"; then 
    echo "WARNING: msgfmt command not found!"
@@ -316,6 +452,25 @@ if test $NLS = "y" && test $LACKING_GETTEXT = "y"; then
 fi
 AC_SUBST(NLS)
 
+# Link Time Optimization
+AC_MSG_CHECKING(Link Time Optimization support)
+AC_ARG_ENABLE(lto,
+             AC_HELP_STRING([--enable-lto],
+                            [enable Link Time Optimization]),
+                            AUX_LTO=$enableval,AUX_LTO=no)
+AC_MSG_RESULT($AUX_LTO)
+LTO="n"
+if test $AUX_LTO = "yes"; then
+       AC_CHECK_PROG(GCC_AR, gcc-ar, gcc-ar)
+       if test x$GCC_AR != x"gcc-ar"; then
+               echo "WARNING: gcc-ar command not found! Disabling LTO support"
+               AUX_LTO="no"
+       else
+               LTO="y"
+       fi
+fi
+AC_SUBST(LTO)
+
 # Data history to keep by sa2
 AC_MSG_CHECKING(number of daily data files to keep)
 AC_ARG_VAR([history],[number of daily data files to keep (default value is 7)]) 
@@ -338,16 +493,16 @@ fi
 AC_MSG_RESULT($COMPRESSAFTER)
 AC_SUBST(COMPRESSAFTER)
 
-# Preallocation factor
-AC_MSG_CHECKING(preallocation factor value)
-AC_ARG_VAR([prealloc],[preallocation factor that will determine data files size (default value is 1)])
-if test x$prealloc = x""; then
-   PREALLOC_FACTOR=1
+# Random delay to wait before sa2 script runs
+AC_MSG_CHECKING(random delay to wait before sa2 script runs)
+AC_ARG_VAR([delay_range],[maximum delay (in seconds) to wait before sa2 script generates its reports])
+if test x$delay_range = x""; then
+   DELAY_RANGE=0
 else
-   PREALLOC_FACTOR=$prealloc
+   DELAY_RANGE=$delay_range
 fi
-AC_MSG_RESULT($PREALLOC_FACTOR)
-AC_SUBST(PREALLOC_FACTOR)
+AC_MSG_RESULT($DELAY_RANGE)
+AC_SUBST(DELAY_RANGE)
 
 # Manual page group
 grep ^man: /etc/group >/dev/null 2>&1
@@ -394,33 +549,17 @@ AC_SUBST(IGNORE_FILE_ATTRIBUTES)
 # Compress manual pages?
 AC_MSG_CHECKING(whether manual pages should be compressed)
 AC_ARG_ENABLE(compress-manpg,
-             AC_HELP_STRING([--enable-compress-manpg],
-                            [compress sysstat manual pages]),
-                            AUX_MPG=$enableval,AUX_MPG=no)
+             AC_HELP_STRING([--disable-compress-manpg],
+                            [do not compress sysstat manual pages]),
+                            AUX_MPG=$enableval,AUX_MPG=yes)
 if test $AUX_MPG != "yes"; then
    COMPRESS_MANPG=n
-   AUX_MPG=no
 else
    COMPRESS_MANPG=y
 fi
 AC_MSG_RESULT($AUX_MPG)
 AC_SUBST(COMPRESS_MANPG)
 
-# Check whether isag should be installed
-AC_MSG_CHECKING(whether isag script should be installed)
-AC_ARG_ENABLE(install-isag,
-             AC_HELP_STRING([--enable-install-isag],
-                            [install isag script]),
-                            AUX_IIS=$enableval,AUX_IIS=no)
-if test $AUX_IIS != "yes"; then
-   INSTALL_ISAG=n
-   AUX_IIS=no
-else
-   INSTALL_ISAG=y
-fi
-AC_MSG_RESULT($AUX_IIS)
-AC_SUBST(INSTALL_ISAG)
-
 # Check whether sa directory should be cleaned
 AC_MSG_CHECKING(whether system activity directory should be cleaned)
 AC_ARG_ENABLE(clean-sa-dir,
@@ -483,6 +622,21 @@ if test $INSTALL_CRON = "y"; then
       REM_CHOWN=$CHOWN
    fi
 
+#  Check whether we should use the standard cron daemon
+   AC_MSG_CHECKING(whether we should use the standard cron daemon)
+   AC_ARG_ENABLE(use-crond,
+                AC_HELP_STRING([--enable-use-crond],
+                               [use standard cron daemon]),
+                               UCROND=$enableval,UCROND=no)
+   if test $UCROND != "yes"; then
+      USE_CROND=n
+      UCROND=no
+   else
+      USE_CROND=y
+   fi
+   AC_MSG_RESULT($UCROND)
+   AC_SUBST(USE_CROND)
+
 #  Crontab interval
    AC_MSG_CHECKING(crontab interval)
    AC_ARG_VAR([cron_interval],[crontab interval])
@@ -560,7 +714,7 @@ AC_ARG_ENABLE(documentation,
              AC_HELP_STRING([--disable-documentation],
                             [do not install documentation]),
                             AUX_DOC=$enableval,AUX_DOC=yes)
-if  test  $AUX_DOC !=  "no"; then
+if test $AUX_DOC != "no"; then
    AUX_DOC="yes"
    INSTALL_DOC="y"
 else
@@ -573,13 +727,15 @@ AC_SUBST(INSTALL_DOC)
 # Set directory for installing manual pages (see comment in Makefile)
 AC_SUBST(mandir)
 
-# Check whether --debuginfo options should be allowed
+# Check whether debug mode should be activated
+AC_MSG_CHECKING(whether debug mode should be activated)
 AC_ARG_ENABLE(debuginfo, 
              AC_HELP_STRING([--enable-debuginfo],
                             [enable debug output (--debuginfo option)]),
                             WITH_DEBUG=yes ; DFLAGS="$DFLAGS -DDEBUG" , WITH_DEBUG=no)
-AC_SUBST(WITH_DEBUG)
+AC_MSG_RESULT($WITH_DEBUG)
 AC_SUBST(DFLAGS)
+AC_SUBST(WITH_DEBUG)
 
 # Check whether object files should be stripped
 AC_MSG_CHECKING(whether object files should be stripped)
@@ -607,7 +763,6 @@ AC_CONFIG_FILES([cron/crontab:cron/crontab.sample]) # File must be renamed
 AC_CONFIG_FILES([sysstat.sysconfig])
 AC_CONFIG_FILES([version.h:version.in])                # File must be renamed
 AC_CONFIG_FILES([sysconfig.h:sysconfig.in])    # File must be renamed
-AC_CONFIG_FILES([prealloc.h:prealloc.in])      # File must be renamed
 AC_CONFIG_FILES([cron/sysstat.cron.daily])
 AC_CONFIG_FILES([cron/sysstat.cron.hourly])
 AC_CONFIG_FILES([cron/sysstat.crond])
@@ -618,6 +773,7 @@ AC_CONFIG_FILES([cron/sysstat-collect.service])
 AC_CONFIG_FILES([cron/sysstat-collect.timer])
 AC_CONFIG_FILES([cron/sysstat-summary.service])
 AC_CONFIG_FILES([cron/sysstat-summary.timer])
+AC_CONFIG_FILES([cron/sysstat.sleep], [chmod +x cron/sysstat.sleep])   # Permissions must be changed
 AC_CONFIG_FILES([man/sa1.8:man/sa1.in])                # File must be renamed
 AC_CONFIG_FILES([man/sa2.8:man/sa2.in])                # File must be renamed
 AC_CONFIG_FILES([man/sadc.8:man/sadc.in])      # File must be renamed
@@ -626,7 +782,7 @@ AC_CONFIG_FILES([man/sar.1:man/sar.in])             # File must be renamed
 AC_CONFIG_FILES([man/sysstat.5:man/sysstat.in])        # File must be renamed
 AC_CONFIG_FILES([man/iostat.1:man/iostat.in])  # File must be renamed
 AC_CONFIG_FILES([man/cifsiostat.1:man/cifsiostat.in])  # File must be renamed
-AC_CONFIG_FILES([contrib/isag/isag], [chmod +x contrib/isag/isag]) # Permissions must be changed
+AC_CONFIG_FILES([tests/variables])
 
 AC_OUTPUT(Makefile)
 
@@ -634,11 +790,15 @@ echo "
    Sysstat version:            $PACKAGE_VERSION
    Installation prefix:                $prefix
    rc directory:               ${RC_DIR}
-   Init directory:             ${INIT_DIR}
-   Systemd unit dir:           ${with_systemdsystemunitdir}
-   Configuration directory:    ${SYSCONFIG_DIR}
+   Init directory:             ${INIT_DIR}"
+if test "$UCROND" != "yes"; then
+   echo "   Systemd unit dir:          ${with_systemdsystemunitdir}"
+   echo "   Systemd sleep dir:         ${with_systemdsleepdir}"
+else
+   echo "   Use standard cron daemon"
+fi
+echo "   Configuration file:           ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
    Man pages directory:                $mandir
    Compiler:                   $CC
    Compiler flags:             $CFLAGS
 "
-