2 # $Id: configure.ac 4319 2016-05-07 12:14:20Z chrfranke $
4 dnl Process this file with autoconf to produce a configure script.
6 AC_INIT(smartmontools, 6.6, smartmontools-support@lists.sourceforge.net)
7 AM_INIT_AUTOMAKE([1.10 foreign])
9 smartmontools_cvs_tag=`echo '$Id: configure.ac 4319 2016-05-07 12:14:20Z chrfranke $'`
10 smartmontools_release_date=2016-05-07
11 smartmontools_release_time="11:17:46 UTC"
13 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments])
14 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date])
15 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time])
16 AC_DEFINE_UNQUOTED(CONFIG_H_CVSID, "$smartmontools_cvs_tag", [smartmontools CVS Tag])
17 AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE, "http://www.smartmontools.org/", [smartmontools Home Page])
19 AC_CONFIG_SRCDIR([smartctl.cpp])
20 AC_CONFIG_HEADER([config.h])
25 dnl Checks for programs.
30 m4_pattern_forbid([^PKG_PROG_])
31 if test "$cross_compiling" = "no"; then
32 m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG],
33 [AC_MSG_WARN([m4/pkg.m4 missing, systemd detection disabled])])
36 AC_ARG_VAR(WINDMC, [Windows message compiler command])
37 AC_ARG_VAR(WINDRES, [Windows resource compiler command])
38 AC_ARG_VAR(MAKENSIS, [NSIS compiler command])
43 AC_CHECK_TOOL(WINDMC, [windmc])
44 AC_CHECK_TOOL(WINDRES, [windres])
46 AC_MSG_CHECKING([for makensis])
47 if test -z "$MAKENSIS"; then
48 if test -n "$PROGRAMFILES" && "$PROGRAMFILES/NSIS/makensis" -VERSION >/dev/null 2>&1; then
49 MAKENSIS="$PROGRAMFILES/NSIS/makensis"
50 elif makensis -VERSION >/dev/null 2>&1; then
54 AC_MSG_RESULT([${MAKENSIS:-no}])
59 AC_MSG_CHECKING([whether this is a build from SVN])
62 if test -f "$srcdir/.svn/wc.db"; then
63 # SVN 1.7, 1.8 working copy
64 svn_deps='${srcdir}/.svn/wc.db'
65 elif test -f "${srcdir}/.svn/entries"; then
66 # SVN <= 1.6 working copy (SVN 1.7 has empty entries file)
67 svn_deps='${srcdir}/.svn/entries'
69 if test -n "$svn_deps"; then
71 if (cd "$srcdir" && svn --version && svnversion && svn info) >/dev/null 2>&1; then
76 AM_CONDITIONAL(IS_SVN_BUILD, [test "$is_svn_build" = "yes"])
77 AC_MSG_RESULT([$is_svn_build])
79 # Note: On Linux, clock_gettime() requires -lrt which implies -lpthreads
80 # Check ommitted for now, gettimeofday() provides reasonable precision
81 # AC_SEARCH_LIBS(clock_gettime, rt)
83 dnl Checks for header files.
84 AC_CHECK_HEADERS([locale.h])
85 AC_CHECK_HEADERS([dev/ata/atavar.h])
86 dnl we need [u]int64_t and friends.
87 AC_CHECK_HEADERS([inttypes.h]) dnl C99, UNIX98, solaris 2.6+
88 AC_CHECK_HEADERS([stdint.h]) dnl C99
89 AC_CHECK_HEADERS([sys/inttypes.h]) dnl pre-UNIX98
90 AC_CHECK_HEADERS([sys/int_types.h]) dnl pre-UNIX98, solaris 2.6+
91 dnl Check for FreeBSD twe include files...currently missing on 5.2, but should be there
92 AC_CHECK_HEADERS([sys/tweio.h])
93 AC_CHECK_HEADERS([sys/twereg.h])
94 dnl Check for FreeBSD twa include files...
95 AC_CHECK_HEADERS([sys/tw_osl_ioctl.h])
96 dnl This header file is needed for cciss_ioctl.h at least on SuSE LINUX
97 AC_CHECK_HEADERS([linux/compiler.h])
98 dnl Check for the FreeBSD CCISS system header and use internal one if not found
99 AC_CHECK_HEADERS([dev/ciss/cissio.h],
100 [AC_DEFINE([CISS_LOCATION],[<dev/ciss/cissio.h>],[freebsd ciss header location])],
101 [AC_DEFINE([CISS_LOCATION],["cissio_freebsd.h"],[freebsd ciss header location])]
103 dnl Check for Linux CCISS include file
104 AC_CHECK_HEADERS([linux/cciss_ioctl.h], [], [], [AC_INCLUDES_DEFAULT
105 #ifdef HAVE_LINUX_COMPILER_H
106 # include <linux/compiler.h>
109 dnl Check for Windows DDK and WMI header files
110 AC_CHECK_HEADERS([ntdddisk.h ddk/ntdddisk.h], [], [], [AC_INCLUDES_DEFAULT
113 AC_CHECK_HEADERS([wbemcli.h])
115 dnl Checks for typedefs, structures, and compiler characteristics.
116 AC_CHECK_TYPES([int64_t, uint64_t])
118 dnl Checks for library functions.
119 AC_CHECK_FUNCS([getopt_long], [need_getopt_long=no], [need_getopt_long=yes])
120 AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"])
121 AC_CHECK_FUNCS([regcomp], [need_regex=no], [need_regex=yes])
122 AM_CONDITIONAL(NEED_REGEX, [test "$need_regex" = "yes"])
124 AC_CHECK_FUNCS([sigset])
125 AC_CHECK_FUNCS([strtoull])
126 AC_CHECK_FUNCS([uname])
127 AC_CHECK_FUNCS([clock_gettime ftime gettimeofday])
129 # Check byte ordering (defines WORDS_BIGENDIAN)
132 # check for __attribute__((packed))
133 # (sizeof() check is required to avoid false positives if other
134 # __attribute__((x)) are supported)
135 AC_MSG_CHECKING([whether $CXX supports __attribute__((packed))])
136 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[
137 struct s { char a; short b; } __attribute__((packed));
138 typedef char t[sizeof(struct s) == 3 ? 1 : -1];]])],
139 [gcc_have_attr_packed=yes], [gcc_have_attr_packed=no])
140 AC_SUBST(gcc_have_attr_packed)
141 if test "$gcc_have_attr_packed" = "yes"; then
142 AC_DEFINE(HAVE_ATTR_PACKED, 1, [Define to 1 if C++ compiler supports __attribute__((packed))])
144 AC_MSG_RESULT([$gcc_have_attr_packed])
150 AC_ARG_WITH(systemdsystemunitdir,
151 [AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR|auto|yes|no@:>@], [Location of systemd service files [auto]])],
152 [], [with_systemdsystemunitdir=auto])
154 systemdsystemunitdir=
155 case "$with_systemdsystemunitdir" in
157 if test -n "$PKG_CONFIG"; then
158 AC_MSG_CHECKING([for systemdsystemunitdir])
159 systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd 2>/dev/null`
160 AC_MSG_RESULT([${systemdsystemunitdir:-no}])
162 case "$with_systemdsystemunitdir:$sysconfdir:$systemdsystemunitdir" in
163 yes:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;;
164 yes:*:*|auto:*:|auto:/etc:*) ;;
165 *) systemdsystemunitdir='${prefix}'$systemdsystemunitdir ;;
168 *) systemdsystemunitdir="$with_systemdsystemunitdir" ;;
170 AC_SUBST(systemdsystemunitdir)
171 AM_CONDITIONAL(INSTALL_SYSTEMDUNIT, [test -n "$systemdsystemunitdir"])
173 AC_ARG_WITH(systemdenvfile,
174 [AS_HELP_STRING([--with-systemdenvfile@<:@=FILE|auto|yes|no@:>@], [Path of systemd EnvironmentFile [auto]])],
175 [], [with_systemdenvfile=auto])
178 case "$with_systemdenvfile:$cross_compiling:$systemdsystemunitdir" in
180 AC_MSG_CHECKING([for path of systemd EnvironmentFile])
181 for dir in sysconfig default; do
182 if test -d /etc/$dir; then
183 systemdenvfile='${sysconfdir}'/$dir/smartmontools
187 AC_MSG_RESULT([${systemdenvfile:-no}])
188 case "$with_systemdenvfile:$systemdenvfile" in
189 yes:) AC_MSG_ERROR([Path of systemd EnvironmentFile not found]) ;;
192 *:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;;
193 *) systemdenvfile="$with_systemdenvfile"
195 AC_SUBST(systemdenvfile)
197 AC_ARG_WITH(initscriptdir,
198 [AS_HELP_STRING([--with-initscriptdir@<:@=DIR|auto|yes|no@:>@], [Location of init scripts [auto]])],
199 [], [with_initscriptdir=auto])
202 case "$with_initscriptdir:$cross_compiling:$systemdsystemunitdir" in
204 AC_MSG_CHECKING([for init (rc) directory])
205 for dir in rc.d/init.d init.d rc.d; do
206 if test -d /etc/$dir; then
207 initddir='${sysconfdir}'/$dir
211 AC_MSG_RESULT([${initddir:-no}])
212 case "$with_initscriptdir:$initddir" in
213 yes:) AC_MSG_ERROR([Location of init scripts not found]) ;;
216 *) initddir="$with_initscriptdir" ;;
219 AM_CONDITIONAL(INSTALL_INITSCRIPT, [test -n "$initddir"])
221 # use different init script templates for different OS
224 initdfile="smartd.freebsd.initd"
227 initdfile="com.smartmontools.smartd.plist"
230 initdfile="smartd.initd"
235 AC_ARG_WITH(exampledir,
236 [AS_HELP_STRING([--with-exampledir=DIR], [Location of example scripts [DOCDIR/examplescripts]])],
237 [exampledir="$withval"], [exampledir='${docdir}/examplescripts'])
240 drivedbdir='${datadir}/${PACKAGE}'
241 AC_ARG_WITH(drivedbdir,
242 [AS_HELP_STRING([--with-drivedbdir@<:@=DIR|yes|no@:>@], [Location of drive database file [DATADIR/smartmontools]])],
243 [case "$withval" in yes) ;; no) drivedbdir= ;; *) drivedbdir="$withval" ;; esac])
245 AM_CONDITIONAL(ENABLE_DRIVEDB, [test -n "$drivedbdir"])
247 AC_ARG_WITH(update-smart_drivedb,
248 [AS_HELP_STRING([--with-update-smart-drivedb@<:@=yes|no@:>@], [Install update-smart-drivedb script [yes]])],
249 [], [with_update_smart_drivedb=yes])
250 test -n "$drivedbdir" || with_update_smart_drivedb=no
251 AC_SUBST(with_update_smart_drivedb)
252 AM_CONDITIONAL(ENABLE_UPDATE_SMART_DRIVEDB, [test "$with_update_smart_drivedb" = "yes"])
254 AC_ARG_WITH(smartdscriptdir,
255 [AS_HELP_STRING([--with-smartdscriptdir=DIR], [Location of smartd_warning.sh script [SYSCONFDIR]])],
256 [smartdscriptdir="$withval"], [smartdscriptdir='${sysconfdir}'])
257 AC_SUBST(smartdscriptdir)
259 AC_ARG_WITH(smartdplugindir,
260 [AS_HELP_STRING([--with-smartdplugindir=@<:@DIR|no@:>@],
261 [Location of smartd_warning.sh plugin scripts [SMARTDSCRIPTDIR/smartd_warning.d]])],
262 [smartdplugindir=; test "$withval" != "no" && smartdplugindir="$withval"],
263 [smartdplugindir='${smartdscriptdir}/smartd_warning.d'])
264 AC_SUBST(smartdplugindir)
267 AC_ARG_WITH(savestates,
268 [AS_HELP_STRING([--with-savestates@<:@=PREFIX|yes|no@:>@],
269 [Enable default smartd state files [no] (yes=LOCALSTATEDIR/lib/smartmontools/smartd.)])],
270 [case "$withval" in yes) savestates='${localstatedir}/lib/${PACKAGE}/smartd.' ;;
271 no) ;; *) savestates="$withval" ;; esac])
272 savestatesdir="${savestates%/*}"
274 AC_SUBST(savestatesdir)
275 AM_CONDITIONAL(ENABLE_SAVESTATES, [test -n "$savestates"])
278 AC_ARG_WITH(attributelog,
279 [AS_HELP_STRING([--with-attributelog@<:@=PREFIX|yes|no@:>@],
280 [Enable default smartd attribute log files [no] (yes=LOCALSTATEDIR/lib/smartmontools/attrlog.)])],
281 [case "$withval" in yes) attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.' ;;
282 no) ;; *) attributelog="$withval" ;; esac])
283 attributelogdir="${attributelog%/*}"
284 AC_SUBST(attributelog)
285 AC_SUBST(attributelogdir)
286 AM_CONDITIONAL(ENABLE_ATTRIBUTELOG, [test -n "$attributelog"])
288 AC_ARG_ENABLE(sample,
289 [AS_HELP_STRING([--enable-sample], [Enables appending .sample to the installed smartd rc script and configuration file])],
290 [smartd_suffix=; test "$enableval" = "yes" && smartd_suffix=".sample"],
292 AC_SUBST(smartd_suffix)
295 [AS_HELP_STRING([--with-os-deps='os_module.o ...'], [Specify OS dependent module(s) [guessed]])],
296 [ for x in $with_os_deps; do
299 *) AC_MSG_ERROR([non-object file specified by --with-os-deps]) ;;
305 [AS_HELP_STRING([--with-selinux@<:@=yes|no@:>@], [Enables SELinux support [no]])],
306 [ if test "$withval" = "yes"; then
307 AC_CHECK_HEADERS([selinux/selinux.h], [], [AC_MSG_ERROR([Missing SELinux header files])])
308 AC_CHECK_LIB(selinux, matchpathcon, [], [AC_MSG_ERROR([Missing or incorrect SELinux library files])])
311 AC_SUBST(with_selinux)
312 if test "$with_selinux" = "yes"; then
313 AC_DEFINE(WITH_SELINUX, 1, [Define to 1 if SELinux support is enabled])
316 AC_ARG_WITH(libcap-ng,
317 [AS_HELP_STRING([--with-libcap-ng@<:@=auto|yes|no@:>@], [Add Libcap-ng support to smartd [auto]])],
318 [], [with_libcap_ng=auto])
321 if test "$with_libcap_ng" != "no"; then
322 AC_CHECK_LIB(cap-ng, capng_clear,
323 [AC_DEFINE(HAVE_LIBCAP_NG, 1, [Define to 1 if you have the `cap-ng' library (-lcap-ng).]) dnl `vim syntax
324 CAPNG_LDADD="-lcap-ng"; use_libcap_ng=yes])
326 if test "$use_libcap_ng" = "yes"; then
327 AC_CHECK_HEADER(cap-ng.h, [], [AC_MSG_ERROR([libcap-ng libraries found but headers are missing])])
328 elif test "$with_libcap_ng" = "yes"; then
329 AC_MSG_ERROR([libcap-ng support was requested but the library was not found])
333 AC_MSG_CHECKING([whether to use libcap-ng])
334 AC_SUBST(CAPNG_LDADD)
335 AC_MSG_RESULT([$use_libcap_ng])
337 # TODO: Remove when NVMe support is no longer EXPERIMENTAL
338 AC_ARG_WITH(nvme-devicescan,
339 [AS_HELP_STRING([--with-nvme-devicescan@<:@=yes|no@:>@],
340 [Include NVMe devices in smartd DEVICESCAN [no]])])
341 AC_SUBST(with_nvme_devicescan)
342 if test "$with_nvme_devicescan" = "yes"; then
343 AC_DEFINE(WITH_NVME_DEVICESCAN, 1, [Define to 1 to include NVMe devices in smartd DEVICESCAN.])
346 AC_ARG_WITH(solaris-sparc-ata,
347 [AS_HELP_STRING([--with-solaris-sparc-ata@<:@=yes|no@:>@],
348 [Enable legacy ATA support on Solaris SPARC (requires os_solaris_ata.s from SVN repository) [no]])])
350 case "$host:$with_solaris_sparc_ata" in
351 sparc-*-solaris*:yes)
352 if test ! -f "$srcdir/os_solaris_ata.s"; then
353 AC_MSG_ERROR([Missing source file: $srcdir/os_solaris_ata.s
354 This file is no longer included in the source tarball but still
355 available in the SVN repository.])
357 AC_DEFINE(WITH_SOLARIS_SPARC_ATA, 1, [Define to 1 to enable legacy ATA support on Solaris SPARC.])
361 # Assume broken snprintf only on Windows with MSVCRT (MinGW without ANSI stdio support)
362 libc_have_working_snprintf=yes
366 case " $CPPFLAGS $CXXFLAGS" in
367 *\ -[[DU]]__USE_MINGW_ANSI_STDIO*)
370 # Older MinGW do not properly define PRI?64 if __USE_MINGW_ANSI_STDIO is set
371 # Newer MinGW set __USE_MINGW_ANSI_STDIO in first C++ include which may be too late
372 AC_MSG_CHECKING([whether __USE_MINGW_ANSI_STDIO is defined by C++ includes])
373 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
374 #undef __USE_MINGW_ANSI_STDIO
376 #ifndef __USE_MINGW_ANSI_STDIO
379 [CXXFLAGS="-D__USE_MINGW_ANSI_STDIO $CXXFLAGS"],
380 [libc_have_working_snprintf=no])
381 AC_MSG_RESULT([$libc_have_working_snprintf])
386 AC_ARG_WITH(working-snprintf,
387 [AS_HELP_STRING([--with-working-snprintf@<:@=yes|no@:>@],
388 [Function snprintf() handles output truncation as specified by C99 [MinGW:guessed,others:yes]])],
389 [libc_have_working_snprintf=$withval])
391 if test "$libc_have_working_snprintf" = "yes"; then
392 AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane.]) dnl `vim syntax
398 # Newer MinGW may add a default manifest
399 AC_MSG_CHECKING([whether $CC adds an application manifest])
401 AC_LINK_IFELSE([AC_LANG_PROGRAM()], [
402 if "$WINDRES" -O rc conftest.exe 2>/dev/null | grep '^1.*RT_MANIFEST' >/dev/null 2>&1; then
403 cc_adds_manifest=incomplete
404 # Manifest must provide a Win 10 compatibility ID
405 if "$WINDRES" -O rc conftest.exe 2>/dev/null | grep '{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}' >/dev/null 2>&1; then
409 [AC_MSG_ERROR([test compile failed])])
410 AC_MSG_RESULT([$cc_adds_manifest])
411 test "$cc_adds_manifest" = "yes" || os_win32_manifest='default.manifest.o'
415 # TODO: Remove after smartmontools 6.5
417 [AS_HELP_STRING([--with-docdir=DIR], [(removed, use --docdir=DIR instead)])],
418 [AC_MSG_ERROR([--with-docdir is no longer supported, use --docdir instead])])
419 AC_ARG_ENABLE(drivedb,
420 [AS_HELP_STRING([--disable-drivedb], [(removed, use --without-drivedbdir instead)])])
421 AC_ARG_ENABLE(savestates,
422 [AS_HELP_STRING([--enable-savestates], [(removed, use --with-savestates@<:@=yes@:>@ instead)])])
423 AC_ARG_ENABLE(attributelog,
424 [AS_HELP_STRING([--enable-attributelog], [(removed, use --with-attributelog@<:@=yes@:>@ instead)])])
425 if test -n "${enable_drivedb+set}${enable_savestates+set}${enable_attributelog+set}"; then
426 AC_MSG_ERROR([Options --disable-drivedb, --enable-savestates, --enable-attributelog are no longer supported.
427 Use --without-drivedbdir, --with-savestates, --with-attributelog instead.])
431 AC_SUBST(releaseversion,['${PACKAGE}-${VERSION}'])
432 AC_SUBST(smartmontools_release_date)
433 AC_SUBST(smartmontools_release_time)
435 # Set platform-specific modules and symbols
437 os_dltools='curl wget lynx svn'
439 os_hostname="'hostname'"
441 os_nisdomainname="'domainname'"
450 os_deps='os_linux.o cciss.o dev_areca.o'
451 os_dnsdomainname="'dnsdomainname' 'hostname -d'"
452 os_nisdomainname="'nisdomainname' 'hostname -y' 'domainname'"
455 *-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*)
456 os_deps='os_freebsd.o cciss.o dev_areca.o'
458 os_dltools='curl wget lynx fetch svn'
459 AC_CHECK_LIB(usb, libusb20_dev_get_device_desc)
460 os_man_filter=FreeBSD
463 os_deps='os_solaris.o'
464 test "$with_solaris_sparc_ata" = "yes" \
465 && os_deps="$os_deps os_solaris_ata.o"
468 os_man_filter=Solaris
471 os_deps='os_solaris.o'
474 os_man_filter=Solaris
477 os_deps='os_netbsd.o'
482 os_deps='os_openbsd.o'
484 os_dltools='curl wget lynx ftp svn'
485 os_man_filter=OpenBSD
488 os_deps='os_win32.o dev_areca.o'
490 os_hostname="'hostname' 'echo "'"${HOSTNAME?unset}"'"'"
491 os_dnsdomainname="'dnsdomainname' 'hostname -d' 'echo "'"${USERDNSDOMAIN?unset}"'"'"
497 os_deps='os_win32.o dev_areca.o'
501 os_man_filter=Windows
504 os_deps='os_win32.o dev_areca.o'
507 os_man_filter=Windows
510 os_deps='os_darwin.o'
511 os_libs='-framework CoreFoundation -framework IOKit'
516 os_deps='os_qnxnto.o'
519 os_deps='os_generic.o'
523 # Replace if '--with-os-deps' was specified
524 test -z "$with_os_deps" || os_deps="$with_os_deps"
526 # Check if we need adapter to old interface (dev_legacy.cpp)
527 os_src=`echo "${os_deps}"|sed -n 's,^\([[^ .]]*\)\.o.*$,\1.cpp,p'`
528 AC_MSG_CHECKING([whether ${os_src} uses new interface])
529 if grep "smart_interface" "${srcdir}/${os_src}" >/dev/null 2>&1; then
533 os_deps="${os_deps} dev_legacy.o"
534 AC_DEFINE(OLD_INTERFACE, 1, [Define to 1 if os_*.cpp still uses the old interface])
536 AC_MSG_RESULT([$os_new_interface])
540 AC_SUBST([os_dltools])
541 AC_SUBST([os_mailer])
542 AC_SUBST([os_hostname])
543 AC_SUBST([os_dnsdomainname])
544 AC_SUBST([os_nisdomainname])
545 AC_SUBST([os_man_filter])
546 AC_SUBST([os_win32_manifest])
548 # Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
549 DRIVEDB_BRANCH=`echo $VERSION | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
550 | sed -n 's,^\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\)$,RELEASE_\1_\2_DRIVEDB,p'`
551 if test -z "$DRIVEDB_BRANCH"; then
552 AC_MSG_ERROR([Unable to create DRIVEDB_BRANCH from VERSION=$VERSION])
554 AC_SUBST([DRIVEDB_BRANCH])
556 # Enable platform-specific makefile sections
557 AM_CONDITIONAL(OS_DARWIN, [test "$os_darwin" = "yes"])
558 AM_CONDITIONAL(OS_SOLARIS, [test "$os_solaris" = "yes"])
559 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
560 AM_CONDITIONAL(OS_WIN32_MINGW, [test "$os_win32_mingw" = "yes"])
561 AM_CONDITIONAL(OS_WIN32_NSIS, [test -n "$MAKENSIS"])
562 AM_CONDITIONAL(OS_WIN64, [test "$os_win64" = "yes"])
564 dnl Add -Wall and -W if using g++ and its not already specified.
565 if test "$GXX" = "yes"; then
566 if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
567 CXXFLAGS="$CXXFLAGS -Wall"
569 # In the next line, do NOT delete the 2 spaces inside double quotes.
570 if test -z "`echo "$CXXFLAGS " | grep "\-W " 2> /dev/null`" ; then
571 CXXFLAGS="$CXXFLAGS -W"
575 dnl We are NOT using gcc, so enable host-specific compiler flags
578 dnl set CXXFLAGS for Solaris/SPARC C++ compiler
579 if test -z "`echo "$CXXFLAGS" | grep "\-xmemalign" 2> /dev/null`" ; then
580 dnl we have to tell the compilers about packed ATA structures
581 CXXFLAGS="-xmemalign=1i $CXXFLAGS"
586 if test -z "`echo "$CXXFLAGS" | grep "\-xO" 2> /dev/null`" ; then
587 dnl turn on optimization if user has not explicitly set its value
588 CXXFLAGS="-xO2 $CXXFLAGS"
590 if test -z "`echo "$CXXFLAGS" | grep "\-erroff" 2> /dev/null`" ; then
591 dnl suppress trivial warnings
592 CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS"
597 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_BUILD_HOST, "${host}", [smartmontools Build Host])
601 AC_CONFIG_FILES(Makefile)
605 # Note: Use `...` here as some shells do not properly parse '$(... case $x in X) ...)'
607 echo "-----------------------------------------------------------------------------"
608 echo "${PACKAGE}-${VERSION} configuration:"
609 echo "host operating system: $host"
610 echo "C++ compiler: $CXX"
611 echo "C compiler: $CC"
612 echo "preprocessor flags: $CPPFLAGS"
613 echo "C++ compiler flags: $CXXFLAGS"
614 echo "C compiler flags: $CFLAGS"
615 echo "linker flags: $LDFLAGS"
616 echo "OS specific modules: $os_deps $os_libs $LIBS"
620 echo "application manifest: ${os_win32_manifest:-built-in}"
621 echo "resource compiler: $WINDRES"
622 echo "message compiler: $WINDMC"
623 echo "NSIS compiler: $MAKENSIS"
624 if test -n "$drivedbdir"; then
625 echo "drive database file: EXEDIR/drivedb.h"
626 if test -n "$MAKENSIS"; then
627 echo "database update tool: EXEDIR/update-smart-drivedb.exe"
630 echo "drive database file: [[disabled]]"
632 if test -n "$savestates"; then
633 echo "smartd save files: \`eval eval eval echo $savestates\`MODEL-SERIAL.TYPE.state"
635 if test -n "$attributelog"; then
636 echo "smartd attribute logs: \`eval eval eval echo $attributelog\`MODEL-SERIAL.TYPE.csv"
638 echo "NVMe DEVICESCAN: ${with_nvme_devicescan-no}"
642 echo "binary install path: \`eval eval eval echo $sbindir\`"
643 echo "man page install path: \`eval eval eval echo $mandir\`"
644 echo "doc file install path: \`eval eval eval echo $docdir\`"
645 echo "examples install path: \`eval eval eval echo $exampledir\`"
646 if test -n "$drivedbdir"; then
647 echo "drive database file: \`eval eval eval echo $drivedbdir\`/drivedb.h"
648 if test "$with_update_smart_drivedb" = "yes"; then
649 echo "database update script: \`eval eval eval echo $sbindir\`/update-smart-drivedb"
650 echo "download tools: \`eval eval eval echo $os_dltools\`"
652 echo "database update script: [[disabled]]"
655 echo "drive database file: [[disabled]]"
657 echo "local drive database: \`eval eval eval echo $sysconfdir\`/smart_drivedb.h"
658 echo "smartd config file: \`eval eval eval echo $sysconfdir\`/smartd.conf${smartd_suffix}"
659 echo "smartd warning script: \`eval eval eval echo $smartdscriptdir\`/smartd_warning.sh"
660 if test -n "$smartdplugindir"; then
661 echo "smartd plugin path: \`eval eval eval echo $smartdplugindir\`"
663 echo "smartd plugin path: [[disabled]]"
665 if test -n "$initddir"; then
666 echo "smartd initd script: \`eval eval eval echo $initddir\`/${initdfile}"
667 elif test -z "$systemdsystemunitdir"; then
668 echo "smartd initd script: [[disabled]]"
670 if test -n "$systemdsystemunitdir"; then
671 echo "smartd systemd file: \`eval eval eval echo $systemdsystemunitdir\`/smartd.service"
672 if test -n "$systemdenvfile"; then
673 echo "smartd environ file: \`eval eval eval echo $systemdenvfile\`"
675 echo "smartd environ file: [[disabled]]"
678 if test -n "$savestates"; then
679 echo "smartd save files: \`eval eval eval echo $savestates\`MODEL-SERIAL.TYPE.state"
681 echo "smartd save files: [[disabled]]"
683 if test -n "$attributelog"; then
684 echo "smartd attribute logs: \`eval eval eval echo $attributelog\`MODEL-SERIAL.TYPE.csv"
686 echo "smartd attribute logs: [[disabled]]"
688 echo "libcap-ng support: $use_libcap_ng"
690 linux*) echo "SELinux support: ${with_selinux-no}" ;;
693 linux*|cygwin*) echo "NVMe DEVICESCAN: ${with_nvme_devicescan-no}" ;;
697 echo "-----------------------------------------------------------------------------"
704 # TODO: Remove when NVMe support is no longer EXPERIMENTAL
705 case "$host_os:${with_nvme_devicescan+set}" in
706 linux*:|cygwin*:|mingw*:)
708 This version of smartmontools provides NVMe support which is still
709 EXPERIMENTAL. NVMe devices are not yet included in smartd.conf
710 'DEVICESCAN' and 'smartctl --scan' unless '-d nvme' is specified.
711 Use option '--with-nvme-devicescan' to include NVMe devices.
712 Use option '--without-nvme-devicescan' to suppress this warning.])
716 # TODO: Remove after smartmontools 6.5
717 case "$host:${with_solaris_sparc_ata+set}" in
720 Legacy ATA support is no longer enabled by default on Solaris SPARC.
721 The required source file 'os_solaris_ata.s' is no longer included in
722 the source tarball but still available in the SVN repository.
723 Use option '--with-solaris-sparc-ata' to enable legacy ATA support.
724 Use option '--without-solaris-sparc-ata' to suppress this warning.])