]> git.proxmox.com Git - mirror_smartmontools-debian.git/commitdiff
New upstream version 6.6
authorJonathan Dowland <jmtd@debian.org>
Thu, 9 Aug 2018 08:01:20 +0000 (09:01 +0100)
committerJonathan Dowland <jmtd@debian.org>
Thu, 9 Aug 2018 08:01:20 +0000 (09:01 +0100)
101 files changed:
.editorconfig [new file with mode: 0644]
AUTHORS
ChangeLog
Doxyfile [deleted file]
INSTALL
Makefile.am
Makefile.in [new file with mode: 0644]
NEWS
README
aclocal.m4 [new file with mode: 0644]
atacmdnames.cpp
atacmdnames.h
atacmds.cpp
atacmds.h
ataidentify.cpp
ataidentify.h
ataprint.cpp
ataprint.h
autogen.sh
compile [new file with mode: 0755]
config.guess [new file with mode: 0755]
config.h.in [new file with mode: 0644]
config.sub [new file with mode: 0755]
configure [new file with mode: 0755]
configure.ac
depcomp [new file with mode: 0755]
dev_areca.cpp
dev_ata_cmd_set.cpp
dev_ata_cmd_set.h
dev_intelliprop.cpp [new file with mode: 0644]
dev_intelliprop.h [new file with mode: 0644]
dev_interface.cpp
dev_legacy.cpp
dev_tunnelled.h
do_release [deleted file]
drivedb.h
freebsd_nvme_ioctl.h
install-sh [new file with mode: 0755]
int64.h
m4/pkg.m4 [new file with mode: 0644]
missing [new file with mode: 0755]
netbsd_nvme_ioctl.h [new file with mode: 0644]
nvmecmds.h
nvmeprint.cpp
os_darwin.cpp
os_darwin.h
os_freebsd.cpp
os_freebsd.h
os_generic.cpp
os_generic.h
os_linux.cpp
os_linux.h
os_netbsd.cpp
os_netbsd.h
os_openbsd.cpp
os_openbsd.h
os_os2.cpp
os_os2.h
os_os2/configure.os2 [deleted file]
os_os2/hdreg.h [deleted file]
os_qnxnto.h
os_solaris.h
os_win32.cpp
os_win32/daemon_win32.cpp
os_win32/daemon_win32.h
os_win32/installer.nsi
os_win32/runcmd.c
os_win32/smartctl_res.rc.in [deleted file]
os_win32/smartd_mailer.conf.sample.ps1 [new file with mode: 0644]
os_win32/smartd_mailer.ps1 [new file with mode: 0644]
os_win32/smartd_res.rc.in [deleted file]
os_win32/smartd_warning.cmd
os_win32/syslog.h
os_win32/syslogevt.mc
os_win32/update-smart-drivedb.nsi
os_win32/vc10/runcmd.vcxproj [deleted file]
os_win32/vc10/smartctl.vcxproj [deleted file]
os_win32/vc10/smartctl.vcxproj.filters [deleted file]
os_win32/vc10/smartd.vcxproj [deleted file]
os_win32/vc10/smartd.vcxproj.filters [deleted file]
os_win32/vc10/smartmontools.sln [deleted file]
os_win32/vc10/wtssendmsg.vcxproj [deleted file]
os_win32/versioninfo.rc.in [new file with mode: 0644]
os_win32/wmiquery.cpp
os_win32/wtssendmsg.c
scsiata.cpp
scsicmds.cpp
scsicmds.h
scsiprint.cpp
scsiprint.h
smartctl.8.in
smartctl.cpp
smartctl.h
smartd.8.in
smartd.conf.5.in
smartd.cpp
smartd.initd.in
smartd_warning.sh.in
update-smart-drivedb.8.in
update-smart-drivedb.in
utility.cpp

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..55e8733
--- /dev/null
@@ -0,0 +1,51 @@
+# smartmontools indent style settings for EditorConfig
+# http://editorconfig.org/
+# $Id: .editorconfig 4385 2017-01-28 15:31:50Z chrfranke $
+
+# top-most file
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+tab_width = 8
+
+[/ChangeLog]
+indent_style = tab
+indent_size = 8
+
+[Makefile*]
+# Rule recipes require tab characters (spaces are used elsewhere)
+indent_style = tab
+indent_size = 8
+
+# TODO: Fix files with other indent styles
+[/scsiata.cpp]
+# indent_size = 2 and 4
+
+[/scsicmds.*]
+indent_size = 4
+
+[/scsiprint.cpp]
+indent_size = 4
+
+[/os_win32/syslog_win32.cpp]
+indent_style = tab
+indent_size = 4
+tab_width = 4
+
+# Keep indent style of imported files as is
+[/*_nvme_ioctl.h]
+indent_style = tab
+indent_size = 8
+
+[/csmisas.h]
+indent_size = 3
+
+[/getopt/getopt.*]
+indent_style = tab
+indent_size = 2
+
+[/regex/reg*.*]
+indent_style = tab
+indent_size = 2
diff --git a/AUTHORS b/AUTHORS
index 62cd8f2812dc7ce0c3bf8a8a2e73861d543acee1..1b05618ac49cda23522080d9d76e2b00863925bc 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,13 +1,15 @@
-$Id: AUTHORS 4285 2016-04-10 13:17:11Z chrfranke $
+$Id: AUTHORS 4403 2017-03-09 20:31:15Z chrfranke $
 
 Developers / Maintainers / Contributors:
 
 Raghava Aditya          <...>
 Bruce Allen             <...>
+Casey Biemiller         <cbiemiller@intelliprop.com>
 Erik Inge Bolsø         <...>
 Stanislav Brabec        <sbrabec@suse.cz>
 Peter Cassidy           <pcassidy@mac.com>
 Praveen Chidambaram     <bunchofmails@gmail.com>
+Jonghwan Choi           <jhbird.choi@gmail.com>
 Yuri Dario              <mc6530@mclink.it>
 Casper Dik              <...>
 Christian Franke        <franke@computer.org>
@@ -19,11 +21,13 @@ Jordan Hargrave         <jordan_hargrave@dell.com>
 Joerg Hering            <...>
 Geoff Keating           <geoffk@geoffk.org>
 Dr. David Kirkby        <...>
+Song Liu                <songliubraving@fb.com>
 Dan Lukes               <dan+smartmontools.changelog@obluda.cz>
 Kai Mäkisara            <kai.makisara@kolumbus.fi>
 Nidhi Malhotra          <nidhi.malhotra@pmcs.com>
 Eduard Martinescu       <martines@rochester.rr.com>
 Frédéric L. W. Meunier  <...>
+Kimihiro Nonaka         <...>
 Alex Samorukov          <samm@os2.kiev.ua>
 Keiji Sawada            <card_captor@users.sourceforge.net>
 Manfred Schwarb         <manfred99@gmx.ch>
index 107304e35eb41bd3942984070ee26cfdefa4eed1..3f56c98b0db87521547c456a989c0dfd0e180e94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,701 @@
-$Id: ChangeLog 4324 2016-05-31 20:45:50Z chrfranke $
+$Id: ChangeLog 4594 2017-11-05 15:21:35Z chrfranke $
+
+2017-11-05  Christian Franke  <franke@computer.org>
+
+       smartmontools 6.6
+
+2017-11-04  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Apple SD/SM/TS...E/F/G SSDs: Rename, add 1TB
+       - Innodisk 3IE3/3ME3/3ME4 SSDs: Rename, add 3ME4
+       - Intel 730 and DC S35x0/3610/3700 Series SSDs: 150GB, *G7
+         (ticket #750)
+       - USB: Toshiba Canvio (0x0480:0xa202, 0xa207)
+       - USB: Seagate Expansion Desktop (0x0bc2:0x3330)
+       - USB: Maxtor D3 Station 3TB (0x0bc2:0x6123)
+       - USB: Seagate Backup Plus 4TB (0x0bc2:0xab1e)
+       - USB: JMicron (0x152d:0x0579)
+       - USB: Hitachi Touro Mobile (0x4971:0x1023)
+       - USB: JMicron JMS566 (0xa152:0xb566)
+       - USB: LogiLink PCCloneEX Lite (0xabcd:0x6104)
+
+       smartd.conf.5.in: Fix conditionals of platform specific samples.
+
+       smartctl.8.in, smartd.conf.5.in: Shorten or remove info about
+       very old 3ware controllers.
+
+       smartctl.8.in: Add '-g' to '-x' documentation.
+       Avoid a very long line.
+
+       smartctl.cpp: Improve help text formatting.
+
+2017-11-03  Christian Franke  <franke@computer.org>
+
+       update-smart-drivedb.8.in: Update mailing list link.
+       update-smart-drivedb.in: Update mailing list comment.
+
+       utility.cpp: Silence g++ 7.1 -Wformat-truncation warning.
+
+       atacmds.cpp, dev_areca.cpp, os_linux.cpp: Add comments to silence
+       g++ 7.1 -Wimplicit-fallthrough=[1-4] warnings.
+
+       os_linux.cpp: Fix indentation (g++ 6.3: -Wmisleading-indentation).
+
+       nvmeprint.cpp: Print IEEE EUI-64 of namespace.
+
+2017-10-29  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in: Add notes about SMART commands obsoleted in ACS-4.
+       Remove some outdated info.
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in: Enable NVMe sections
+       for Darwin.
+
+       os_win32/installer.nsi: Update links.
+       Remove outdated uninstall commands.
+
+       INSTALL: Update ./configure description and OS info.
+
+       ataidentify.cpp, ataprint.cpp: Minor ACS-4 additions.
+
+       ataprint.cpp, ataprint.h, smartctl.cpp: Add option '-l defects'
+       to print ATA ACS-4 Pending Defects log (ticket #909).
+       smartctl.8.in: Document '-l defects'.
+
+2017-10-25  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Samsung based SSDs: PM871b (tickets #895, #903)
+       - Seagate Enterprise Capacity 3.5 HDD: 4TB (fix for #913)
+       - Western Digital Red Pro: 6TB (ticket #785)
+
+       os_win32/smartd_warning.cmd: Add ability to run PowerShell scripts
+       with '-M exec'.
+       smartd.conf.5.in: Document new functionality.  Fix typo.
+
+2017-10-25  Alex Samorukov <samm@os2.kiev.ua>
+
+       drivedb.h:
+        - add SATA Voyager GTX (#893)
+
+2017-10-24  Christian Franke  <franke@computer.org>
+
+       do_release: Update code signing key id.
+
+       update-smart-drivedb.in: Add new mailing list address to database
+       signing key.
+
+2017-10-24  Alex Samorukov <samm@os2.kiev.ua>
+
+       drivedb.h:
+        - add USB Voyager GTX (#893)
+        - add Phison based OEM SSD based on the firmware name (#853, #831)
+        - add Ultrastar 7K2 series (#892)
+        - add LITEON ZETA (LMH-*V2M-*) (#794)
+
+2017-10-22  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Decode Windows 10 1709 build number.
+
+       configure.ac: Fail instead of warn if no compiler option to accept
+       C++11 found and '--with-cxx11-option' is not specified.
+
+2017-10-19  Alex Samorukov <samm@os2.kiev.ua>
+
+       scsicmds.h: increase SCSI_TIMEOUT_DEFAULT to 1 minute to work on the
+       big JBOD arrays (#917)
+
+2017-10-15  Christian Franke  <franke@computer.org>
+
+       smartd.cpp: Use also device identify information to detect for
+       duplicate devices (ticket #313).
+
+       atacmds.cpp: Don't pass possibly unaligned pointers to swapx().
+       This silences '-Waddress-of-packed-member' warning from clang++ 4.0
+       (ticket #915).
+
+2017-10-12  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_linux.cpp: implemented support for the SG_IO V4 API. This should
+       fix kernel warnings and other issues on the /dev/bsg SCSI devices.
+       Based on the patch created by Circuitsoft (#782)
+
+2017-10-11  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_darwin.cpp: fix crash on --scan (regression from r4549)
+
+2017-10-10  Christian Franke  <franke@computer.org>
+
+       configure.ac, os_darwin.cpp: Align Darwin NVMe device scanning with
+       other platforms: Disable unless '--with-nvme-devicescan' or '-d nvme'
+       is specified.  Print related configure warning.
+
+2017-10-09  Alex Samorukov <samm@os2.kiev.ua>
+
+       drivedb.h:
+       - Extend Seagate Barracuda 7200.12 regexp (#910)
+       - Extend Seagate NAS HDD regexp (#778)
+       - Extend Seagate Surveillance regexp (#807)
+       - Extend Seagate Enterprise Capacity 3.5 HDD regexp (#864, #913)
+       - Fix Seagate Barracuda 2.5 5400 regexp to add new models and
+         avoid false matches (#796)
+       - Add Seagate IronWolf HDD  series (#760)
+       - Fix attribute 183 for the Seagate Barracuda 2.5 5400 HDD (#816)
+       - Added Mushkin Triactor series (#905)
+       - Extend Samsung PM830 regexp (#897) 
+
+2017-10-08  Alex Samorukov <samm@os2.kiev.ua>
+
+       drivedb.h: 
+       - Add TOSHIBA MQ03UBB... series (#901)
+       - extend TOSHIBA THNSF regexp (#790)
+
+2017-10-08  Christian Franke  <franke@computer.org>
+
+       configure.ac: Check for compiler option to accept C++11.
+       If none found, print warning and ask user to provide info.
+       Add '--with-cxx11-option' to suppress this warning.
+       This is intended to check whether C++11 could be used in some
+       future smartmontools release.  The current build is not affected.
+
+       configure.ac, Makefile.am: Add Windows VERSIONINFO resource also to
+       runcmd*.exe and wtssendmsg.exe.  Include application manifests if
+       needed.  This also fixes manifests with older MinGW binutils which
+       do not support more than one resource objects.
+       os_win32/smart*_res.rc.in: Replace by os_win32/versioninfo.rc.in.
+
+2017-10-06  Christian Franke  <franke@computer.org>
+
+       Makefile.am: Add PDF man page formatting.
+       os_win32/installer.nsi: Add PDF man pages, remove TXT man pages.
+
+       drivedb.h:
+       - SMART Modular Technologies mSATA XL+ SSDs (patch from ticket #802)
+       - StorFly CFast SATA: Add missing space.
+       - Fix regexp from tickets #882, #885.
+
+2017-10-05  Alex Samorukov  <samm@os2.kiev.ua>
+
+       drivedb.h: add StorFly CFast SATA 6Gbps SSDs (#911)
+
+2017-10-05  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Western Digital Red: WD80EFAX (tickets #857, #899)
+       - USB: Toshiba Canvio (0x0480:0xb207)
+       - USB: Apple/TOSHIBA MQ01UBB200 (0x05ac:0x8406)
+       - USB: Seagate Expansion Portable 2TB (0x0bc2:0x231a)
+       - USB: Maxtor M3 Portable 4TB (0x0bc2:0x61b7) (ticket #875)
+       - USB: WD Elements / My Passport (0x1058:0x259f) (ticket #833)
+       - USB: WD Elements / My Passport (0x1058:0x25e2)
+       - USB: WD Elements / My Passport (0x1058:0x25fa) (ticket #840)
+       - USB: WD My Book / Easystore (0x1058:0x1230) (ticket #835)
+       - USB: WD My Book / Easystore (0x1058:0x25fb) (tickets #857, #899)
+       - USB: JMicron JMS561U (0x152d:0x8561) (ticket #860)
+       - USB: Innostor IS888 (0x1f75:0x0888): -d sat works (ticket #827)
+
+2017-10-04  Alex Samorukov  <samm@os2.kiev.ua>
+
+       smartctl.8.in: update information about NVMe in Darwin and OS/2 support
+       smartd.cpp, utility.cpp: fix compiler warnings related to vprintf
+
+2017-10-03  Christian Franke  <franke@computer.org>
+
+       nvmeprint.cpp: Print new NVMe 1.3 feature flags.
+
+2017-10-02  Christian Franke  <franke@computer.org>
+
+       smartd.cpp: Add strict tests of /dev/null redirection and chdir("/").
+
+       configure.ac: Use '-fstack-protector' if '-strong' is not supported.
+
+2017-10-01  Christian Franke  <franke@computer.org>
+
+       configure.ac: Set default LDFLAGS for MinGW only if LDFLAGS is unset.
+       Add '-Wformat=2 -fstack-protector-strong' if supported and CXXFLAGS
+       is unset.
+
+       drivedb.h:
+       - Fix regexp from tickets #714, #721, #759, #789, #797, #798, #806,
+         #824, #825, #866, #872, #880.
+       - SK hynix SATA SSDs (based on patch from ticket #874)
+
+2017-09-25  Alex Samorukov  <samm@os2.kiev.ua>
+
+       NVME:
+       - extend controller and smart log page structures to match 1.3 specification.
+       - Print thermal temperature transition statistic
+       drivedb.h:
+       - Added support for more LaCie and Freecom devices (patch from #891)
+
+2017-09-24  Alex Samorukov  <samm@os2.kiev.ua>
+
+       drivedb.h:
+       - Added Toshiba MK..34GSX series (#886) and MK..32GSX series (#887)
+       - Added GOODRAM CX200 SSD (#838)
+       - Added Mushkin SSD family (#797)
+       - Added Samsung PM871 to the Samsung SSD family (#798)
+       - Added PNY CS1311 family (#890)
+       - Added 0x152d:0x0578 Jmicron USB->SATA
+       - Added Transcend MTS800 drives (#787)
+       - Added Transcend MSA 630 series (#759)
+       - Extended Hitachi Deskstar 7K3000 regexp (#858)
+
+2017-09-23  Alex Samorukov  <samm@os2.kiev.ua>
+
+       drivedb.h:
+       - Fix HGST HDS724040ALE640 (#885)
+       - Add Toshiba MQ03ABB300 (#884)
+       - Fixed Hitachi 7K1000 (#883)
+       - Added Seagate Barracuda 2.5 5400 series (#882)
+       - Added new Seagate Barracuda 3.5 7200 series (#880)
+       - Added Toshiba P300 series (#881)
+       - Added SK hynix SSD SC300 series (#699)
+       - Added Toshiba HG6 Series SSD (#721)
+       - Added Hynix SSD series
+       - Added AMD Radeon Solid State Drives (#762)
+       - Added USB Bridge 0x3538:0x0064 (#855)
+       - Added Seagate ST4000NM0085 to the Capacity family
+       - Added Sandisk SATA Cloudspeed Max and GEN2 ESS SSDs and Sandisk SATA CS1K
+         GEN1 ESS SSDs (#846)
+       - Added Seagate FireCuda drives (#825)
+       - Added Transcend MTS400 drives (#847)
+       - Added Transcend MTS420 drives (#869)
+       - Added Transcend SSD230 drives (#879)
+       - Added Transcend SSD220S drives (#821)
+       - Added Intel 540 Series SSDs (#803)
+       - Added Intel 3710 Series SSDs (#824)
+       - Added Micron 5100 ECO, PRO, and MAX Models (#861)
+       - Added Samsung EVO SSD series - make regexp match less strict (#806)
+       - Added Hitachi CinemaStar 5K1000 series (#758)
+       - Added WDC WD4004FZWX disk to the Digital Black family (#765)
+       - Added Samsung SSD 845DC EVO series (#866)
+       - Added SK hynix SL308 family (#808)
+       - Added WD Blue PC SSD family (#767)
+       - Corrected Crucial M4 drivedb entry to include 32Gb model (#844)
+
+2017-09-20  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_freebsd: use /dev/nvme/nvme.h on the recent versions
+       os_darwin: 
+        - initial NVMe support for the darwin platform.
+        - NVMe device scan support
+        - Add device type autodetection
+
+2017-08-08  Christian Franke  <franke@computer.org>
+
+       ataprint.cpp: Fix ATA Security Level check.
+
+       configure.ac: Detect MinGW libstdc++ problems with high
+       '--image-base'.
+
+       Update smartmontools-support mailing list address.
+       Remove old mailing list address from all source files.
+
+2017-05-03  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in,
+       update-smart-drivedb.8.in:
+       Rework vertical space and '.nf...fi' (no-fill) sections
+       for better formatting with various tools (groff, mandoc,
+       man2html) and output formats (text, pdf, html).
+       Use default vertical space instead of an empty line
+       between paragraphs.
+       Use '.br' instead of '.nf...fi' where applicable.
+       Use CW font in remaining no-fill sections.
+
+       smartctl.8.in: Replace UTF-8 quotes.
+
+2017-05-02  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in,
+       update-smart-drivedb.8.in:
+       Various man/groff syntax fixes (ticket #656):
+       Split long lines.
+       Insert two spaces or newline between sentences.
+       Use ' for apostrophes.
+       Use groff extension \(aq (apostrophe quote, ASCII 0x27)
+       or ' for quotes.
+       Use \- (minus sign) for options and examples.
+       Use \(en (en-dash) for numeric ranges.
+       Protect . with \& if not at end of sentence.
+
+2017-04-24  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_freebsd.cpp: remove duplicated code which checks ATA SMART
+       status (#746)
+
+2017-04-23  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_os2.cpp:
+       - code cleanup
+       - add os2ahci driver initial support
+       - fix selftest command
+       - add device scan support
+
+2017-04-19  Alex Samorukov  <samm@os2.kiev.ua>
+
+       OS/2 - many fixes:
+        - autodetect and build os_os2.o on OS/2
+        - fix os_os2.cpp/os_os2.h compilation (thanks to franke@)
+        - get rid from the os_os/hdreg.h - use constants from the atacmd.h
+        - remove most of the dead code and unused functions
+
+2017-04-17  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Decode Windows 10 1703 build number.
+
+       atacmds.h, ataprint.cpp: Use STANDBY instead of IDLE command if
+       '-s standby,[N|off]' and '-s standby,now' are both specified.
+       smartctl.8.in: Document new behaviour of '-s standby,*'.
+
+2017-04-01  Christian Franke  <franke@computer.org>
+
+       atacmds.cpp, atacmds.h, ataprint.cpp: Print minimum supported ERC
+       Time Limit from SCT Status.
+
+       ataidentify.cpp, ataprint.cpp: Add ACS-4 and SATA 3.3 major
+       versions, log pages, device statistic values and feature bits.
+
+2017-03-27  Christian Franke  <franke@computer.org>
+
+       scsiprint.cpp: Suppress "SAS address" if '-q noserial' is
+       specified (ticket #822).
+
+       scsicmds.cpp: Remove useless variable
+       (cppcheck 1.77: knownConditionTrueFalse).
+
+       smartd.cpp: Always suppress "failed to read Temperature" message
+       if SCSI device does not support temperature (ticket #817).
+       Fix initial check for SCSI temperature support.
+       Log SCSI temperature regardless of its origin.
+
+2017-03-11  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in,
+       update-smart-drivedb.8.in: Update EXPERIMENTAL notes.
+       Update links.  Update or remove various outdated info.
+
+       smartctl.8.in: Fix documentation of the '-g all' option.
+
+       smartctl.cpp: Add '-g dsn' to '-x' output.
+
+2017-03-11  Jonghwan Choi  <jhbird.choi@gmail.com>
+
+       ataprint.cpp: Fix false positive DSN support detection.
+
+2017-03-09  Jean Delvare  <...>
+
+       smartctl.8.in: Fix documentation of the '-q' option.
+
+2017-03-09  Christian Franke  <franke@computer.org>
+
+       AUTHORS: Add Jonghwan Choi.
+
+2017-03-09  Jonghwan Choi  <jhbird.choi@gmail.com>
+
+       Add options to get/set ATA DSN (Device Statistics Notification)
+       feature (ticket #815):
+       atacmds.h: Add DSN feature subcommand code.
+       ataprint.cpp, ataprint.h, smartctl.cpp: Add '-g/s dsn' options.
+       smartd.cpp: Add '-e dsn' directive.
+       smartctl.8.in, smartd.conf.5.in: Document the new options.
+
+2017-03-04  Christian Franke  <franke@computer.org>
+
+       smartctl.cpp, smartd.cpp: Fix help text for '-B' option.
+
+       smartd.cpp: Unify indent style, replace tabs.
+       Move ATA/SCSI/NVMe device open to new common function.
+       Suppress warning emails and repeated log messages on open error if
+       '-d removable' is specified (Debian Bug 770872, Ubuntu Bug 1451572).
+       smartd.conf.5.in: Document new behaviour of '-d removable'.
+
+2017-03-02  Christian Franke  <franke@computer.org>
+
+       smartd.cpp: Move single device registration to new function.
+       Exit smartd on device open error unless '-q never' or '-d removable'
+       is specified (regression from r2602).
+       Prevent retry if registration failed and '-q never' is specified.
+       Add enum for '-q, --quit' option.
+
+2017-02-27  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Crucial/Micron RealSSD C300/P300: Rename, add P300, remove M500
+       - Crucial/Micron RealSSD m4/C400/P400: P400e micro SATA
+       - Crucial/Micron MX1/2/300, M5/600, 1100 Client SSDs: Rename,
+         add MX300 (tickets #763, #791), M550 M.2 (ticket #810),
+         1100 (ticket #783)
+
+2017-02-22  Christian Franke  <franke@computer.org>
+
+       configure.ac: Set various default LDFLAGS for MinGW builds:
+       Link statically, indicate DEP and TS compatibility, enable ASLR.
+       Add '--with-mingw-aslr' option.
+
+2017-02-20  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Decode Windows Server 2016 build number.
+
+       os_win32.cpp: Rework CSMI port mapping.  This fixes access to
+       ports != 0 behind IRST driver 15.2 (ticket #804).
+
+2017-01-30  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_freebsd.cpp: unblock 48bit ATACAM commands for the legacy controllers
+       if FreeBSD version is >= 9.2-RELEASE, tested on FreeBSD 10.3
+
+2017-01-28  Christian Franke  <franke@computer.org>
+
+       ataidentify.cpp: Don't shift negative values
+       (g++ 6.3: -Wshift-negative-value, cppcheck 1.77: shiftNegativeLHS).
+
+       os_win32.cpp, scsiata.cpp, scsicmds.cpp, scsiprint.cpp: Fix 'if'
+       and 'else' clause indentations (g++ 6.3: -Wmisleading-indentation).
+
+       Add indent style configuration for EditorConfig
+       (http://editorconfig.org/):
+       .editorconfig: New file.
+       Makefile.am: Add new file to source tarball.
+
+2017-01-21  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Marvell based SanDisk SSDs: X300 OEM (ticket #747),
+         X400 (ticket #715), Ultra II (ticket #744)
+       - USB: Renesas uPD720231A (0x045b:0x0229)
+       - USB: Maxtor D3 Station 5TB (0x0bc2:0x6126)
+       - USB: Seagate Backup Plus 8TB (0x0bc2:0xab38) (ticket #786)
+       - USB: WD Elements / My Passport (0x1058:0x107d) (ticket #772)
+       - USB: WD Elements / My Passport (0x1058:0x25a1) (ticket #773)
+       - USB: WD My Book 4TB (0x1058:0x25a3) (ticket #784)
+       - USB: WD Elements / My Passport: Merge entries
+       - USB: WD My Book: Merge entries
+
+2017-01-14  Christian Franke  <franke@computer.org>
+
+       scsiata.cpp: Remove redundant assignment
+       (cppcheck: redundantAssignment).
+
+       ataprint.cpp, ataprint.h, smartctl.cpp, smartctl.8.in:
+       Add STATUS parameter to '-n POWERMODE' option (ticket #697).
+
+2017-01-13  Christian Franke  <franke@computer.org>
+
+       configure.ac: Rework CXXFLAGS settings, use shell intrinsics.
+
+       os_win32.cpp: Fix harmless buffer overflow bug
+       (found by VC14 code analyser).
+
+2017-01-12  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Innodisk 1ME3/3ME/3SE SSDs: Rename, add 1ME3 (ticket #713), 3SE
+       - Innodisk 3IE2/3ME2/3MG2/3SE2 SSDs: Rename, add 3ME2
+       - Samsung based SSDs: 750 EVO, PM810(470), 840, PM830, PM851,
+         CM871 (ticket #754), CM871a, PM871a (tickets #745, #775),
+         SM951 (ticket #704)
+
+2017-01-11  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in: Make '-d intelliprop' visible on all platforms.
+       Add warning.
+       smartd.conf.5.in: Document '-d intelliprop'.
+
+       os_win32/vc14/smart*.vcxproj*: Add new files.
+
+       AUTHORS: Add Casey Biemiller
+
+2017-01-11  Casey Biemiller  <cbiemiller@intelliprop.com>
+
+       Add '-d intelliprop' device type for drives behind IntelliProp
+       RAID controllers (ticket #730):
+       atacmds.cpp, atacmds.h: Add function ataWriteLogExt().
+       dev_intelliprop.cpp, dev_intelliprop.h: New files.
+       dev_interface.cpp: Add '-d intelliprop,N[+TYPE]' option.
+       Makefile.am: Add new files.
+       smartctl.8.in, smartd.conf.5.in: Document it.
+
+2017-01-09  Alex Samorukov  <samm@os2.kiev.ua>
+
+       os_freebsd.cpp: fix panic on INVARIANTS enabled kernel, patch
+       provided (#780) by Oliver Pinter <oliver.pinter@hardenedbsd.org>
+
+2017-01-01  Christian Franke  <franke@computer.org>
+
+       Happy New Year! Update copyright year in version info.
+
+2016-11-12  Christian Franke  <franke@computer.org>
+
+       atacmds.h, freebsd_nvme_ioctl.h: Apply patch-atacmds.h 1.1
+       and patch-freebsd_nvme_ioctl.h 1.1 (2016-11-04) from
+       pkgsrc.se/sysutils/smartmontools:
+       Build fix for FreeBSD-11 and newer.  Don't redefine now
+       existing things, ATA_SET_FEATURES and nvme_command.
+
+2016-11-10  Christian Franke  <franke@computer.org>
+
+       os_linux.cpp: Don't detect devices behind hpsa driver as regular
+       SCSI devices.  Suggest to use '-d cciss,N' instead.
+
+       Based on patch provided by Stanislav Brabec.
+
+2016-11-05  Christian Franke  <franke@computer.org>
+
+       update-smart-drivedb.in: Fix 'mv' error on first update with new
+       script.
+
+       configure.ac, update-smart-drivedb.in: Add '--with-gnupg' option.
+
+       configure.ac: Add '--with-update-smart-drivedb=X.Y' option to
+       backport drive database update script and man page to older
+       version X.Y.
+
+       configure.ac: Remove checks for no longer supported options
+       --disable-drivedb, --enable-savestates and --enable-attributelog.
+
+2016-11-04  Christian Franke  <franke@computer.org>
+
+       Add authentication to update-smart-drivedb (ticket #751):
+       Create missing branches RELEASE_6_5_DRIVEDB and RELEASE_6_6_DRIVEDB.
+       Add signature files drivedb.h.raw.asc to each maintained branch.
+
+       update-smart-drivedb.in: Include new public key block ID DFD22559.
+       Download also drivedb.h.raw.asc.
+       Do no longer download from trunk if branch does not exist.
+       Create drivedb.h.raw.  Verify signature.
+       Add options '--trunk', '--no-verify' and '--export-key'.
+       update-smart-drivedb.8.in: Document new behaviour and options.
+
+2016-10-23  Christian Franke  <franke@computer.org>
+
+       smartd.8.in: Document Windows PARAMCHANGE service control command.
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in: Enable NVMe sections
+       for NetBSD.
+
+       configure.ac, os_netbsd.cpp: Add --with-nvme-devicescan for NetBSD.
+
+       drivedb.h:
+       - Toshiba 3.5" MG04ACA... Enterprise HDD (ticket #732)
+       - Toshiba X300 (ticket #716)
+       - Seagate Laptop HDD: Rename, add 3/4TB (ticket #738)
+       - Seagate Constellation ES: HP OEM
+       - Western Digital RE4: *ABYZ variant
+       - Western Digital Re: Add attribute 16 (ticket #742)
+       - Western Digital Black: Remove *BEK[TX] variants
+       - Western Digital Black Mobile: 1TB, *BEKT, *LPLX variants
+       - Western Digital Elements / My Passport (USB, AF): 4TB
+       - USB: Neodio Technologies (0x0aec:0x3050)
+       - USB: Dura Micro (0x0c0b:0xb136)
+       - USB: My Passport Ultra 4TB (0x1058:0x2599)
+
+2016-10-17  Christian Franke  <franke@computer.org>
+
+       configure.ac: Add --with-scriptpath option.
+       smartd_warning.sh.in, update-smart-drivedb.in: Set PATH variable.
+
+2016-10-03  Christian Franke  <franke@computer.org>
+
+       os_win32/vc14/*.vcxproj: Add platform x64.
+
+       os_win32.cpp: Use new enhanced version of IOCTL_STORAGE_QUERY_PROPERTY
+       to access NVMe info.  This works with Windows 10 NVMe driver
+       (stornvme.sys) (ticket #691).
+       smartctl.8.in, smartd.8.in: Document device names.
+
+2016-09-28  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - USB: Buffalo MiniStation HD-PZU3 (0x0411:0x01f9) (ticket #739)
+       - USB: Iomega Prestige (0x059b:0x0571)
+       - USB: LaCie P9223 (0x059f:0x1070)
+       - USB: Seagate Expansion Desktop (0x0bc2:0x331a) (ticket #725)
+       - USB: Seagate Backup Plus (0x0bc2:0xab28) (ticket #738)
+       - USB: WD My Passport Ultra (0x1058:0x259d) (ticket #736)
+       - USB: ASMedia ASM1351 (0x174c:0x1351)
+
+2016-09-25  Christian Franke  <franke@computer.org>
+
+       AUTHORS: Add Kimihiro Nonaka.
+
+2016-09-25  Kimihiro Nonaka  <...>
+
+       os_netbsd.cpp: Migrate to new dev_interface (ticket #101).
+       Add NVMe support (ticket #728).
+       Implement netbsd_ata_device::ata_pass_through().
+       netbsd_nvme_ioctl.h: New file based on "sys/dev/ic/nvmeio.h" from
+       NetBSD kernel sources.
+       Makefile.am: Add new file.
+
+2016-09-07  Christian Franke  <franke@computer.org>
+
+       Makefile.am: clean-vc14 targets.
+
+       os_win32.cpp: Decode Windows 10 build number.
+
+       os_win32/smartd_warning.cmd: Use delayed variable expansion.
+
+       os_win32/smartd_mailer.ps1: Use domainname for default sender address.
+       os_win32/smartd_mailer.conf.sample.ps1: Update related comment.
+       os_win32/smartd_warning.cmd: Remove trailing '\r' from USERDNSDOMAIN.
+
+2016-08-28  Christian Franke  <franke@computer.org>
+
+       os_win32/installer.nsi: Fix quoting of EDITOR shortcuts.
+
+       Send warning mails via PowerShell script on Windows (ticket #731):
+       Makefile.am, os_win32/installer.nsi: Add new files.
+       os_win32/smartd_mailer.ps1: New PowerShell script using Send-MailMessage
+       cmdlet to send mail.
+       os_win32/smartd_mailer.conf.sample.ps1: New sample config file.
+       os_win32/smartd_warning.cmd: Call new script if configured.
+       Improve error handling.  Add setlocal.
+       smartd.conf.5.in: Document it.
+
+2016-08-17  Christian Franke  <franke@computer.org>
+
+       AUTHORS: Add Song Liu.
+
+       smartctl.cpp: Reduce scope of 'persistent' flag
+       (cppcheck: variableScope).
+
+2016-08-17  Song Liu  <songliubraving@fb.com>
+
+       ataprint.cpp, ataprint.h, smartctl.cpp, smartctl.8.in:
+       Add persistent option ',p' to '-s wcreorder,on|off' (ticket #726).
+
+       atacmds.cpp, atacmds.h, ataprint.cpp, ataprint.h, smartctl.cpp,
+       smartctl.8.in: Add ability to control ATA drive write cache through
+       SCT Feature control.  The new smartctl options are
+       '-s wcache-sct,ata|on|off[,p]' and '-g wcache-sct' (ticket #723).
+
+2016-08-06  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Add Windows 10 build number to get_os_version_str().
+
+       Update MSVC10 (VS2010) for VC14 (VS2015):
+       os_win32/vc14/*: Move from os_win32/vc10/*.
+       os_win32/vc14/*.vcxproj: Update for VC14.
+       Remove '__func__' workaround (revert r4225).
+       Makefile.am: Rename and update config-vc14 target.
+       utility.cpp: Add workaround for missing 'tzname'.
+
+       drivedb.h:
+       - OCZ/Toshiba Trion SSDs: Rename, add TOSHIBA-TR150 (ticket #722)
+       - HGST Ultrastar 7K6000 (ticket #708)
+       - HGST Ultrastar He10
+       - Seagate Desktop HDD.15: 6TB, 8TB
+       - Seagate Enterprise Capacity 3.5 HDD: 8TB, 10TB (ticket #717),
+         attribute 240
+       - Seagate SV35: 4TB
+       - Western Digital Gold (ticket #711)
+       - USB: LaCie (0x059f:0x1075) (ticket #718)
+       - USB: Seagate Expansion External (0x0bc2:0x3322) (ticket #706)
+       - USB: Seagate FreeAgent GoFlex (0x0bc2:0x5030) (ticket #720)
+       - USB: Seagate Backup Plus Desktop (0x0bc2:0xab34) (ticket #700)
 
 2016-05-31  Christian Franke  <franke@computer.org>
 
diff --git a/Doxyfile b/Doxyfile
deleted file mode 100644 (file)
index 50eeac7..0000000
--- a/Doxyfile
+++ /dev/null
@@ -1,241 +0,0 @@
-# Doxyfile 1.5.5
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING      = UTF-8
-PROJECT_NAME           = smartmontools
-PROJECT_NUMBER         = 
-OUTPUT_DIRECTORY       = doc
-CREATE_SUBDIRS         = NO
-OUTPUT_LANGUAGE        = English
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = YES
-ABBREVIATE_BRIEF       = 
-ALWAYS_DETAILED_SEC    = YES
-INLINE_INHERITED_MEMB  = NO
-FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = 
-STRIP_FROM_INC_PATH    = 
-SHORT_NAMES            = NO
-JAVADOC_AUTOBRIEF      = YES
-QT_AUTOBRIEF           = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP         = NO
-INHERIT_DOCS           = YES
-SEPARATE_MEMBER_PAGES  = NO
-TAB_SIZE               = 8
-ALIASES                = 
-OPTIMIZE_OUTPUT_FOR_C  = NO
-OPTIMIZE_OUTPUT_JAVA   = NO
-OPTIMIZE_FOR_FORTRAN   = NO
-OPTIMIZE_OUTPUT_VHDL   = NO
-BUILTIN_STL_SUPPORT    = NO
-CPP_CLI_SUPPORT        = NO
-SIP_SUPPORT            = NO
-DISTRIBUTE_GROUP_DOC   = NO
-SUBGROUPING            = YES
-TYPEDEF_HIDES_STRUCT   = NO
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL            = YES
-EXTRACT_PRIVATE        = YES
-EXTRACT_STATIC         = YES
-EXTRACT_LOCAL_CLASSES  = YES
-EXTRACT_LOCAL_METHODS  = NO
-EXTRACT_ANON_NSPACES   = YES
-HIDE_UNDOC_MEMBERS     = NO
-HIDE_UNDOC_CLASSES     = NO
-HIDE_FRIEND_COMPOUNDS  = NO
-HIDE_IN_BODY_DOCS      = NO
-INTERNAL_DOCS          = NO
-CASE_SENSE_NAMES       = YES
-HIDE_SCOPE_NAMES       = NO
-SHOW_INCLUDE_FILES     = YES
-INLINE_INFO            = YES
-SORT_MEMBER_DOCS       = YES
-SORT_BRIEF_DOCS        = NO
-SORT_GROUP_NAMES       = NO
-SORT_BY_SCOPE_NAME     = NO
-GENERATE_TODOLIST      = YES
-GENERATE_TESTLIST      = YES
-GENERATE_BUGLIST       = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS       = 
-MAX_INITIALIZER_LINES  = 30
-SHOW_USED_FILES        = YES
-SHOW_DIRECTORIES       = NO
-FILE_VERSION_FILTER    = 
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET                  = NO
-WARNINGS               = YES
-WARN_IF_UNDOCUMENTED   = NO
-WARN_IF_DOC_ERROR      = YES
-WARN_NO_PARAMDOC       = NO
-WARN_FORMAT            = "$file:$line: $text"
-WARN_LOGFILE           = 
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT                  = 
-INPUT_ENCODING         = UTF-8
-FILE_PATTERNS          = dev*.h \
-                         dev*.cpp \
-                         scsiata.cpp
-RECURSIVE              = NO
-EXCLUDE                = 
-EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXCLUDE_SYMBOLS        = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
-EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = 
-INPUT_FILTER           = 
-FILTER_PATTERNS        = 
-FILTER_SOURCE_FILES    = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER         = YES
-INLINE_SOURCES         = NO
-STRIP_CODE_COMMENTS    = NO
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION    = NO
-REFERENCES_LINK_SOURCE = YES
-USE_HTAGS              = NO
-VERBATIM_HEADERS       = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX     = NO
-COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML          = YES
-HTML_OUTPUT            = html
-HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = 
-HTML_ALIGN_MEMBERS     = YES
-GENERATE_HTMLHELP      = NO
-GENERATE_DOCSET        = NO
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-HTML_DYNAMIC_SECTIONS  = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
-GENERATE_CHI           = NO
-BINARY_TOC             = NO
-TOC_EXPAND             = NO
-DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
-GENERATE_TREEVIEW      = NO
-TREEVIEW_WIDTH         = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX         = YES
-LATEX_OUTPUT           = latex
-LATEX_CMD_NAME         = latex
-MAKEINDEX_CMD_NAME     = makeindex
-COMPACT_LATEX          = NO
-PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
-PDF_HYPERLINKS         = YES
-USE_PDFLATEX           = YES
-LATEX_BATCHMODE        = NO
-LATEX_HIDE_INDICES     = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF           = NO
-RTF_OUTPUT             = rtf
-COMPACT_RTF            = NO
-RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN           = NO
-MAN_OUTPUT             = man
-MAN_EXTENSION          = .3
-MAN_LINKS              = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML           = NO
-XML_OUTPUT             = xml
-XML_SCHEMA             = 
-XML_DTD                = 
-XML_PROGRAMLISTING     = YES
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF   = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD       = NO
-PERLMOD_LATEX          = NO
-PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING   = YES
-MACRO_EXPANSION        = NO
-EXPAND_ONLY_PREDEF     = NO
-SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
-SKIP_FUNCTION_MACROS   = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references   
-#---------------------------------------------------------------------------
-TAGFILES               = 
-GENERATE_TAGFILE       = 
-ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = YES
-MSCGEN_PATH            = 
-HIDE_UNDOC_RELATIONS   = YES
-HAVE_DOT               = NO
-CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-GROUP_GRAPHS           = YES
-UML_LOOK               = NO
-TEMPLATE_RELATIONS     = NO
-INCLUDE_GRAPH          = YES
-INCLUDED_BY_GRAPH      = YES
-CALL_GRAPH             = NO
-CALLER_GRAPH           = NO
-GRAPHICAL_HIERARCHY    = YES
-DIRECTORY_GRAPH        = YES
-DOT_IMAGE_FORMAT       = png
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-DOT_GRAPH_MAX_NODES    = 50
-MAX_DOT_GRAPH_DEPTH    = 0
-DOT_TRANSPARENT        = YES
-DOT_MULTI_TARGETS      = NO
-GENERATE_LEGEND        = YES
-DOT_CLEANUP            = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = NO
diff --git a/INSTALL b/INSTALL
index 011622ac358ae950d2902ed5392313767f3faee6..fcffe649b81983d3980fc9430fefd39699c787e4 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
 Smartmontools installation instructions
 =======================================
 
-$Id: INSTALL 4120 2015-08-27 16:12:21Z samm2 $
+$Id: INSTALL 4574 2017-10-29 15:41:13Z chrfranke $
 
 Please also see the smartmontools home page:
 http://www.smartmontools.org/
@@ -54,8 +54,8 @@ Table of contents:
 
     E) Cygwin
 
-    The code was tested on Cygwin 1.7.15-1.  It should also work on other
-    recent releases.
+    The code was tested on Cygwin 2.9.0-3 x86 and x86_64. It should also
+    work on other recent releases.
 
     Both Cygwin and Windows versions of smartmontools share the same code
     to access the IDE/ATA or SCSI devices. The information in the "Windows"
@@ -64,7 +64,7 @@ Table of contents:
     F) Windows
 
     The code was tested on Windows XP SP3, 2003, Vista, Windows 7, 8, 8.1
-    and Windows 10 Release Preview.  Support von Windows 9x/ME and NT4 was
+    and Windows 10 up to 1709.  Support von Windows 9x/ME and NT4 was
     removed after smartmontools 5.43.
 
     ATA or SATA devices are supported if the device driver implements
@@ -72,16 +72,11 @@ Table of contents:
     Only the latter provides full pass-through support which is needed
     for all smartmontools features.
 
+    SATA devices behind a Intel RST driver are accessed through CSMI.
+
     SCSI and USB devices are accessed through SPTI. Special driver support
     is not required.
 
-    3ware 9000 RAID controllers are supported using features available
-    in the Windows driver release 9.4.0 (3wareDrv.sys 3.0.2.70) or later.
-    Older drivers provide SMART access to the first physical drive (port)
-    of each logical drive (unit). If driver support is not available
-    (7000/8000 series, 9000 on XP 64), smartctl can be used to parse SMART
-    data output from CLI or 3DM.
-
     G) MacOS/Darwin
 
     The code was tested on MacOS 10.3.4.  It should work from 10.3
@@ -149,11 +144,9 @@ Table of contents:
     and continue with step [3] below, skipping the "unpack the tarball" step.
 
     The autogen.sh command is ONLY required when installing from
-    SVN. You need GNU Autoconf (version 2.50 or greater), GNU Automake
-    (version 1.7 or greater) and their dependencies installed in order
-    to run it.  You can get these here:
-    http://directory.fsf.org/project/autoconf/
-    http://directory.fsf.org/project/automake/
+    SVN. You need GNU Autoconf (version 2.60 or greater), GNU Automake
+    (version 1.10 or greater) and their dependencies installed in order
+    to run it.
 
 [3] Installing from the source tarball
 ======================================
@@ -184,14 +177,21 @@ Table of contents:
     --with-initscriptdir=auto
     --with-exampledir='${docdir}/examplescripts'
     --with-drivedbdir='${datadir}/smartmontools'
+    --with-update-smart-drivedb
+    --with-gnupg
     --with-smartdscriptdir='${sysconfdir}'
     --with-smartdplugindir='${smartdscriptdir}/smartd_warning.d'
+    --with-scriptpath='/bin:/usr/bin'
     --without-savestates
     --without-attributelog
     --with-os-deps='os_linux.o dev_areca.o' (platform specific)
     --without-selinux
     --with-libcap-ng=auto
-    --with-working-snprintf
+    --without-nvme-devicescan
+    --without-solaris-sparc-ata (Solaris SPARC only)
+    --with-working-snprintf (Windows: guessed)
+    --with-mingw-aslr=auto (Windows only)
+    --with-cxx11-option=auto
 
     These will usually not overwrite existing "distribution" installations on
     Linux Systems since the FHS reserves this area for use by the system
@@ -200,10 +200,8 @@ Table of contents:
     For different installation locations or distributions, simply add
     arguments to ./configure as shown in [4] below.
 
-    If you wish to alter the default C++ compiler flags, set an
-    environment variable CXXFLAGS='your options' before doing
-    ./configure, or else do:
-    make CXXFLAGS='your options'
+    If you wish to alter the default C++ compiler flags, add
+    CXXFLAGS='your options' to ./configure command.
 
     The first output line of smartctl and smartd provides information
     about release number, last SVN checkin date and revison, platform,
@@ -215,7 +213,7 @@ Table of contents:
 ================================================
 
 Note: Please send corrections/additions to:
-smartmontools-support@lists.sourceforge.net
+smartmontools-support@listi.jpberlin.de
 
 Debian:
   If you don't want to overwrite any distribution package, use:
@@ -373,7 +371,7 @@ Same as Red Hat:
 [10] Guidelines for Windows
 ===========================
 
-To compile the Windows release with MinGW gcc on MSYS, use:
+To compile statically linked Windows release with MinGW gcc on MSYS, use:
 
   ./configure
   make
@@ -384,12 +382,10 @@ To compile the Windows release with MinGW gcc on MSYS, use:
 Cross-compile statically linked 32-bit and 64-bit versions with MinGW-w64:
 
   ./configure --build=$(./config.guess) \
-              --host=i686-w64-mingw32 \
-              LDFLAGS=-static
+              --host=i686-w64-mingw32
 
   ./configure --build=$(./config.guess) \
-              --host=x86_64-w64-mingw32 \
-              LDFLAGS=-static
+              --host=x86_64-w64-mingw32
 
   Tested on Cygwin, Debian and Fedora.
 
@@ -438,16 +434,16 @@ To both create and run the (interactive) installer, use:
   The binary distribution includes all documentation files converted
   to DOS text file format and *.html and *.txt preformatted man pages.
 
-To prepare os_win32 directory for MS Visual Studio C++ 2010 [Express],
+To prepare os_win32/vc14 directory for MS Visual Studio C++ 2015 builds,
 use the following on MSYS or Cygwin:
 
   mkdir vctmp && cd vctmp
   ../configure [... any MinGW option set from above ...]
-  make config-vc10
+  make config-vc14
 
-  The MSVC project files (os_win32/vc10/*) are included in SVN (but not
-  in source tarball). The target config-vc10 from a Makefile configured
-  for MinGW creates os_win32/vc10/{config.h,smart*.rc,svnversion.h}.
+  The MSVC project files (os_win32/vc14/*) are included in SVN (but not
+  in source tarball). The target config-vc14 from a Makefile configured
+  for MinGW creates os_win32/vc14/{config.h,smart*.rc,svnversion.h}.
   The configure skript must be run outside of the source directory to
   avoid inclusion of the original config.h.
 
@@ -457,7 +453,7 @@ use the following on MSYS or Cygwin:
 
 To compile the OS/2 code, please run
 
-  ./os_os2/configure.os2
+  ./configure
   make
   make install
 
@@ -559,13 +555,14 @@ default then the default configuration file is installed as
 The commands:
 
 make htmlman
+make pdfman
 make txtman
 
-may be used to build .html and .txt preformatted man pages.
+may be used to build .html, .pdf and .txt preformatted man pages.
 These are used by the dist-win32 make target to build the Windows
 distribution.
 The commands also work on other operating system configurations
-if suitable versions of man2html, groff and grotty are installed.
+if suitable versions of man, man2html and groff are installed.
 On systems without man2html, the following command should work
 if groff is available:
 
@@ -594,8 +591,7 @@ a description of available configure options is printed
 [with defaults in square brackets].  See also section [3] above.
 
 
-The following old configure options are deprecated and will be removed
-in a future release of smartmontools:
+The following old configure options are no longer supported:
 
 Old option                 Replacement
 --with-docdir=DIR          --docdir=DIR (autoconf >= 2.60)
@@ -670,4 +666,4 @@ Case 2:
         /usr/local/etc/rc.d/init.d/smartd
 
 Additional information about using configure can be found here:
-http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts
+https://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts
index c496bc9e202cfe42295cacb8592f05fcb2d22d2e..7540f57019ded8de4e97941935827415e127ab0d 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 #
-# $Id: Makefile.am 4299 2016-04-16 19:45:57Z chrfranke $
+# $Id: Makefile.am 4519 2017-10-08 15:41:54Z chrfranke $
 #
 
 @SET_MAKE@
@@ -63,6 +63,8 @@ smartctl_SOURCES = \
         ataprint.h \
         dev_ata_cmd_set.cpp \
         dev_ata_cmd_set.h \
+        dev_intelliprop.cpp \
+        dev_intelliprop.h \
         dev_interface.cpp \
         dev_interface.h \
         dev_tunnelled.h \
@@ -96,6 +98,8 @@ EXTRA_smartctl_SOURCES = \
         os_netbsd.h \
         os_openbsd.cpp \
         os_openbsd.h \
+        os_os2.cpp \
+        os_os2.h \
         os_qnxnto.cpp \
         os_qnxnto.h \
         os_solaris.cpp \
@@ -115,8 +119,8 @@ EXTRA_smartctl_SOURCES = \
 
 if OS_WIN32_MINGW
 
-smartctl_LDADD        += smartctl_res.o $(os_win32_manifest)
-smartctl_DEPENDENCIES += smartctl_res.o $(os_win32_manifest)
+smartctl_LDADD        += smartctl_res.o
+smartctl_DEPENDENCIES += smartctl_res.o
 
 endif
 
@@ -129,6 +133,8 @@ smartd_SOURCES = \
         atacmds.h \
         dev_ata_cmd_set.cpp \
         dev_ata_cmd_set.h \
+        dev_intelliprop.cpp \
+        dev_intelliprop.h \
         dev_interface.cpp \
         dev_interface.h \
         dev_tunnelled.h \
@@ -158,6 +164,8 @@ EXTRA_smartd_SOURCES = \
         os_netbsd.h \
         os_openbsd.cpp \
         os_openbsd.h \
+        os_os2.cpp \
+        os_os2.h \
         os_qnxnto.cpp \
         os_qnxnto.h \
         os_solaris.cpp \
@@ -174,6 +182,7 @@ EXTRA_smartd_SOURCES = \
         dev_legacy.cpp \
         linux_nvme_ioctl.h \
         freebsd_nvme_ioctl.h \
+        netbsd_nvme_ioctl.h \
         megaraid.h
 
 if OS_WIN32_MINGW
@@ -184,8 +193,8 @@ smartd_SOURCES += \
         os_win32/syslog_win32.cpp \
         os_win32/syslog.h
 
-smartd_LDADD        += smartd_res.o $(os_win32_manifest)
-smartd_DEPENDENCIES += smartd_res.o $(os_win32_manifest)
+smartd_LDADD        += smartd_res.o
+smartd_DEPENDENCIES += smartd_res.o
 
 endif
 
@@ -360,6 +369,7 @@ uninstall-sysconfDATA:
 smartdscript_SCRIPTS = smartd_warning.sh
 
 EXTRA_DIST = \
+        .editorconfig \
         autogen.sh \
         smartd.initd.in \
         smartd.freebsd.initd.in \
@@ -380,32 +390,36 @@ EXTRA_DIST = \
         os_win32/default.manifest \
         os_win32/installer.nsi \
         os_win32/runcmd.c \
-        os_win32/smartctl_res.rc.in \
-        os_win32/smartd_res.rc.in \
+        os_win32/smartd_mailer.ps1 \
+        os_win32/smartd_mailer.conf.sample.ps1 \
         os_win32/smartd_warning.cmd \
         os_win32/syslogevt.mc \
         os_win32/update-smart-drivedb.nsi \
         os_win32/wbemcli_small.h \
+        os_win32/versioninfo.rc.in \
         os_win32/wtssendmsg.c \
         $(docs_DATA) \
         $(examples_DATA) \
         $(examples_SCRIPTS)
 
 CLEANFILES = \
-        smartd.conf.5 \
-        smartd.conf.4 \
         smartd.8 \
         smartd.1m \
         smartd.8.html \
         smartd.8.html.tmp \
+        smartd.8.pdf \
         smartd.8.txt \
         smartctl.8 \
         smartctl.1m \
         smartctl.8.html \
         smartctl.8.html.tmp \
+        smartctl.8.pdf \
         smartctl.8.txt \
+        smartd.conf.5 \
+        smartd.conf.4 \
         smartd.conf.5.html \
         smartd.conf.5.html.tmp \
+        smartd.conf.5.pdf \
         smartd.conf.5.txt \
         smartd.initd \
         smartd.freebsd.initd \
@@ -415,6 +429,10 @@ CLEANFILES = \
         update-smart-drivedb \
         update-smart-drivedb.8 \
         update-smart-drivedb.1m \
+        update-smart-drivedb.8.html \
+        update-smart-drivedb.8.html.tmp \
+        update-smart-drivedb.8.pdf \
+        update-smart-drivedb.8.txt \
         SMART
 
 # 'make maintainer-clean' also removes files generated by './autogen.sh'
@@ -658,10 +676,12 @@ update-smart-drivedb.1m: update-smart-drivedb.8
        @$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@
 
 
-# Commands to convert man pages into .html and .txt
+# Convert man pages into .html, .pdf and .txt
 # TODO: configure
 MAN2HTML = man2html
 #MAN2HTML = groff -man -Thtml
+MAN2PDF = man -Tpdf -l
+#MAN2PDF = groff -man -Tpdf
 MAN2TXT = groff -man -Tascii -P'-bcou'
 
 # Remove HTTP header and fix links in man2html output
@@ -671,11 +691,11 @@ FIXHTML = sed -e '1s,^Content-type.*,,' \
               -e 's,<A HREF="[^"]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
               -e 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
 
-# Convert man pages into .html and .txt
+htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html update-smart-drivedb.8.html
 
-htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html
+pdfman:  smartctl.8.pdf smartd.8.pdf smartd.conf.5.pdf update-smart-drivedb.8.pdf
 
-txtman:  smartctl.8.txt smartd.8.txt smartd.conf.5.txt
+txtman:  smartctl.8.txt smartd.8.txt smartd.conf.5.txt update-smart-drivedb.8.txt
 
 %.5.html: %.5
        $(MAN2HTML) $< > $@.tmp
@@ -687,6 +707,12 @@ txtman:  smartctl.8.txt smartd.8.txt smartd.conf.5.txt
        @echo ' $$(FIXHTML) < $@.tmp > $@'
        @$(FIXHTML) < $@.tmp > $@
 
+%.5.pdf: %.5
+       $(MAN2PDF) $< > $@
+
+%.8.pdf: %.8
+       $(MAN2PDF) $< > $@
+
 %.5.txt: %.5
        $(MAN2TXT) $< > $@
 
@@ -706,38 +732,64 @@ check:
 if OS_WIN32_MINGW
 # Windows resources
 
-smartctl_res.o: smartctl_res.rc
+smartctl_res.o: smartctl_res.rc $(os_win32_manifest)
+       $(WINDRES) $< $@
+
+smartd_res.o: smartd_res.rc syslogevt.rc $(os_win32_manifest)
        $(WINDRES) $< $@
 
-smartd_res.o: smartd_res.rc syslogevt.rc
-       $(WINDRES) -I. $< $@
+runcmda_res.o: runcmda_res.rc defadmin.manifest
+       $(WINDRES) $< $@
+
+runcmdu_res.o: runcmdu_res.rc $(os_win32_manifest)
+       $(WINDRES) $< $@
+
+wtssendmsg_res.o: wtssendmsg_res.rc $(os_win32_manifest)
+       $(WINDRES) $< $@
 
-# Convert version for VERSIONINFO resource: 6.1 r3754 -> 6.1.0.3754, set Copyright year
+# Convert version for VERSIONINFO resource: 6.6 r4519 -> 6.6.0.4519,
+# set description, name, version and year
 WIN_RC_FILTER = { \
     ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'` && \
     rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h` && \
     txtver="$${ver:-0.0.0}.$${rev:-0}" && binver=`echo "$$txtver" | sed 's|\.|,|g'` && \
     yy=`sed -n 's,^.*DATE[^"]*"20\([0-9][0-9]\).*$$,\1,p' svnversion.h` && yy="$${yy:-XX}" && \
-    sed -e "s|@BINARY_VERSION@|$$binver|g" -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; }
+    sed -e "s|@DESC@|$$d|" -e "s|@NAME@|$$n|" -e "s|@BINARY_VERSION@|$$binver|g" \
+        -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; }
 
-smartctl_res.rc: os_win32/smartctl_res.rc.in Makefile svnversion.h
-       @echo ' $$(WIN_RC_FILTER) < $< > $@'
-       @$(WIN_RC_FILTER) < $< > $@
+WIN_MAKE_RES = \
+    echo "n=$$n d=\"$$d"'"; $$(WIN_RC_FILTER) < $< > $@'; \
+    $(WIN_RC_FILTER) < $< > $@
 
-smartd_res.rc: os_win32/smartd_res.rc.in Makefile svnversion.h
-       @echo ' $$(WIN_RC_FILTER) < $< > $@'
-       @$(WIN_RC_FILTER) < $< > $@
+WIN_APP_MANIFEST = \
+    if test -n '$(os_win32_manifest)'; then \
+      echo "echo '1 24 \"$(srcdir)/$(os_win32_manifest)\"' >> $@"; \
+      echo '1 24 "$(srcdir)/$(os_win32_manifest)"' >> $@; \
+    fi
 
-syslogevt.rc: os_win32/syslogevt.mc
-       $(WINDMC) -b $<
+smartctl_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+       @n=smartctl d="Control and Monitor Utility for SMART Disks"; $(WIN_MAKE_RES)
+       @$(WIN_APP_MANIFEST)
+
+smartd_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+       @n=smartd d="SMART Disk Monitoring Daemon"; $(WIN_MAKE_RES)
+       echo '#include "./syslogevt.rc"' >> $@
+       @$(WIN_APP_MANIFEST)
 
-# Application manifests
+runcmdu_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+       @n=runcmdu d="Run console command"; $(WIN_MAKE_RES)
+       @$(WIN_APP_MANIFEST)
 
-default.manifest.o: os_win32/default.manifest
-       echo '1 24 "$<"' | $(WINDRES) -J rc -o $@
+runcmda_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+       @n=runcmda d="Run console command as admin"; $(WIN_MAKE_RES)
+       echo '1 24 "./defadmin.manifest"' >> $@
 
-defadmin.manifest.o: defadmin.manifest
-       echo '1 24 "$<"' | $(WINDRES) -J rc -o $@
+wtssendmsg_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+       @n=wtssendmsg d="Send console messages"; $(WIN_MAKE_RES)
+       @$(WIN_APP_MANIFEST)
+
+syslogevt.rc: os_win32/syslogevt.mc
+       $(WINDMC) -b $<
 
 defadmin.manifest: os_win32/default.manifest
        sed 's,"asInvoker","requireAdministrator",' $< > $@
@@ -761,6 +813,8 @@ EXEFILES_WIN32 = \
         $(exedir_win32)/smartctl.exe \
         $(exedir_win32)/smartctl-nc.exe \
         $(exedir_win32)/smartd.exe \
+        $(exedir_win32)/smartd_mailer.ps1 \
+        $(exedir_win32)/smartd_mailer.conf.sample.ps1 \
         $(exedir_win32)/smartd_warning.cmd \
         $(exedir_win32)/runcmda.exe \
         $(exedir_win32)/runcmdu.exe \
@@ -786,11 +840,11 @@ FILES_WIN32 = \
         $(docdir_win32)/checksums$(win_bits).txt \
         $(docdir_win32)/smartd.conf \
         $(docdir_win32)/smartctl.8.html \
-        $(docdir_win32)/smartctl.8.txt \
+        $(docdir_win32)/smartctl.8.pdf \
         $(docdir_win32)/smartd.8.html \
-        $(docdir_win32)/smartd.8.txt \
+        $(docdir_win32)/smartd.8.pdf \
         $(docdir_win32)/smartd.conf.5.html \
-        $(docdir_win32)/smartd.conf.5.txt
+        $(docdir_win32)/smartd.conf.5.pdf
 
 if ENABLE_DRIVEDB
 FILES_WIN32 += \
@@ -801,13 +855,14 @@ CLEANFILES += \
         $(FILES_WIN32) \
         defadmin.manifest \
         distdir.mkdir \
-        runcmda.exe runcmdu.exe \
+        runcmda.exe runcmda_res.rc \
+        runcmdu.exe runcmdu_res.rc \
         smartctl-nc.exe smartctl-nc.exe.tmp \
         smartctl_res.rc smartd_res.rc \
         syslogevt.h \
         syslogevt.rc syslogevt_*.bin \
         update-smart-drivedb.exe \
-        wtssendmsg.exe
+        wtssendmsg.exe wtssendmsg_res.rc
 
 # Note: Only use without options to be compatible with all variants
 UNIX2DOS = unix2dos
@@ -880,14 +935,17 @@ $(exedir_win32)/%.cmd: $(srcdir)/os_win32/%.cmd
        $(UNIX2DOS) < $< > $@
        touch -r $< $@
 
-$(docdir_win32)/%.html: %.html
+$(exedir_win32)/%.ps1: $(srcdir)/os_win32/%.ps1
        $(UNIX2DOS) < $< > $@
        touch -r $< $@
 
-$(docdir_win32)/%.txt: %.txt
+$(docdir_win32)/%.html: %.html
        $(UNIX2DOS) < $< > $@
        touch -r $< $@
 
+$(docdir_win32)/%.pdf: %.pdf
+       cp -p $< $@
+
 $(docdir_win32)/%.txt: $(srcdir)/%
        $(UNIX2DOS) < $< > $@
        touch -r $< $@
@@ -920,37 +978,58 @@ smartctl-nc.exe: smartctl.exe
 runcmd.o: os_win32/runcmd.c
        $(CC) -c -Os $<
 
-runcmdu.exe: runcmd.o $(os_win32_manifest)
+runcmdu.exe: runcmd.o runcmdu_res.o
        $(CC) -o $@ $^
 
-runcmda.exe: runcmd.o defadmin.manifest.o
+runcmda.exe: runcmd.o runcmda_res.o
        $(CC) -o $@ $^
 
-wtssendmsg.exe: os_win32/wtssendmsg.c $(os_win32_manifest)
-       $(CC) -Os -o $@ $< $(os_win32_manifest) -lwtsapi32
+wtssendmsg.exe: os_win32/wtssendmsg.c wtssendmsg_res.o
+       $(CC) -Os -o $@ $^ -lwtsapi32
 
-# Build os_win32/vc10/{config.h,smart*.rc,svnversion.h} for MSVC10 from MinGW files
+# Build os_win32/vc14/{config.h,smart*.rc,svnversion.h} for MSVC14 from MinGW files
 
-config-vc10: $(srcdir)/os_win32/vc10/config.h \
-             $(srcdir)/os_win32/vc10/smartctl_res.rc \
-             $(srcdir)/os_win32/vc10/smartd_res.rc \
-             $(srcdir)/os_win32/vc10/svnversion.h
+vcver = 14
 
-$(srcdir)/os_win32/vc10/config.h: config.h Makefile
-       sed -e '1i/* os_win32/vc10/config.h.  Generated from config.h by Makefile.  */' \
-           -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STRINGS_H\|STRTOULL\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' \
-           -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc10,' $< > $@
+CONFIG_VC_FILES = \
+        $(srcdir)/os_win32/vc$(vcver)/config.h \
+        $(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc \
+        $(srcdir)/os_win32/vc$(vcver)/smartd_res.rc \
+        $(srcdir)/os_win32/vc$(vcver)/svnversion.h
 
-$(srcdir)/os_win32/vc10/svnversion.h: svnversion.h
-       cp $< $@
+config-vc$(vcver): $(CONFIG_VC_FILES)
 
-$(srcdir)/os_win32/vc10/smartctl_res.rc: smartctl_res.rc
-       cp $< $@
+$(srcdir)/os_win32/vc$(vcver)/config.h: config.h Makefile
+       sed -e '1i/* os_win32/vc$(vcver)/config.h.  Generated from config.h by Makefile.  */' \
+           -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|[DK_]*NTDDDISK_H\|STRINGS_H\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */ /* VC$(vcver) */,' \
+           -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc$(vcver),' $< > $@
 
-$(srcdir)/os_win32/vc10/smartd_res.rc: smartd_res.rc
+$(srcdir)/os_win32/vc$(vcver)/svnversion.h: svnversion.h
        cp $< $@
 
+$(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc: smartctl_res.rc
+       sed '/^1 24 /d' $< > $@
+
+$(srcdir)/os_win32/vc$(vcver)/smartd_res.rc: smartd_res.rc
+       sed '/^1 24 /d' $< > $@
+
+clean-vc$(vcver):
+       rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.VC.opendb
+       rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.db
+       rm -f $(srcdir)/os_win32/vc$(vcver)/syslogevt.h
+       rm -rf $(srcdir)/os_win32/vc$(vcver)/Debug
+       rm -rf $(srcdir)/os_win32/vc$(vcver)/Release
+       rm -rf $(srcdir)/os_win32/vc$(vcver)/x64
+
+distclean-vc$(vcver): clean-vc$(vcver)
+       rm -f $(CONFIG_VC_FILES)
+
+maintainer-clean-vc$(vcver): distclean-vc$(vcver)
+       rm -rf $(srcdir)/os_win32/vc$(vcver)/.vs
+
 endif
+
+
 if OS_DARWIN
 # Definitions for OSX distribution
 distdir_darwin  = $(PACKAGE)-$(VERSION).darwin
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..cd043c6
--- /dev/null
@@ -0,0 +1,2274 @@
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# $Id: Makefile.am 4519 2017-10-08 15:41:54Z chrfranke $
+#
+
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@ENABLE_DRIVEDB_TRUE@am__append_1 = -DSMARTMONTOOLS_DRIVEDBDIR='"$(drivedbdir)"'
+@ENABLE_SAVESTATES_TRUE@am__append_2 = -DSMARTMONTOOLS_SAVESTATES='"$(savestates)"'
+@ENABLE_ATTRIBUTELOG_TRUE@am__append_3 = -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"'
+@OS_WIN32_MINGW_TRUE@am__append_4 = -I$(srcdir)/os_win32
+@NEED_GETOPT_LONG_TRUE@am__append_5 = -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__
+@NEED_REGEX_TRUE@am__append_6 = -I$(srcdir)/regex
+sbin_PROGRAMS = smartctl$(EXEEXT) smartd$(EXEEXT)
+@OS_WIN32_MINGW_TRUE@am__append_7 = smartctl_res.o
+@OS_WIN32_MINGW_TRUE@am__append_8 = smartctl_res.o
+@OS_WIN32_MINGW_TRUE@am__append_9 = \
+@OS_WIN32_MINGW_TRUE@        os_win32/daemon_win32.cpp \
+@OS_WIN32_MINGW_TRUE@        os_win32/daemon_win32.h \
+@OS_WIN32_MINGW_TRUE@        os_win32/syslog_win32.cpp \
+@OS_WIN32_MINGW_TRUE@        os_win32/syslog.h
+
+@OS_WIN32_MINGW_TRUE@am__append_10 = smartd_res.o
+@OS_WIN32_MINGW_TRUE@am__append_11 = smartd_res.o
+@NEED_GETOPT_LONG_TRUE@am__append_12 = \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt.c \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt.h \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt1.c
+
+@NEED_GETOPT_LONG_TRUE@am__append_13 = \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt.c \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt.h \
+@NEED_GETOPT_LONG_TRUE@        getopt/getopt1.c
+
+@NEED_REGEX_TRUE@am__append_14 = \
+@NEED_REGEX_TRUE@        regex/regex.c \
+@NEED_REGEX_TRUE@        regex/regex.h \
+@NEED_REGEX_TRUE@        regex/regex_internal.h
+
+@NEED_REGEX_TRUE@am__append_15 = \
+@NEED_REGEX_TRUE@        regex/regex.c \
+@NEED_REGEX_TRUE@        regex/regex.h \
+@NEED_REGEX_TRUE@        regex/regex_internal.h
+
+
+# Included by regex.c:
+@NEED_REGEX_TRUE@am__append_16 = \
+@NEED_REGEX_TRUE@        regex/regcomp.c \
+@NEED_REGEX_TRUE@        regex/regexec.c \
+@NEED_REGEX_TRUE@        regex/regex_internal.c
+
+@NEED_REGEX_TRUE@am__append_17 = \
+@NEED_REGEX_TRUE@        regex/regcomp.c \
+@NEED_REGEX_TRUE@        regex/regexec.c \
+@NEED_REGEX_TRUE@        regex/regex_internal.c
+
+@OS_WIN32_TRUE@am__append_18 = \
+@OS_WIN32_TRUE@        csmisas.h \
+@OS_WIN32_TRUE@        os_win32/wmiquery.cpp \
+@OS_WIN32_TRUE@        os_win32/wmiquery.h
+
+@OS_WIN32_TRUE@am__append_19 = \
+@OS_WIN32_TRUE@        csmisas.h \
+@OS_WIN32_TRUE@        os_win32/wmiquery.cpp \
+@OS_WIN32_TRUE@        os_win32/wmiquery.h
+
+@OS_WIN32_TRUE@am__append_20 = -lole32 -loleaut32
+@OS_WIN32_TRUE@am__append_21 = -lole32 -loleaut32
+@ENABLE_UPDATE_SMART_DRIVEDB_TRUE@@OS_SOLARIS_TRUE@am__append_22 = update-smart-drivedb.1m
+@ENABLE_UPDATE_SMART_DRIVEDB_TRUE@@OS_SOLARIS_FALSE@am__append_23 = update-smart-drivedb.8
+@ENABLE_DRIVEDB_TRUE@@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@am__append_24 = \
+@ENABLE_DRIVEDB_TRUE@@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@        $(exedir_win32)/update-smart-drivedb.exe
+
+@ENABLE_DRIVEDB_TRUE@@OS_WIN32_MINGW_TRUE@am__append_25 = \
+@ENABLE_DRIVEDB_TRUE@@OS_WIN32_MINGW_TRUE@        $(exedir_win32)/drivedb.h
+
+@OS_WIN32_MINGW_TRUE@am__append_26 = \
+@OS_WIN32_MINGW_TRUE@        $(FILES_WIN32) \
+@OS_WIN32_MINGW_TRUE@        defadmin.manifest \
+@OS_WIN32_MINGW_TRUE@        distdir.mkdir \
+@OS_WIN32_MINGW_TRUE@        runcmda.exe runcmda_res.rc \
+@OS_WIN32_MINGW_TRUE@        runcmdu.exe runcmdu_res.rc \
+@OS_WIN32_MINGW_TRUE@        smartctl-nc.exe smartctl-nc.exe.tmp \
+@OS_WIN32_MINGW_TRUE@        smartctl_res.rc smartd_res.rc \
+@OS_WIN32_MINGW_TRUE@        syslogevt.h \
+@OS_WIN32_MINGW_TRUE@        syslogevt.rc syslogevt_*.bin \
+@OS_WIN32_MINGW_TRUE@        update-smart-drivedb.exe \
+@OS_WIN32_MINGW_TRUE@        wtssendmsg.exe wtssendmsg_res.rc
+
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/pkg.m4 \
+       $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(examplesdir)" \
+       "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(smartdscriptdir)" \
+       "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \
+       "$(DESTDIR)$(docsdir)" "$(DESTDIR)$(drivedbdir)" \
+       "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(initddir)" \
+       "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(systemdsystemunitdir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am__smartctl_SOURCES_DIST = smartctl.cpp smartctl.h atacmdnames.cpp \
+       atacmdnames.h atacmds.cpp atacmds.h ataidentify.cpp \
+       ataidentify.h ataprint.cpp ataprint.h dev_ata_cmd_set.cpp \
+       dev_ata_cmd_set.h dev_intelliprop.cpp dev_intelliprop.h \
+       dev_interface.cpp dev_interface.h dev_tunnelled.h drivedb.h \
+       int64.h knowndrives.cpp knowndrives.h nvmecmds.cpp nvmecmds.h \
+       nvmeprint.cpp nvmeprint.h scsicmds.cpp scsicmds.h scsiata.cpp \
+       scsiprint.cpp scsiprint.h utility.cpp utility.h \
+       getopt/getopt.c getopt/getopt.h getopt/getopt1.c regex/regex.c \
+       regex/regex.h regex/regex_internal.h csmisas.h \
+       os_win32/wmiquery.cpp os_win32/wmiquery.h
+@NEED_GETOPT_LONG_TRUE@am__objects_1 = getopt.$(OBJEXT) \
+@NEED_GETOPT_LONG_TRUE@        getopt1.$(OBJEXT)
+@NEED_REGEX_TRUE@am__objects_2 = regex.$(OBJEXT)
+@OS_WIN32_TRUE@am__objects_3 = wmiquery.$(OBJEXT)
+am_smartctl_OBJECTS = smartctl.$(OBJEXT) atacmdnames.$(OBJEXT) \
+       atacmds.$(OBJEXT) ataidentify.$(OBJEXT) ataprint.$(OBJEXT) \
+       dev_ata_cmd_set.$(OBJEXT) dev_intelliprop.$(OBJEXT) \
+       dev_interface.$(OBJEXT) knowndrives.$(OBJEXT) \
+       nvmecmds.$(OBJEXT) nvmeprint.$(OBJEXT) scsicmds.$(OBJEXT) \
+       scsiata.$(OBJEXT) scsiprint.$(OBJEXT) utility.$(OBJEXT) \
+       $(am__objects_1) $(am__objects_2) $(am__objects_3)
+am__EXTRA_smartctl_SOURCES_DIST = os_darwin.cpp os_darwin.h \
+       os_linux.cpp os_linux.h os_freebsd.cpp os_freebsd.h \
+       os_netbsd.cpp os_netbsd.h os_openbsd.cpp os_openbsd.h \
+       os_os2.cpp os_os2.h os_qnxnto.cpp os_qnxnto.h os_solaris.cpp \
+       os_solaris.h os_win32.cpp os_generic.cpp os_generic.h \
+       aacraid.h cciss.cpp cciss.h cissio_freebsd.h dev_areca.cpp \
+       dev_areca.h dev_legacy.cpp linux_nvme_ioctl.h megaraid.h \
+       regex/regcomp.c regex/regexec.c regex/regex_internal.c
+smartctl_OBJECTS = $(am_smartctl_OBJECTS)
+am__DEPENDENCIES_1 =
+am__smartd_SOURCES_DIST = smartd.cpp atacmdnames.cpp atacmdnames.h \
+       atacmds.cpp atacmds.h dev_ata_cmd_set.cpp dev_ata_cmd_set.h \
+       dev_intelliprop.cpp dev_intelliprop.h dev_interface.cpp \
+       dev_interface.h dev_tunnelled.h drivedb.h int64.h \
+       knowndrives.cpp knowndrives.h nvmecmds.cpp nvmecmds.h \
+       scsicmds.cpp scsicmds.h scsiata.cpp utility.cpp utility.h \
+       os_win32/daemon_win32.cpp os_win32/daemon_win32.h \
+       os_win32/syslog_win32.cpp os_win32/syslog.h getopt/getopt.c \
+       getopt/getopt.h getopt/getopt1.c regex/regex.c regex/regex.h \
+       regex/regex_internal.h csmisas.h os_win32/wmiquery.cpp \
+       os_win32/wmiquery.h
+@OS_WIN32_MINGW_TRUE@am__objects_4 = daemon_win32.$(OBJEXT) \
+@OS_WIN32_MINGW_TRUE@  syslog_win32.$(OBJEXT)
+am_smartd_OBJECTS = smartd.$(OBJEXT) atacmdnames.$(OBJEXT) \
+       atacmds.$(OBJEXT) dev_ata_cmd_set.$(OBJEXT) \
+       dev_intelliprop.$(OBJEXT) dev_interface.$(OBJEXT) \
+       knowndrives.$(OBJEXT) nvmecmds.$(OBJEXT) scsicmds.$(OBJEXT) \
+       scsiata.$(OBJEXT) utility.$(OBJEXT) $(am__objects_4) \
+       $(am__objects_1) $(am__objects_2) $(am__objects_3)
+am__EXTRA_smartd_SOURCES_DIST = os_darwin.cpp os_darwin.h os_linux.cpp \
+       os_linux.h os_freebsd.cpp os_freebsd.h os_netbsd.cpp \
+       os_netbsd.h os_openbsd.cpp os_openbsd.h os_os2.cpp os_os2.h \
+       os_qnxnto.cpp os_qnxnto.h os_solaris.cpp os_solaris.h \
+       os_win32.cpp os_generic.cpp os_generic.h aacraid.h cciss.cpp \
+       cciss.h cissio_freebsd.h dev_areca.cpp dev_areca.h \
+       dev_legacy.cpp linux_nvme_ioctl.h freebsd_nvme_ioctl.h \
+       netbsd_nvme_ioctl.h megaraid.h regex/regcomp.c regex/regexec.c \
+       regex/regex_internal.c
+smartd_OBJECTS = $(am_smartd_OBJECTS)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+SCRIPTS = $(examples_SCRIPTS) $(sbin_SCRIPTS) $(smartdscript_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+       -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+AM_V_CCAS = $(am__v_CCAS_@AM_V@)
+am__v_CCAS_ = $(am__v_CCAS_@AM_DEFAULT_V@)
+am__v_CCAS_0 = @echo "  CCAS    " $@;
+am__v_CCAS_1 = 
+SOURCES = $(smartctl_SOURCES) $(EXTRA_smartctl_SOURCES) \
+       $(nodist_EXTRA_smartctl_SOURCES) $(smartd_SOURCES) \
+       $(EXTRA_smartd_SOURCES) $(nodist_EXTRA_smartd_SOURCES)
+DIST_SOURCES = $(am__smartctl_SOURCES_DIST) \
+       $(am__EXTRA_smartctl_SOURCES_DIST) $(am__smartd_SOURCES_DIST) \
+       $(am__EXTRA_smartd_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+man5dir = $(mandir)/man5
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man_MANS)
+DATA = $(docs_DATA) $(drivedb_DATA) $(examples_DATA) $(initd_DATA) \
+       $(sysconf_DATA) $(systemdsystemunit_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+       $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
+       COPYING ChangeLog INSTALL NEWS README TODO compile \
+       config.guess config.sub depcomp install-sh missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+ASFLAGS = @ASFLAGS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CAPNG_LDADD = @CAPNG_LDADD@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DRIVEDB_BRANCH = @DRIVEDB_BRANCH@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKENSIS = @MAKENSIS@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WINDMC = @WINDMC@
+WINDRES = @WINDRES@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+attributelog = @attributelog@
+attributelogdir = @attributelogdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+drivedbdir = @drivedbdir@
+dvidir = @dvidir@
+exampledir = @exampledir@
+exec_prefix = @exec_prefix@
+gcc_have_attr_packed = @gcc_have_attr_packed@
+gnupg = @gnupg@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+initddir = @initddir@
+initdfile = @initdfile@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+os_deps = @os_deps@
+os_dltools = @os_dltools@
+os_dnsdomainname = @os_dnsdomainname@
+os_hostname = @os_hostname@
+os_libs = @os_libs@
+os_mailer = @os_mailer@
+os_man_filter = @os_man_filter@
+os_nisdomainname = @os_nisdomainname@
+os_win32_manifest = @os_win32_manifest@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+releaseversion = @releaseversion@
+savestates = @savestates@
+savestatesdir = @savestatesdir@
+sbindir = @sbindir@
+scriptpath = @scriptpath@
+sharedstatedir = @sharedstatedir@
+smartd_suffix = @smartd_suffix@
+smartdplugindir = @smartdplugindir@
+smartdscriptdir = @smartdscriptdir@
+smartmontools_release_date = @smartmontools_release_date@
+smartmontools_release_time = @smartmontools_release_time@
+srcdir = @srcdir@
+svn_deps = @svn_deps@
+sysconfdir = @sysconfdir@
+systemdenvfile = @systemdenvfile@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_nvme_devicescan = @with_nvme_devicescan@
+with_selinux = @with_selinux@
+with_update_smart_drivedb = @with_update_smart_drivedb@
+ACLOCAL_AMFLAGS = -I m4
+
+# Make sure .cpp takes precedence to avoid compiling old .c file
+SUFFIXES = .cpp .c .s .o
+
+# BUILD_INFO can be provided by package maintainers (see INSTALL file)
+BUILD_INFO = "(local build)"
+AM_CPPFLAGS = -DBUILD_INFO='$(BUILD_INFO)' \
+       -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"' \
+       -DSMARTMONTOOLS_SMARTDSCRIPTDIR='"$(smartdscriptdir)"' \
+       $(am__append_1) $(am__append_2) $(am__append_3) \
+       $(am__append_4) $(am__append_5) $(am__append_6)
+@ENABLE_UPDATE_SMART_DRIVEDB_TRUE@@OS_WIN32_MINGW_FALSE@sbin_SCRIPTS = update-smart-drivedb
+smartctl_SOURCES = smartctl.cpp smartctl.h atacmdnames.cpp \
+       atacmdnames.h atacmds.cpp atacmds.h ataidentify.cpp \
+       ataidentify.h ataprint.cpp ataprint.h dev_ata_cmd_set.cpp \
+       dev_ata_cmd_set.h dev_intelliprop.cpp dev_intelliprop.h \
+       dev_interface.cpp dev_interface.h dev_tunnelled.h drivedb.h \
+       int64.h knowndrives.cpp knowndrives.h nvmecmds.cpp nvmecmds.h \
+       nvmeprint.cpp nvmeprint.h scsicmds.cpp scsicmds.h scsiata.cpp \
+       scsiprint.cpp scsiprint.h utility.cpp utility.h \
+       $(am__append_12) $(am__append_14) $(am__append_18)
+smartctl_LDADD = $(os_deps) $(os_libs) $(am__append_7) \
+       $(am__append_20)
+smartctl_DEPENDENCIES = $(os_deps) $(am__append_8)
+EXTRA_smartctl_SOURCES = os_darwin.cpp os_darwin.h os_linux.cpp \
+       os_linux.h os_freebsd.cpp os_freebsd.h os_netbsd.cpp \
+       os_netbsd.h os_openbsd.cpp os_openbsd.h os_os2.cpp os_os2.h \
+       os_qnxnto.cpp os_qnxnto.h os_solaris.cpp os_solaris.h \
+       os_win32.cpp os_generic.cpp os_generic.h aacraid.h cciss.cpp \
+       cciss.h cissio_freebsd.h dev_areca.cpp dev_areca.h \
+       dev_legacy.cpp linux_nvme_ioctl.h megaraid.h $(am__append_16)
+smartd_SOURCES = smartd.cpp atacmdnames.cpp atacmdnames.h atacmds.cpp \
+       atacmds.h dev_ata_cmd_set.cpp dev_ata_cmd_set.h \
+       dev_intelliprop.cpp dev_intelliprop.h dev_interface.cpp \
+       dev_interface.h dev_tunnelled.h drivedb.h int64.h \
+       knowndrives.cpp knowndrives.h nvmecmds.cpp nvmecmds.h \
+       scsicmds.cpp scsicmds.h scsiata.cpp utility.cpp utility.h \
+       $(am__append_9) $(am__append_13) $(am__append_15) \
+       $(am__append_19)
+smartd_LDADD = $(os_deps) $(os_libs) $(CAPNG_LDADD) $(am__append_10) \
+       $(am__append_21)
+smartd_DEPENDENCIES = $(os_deps) $(am__append_11)
+EXTRA_smartd_SOURCES = os_darwin.cpp os_darwin.h os_linux.cpp \
+       os_linux.h os_freebsd.cpp os_freebsd.h os_netbsd.cpp \
+       os_netbsd.h os_openbsd.cpp os_openbsd.h os_os2.cpp os_os2.h \
+       os_qnxnto.cpp os_qnxnto.h os_solaris.cpp os_solaris.h \
+       os_win32.cpp os_generic.cpp os_generic.h aacraid.h cciss.cpp \
+       cciss.h cissio_freebsd.h dev_areca.cpp dev_areca.h \
+       dev_legacy.cpp linux_nvme_ioctl.h freebsd_nvme_ioctl.h \
+       netbsd_nvme_ioctl.h megaraid.h $(am__append_17)
+
+# Exclude from source tarball
+nodist_EXTRA_smartctl_SOURCES = os_solaris_ata.s
+nodist_EXTRA_smartd_SOURCES = os_solaris_ata.s
+
+# This block is required because Solaris uses manual page section 1m
+# for administrative command (linux/freebsd use section 8) and Solaris
+# uses manual page section 4 for file formats (linux/freebsd use
+# section 5).  Automake can deal cleanly with man page sections 1-8
+# and n, but NOT with sections of the form 1m.
+@OS_SOLARIS_TRUE@extra_MANS = smartd.conf.4 smartctl.1m smartd.1m \
+@OS_SOLARIS_TRUE@      $(am__append_22)
+# For systems that adopts traditional manner
+@OS_SOLARIS_FALSE@man_MANS = smartd.conf.5 smartctl.8 smartd.8 \
+@OS_SOLARIS_FALSE@     $(am__append_23)
+docsdir = $(docdir)
+docs_DATA = \
+        AUTHORS \
+        ChangeLog \
+        ChangeLog-5.0-6.0 \
+        COPYING \
+        INSTALL \
+        NEWS \
+        README \
+        TODO \
+        smartd.conf
+
+examplesdir = $(exampledir)
+examples_DATA = \
+        examplescripts/README
+
+examples_SCRIPTS = \
+        examplescripts/Example1 \
+        examplescripts/Example2 \
+        examplescripts/Example3 \
+        examplescripts/Example4 \
+        examplescripts/Example5 \
+        examplescripts/Example6
+
+sysconf_DATA = smartd.conf
+smartdscript_SCRIPTS = smartd_warning.sh
+EXTRA_DIST = \
+        .editorconfig \
+        autogen.sh \
+        smartd.initd.in \
+        smartd.freebsd.initd.in \
+        smartd.8.in \
+        smartctl.8.in \
+        smartd.conf.5.in \
+        smartd.conf \
+        smartd.service.in \
+        smartd_warning.sh.in \
+        update-smart-drivedb.in \
+        update-smart-drivedb.8.in \
+        m4/pkg.m4 \
+        os_darwin/com.smartmontools.smartd.plist.in \
+        os_darwin/pkg/PackageInfo.in \
+        os_darwin/pkg/Distribution.in \
+        os_darwin/pkg/installer/README.html \
+        os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall \
+        os_win32/default.manifest \
+        os_win32/installer.nsi \
+        os_win32/runcmd.c \
+        os_win32/smartd_mailer.ps1 \
+        os_win32/smartd_mailer.conf.sample.ps1 \
+        os_win32/smartd_warning.cmd \
+        os_win32/syslogevt.mc \
+        os_win32/update-smart-drivedb.nsi \
+        os_win32/wbemcli_small.h \
+        os_win32/versioninfo.rc.in \
+        os_win32/wtssendmsg.c \
+        $(docs_DATA) \
+        $(examples_DATA) \
+        $(examples_SCRIPTS)
+
+CLEANFILES = smartd.8 smartd.1m smartd.8.html smartd.8.html.tmp \
+       smartd.8.pdf smartd.8.txt smartctl.8 smartctl.1m \
+       smartctl.8.html smartctl.8.html.tmp smartctl.8.pdf \
+       smartctl.8.txt smartd.conf.5 smartd.conf.4 smartd.conf.5.html \
+       smartd.conf.5.html.tmp smartd.conf.5.pdf smartd.conf.5.txt \
+       smartd.initd smartd.freebsd.initd smartd.service \
+       smartd_warning.sh svnversion.h update-smart-drivedb \
+       update-smart-drivedb.8 update-smart-drivedb.1m \
+       update-smart-drivedb.8.html update-smart-drivedb.8.html.tmp \
+       update-smart-drivedb.8.pdf update-smart-drivedb.8.txt SMART \
+       $(am__append_26)
+
+# 'make maintainer-clean' also removes files generated by './autogen.sh'
+MAINTAINERCLEANFILES = \
+        $(srcdir)/Makefile.in \
+        $(srcdir)/aclocal.m4 \
+        $(srcdir)/compile \
+        $(srcdir)/configure \
+        $(srcdir)/config.guess \
+        $(srcdir)/config.h.in \
+        $(srcdir)/config.h.in~ \
+        $(srcdir)/config.sub \
+        $(srcdir)/depcomp \
+        $(srcdir)/install-sh \
+        $(srcdir)/missing \
+        $(srcdir)/m4/pkg.m4
+
+@ENABLE_DRIVEDB_TRUE@drivedb_DATA = drivedb.h
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@initd_DATA = $(initdfile)
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@initd_DATA = com.smartmontools.smartd.plist
+@INSTALL_INITSCRIPT_FALSE@initd_DATA_install = install-initdDATA-null
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@initd_DATA_install = install-initdDATA-generic
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@initd_DATA_install = install-initdDATA-darwin
+@INSTALL_INITSCRIPT_FALSE@initd_DATA_uninstall = uninstall-initdDATA-null
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@initd_DATA_uninstall = uninstall-initdDATA-generic
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@initd_DATA_uninstall = uninstall-initdDATA-darwin
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@initd_install_name = smartd$(smartd_suffix)
+@INSTALL_SYSTEMDUNIT_TRUE@systemdsystemunit_DATA = smartd.service
+
+#
+# Build man pages
+#
+MAN_FILTER = { \
+    sed -e 's|CURRENT_SVN_VERSION|$(releaseversion)|g' \
+        -e "s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g" \
+        -e "s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g" \
+        -e 's|/usr/local/share/man/|$(mandir)/|g' \
+        -e 's|/usr/local/sbin/|$(sbindir)/|g' \
+        -e 's|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g' \
+        -e 's|/usr/local/share/doc/smartmontools/|$(docsdir)/|g' \
+        -e 's|!exampledir!|$(exampledir)/|g' \
+        -e 's|/usr/local/etc/smartd\.conf|$(sysconfdir)/smartd.conf|g' \
+        -e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' \
+        -e 's|/usr/local/etc/smartd_warning\.sh|$(smartdscriptdir)/smartd_warning.sh|g' \
+        -e 's|\\fBmail\\fP|\\fB$(os_mailer)\\fP|g' \
+        -e 's|\\'\''mail\\'\''|\\'\''$(os_mailer)\\'\''|g' \
+        -e 's|/usr/bin/mail|/usr/bin/$(os_mailer)|g' \
+        -e 's|RELEASE_6_0_DRIVEDB|$(DRIVEDB_BRANCH)|g' | \
+    if test -n '$(drivedbdir)'; then \
+      sed 's|/usr/local/share/smartmontools/drivedb\.h|$(drivedbdir)/drivedb.h|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test '$(with_update_smart_drivedb)' = 'yes'; then \
+      cat; \
+    else \
+      sed '/^\.\\" %IF ENABLE_UPDATE_SMART_DRIVEDB/,/^\.\\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(initddir)'; then \
+      sed 's|/usr/local/etc/rc\.d/init\.d/|$(initddir)/|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_INITSCRIPT/,/^\.\\" %ENDIF ENABLE_INITSCRIPT/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(savestates)'; then \
+      sed 's|/usr/local/var/lib/smartmontools/smartd\.|$(savestates)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(attributelog)'; then \
+      sed 's|/usr/local/var/lib/smartmontools/attrlog\.|$(attributelog)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(smartdplugindir)'; then \
+      sed 's|/usr/local/etc/smartd_warning\.d|$(smartdplugindir)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_SMARTDPLUGINDIR/,/^\.\\" %ENDIF ENABLE_SMARTDPLUGINDIR/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(CAPNG_LDADD)'; then \
+      cat; \
+    else \
+      sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test '$(with_nvme_devicescan)' = 'yes'; then \
+      cat; \
+    else \
+      sed '/^\.\\" %IF ENABLE_NVME_DEVICESCAN/,/^\.\\" %ENDIF ENABLE_NVME_DEVICESCAN/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(os_man_filter)'; then \
+      sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \
+          -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \
+          -e '/^\.\\" %IF OS .*$(os_man_filter)/,/^\.\\" %ENDIF OS .*$(os_man_filter)/ s,^,!!,' \
+          -e '/^\.\\" %IF OS ./,/^\.\\" %ENDIF OS ./ s,^,.\\"\# ,' \
+          -e '/^!*\.\\" %IF NOT OS ./,/^!*\.\\" %ENDIF NOT OS ./ s,^,!!,' \
+          -e 's,^!!!*\.\\"! \(.*\)$$,\1 \\"\#,' \
+          -e 's,^!!!*,,' ; \
+    else \
+      cat; \
+    fi; }
+
+
+# Build Solaris specific man pages
+SOLARIS_MAN_FILTER = \
+    sed -e '/^\.TH/s, \([58]\) , !!\1!! ,' \
+        -e '/^\.BR/s, (\([578]\)), (!!\1!!),' \
+        -e 's,\\fP(\([578]\)),\\fP(!!\1!!),g' \
+        -e 's,!!5!!,4,g' -e 's,!!7!!,5,g' -e 's,!!8!!,1m,g' \
+        -e 's,/var/log/messages,/var/adm/messages,g'
+
+
+# Convert man pages into .html, .pdf and .txt
+# TODO: configure
+MAN2HTML = man2html
+#MAN2HTML = groff -man -Thtml
+MAN2PDF = man -Tpdf -l
+#MAN2PDF = groff -man -Tpdf
+MAN2TXT = groff -man -Tascii -P'-bcou'
+
+# Remove HTTP header and fix links in man2html output
+FIXHTML = sed -e '1s,^Content-type.*,,' \
+              -e 's,<A HREF="[^"]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
+              -e 's,<A HREF="[^"]*/man2html">,<A HREF=".">,g' \
+              -e 's,<A HREF="[^"]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
+              -e 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
+
+
+# Convert version for VERSIONINFO resource: 6.6 r4519 -> 6.6.0.4519,
+# set description, name, version and year
+@OS_WIN32_MINGW_TRUE@WIN_RC_FILTER = { \
+@OS_WIN32_MINGW_TRUE@    ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'` && \
+@OS_WIN32_MINGW_TRUE@    rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h` && \
+@OS_WIN32_MINGW_TRUE@    txtver="$${ver:-0.0.0}.$${rev:-0}" && binver=`echo "$$txtver" | sed 's|\.|,|g'` && \
+@OS_WIN32_MINGW_TRUE@    yy=`sed -n 's,^.*DATE[^"]*"20\([0-9][0-9]\).*$$,\1,p' svnversion.h` && yy="$${yy:-XX}" && \
+@OS_WIN32_MINGW_TRUE@    sed -e "s|@DESC@|$$d|" -e "s|@NAME@|$$n|" -e "s|@BINARY_VERSION@|$$binver|g" \
+@OS_WIN32_MINGW_TRUE@        -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; }
+
+@OS_WIN32_MINGW_TRUE@WIN_MAKE_RES = \
+@OS_WIN32_MINGW_TRUE@    echo "n=$$n d=\"$$d"'"; $$(WIN_RC_FILTER) < $< > $@'; \
+@OS_WIN32_MINGW_TRUE@    $(WIN_RC_FILTER) < $< > $@
+
+@OS_WIN32_MINGW_TRUE@WIN_APP_MANIFEST = \
+@OS_WIN32_MINGW_TRUE@    if test -n '$(os_win32_manifest)'; then \
+@OS_WIN32_MINGW_TRUE@      echo "echo '1 24 \"$(srcdir)/$(os_win32_manifest)\"' >> $@"; \
+@OS_WIN32_MINGW_TRUE@      echo '1 24 "$(srcdir)/$(os_win32_manifest)"' >> $@; \
+@OS_WIN32_MINGW_TRUE@    fi
+
+@OS_WIN32_MINGW_TRUE@@OS_WIN64_FALSE@win_bits = 32
+
+# Definitions for Windows distribution
+@OS_WIN32_MINGW_TRUE@@OS_WIN64_TRUE@win_bits = 64
+@OS_WIN32_MINGW_TRUE@distdir_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)
+@OS_WIN32_MINGW_TRUE@distzip_win32 = $(PACKAGE)-$(VERSION).win$(win_bits).zip
+@OS_WIN32_MINGW_TRUE@distinst_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)-setup.exe
+@OS_WIN32_MINGW_TRUE@exedir_win32 = $(distdir_win32)/bin
+@OS_WIN32_MINGW_TRUE@docdir_win32 = $(distdir_win32)/doc
+@OS_WIN32_MINGW_TRUE@EXEFILES_WIN32 = $(exedir_win32)/smartctl.exe \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/smartctl-nc.exe \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/smartd.exe \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/smartd_mailer.ps1 \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/smartd_mailer.conf.sample.ps1 \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/smartd_warning.cmd \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/runcmda.exe \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/runcmdu.exe \
+@OS_WIN32_MINGW_TRUE@  $(exedir_win32)/wtssendmsg.exe \
+@OS_WIN32_MINGW_TRUE@  $(am__append_24)
+@OS_WIN32_MINGW_TRUE@FILES_WIN32 = $(EXEFILES_WIN32) \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/AUTHORS.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/ChangeLog.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/ChangeLog-5.0-6.0.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/COPYING.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/INSTALL.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/NEWS.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/README.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/TODO.txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/checksums$(win_bits).txt \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartd.conf \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartctl.8.html \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartctl.8.pdf \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartd.8.html \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartd.8.pdf \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartd.conf.5.html \
+@OS_WIN32_MINGW_TRUE@  $(docdir_win32)/smartd.conf.5.pdf \
+@OS_WIN32_MINGW_TRUE@  $(am__append_25)
+
+# Note: Only use without options to be compatible with all variants
+@OS_WIN32_MINGW_TRUE@UNIX2DOS = unix2dos
+
+# Build os_win32/vc14/{config.h,smart*.rc,svnversion.h} for MSVC14 from MinGW files
+@OS_WIN32_MINGW_TRUE@vcver = 14
+@OS_WIN32_MINGW_TRUE@CONFIG_VC_FILES = \
+@OS_WIN32_MINGW_TRUE@        $(srcdir)/os_win32/vc$(vcver)/config.h \
+@OS_WIN32_MINGW_TRUE@        $(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc \
+@OS_WIN32_MINGW_TRUE@        $(srcdir)/os_win32/vc$(vcver)/smartd_res.rc \
+@OS_WIN32_MINGW_TRUE@        $(srcdir)/os_win32/vc$(vcver)/svnversion.h
+
+
+# Definitions for OSX distribution
+@OS_DARWIN_TRUE@distdir_darwin = $(PACKAGE)-$(VERSION).darwin
+@OS_DARWIN_TRUE@dmg_darwin = $(PACKAGE)-$(VERSION).dmg
+@OS_DARWIN_TRUE@pkg_darwin = $(PACKAGE)-$(VERSION).pkg
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .c .s .o .obj
+am--refresh: Makefile
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @test -f $@ || rm -f stamp-h1
+       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f config.h stamp-h1
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-sbinPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+       -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+
+smartctl$(EXEEXT): $(smartctl_OBJECTS) $(smartctl_DEPENDENCIES) $(EXTRA_smartctl_DEPENDENCIES) 
+       @rm -f smartctl$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(smartctl_OBJECTS) $(smartctl_LDADD) $(LIBS)
+
+smartd$(EXEEXT): $(smartd_OBJECTS) $(smartd_DEPENDENCIES) $(EXTRA_smartd_DEPENDENCIES) 
+       @rm -f smartd$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(smartd_OBJECTS) $(smartd_LDADD) $(LIBS)
+install-examplesSCRIPTS: $(examples_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(examples_SCRIPTS)'; test -n "$(examplesdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(examplesdir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(examplesdir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-examplesSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(examples_SCRIPTS)'; test -n "$(examplesdir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(examplesdir)'; $(am__uninstall_files_from_dir)
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-sbinSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
+install-smartdscriptSCRIPTS: $(smartdscript_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(smartdscript_SCRIPTS)'; test -n "$(smartdscriptdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(smartdscriptdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(smartdscriptdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(smartdscriptdir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(smartdscriptdir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-smartdscriptSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(smartdscript_SCRIPTS)'; test -n "$(smartdscriptdir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(smartdscriptdir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atacmdnames.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atacmds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ataidentify.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ataprint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cciss.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon_win32.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_areca.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_ata_cmd_set.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_intelliprop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_interface.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_legacy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/knowndrives.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvmecmds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvmeprint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_darwin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_freebsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_generic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_linux.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_netbsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_openbsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_os2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_qnxnto.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_solaris.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_win32.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsiata.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsicmds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsiprint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartctl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog_win32.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmiquery.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+getopt.o: getopt/getopt.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.o -MD -MP -MF $(DEPDIR)/getopt.Tpo -c -o getopt.o `test -f 'getopt/getopt.c' || echo '$(srcdir)/'`getopt/getopt.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/getopt.Tpo $(DEPDIR)/getopt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='getopt/getopt.c' object='getopt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.o `test -f 'getopt/getopt.c' || echo '$(srcdir)/'`getopt/getopt.c
+
+getopt.obj: getopt/getopt.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.obj -MD -MP -MF $(DEPDIR)/getopt.Tpo -c -o getopt.obj `if test -f 'getopt/getopt.c'; then $(CYGPATH_W) 'getopt/getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt/getopt.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/getopt.Tpo $(DEPDIR)/getopt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='getopt/getopt.c' object='getopt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f 'getopt/getopt.c'; then $(CYGPATH_W) 'getopt/getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt/getopt.c'; fi`
+
+getopt1.o: getopt/getopt1.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt1.o -MD -MP -MF $(DEPDIR)/getopt1.Tpo -c -o getopt1.o `test -f 'getopt/getopt1.c' || echo '$(srcdir)/'`getopt/getopt1.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/getopt1.Tpo $(DEPDIR)/getopt1.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='getopt/getopt1.c' object='getopt1.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt1.o `test -f 'getopt/getopt1.c' || echo '$(srcdir)/'`getopt/getopt1.c
+
+getopt1.obj: getopt/getopt1.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt1.obj -MD -MP -MF $(DEPDIR)/getopt1.Tpo -c -o getopt1.obj `if test -f 'getopt/getopt1.c'; then $(CYGPATH_W) 'getopt/getopt1.c'; else $(CYGPATH_W) '$(srcdir)/getopt/getopt1.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/getopt1.Tpo $(DEPDIR)/getopt1.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='getopt/getopt1.c' object='getopt1.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt1.obj `if test -f 'getopt/getopt1.c'; then $(CYGPATH_W) 'getopt/getopt1.c'; else $(CYGPATH_W) '$(srcdir)/getopt/getopt1.c'; fi`
+
+regex.o: regex/regex.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regex.o -MD -MP -MF $(DEPDIR)/regex.Tpo -c -o regex.o `test -f 'regex/regex.c' || echo '$(srcdir)/'`regex/regex.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regex.Tpo $(DEPDIR)/regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regex.c' object='regex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regex.o `test -f 'regex/regex.c' || echo '$(srcdir)/'`regex/regex.c
+
+regex.obj: regex/regex.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regex.obj -MD -MP -MF $(DEPDIR)/regex.Tpo -c -o regex.obj `if test -f 'regex/regex.c'; then $(CYGPATH_W) 'regex/regex.c'; else $(CYGPATH_W) '$(srcdir)/regex/regex.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regex.Tpo $(DEPDIR)/regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regex.c' object='regex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regex.obj `if test -f 'regex/regex.c'; then $(CYGPATH_W) 'regex/regex.c'; else $(CYGPATH_W) '$(srcdir)/regex/regex.c'; fi`
+
+regcomp.o: regex/regcomp.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regcomp.o -MD -MP -MF $(DEPDIR)/regcomp.Tpo -c -o regcomp.o `test -f 'regex/regcomp.c' || echo '$(srcdir)/'`regex/regcomp.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regcomp.Tpo $(DEPDIR)/regcomp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regcomp.c' object='regcomp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regcomp.o `test -f 'regex/regcomp.c' || echo '$(srcdir)/'`regex/regcomp.c
+
+regcomp.obj: regex/regcomp.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regcomp.obj -MD -MP -MF $(DEPDIR)/regcomp.Tpo -c -o regcomp.obj `if test -f 'regex/regcomp.c'; then $(CYGPATH_W) 'regex/regcomp.c'; else $(CYGPATH_W) '$(srcdir)/regex/regcomp.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regcomp.Tpo $(DEPDIR)/regcomp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regcomp.c' object='regcomp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regcomp.obj `if test -f 'regex/regcomp.c'; then $(CYGPATH_W) 'regex/regcomp.c'; else $(CYGPATH_W) '$(srcdir)/regex/regcomp.c'; fi`
+
+regexec.o: regex/regexec.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regexec.o -MD -MP -MF $(DEPDIR)/regexec.Tpo -c -o regexec.o `test -f 'regex/regexec.c' || echo '$(srcdir)/'`regex/regexec.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regexec.Tpo $(DEPDIR)/regexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regexec.c' object='regexec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regexec.o `test -f 'regex/regexec.c' || echo '$(srcdir)/'`regex/regexec.c
+
+regexec.obj: regex/regexec.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regexec.obj -MD -MP -MF $(DEPDIR)/regexec.Tpo -c -o regexec.obj `if test -f 'regex/regexec.c'; then $(CYGPATH_W) 'regex/regexec.c'; else $(CYGPATH_W) '$(srcdir)/regex/regexec.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regexec.Tpo $(DEPDIR)/regexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regexec.c' object='regexec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regexec.obj `if test -f 'regex/regexec.c'; then $(CYGPATH_W) 'regex/regexec.c'; else $(CYGPATH_W) '$(srcdir)/regex/regexec.c'; fi`
+
+regex_internal.o: regex/regex_internal.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regex_internal.o -MD -MP -MF $(DEPDIR)/regex_internal.Tpo -c -o regex_internal.o `test -f 'regex/regex_internal.c' || echo '$(srcdir)/'`regex/regex_internal.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regex_internal.Tpo $(DEPDIR)/regex_internal.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regex_internal.c' object='regex_internal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regex_internal.o `test -f 'regex/regex_internal.c' || echo '$(srcdir)/'`regex/regex_internal.c
+
+regex_internal.obj: regex/regex_internal.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT regex_internal.obj -MD -MP -MF $(DEPDIR)/regex_internal.Tpo -c -o regex_internal.obj `if test -f 'regex/regex_internal.c'; then $(CYGPATH_W) 'regex/regex_internal.c'; else $(CYGPATH_W) '$(srcdir)/regex/regex_internal.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/regex_internal.Tpo $(DEPDIR)/regex_internal.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='regex/regex_internal.c' object='regex_internal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o regex_internal.obj `if test -f 'regex/regex_internal.c'; then $(CYGPATH_W) 'regex/regex_internal.c'; else $(CYGPATH_W) '$(srcdir)/regex/regex_internal.c'; fi`
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+wmiquery.o: os_win32/wmiquery.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wmiquery.o -MD -MP -MF $(DEPDIR)/wmiquery.Tpo -c -o wmiquery.o `test -f 'os_win32/wmiquery.cpp' || echo '$(srcdir)/'`os_win32/wmiquery.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/wmiquery.Tpo $(DEPDIR)/wmiquery.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/wmiquery.cpp' object='wmiquery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wmiquery.o `test -f 'os_win32/wmiquery.cpp' || echo '$(srcdir)/'`os_win32/wmiquery.cpp
+
+wmiquery.obj: os_win32/wmiquery.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wmiquery.obj -MD -MP -MF $(DEPDIR)/wmiquery.Tpo -c -o wmiquery.obj `if test -f 'os_win32/wmiquery.cpp'; then $(CYGPATH_W) 'os_win32/wmiquery.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/wmiquery.cpp'; fi`
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/wmiquery.Tpo $(DEPDIR)/wmiquery.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/wmiquery.cpp' object='wmiquery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wmiquery.obj `if test -f 'os_win32/wmiquery.cpp'; then $(CYGPATH_W) 'os_win32/wmiquery.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/wmiquery.cpp'; fi`
+
+daemon_win32.o: os_win32/daemon_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT daemon_win32.o -MD -MP -MF $(DEPDIR)/daemon_win32.Tpo -c -o daemon_win32.o `test -f 'os_win32/daemon_win32.cpp' || echo '$(srcdir)/'`os_win32/daemon_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/daemon_win32.Tpo $(DEPDIR)/daemon_win32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/daemon_win32.cpp' object='daemon_win32.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o daemon_win32.o `test -f 'os_win32/daemon_win32.cpp' || echo '$(srcdir)/'`os_win32/daemon_win32.cpp
+
+daemon_win32.obj: os_win32/daemon_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT daemon_win32.obj -MD -MP -MF $(DEPDIR)/daemon_win32.Tpo -c -o daemon_win32.obj `if test -f 'os_win32/daemon_win32.cpp'; then $(CYGPATH_W) 'os_win32/daemon_win32.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/daemon_win32.cpp'; fi`
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/daemon_win32.Tpo $(DEPDIR)/daemon_win32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/daemon_win32.cpp' object='daemon_win32.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o daemon_win32.obj `if test -f 'os_win32/daemon_win32.cpp'; then $(CYGPATH_W) 'os_win32/daemon_win32.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/daemon_win32.cpp'; fi`
+
+syslog_win32.o: os_win32/syslog_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT syslog_win32.o -MD -MP -MF $(DEPDIR)/syslog_win32.Tpo -c -o syslog_win32.o `test -f 'os_win32/syslog_win32.cpp' || echo '$(srcdir)/'`os_win32/syslog_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/syslog_win32.Tpo $(DEPDIR)/syslog_win32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/syslog_win32.cpp' object='syslog_win32.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o syslog_win32.o `test -f 'os_win32/syslog_win32.cpp' || echo '$(srcdir)/'`os_win32/syslog_win32.cpp
+
+syslog_win32.obj: os_win32/syslog_win32.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT syslog_win32.obj -MD -MP -MF $(DEPDIR)/syslog_win32.Tpo -c -o syslog_win32.obj `if test -f 'os_win32/syslog_win32.cpp'; then $(CYGPATH_W) 'os_win32/syslog_win32.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/syslog_win32.cpp'; fi`
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) $(DEPDIR)/syslog_win32.Tpo $(DEPDIR)/syslog_win32.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='os_win32/syslog_win32.cpp' object='syslog_win32.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o syslog_win32.obj `if test -f 'os_win32/syslog_win32.cpp'; then $(CYGPATH_W) 'os_win32/syslog_win32.cpp'; else $(CYGPATH_W) '$(srcdir)/os_win32/syslog_win32.cpp'; fi`
+
+.s.o:
+       $(AM_V_CCAS)$(CCASCOMPILE) -c -o $@ $<
+
+.s.obj:
+       $(AM_V_CCAS)$(CCASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+install-man5: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man5dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.5[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man5:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man5dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.5[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
+install-man8: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man8dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.8[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man8:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man8dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.8[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
+install-docsDATA: $(docs_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(docsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(docsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \
+       done
+
+uninstall-docsDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(docsdir)'; $(am__uninstall_files_from_dir)
+install-drivedbDATA: $(drivedb_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(drivedb_DATA)'; test -n "$(drivedbdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(drivedbdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(drivedbdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(drivedbdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(drivedbdir)" || exit $$?; \
+       done
+
+uninstall-drivedbDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(drivedb_DATA)'; test -n "$(drivedbdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(drivedbdir)'; $(am__uninstall_files_from_dir)
+install-examplesDATA: $(examples_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(examples_DATA)'; test -n "$(examplesdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(examplesdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesdir)" || exit $$?; \
+       done
+
+uninstall-examplesDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(examples_DATA)'; test -n "$(examplesdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(examplesdir)'; $(am__uninstall_files_from_dir)
+install-systemdsystemunitDATA: $(systemdsystemunit_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \
+       done
+
+uninstall-systemdsystemunitDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+       -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+       $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_remove_distdir)
+
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+       $(am__post_remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__post_remove_distdir)
+
+dist-shar: distdir
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+       $(am__post_remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__post_remove_distdir)
+
+dist dist-all:
+       $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+       $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+       chmod a-w $(distdir)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=../.. --prefix="$$dc_install_base" \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__post_remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-am
+@OS_SOLARIS_FALSE@all-local:
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) config.h \
+               all-local
+installdirs: installdirs-local
+       for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(smartdscriptdir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docsdir)" "$(DESTDIR)$(drivedbdir)" "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-docsDATA \
+       install-drivedbDATA install-examplesDATA \
+       install-examplesSCRIPTS install-initdDATA install-man \
+       install-smartdscriptSCRIPTS install-systemdsystemunitDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS \
+       install-sysconfDATA
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+@OS_SOLARIS_FALSE@install-man: install-man5 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-docsDATA uninstall-drivedbDATA \
+       uninstall-examplesDATA uninstall-examplesSCRIPTS \
+       uninstall-initdDATA uninstall-man uninstall-sbinPROGRAMS \
+       uninstall-sbinSCRIPTS uninstall-smartdscriptSCRIPTS \
+       uninstall-sysconfDATA uninstall-systemdsystemunitDATA
+
+@OS_SOLARIS_FALSE@uninstall-man: uninstall-man5 uninstall-man8
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
+       check-am clean clean-cscope clean-generic clean-sbinPROGRAMS \
+       cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+       dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+       distcheck distclean distclean-compile distclean-generic \
+       distclean-hdr distclean-tags distcleancheck distdir \
+       distuninstallcheck dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am \
+       install-data-local install-docsDATA install-drivedbDATA \
+       install-dvi install-dvi-am install-examplesDATA \
+       install-examplesSCRIPTS install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-initdDATA install-man install-man5 install-man8 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-sbinPROGRAMS install-sbinSCRIPTS \
+       install-smartdscriptSCRIPTS install-strip install-sysconfDATA \
+       install-systemdsystemunitDATA installcheck installcheck-am \
+       installdirs installdirs-local maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-docsDATA uninstall-drivedbDATA \
+       uninstall-examplesDATA uninstall-examplesSCRIPTS \
+       uninstall-initdDATA uninstall-man uninstall-man5 \
+       uninstall-man8 uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+       uninstall-smartdscriptSCRIPTS uninstall-sysconfDATA \
+       uninstall-systemdsystemunitDATA
+
+.PRECIOUS: Makefile
+
+
+@SET_MAKE@
+
+@OS_SOLARIS_TRUE@all-local: $(extra_MANS)
+@OS_SOLARIS_TRUE@install-man: $(extra_MANS)
+@OS_SOLARIS_TRUE@      @$(NORMAL_INSTALL)
+@OS_SOLARIS_TRUE@      $(MKDIR_P) '$(DESTDIR)$(mandir)/man4'
+@OS_SOLARIS_TRUE@      $(MKDIR_P) '$(DESTDIR)$(mandir)/man1m'
+@OS_SOLARIS_TRUE@      for i in $(extra_MANS); do \
+@OS_SOLARIS_TRUE@        if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+@OS_SOLARIS_TRUE@        else file=$$i; fi; \
+@OS_SOLARIS_TRUE@        ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$inst | sed -e 's/^.*\///'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+@OS_SOLARIS_TRUE@        echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
+@OS_SOLARIS_TRUE@        $(INSTALL_DATA) "$$file" "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
+@OS_SOLARIS_TRUE@      done
+@OS_SOLARIS_TRUE@uninstall-man:
+@OS_SOLARIS_TRUE@      @$(NORMAL_UNINSTALL)
+@OS_SOLARIS_TRUE@      for i in $(extra_MANS); do \
+@OS_SOLARIS_TRUE@        if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+@OS_SOLARIS_TRUE@        else file=$$i; fi; \
+@OS_SOLARIS_TRUE@        ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$inst | sed -e 's/^.*\///'`; \
+@OS_SOLARIS_TRUE@        inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+@OS_SOLARIS_TRUE@        echo " rm -f '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
+@OS_SOLARIS_TRUE@        rm -f "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
+@OS_SOLARIS_TRUE@      done
+
+# If modified smartd.conf exists install smartd.conf.sample instead
+install-sysconfDATA: $(sysconf_DATA)
+       $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'
+       @s="$(srcdir)/smartd.conf"; \
+       f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
+       if test -z "$(smartd_suffix)" && test -f "$$f"; then \
+         if cmp "$$s" "$$f" >/dev/null 2>/dev/null; then :; else \
+           echo "************************************************************"; \
+           echo "*** $$f preserved"; \
+           echo "*** installing smartd.conf.sample instead"; \
+           echo "************************************************************"; \
+           f="$$f".sample; \
+         fi; \
+       fi; \
+       echo " $(INSTALL_DATA) '$$s' '$$f'"; \
+       $(INSTALL_DATA) "$$s" "$$f"
+
+# If smartd.conf.sample exists preserve smartd.conf
+uninstall-sysconfDATA:
+       @f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
+       if test -z "$(smartd_suffix)" && test -f "$$f".sample; then \
+         echo "************************************************************"; \
+         echo "*** $$f preserved"; \
+         echo "*** removing smartd.conf.sample instead"; \
+         echo "************************************************************"; \
+         f="$$f".sample; \
+       fi; \
+       echo " rm -f '$$f'"; \
+       rm -f "$$f"
+
+utility.o: svnversion.h
+
+# Get version info from SVN
+@IS_SVN_BUILD_TRUE@svnversion.h: ChangeLog Makefile $(svn_deps)
+@IS_SVN_BUILD_TRUE@    @echo ' svn info | $$(VERSION_FROM_SVN_INFO) > $@'
+@IS_SVN_BUILD_TRUE@    @echo '/* svnversion.h.  Generated by Makefile from svn info.  */' > $@
+@IS_SVN_BUILD_TRUE@    @(cd $(srcdir) \
+@IS_SVN_BUILD_TRUE@     && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV  "\1",p' \
+@IS_SVN_BUILD_TRUE@     && TZ= LC_ALL=C svn info 2>/dev/null \
+@IS_SVN_BUILD_TRUE@     | sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
+@IS_SVN_BUILD_TRUE@    | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
+
+# SVN not available, guess version info from Id strings
+@IS_SVN_BUILD_FALSE@svnversion.h: ChangeLog Makefile NEWS
+@IS_SVN_BUILD_FALSE@   @echo ' cat ChangeLog NEWS $$(SOURCES) | $$(VERSION_FROM_SVN_IDS) > $@'
+@IS_SVN_BUILD_FALSE@   @echo '/* svnversion.h.  Generated by Makefile from Id strings.  */' > $@
+@IS_SVN_BUILD_FALSE@   @(cd $(srcdir) && cat ChangeLog NEWS Makefile.am configure.ac smart*.in *.cpp *.h) \
+@IS_SVN_BUILD_FALSE@   | sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
+@IS_SVN_BUILD_FALSE@   | sort -n -r \
+@IS_SVN_BUILD_FALSE@   | sed -n 'h;s,^\([^ ]*\) .*$$,REV  "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
+@IS_SVN_BUILD_FALSE@   | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
+
+update-smart-drivedb: update-smart-drivedb.in config.status
+       $(SHELL) ./config.status --file=$@
+       chmod +x $@
+
+smartd_warning.sh: smartd_warning.sh.in config.status
+       $(SHELL) ./config.status --file=$@
+       chmod +x $@
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@com.smartmontools.smartd.plist : os_darwin/com.smartmontools.smartd.plist.in
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@      sed "s|/usr/sbin/|$(sbindir)/|" $< > $@
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@install-initdDATA-darwin: $(initd_DATA)
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@      $(MKDIR_P) '$(DESTDIR)$(initddir)'
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@      $(INSTALL_DATA) $(top_builddir)/$(initd_DATA) $(DESTDIR)$(initddir)/$(initd_DATA)
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@uninstall-initdDATA-darwin:
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_TRUE@      rm -f $(DESTDIR)$(initddir)/$(initd_DATA)
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@$(initdfile): $(srcdir)/$(initdfile).in Makefile
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@     sed 's|/usr/local/sbin/|$(sbindir)/|g' $(srcdir)/$(initdfile).in > $@
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@install-initdDATA-generic: $(initd_DATA)
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@     $(MKDIR_P) '$(DESTDIR)$(initddir)'
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@     $(INSTALL_SCRIPT) '$(top_builddir)/$(initdfile)' '$(DESTDIR)$(initddir)/smartd$(smartd_suffix)'
+
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@uninstall-initdDATA-generic:
+@INSTALL_INITSCRIPT_TRUE@@OS_DARWIN_FALSE@     rm -f '$(DESTDIR)$(initddir)/$(initd_install_name)'
+
+@INSTALL_INITSCRIPT_FALSE@install-initdDATA-null:
+@INSTALL_INITSCRIPT_FALSE@uninstall-initdDATA-null:
+
+install-initdDATA : $(initd_DATA_install)
+
+uninstall-initdDATA: $(initd_DATA_uninstall)
+
+smartd.service: smartd.service.in Makefile
+       @echo ' $$(SMARTD_SERVICE_FILTER) < $(srcdir)/smartd.service.in > $@'
+       @{ \
+       sed 's|/usr/local/sbin/smartd|$(sbindir)/smartd|' | \
+       if test -n '$(systemdenvfile)'; then \
+         sed 's|/usr/local/etc/sysconfig/smartmontools|$(systemdenvfile)|'; \
+       else \
+         sed -e '/^EnvironmentFile=/d' -e 's| *\$$smartd[_a-z]* *||g'; \
+       fi; } < $(srcdir)/smartd.service.in > $@
+
+# Create empty directories if configured.
+# Default install rules no longer create empty directories since automake 1.11.
+installdirs-local:
+       @for d in '$(smartdplugindir)' '$(savestatesdir)' '$(attributelogdir)'; do \
+         test -n "$$d" || continue; \
+         echo " $(MKDIR_P) '$(DESTDIR)$$d'"; \
+         $(MKDIR_P) "$(DESTDIR)$$d" || exit 1; \
+       done
+
+install-data-local: installdirs-local
+
+# Implicit rule 'smart%: smart%.in ...' does not work with BSD make
+smartctl.8: smartctl.8.in Makefile svnversion.h
+       @echo ' $$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@'
+       @$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@
+
+smartd.8: smartd.8.in Makefile svnversion.h
+       @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@'
+       @$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@
+
+smartd.conf.5: smartd.conf.5.in Makefile svnversion.h
+       @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@'
+       @$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@
+
+update-smart-drivedb.8: update-smart-drivedb.8.in Makefile svnversion.h
+       @echo ' $$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@'
+       @$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@
+
+smartctl.1m: smartctl.8
+       @echo ' $$(SOLARIS_MAN_FILTER) < smartctl.8 > $@'
+       @$(SOLARIS_MAN_FILTER) < smartctl.8 > $@
+
+smartd.1m: smartd.8
+       @echo ' $$(SOLARIS_MAN_FILTER) < smartd.8 > $@'
+       @$(SOLARIS_MAN_FILTER) < smartd.8 > $@
+
+smartd.conf.4: smartd.conf.5
+       @echo ' $$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@'
+       @$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@
+
+update-smart-drivedb.1m: update-smart-drivedb.8
+       @echo ' $$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@'
+       @$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@
+
+htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html update-smart-drivedb.8.html
+
+pdfman:  smartctl.8.pdf smartd.8.pdf smartd.conf.5.pdf update-smart-drivedb.8.pdf
+
+txtman:  smartctl.8.txt smartd.8.txt smartd.conf.5.txt update-smart-drivedb.8.txt
+
+%.5.html: %.5
+       $(MAN2HTML) $< > $@.tmp
+       @echo ' $$(FIXHTML) < $@.tmp > $@'
+       @$(FIXHTML) < $@.tmp > $@
+
+%.8.html: %.8
+       $(MAN2HTML) $< > $@.tmp
+       @echo ' $$(FIXHTML) < $@.tmp > $@'
+       @$(FIXHTML) < $@.tmp > $@
+
+%.5.pdf: %.5
+       $(MAN2PDF) $< > $@
+
+%.8.pdf: %.8
+       $(MAN2PDF) $< > $@
+
+%.5.txt: %.5
+       $(MAN2TXT) $< > $@
+
+%.8.txt: %.8
+       $(MAN2TXT) $< > $@
+
+# Check drive database syntax
+check:
+       @if ./smartctl -B $(srcdir)/drivedb.h -P showall >/dev/null; then \
+         echo "$(srcdir)/drivedb.h: OK"; \
+       else \
+         echo "$(srcdir)/drivedb.h: Syntax check failed"; exit 1; \
+       fi
+
+# Windows resources
+
+@OS_WIN32_MINGW_TRUE@smartctl_res.o: smartctl_res.rc $(os_win32_manifest)
+@OS_WIN32_MINGW_TRUE@  $(WINDRES) $< $@
+
+@OS_WIN32_MINGW_TRUE@smartd_res.o: smartd_res.rc syslogevt.rc $(os_win32_manifest)
+@OS_WIN32_MINGW_TRUE@  $(WINDRES) $< $@
+
+@OS_WIN32_MINGW_TRUE@runcmda_res.o: runcmda_res.rc defadmin.manifest
+@OS_WIN32_MINGW_TRUE@  $(WINDRES) $< $@
+
+@OS_WIN32_MINGW_TRUE@runcmdu_res.o: runcmdu_res.rc $(os_win32_manifest)
+@OS_WIN32_MINGW_TRUE@  $(WINDRES) $< $@
+
+@OS_WIN32_MINGW_TRUE@wtssendmsg_res.o: wtssendmsg_res.rc $(os_win32_manifest)
+@OS_WIN32_MINGW_TRUE@  $(WINDRES) $< $@
+
+@OS_WIN32_MINGW_TRUE@smartctl_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+@OS_WIN32_MINGW_TRUE@  @n=smartctl d="Control and Monitor Utility for SMART Disks"; $(WIN_MAKE_RES)
+@OS_WIN32_MINGW_TRUE@  @$(WIN_APP_MANIFEST)
+
+@OS_WIN32_MINGW_TRUE@smartd_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+@OS_WIN32_MINGW_TRUE@  @n=smartd d="SMART Disk Monitoring Daemon"; $(WIN_MAKE_RES)
+@OS_WIN32_MINGW_TRUE@  echo '#include "./syslogevt.rc"' >> $@
+@OS_WIN32_MINGW_TRUE@  @$(WIN_APP_MANIFEST)
+
+@OS_WIN32_MINGW_TRUE@runcmdu_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+@OS_WIN32_MINGW_TRUE@  @n=runcmdu d="Run console command"; $(WIN_MAKE_RES)
+@OS_WIN32_MINGW_TRUE@  @$(WIN_APP_MANIFEST)
+
+@OS_WIN32_MINGW_TRUE@runcmda_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+@OS_WIN32_MINGW_TRUE@  @n=runcmda d="Run console command as admin"; $(WIN_MAKE_RES)
+@OS_WIN32_MINGW_TRUE@  echo '1 24 "./defadmin.manifest"' >> $@
+
+@OS_WIN32_MINGW_TRUE@wtssendmsg_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
+@OS_WIN32_MINGW_TRUE@  @n=wtssendmsg d="Send console messages"; $(WIN_MAKE_RES)
+@OS_WIN32_MINGW_TRUE@  @$(WIN_APP_MANIFEST)
+
+@OS_WIN32_MINGW_TRUE@syslogevt.rc: os_win32/syslogevt.mc
+@OS_WIN32_MINGW_TRUE@  $(WINDMC) -b $<
+
+@OS_WIN32_MINGW_TRUE@defadmin.manifest: os_win32/default.manifest
+@OS_WIN32_MINGW_TRUE@  sed 's,"asInvoker","requireAdministrator",' $< > $@
+
+# Build Windows distribution
+
+@OS_WIN32_MINGW_TRUE@dist-win32: $(distzip_win32)
+
+@OS_WIN32_MINGW_TRUE@install-win32: $(distinst_win32)
+@OS_WIN32_MINGW_TRUE@  ./$(distinst_win32)
+
+@OS_WIN32_MINGW_TRUE@installer-win32: $(distinst_win32)
+
+@OS_WIN32_MINGW_TRUE@distdir-win32: distdir.mkdir $(FILES_WIN32)
+
+@OS_WIN32_MINGW_TRUE@$(distzip_win32): distdir.mkdir $(FILES_WIN32)
+@OS_WIN32_MINGW_TRUE@  @rm -fv $(distzip_win32)
+@OS_WIN32_MINGW_TRUE@  cd $(distdir_win32) && zip -9 ../$(distzip_win32) bin/* doc/*
+@OS_WIN32_MINGW_TRUE@  md5sum $@ > $@.md5
+@OS_WIN32_MINGW_TRUE@  sha1sum $@ > $@.sha1
+@OS_WIN32_MINGW_TRUE@  sha256sum $@ > $@.sha256
+
+# Build NSIS installer
+# Note: Only option character '-' is also compatible with Linux version of makensis
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@$(distinst_win32): os_win32/installer.nsi distdir.mkdir $(FILES_WIN32)
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      test -z '$(builddir_win64)' || ( cd $(builddir_win64) && make distdir-win32 )
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      @date=`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h` && \
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      rev=`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h` && \
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      verstr="$(PACKAGE_VERSION) $$date $$rev "$(BUILD_INFO) && \
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      d64= && if [ -n '$(builddir_win64)' ]; then d64='-DINPDIR64=$(builddir_win64)/$(PACKAGE)-$(VERSION).win64'; fi && \
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      echo "'$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR='$$verstr' $<" && \
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      '$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR="$$verstr" $<
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      md5sum $@ > $@.md5
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      sha1sum $@ > $@.sha1
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      sha256sum $@ > $@.sha256
+
+# Build drivedb.h update tool
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@update-smart-drivedb.exe: os_win32/update-smart-drivedb.nsi
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_TRUE@      "$(MAKENSIS)" -V2 -NOCD -DBRANCH=$(DRIVEDB_BRANCH) $<
+
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_FALSE@$(distinst_win32):
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_FALSE@     @echo "makensis: command not found. Please install NSIS from http://nsis.sourceforge.net/" 1>&2
+@OS_WIN32_MINGW_TRUE@@OS_WIN32_NSIS_FALSE@     @exit 1
+
+@OS_WIN32_MINGW_TRUE@cleandist-win32:
+@OS_WIN32_MINGW_TRUE@  rm -rf $(distdir_win32) distdir.mkdir
+
+@OS_WIN32_MINGW_TRUE@distdir.mkdir:
+@OS_WIN32_MINGW_TRUE@  @test -d $(exedir_win32) || mkdir -pv $(exedir_win32)
+@OS_WIN32_MINGW_TRUE@  @test -d $(docdir_win32) || mkdir -pv $(docdir_win32)
+@OS_WIN32_MINGW_TRUE@  touch $@
+
+@OS_WIN32_MINGW_TRUE@$(exedir_win32)/%.exe: %.exe
+@OS_WIN32_MINGW_TRUE@  cp -p $< $@
+@OS_WIN32_MINGW_TRUE@  if test -n '$(STRIP)'; then $(STRIP) -s $@; else strip -s $@; fi
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+# strip would break NSIS integrity check
+@OS_WIN32_MINGW_TRUE@$(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe
+@OS_WIN32_MINGW_TRUE@  cp -p $< $@
+
+@OS_WIN32_MINGW_TRUE@$(exedir_win32)/%.h: $(srcdir)/%.h
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(exedir_win32)/%.cmd: $(srcdir)/os_win32/%.cmd
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(exedir_win32)/%.ps1: $(srcdir)/os_win32/%.ps1
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(docdir_win32)/%.html: %.html
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(docdir_win32)/%.pdf: %.pdf
+@OS_WIN32_MINGW_TRUE@  cp -p $< $@
+
+@OS_WIN32_MINGW_TRUE@$(docdir_win32)/%.txt: $(srcdir)/%
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(docdir_win32)/%.conf: $(srcdir)/%.conf
+@OS_WIN32_MINGW_TRUE@  $(UNIX2DOS) < $< > $@
+@OS_WIN32_MINGW_TRUE@  touch -r $< $@
+
+@OS_WIN32_MINGW_TRUE@$(docdir_win32)/checksums$(win_bits).txt: $(EXEFILES_WIN32)
+@OS_WIN32_MINGW_TRUE@  (cd $(exedir_win32) && md5sum *.exe && sha1sum *.exe && sha256sum *.exe) \
+@OS_WIN32_MINGW_TRUE@  | $(UNIX2DOS) > $@
+
+# Build non-console version of smartctl for GSmartControl.
+# The script below changes the word at offset 220 (Subsystem) from 3
+# (Console) to 2 (GUI) in a copy of smartctl.exe.
+# This will be changed when a tool (like 'editbin') is available in
+# the Cygwin distribution
+@OS_WIN32_MINGW_TRUE@smartctl-nc.exe: smartctl.exe
+@OS_WIN32_MINGW_TRUE@  @rm -f $@
+@OS_WIN32_MINGW_TRUE@  cp -p smartctl.exe $@.tmp
+@OS_WIN32_MINGW_TRUE@  @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 3; then :; \
+@OS_WIN32_MINGW_TRUE@    else echo "invalid EXE header"; exit 1; fi
+@OS_WIN32_MINGW_TRUE@  @echo "editbin /subsystem:windows $@.tmp"
+@OS_WIN32_MINGW_TRUE@  @echo -ne '\002' | dd bs=1 seek=220 count=1 conv=notrunc of=$@.tmp 2>/dev/null
+@OS_WIN32_MINGW_TRUE@  @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 2; then :; \
+@OS_WIN32_MINGW_TRUE@    else echo "EXE patch failed"; exit 1; fi
+@OS_WIN32_MINGW_TRUE@  mv -f $@.tmp $@
+
+# Build runcmd?.exe and wtssendmsg.exe
+@OS_WIN32_MINGW_TRUE@runcmd.o: os_win32/runcmd.c
+@OS_WIN32_MINGW_TRUE@  $(CC) -c -Os $<
+
+@OS_WIN32_MINGW_TRUE@runcmdu.exe: runcmd.o runcmdu_res.o
+@OS_WIN32_MINGW_TRUE@  $(CC) -o $@ $^
+
+@OS_WIN32_MINGW_TRUE@runcmda.exe: runcmd.o runcmda_res.o
+@OS_WIN32_MINGW_TRUE@  $(CC) -o $@ $^
+
+@OS_WIN32_MINGW_TRUE@wtssendmsg.exe: os_win32/wtssendmsg.c wtssendmsg_res.o
+@OS_WIN32_MINGW_TRUE@  $(CC) -Os -o $@ $^ -lwtsapi32
+
+@OS_WIN32_MINGW_TRUE@config-vc$(vcver): $(CONFIG_VC_FILES)
+
+@OS_WIN32_MINGW_TRUE@$(srcdir)/os_win32/vc$(vcver)/config.h: config.h Makefile
+@OS_WIN32_MINGW_TRUE@  sed -e '1i/* os_win32/vc$(vcver)/config.h.  Generated from config.h by Makefile.  */' \
+@OS_WIN32_MINGW_TRUE@      -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|[DK_]*NTDDDISK_H\|STRINGS_H\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */ /* VC$(vcver) */,' \
+@OS_WIN32_MINGW_TRUE@      -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc$(vcver),' $< > $@
+
+@OS_WIN32_MINGW_TRUE@$(srcdir)/os_win32/vc$(vcver)/svnversion.h: svnversion.h
+@OS_WIN32_MINGW_TRUE@  cp $< $@
+
+@OS_WIN32_MINGW_TRUE@$(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc: smartctl_res.rc
+@OS_WIN32_MINGW_TRUE@  sed '/^1 24 /d' $< > $@
+
+@OS_WIN32_MINGW_TRUE@$(srcdir)/os_win32/vc$(vcver)/smartd_res.rc: smartd_res.rc
+@OS_WIN32_MINGW_TRUE@  sed '/^1 24 /d' $< > $@
+
+@OS_WIN32_MINGW_TRUE@clean-vc$(vcver):
+@OS_WIN32_MINGW_TRUE@  rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.VC.opendb
+@OS_WIN32_MINGW_TRUE@  rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.db
+@OS_WIN32_MINGW_TRUE@  rm -f $(srcdir)/os_win32/vc$(vcver)/syslogevt.h
+@OS_WIN32_MINGW_TRUE@  rm -rf $(srcdir)/os_win32/vc$(vcver)/Debug
+@OS_WIN32_MINGW_TRUE@  rm -rf $(srcdir)/os_win32/vc$(vcver)/Release
+@OS_WIN32_MINGW_TRUE@  rm -rf $(srcdir)/os_win32/vc$(vcver)/x64
+
+@OS_WIN32_MINGW_TRUE@distclean-vc$(vcver): clean-vc$(vcver)
+@OS_WIN32_MINGW_TRUE@  rm -f $(CONFIG_VC_FILES)
+
+@OS_WIN32_MINGW_TRUE@maintainer-clean-vc$(vcver): distclean-vc$(vcver)
+@OS_WIN32_MINGW_TRUE@  rm -rf $(srcdir)/os_win32/vc$(vcver)/.vs
+
+# build darwin installer 
+@OS_DARWIN_TRUE@$(pkg_darwin):
+@OS_DARWIN_TRUE@       ${MAKE} install DESTDIR=$(distdir_darwin)/root
+@OS_DARWIN_TRUE@       @cp $(srcdir)/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall $(distdir_darwin)/root$(sbindir)
+@OS_DARWIN_TRUE@       @mkdir -p $(distdir_darwin)/pkg
+@OS_DARWIN_TRUE@       @( cd $(distdir_darwin)/root && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > $(distdir_darwin)/pkg/Payload
+@OS_DARWIN_TRUE@       PAYLOAD_FILES=`find $(distdir_darwin)/root | wc -l` &&\
+@OS_DARWIN_TRUE@       PAYLOAD_SIZEKB=`du -BK  -s $(distdir_darwin)/root|${AWK} '{print $$1}'|tr -d 'K'` &&\
+@OS_DARWIN_TRUE@       sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" \
+@OS_DARWIN_TRUE@               -e "s|@size@|$${PAYLOAD_SIZEKB}|" $(srcdir)/os_darwin/pkg/PackageInfo.in \
+@OS_DARWIN_TRUE@               > $(distdir_darwin)/pkg/PackageInfo &&\
+@OS_DARWIN_TRUE@       sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" -e "s|@size@|$${PAYLOAD_SIZEKB}|" \
+@OS_DARWIN_TRUE@               -e "s|@pkgname@|$(pkg_darwin)|" \
+@OS_DARWIN_TRUE@               $(srcdir)/os_darwin/pkg/Distribution.in > $(distdir_darwin)/pkg/Distribution
+@OS_DARWIN_TRUE@       @mkdir -p $(distdir_darwin)/pkg/Resources/English.lproj
+@OS_DARWIN_TRUE@       @cp $(srcdir)/COPYING $(distdir_darwin)/pkg/Resources/English.lproj/license.txt
+@OS_DARWIN_TRUE@       @mkbom -u 0 -g 80 $(distdir_darwin)/root $(distdir_darwin)/pkg/Bom
+@OS_DARWIN_TRUE@       @mkdir -p $(distdir_darwin)/dmg
+@OS_DARWIN_TRUE@       @( cd $(distdir_darwin)/pkg && xar --compression none -cf "../dmg/$(pkg_darwin)" * )
+
+# build darwon dmg image
+@OS_DARWIN_TRUE@$(dmg_darwin):
+@OS_DARWIN_TRUE@       @cp $(srcdir)/os_darwin/pkg/installer/README.html $(distdir_darwin)/dmg
+@OS_DARWIN_TRUE@       @mkisofs -V 'smartmontools' -no-pad -r -apple -o $(distdir_darwin)/smartmontools-$(VERSION).iso \
+@OS_DARWIN_TRUE@               -hfs-bless "$(distdir_darwin)/dmg/" "$(distdir_darwin)/dmg/"
+@OS_DARWIN_TRUE@       @dmg dmg $(distdir_darwin)/smartmontools-$(VERSION).iso $(dmg_darwin)
+@OS_DARWIN_TRUE@       md5sum $@ > $@.md5
+@OS_DARWIN_TRUE@       sha1sum $@ > $@.sha1
+@OS_DARWIN_TRUE@       sha256sum $@ > $@.sha256
+
+@OS_DARWIN_TRUE@install-darwin: install-darwin-cleanup $(pkg_darwin) $(dmg_darwin)
+
+@OS_DARWIN_TRUE@install-darwin-cleanup: 
+@OS_DARWIN_TRUE@       @rm -rf $(distdir_darwin)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
index 6db7d288586c2ab90b81653a14d8054163621a8e..b070e9ff7454c25c2b7063468d34d0f87d3e1d7f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,68 @@
 smartmontools NEWS
 ------------------
-$Id: NEWS 4318 2016-05-07 11:18:20Z chrfranke $
+$Id: NEWS 4594 2017-11-05 15:21:35Z chrfranke $
 
 The most up-to-date version of this file is:
-http://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/NEWS
+https://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/NEWS
+
+Date 2017-11-05
+Summary: smartmontools release 6.6
+-----------------------------------------------------------
+- smartctl '-i' and '--identify': ATA ACS-4 and SATA 3.3 enhancements.
+- smartctl: Control ATA write cache through SCT Feature Control
+  with '-s wcache-sct,ata|on|off[,p]' and '-g wcache-sct'.
+- smartctl: Print ATA Pending Defects log with '-l defects'.
+- smartctl '-s wcreorder,on|off': New persistent flag ',p'.
+- smartctl '-s standby': Prevent temporary drive spinup.
+- smartctl '-n POWERMODE': New parameter to set exit status.
+- smartctl '-g security': ATA Security Level check fixed.
+- smartctl '-l scttemp*': Print minimum supported ERC Time Limit.
+- smartctl '-q noserial': Now also suppresses "SAS address" output.
+- smartctl '-i': Print IEEE EUI-64 of NVMe namespace.
+- smartctl '-c': Print NVMe 1.3 feature flags.
+- smartctl '-A': Print NVMe 1.3 thermal temperature transition
+  statistic.
+- smartctl '-g/s dsn': Get/set ATA DSN.
+- smartd: Uses also device identify information to detect for duplicate
+  devices.
+- smartd '-e dsn' directive: Set ATA DSN.
+- smartd: Improved SCSI/SAS temperature logging.
+- smartd: Silence emails and log messages on open errors of
+  '-d removable' devices.
+- smartd: Exit on device open error unless '-q never' or '-d removable'
+  is specified (regression).
+- update-smart-drivedb: Now authenticates downloaded file with GnuPG.
+- update-smart-drivedb: New options '--trunk', '--no-verify' and
+  '--export-key'.
+- Device type '-d intelliprop,N' for IntelliProp controllers.
+- SCSI: Default timeout increased to 1 minute.
+- configure: New options '--with-gnupg', '--with-scriptpath' and
+  '--with-update-smart-drivedb=X.Y'
+- configure: Checks for C++11 support option and requires
+  '--with[out]-cxx11-option' if option unknown or no C++11 support.
+- HDD, SSD and USB additions to drive database.
+- New smartmontools-* mailing list addresses.
+- Man page formatting reworked.
+- Linux: Uses SG_IO V4 API if supported.
+- Linux: Devices behind hpsa driver are no longer detected as regular
+  SCSI devices.
+- Darwin: Initial NVMe support based on undocumented API.
+- FreeBSD: Fix panic on INVARIANTS enabled kernel.
+- FreeBSD: Improve ATA SMART STATUS check for legacy controllers.
+- FreeBSD: Compile fix for FreeBSD-11 and newer.
+- NetBSD: NVMe support.
+- NetBSD: Full 28-bit ATA support.
+- NetBSD: Compile fix.
+- NetBSD: Use a raw disk device file.
+- OpenBSD: Compile fix.
+- OS/2: Support for the OS2AHCI driver, updating source code,
+  adding autoscan support, adding self-test support.
+- Windows: Support for Windows 10 NVMe driver (stornvme.sys).
+- Windows: Fix CSMI access for IRST driver 15.2.
+- Windows smartd: Ability to run PowerShell scripts with '-M exec'.
+- Windows smartd: New PowerShell script to send smartd warning emails
+  without external tools.
+- Windows package: Now provides PDF man pages.
 
 Date 2016-05-07
 Summary: smartmontools release 6.5
diff --git a/README b/README
index 6d20c011416592a689c10aa87aa0b16481c28824..f7dc1036e2cf4914c5b05a2942d24d96118ab7c5 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ smartmontools - S.M.A.R.T. utility toolset for Darwin/Mac
 OSX, FreeBSD, Linux, NetBSD, OpenBSD, Solaris, and Windows.
 ==========================================================
 
-$Id: README 4120 2015-08-27 16:12:21Z samm2 $
+$Id: README 4431 2017-08-08 19:38:15Z chrfranke $
 
 == HOME ==
 The home for smartmontools is located at:
@@ -15,7 +15,7 @@ patches and bug reports.
 
 You will find a mailing list for support and other questions at:
 
-    http://lists.sourceforge.net/lists/listinfo/smartmontools-support
+    https://listi.jpberlin.de/mailman/listinfo/smartmontools-support
 
 
 == COPYING ==
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..315c1b2
--- /dev/null
@@ -0,0 +1,1209 @@
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.15'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.15.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Figure out how to run the assembler.                      -*- Autoconf -*-
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_AM_DEPENDENCIES([CC])],
+                 [m4_define([AC_PROG_CC],
+                            m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                 [_AM_DEPENDENCIES([CXX])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES([OBJC])],
+                 [m4_define([AC_PROG_OBJC],
+                            m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+                 [_AM_DEPENDENCIES([OBJCXX])],
+                 [m4_define([AC_PROG_OBJCXX],
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+       && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
+  rm -rf conftest.dir
+
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/pkg.m4])
index 9a57c175c797e3cb2a7154e55f6f8f9e31214e07..ad4eaddffd8ba27d24eab3dcb17d07b3c9d60446 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2003-8 Philip Williams
- * Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2012 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-const char * atacmdnames_cpp_cvsid = "$Id: atacmdnames.cpp 4120 2015-08-27 16:12:21Z samm2 $"
+const char * atacmdnames_cpp_cvsid = "$Id: atacmdnames.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   ATACMDNAMES_H_CVSID;
 
 const char cmd_reserved[]        = "[RESERVED]";
index 20f99eda2ace97efab4ae853d11c427ef14c89a2..63f09d89afd0f5722e2b5fb57bf8e33de79f9d87 100644 (file)
@@ -5,7 +5,6 @@
  * specification, which is available from http://www.t13.org/#FTP_site
  *
  * Home page of code is: http://www.smartmontools.org
- * Address of support mailing list: smartmontools-support@lists.sourceforge.net
  *
  * Copyright (C) 2003-8 Philip Williams
  *
@@ -23,7 +22,7 @@
 #ifndef ATACMDNAMES_H_
 #define ATACMDNAMES_H_
 
-#define ATACMDNAMES_H_CVSID "$Id: atacmdnames.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define ATACMDNAMES_H_CVSID "$Id: atacmdnames.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 /* Returns the name of the command (and possibly sub-command) with the given
    command code and feature register values. */
index f1974916c8c08a7b2517198c60b0679a35e77c5b..d92d4cd523ab05d504ed4d556c73c1f173940f90 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-11 Bruce Allen
- * Copyright (C) 2008-15 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
  *
@@ -36,7 +36,7 @@
 #include "utility.h"
 #include "dev_ata_cmd_set.h" // for parsed_ata_device
 
-const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 4301 2016-04-16 20:48:29Z chrfranke $"
+const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 4582 2017-11-03 20:54:56Z chrfranke $"
                                  ATACMDS_H_CVSID;
 
 // Print ATA debug messages?
@@ -339,6 +339,16 @@ void swap8(char *location){
   return;
 }
 
+// When using the overloaded swapx() function with member of packed ATA structs,
+// it is required to pass a possibly unaligned pointer as argument.
+// Clang++ 4.0 prints -Waddress-of-packed-member warning in this case.
+// The SWAPV() macro below is a replacement which prevents the use of such pointers.
+template <typename T>
+static T get_swapx_val(T x)
+  { swapx(&x); return x; }
+
+#define SWAPV(x)  ((x) = get_swapx_val(x))
+
 // Invalidate serial number and WWN and adjust checksum in IDENTIFY data
 static void invalidate_serno(ata_identify_device * id)
 {
@@ -355,13 +365,13 @@ static void invalidate_serno(ata_identify_device * id)
 #ifndef __NetBSD__
   bool must_swap = !!isbigendian();
   if (must_swap)
-    swapx(id->words088_255+255-88);
+    SWAPV(id->words088_255[255-88]);
 #endif
   if ((id->words088_255[255-88] & 0x00ff) == 0x00a5)
     id->words088_255[255-88] += sum << 8;
 #ifndef __NetBSD__
   if (must_swap)
-    swapx(id->words088_255+255-88);
+    SWAPV(id->words088_255[255-88]);
 #endif
 }
 
@@ -538,6 +548,7 @@ int smartcommandhandler(ata_device * device, smart_command_set command, int sele
         break;
       case STATUS_CHECK:
         in.out_needed.lba_high = in.out_needed.lba_mid = true; // Status returned here
+        /* FALLTHRU */
       case STATUS:
         in.in_regs.features = ATA_SMART_STATUS;
         break;
@@ -1001,7 +1012,7 @@ int ataReadSmartValues(ata_device * device, struct ata_smart_values *data){
     swap2((char *)&(data->revnumber));
     swap2((char *)&(data->total_time_to_complete_off_line));
     swap2((char *)&(data->smart_capability));
-    swapx(&data->extend_test_completion_time_w);
+    SWAPV(data->extend_test_completion_time_w);
     for (i=0; i<NUMBER_ATA_SMART_ATTRIBUTES; i++){
       struct ata_smart_attribute *x=data->vendor_attributes+i;
       swap2((char *)&(x->flags));
@@ -1088,15 +1099,45 @@ bool ataReadExtSelfTestLog(ata_device * device, ata_smart_extselftestlog * log,
   check_multi_sector_sum(log, nsectors, "SMART Extended Self-test Log Structure");
 
   if (isbigendian()) {
-    swapx(&log->log_desc_index);
+    SWAPV(log->log_desc_index);
     for (unsigned i = 0; i < nsectors; i++) {
       for (unsigned j = 0; j < 19; j++)
-        swapx(&log->log_descs[i].timestamp);
+        SWAPV(log->log_descs[i].timestamp);
     }
   }
   return true;
 }
 
+// Write GP Log page(s)
+bool ataWriteLogExt(ata_device * device, unsigned char logaddr,
+                    unsigned page, void * data, unsigned nsectors)
+{
+  ata_cmd_in in;
+  in.in_regs.command      = ATA_WRITE_LOG_EXT;
+  in.set_data_out(data, nsectors);
+  in.in_regs.lba_low      = logaddr;
+  in.in_regs.lba_mid_16   = page;
+  in.set_data_out(data, nsectors);
+
+  ata_cmd_out out;
+  if (!device->ata_pass_through(in, out)) { // TODO: Debug output
+    if (nsectors <= 1) {
+      pout("ATA_WRITE_LOG_EXT (addr=0x%02x, page=%u, n=%u) failed: %s\n",
+           logaddr, page, nsectors, device->get_errmsg());
+      return false;
+    }
+
+    // Recurse to retry with single sectors,
+    // multi-sector reads may not be supported by ioctl.
+    for (unsigned i = 0; i < nsectors; i++) {
+      if (!ataWriteLogExt(device, logaddr, page + i,
+                         (char *)data + 512*i, 1))
+        return false;
+    }
+  }
+
+  return true;
+}
 
 // Read GP Log page(s)
 bool ataReadLogExt(ata_device * device, unsigned char logaddr,
@@ -1165,7 +1206,7 @@ int ataReadLogDirectory(ata_device * device, ata_smart_log_directory * data, boo
 
   // swap endian order if needed
   if (isbigendian())
-    swapx(&data->logversion);
+    SWAPV(data->logversion);
 
   return 0;
 }
@@ -1488,13 +1529,13 @@ bool ataReadExtErrorLog(ata_device * device, ata_smart_exterrlog * log,
   check_multi_sector_sum(log, nsectors, "SMART Extended Comprehensive Error Log Structure");
 
   if (isbigendian()) {
-    swapx(&log->device_error_count);
-    swapx(&log->error_log_index);
+    SWAPV(log->device_error_count);
+    SWAPV(log->error_log_index);
     for (unsigned i = 0; i < nsectors; i++) {
       for (unsigned j = 0; j < 4; j++) {
         for (unsigned k = 0; k < 5; k++)
-           swapx(&log[i].error_logs[j].commands[k].timestamp);
-        swapx(&log[i].error_logs[j].error.timestamp);
+           SWAPV(log[i].error_logs[j].commands[k].timestamp);
+        SWAPV(log[i].error_logs[j].error.timestamp);
       }
     }
   }
@@ -2227,15 +2268,16 @@ int ataReadSCTStatus(ata_device * device, ata_sct_status_response * sts)
 
   // swap endian order if needed
   if (isbigendian()){
-    swapx(&sts->format_version);
-    swapx(&sts->sct_version);
-    swapx(&sts->sct_spec);
-    swapx(&sts->ext_status_code);
-    swapx(&sts->action_code);
-    swapx(&sts->function_code);
-    swapx(&sts->over_limit_count);
-    swapx(&sts->under_limit_count);
-    swapx(&sts->smart_status);
+    SWAPV(sts->format_version);
+    SWAPV(sts->sct_version);
+    SWAPV(sts->sct_spec);
+    SWAPV(sts->ext_status_code);
+    SWAPV(sts->action_code);
+    SWAPV(sts->function_code);
+    SWAPV(sts->over_limit_count);
+    SWAPV(sts->under_limit_count);
+    SWAPV(sts->smart_status);
+    SWAPV(sts->min_erc_time);
   }
 
   // Check format version
@@ -2268,9 +2310,9 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
 
   // swap endian order if needed
   if (isbigendian()) {
-    swapx(&cmd.action_code);
-    swapx(&cmd.function_code);
-    swapx(&cmd.table_id);
+    SWAPV(cmd.action_code);
+    SWAPV(cmd.function_code);
+    SWAPV(cmd.table_id);
   }
 
   // write command via SMART log page 0xe0
@@ -2298,17 +2340,19 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
 
   // swap endian order if needed
   if (isbigendian()){
-    swapx(&tmh->format_version);
-    swapx(&tmh->sampling_period);
-    swapx(&tmh->interval);
-    swapx(&tmh->cb_index);
-    swapx(&tmh->cb_size);
+    SWAPV(tmh->format_version);
+    SWAPV(tmh->sampling_period);
+    SWAPV(tmh->interval);
+    SWAPV(tmh->cb_index);
+    SWAPV(tmh->cb_size);
   }
   return 0;
 }
 
-// Get/Set Write Cache Reordering
-int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool persistent, bool set)
+// Common function for Get/Set SCT Feature Control:
+// Write Cache, Write Cache Reordering, etc.
+static int ataGetSetSCTFeatureControl(ata_device * device, unsigned short feature_code,
+                                      unsigned short state, bool persistent, bool set)
 {
   // Check initial status
   ata_sct_status_response sts;
@@ -2327,17 +2371,17 @@ int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool pers
   // CAUTION: DO NOT CHANGE THIS VALUE (SOME ACTION CODES MAY ERASE DISK)
   cmd.action_code   = 4; // Feature Control command
   cmd.function_code  = (set ? 1 : 2); // 1=Set, 2=Get
-  cmd.feature_code  = 2; //  Enable/Disable Write Cache Reordering 
-  cmd.state         = (enable ? 1 : 2); // 1 enable, 2 disable
+  cmd.feature_code  = feature_code;
+  cmd.state         = state;
   cmd.option_flags  = (persistent ? 0x01 : 0x00);
 
   // swap endian order if needed
   if (isbigendian()) {
-    swapx(&cmd.action_code);
-    swapx(&cmd.function_code);
-    swapx(&cmd.feature_code);
-    swapx(&cmd.state);
-    swapx(&cmd.option_flags);
+    SWAPV(cmd.action_code);
+    SWAPV(cmd.function_code);
+    SWAPV(cmd.feature_code);
+    SWAPV(cmd.state);
+    SWAPV(cmd.option_flags);
   }
 
   // write command via SMART log page 0xe0
@@ -2359,7 +2403,7 @@ int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool pers
       (!set ? 'G' : 'S'), device->get_errmsg());
     return -1;
   }
-  int state = out.out_regs.sector_count | (out.out_regs.lba_low << 8);
+  state = out.out_regs.sector_count | (out.out_regs.lba_low << 8);
 
   // re-read and check SCT status
   if (ataReadSCTStatus(device, &sts))
@@ -2373,6 +2417,19 @@ int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool pers
   return state;
 }
 
+// Get/Set Write Cache Reordering
+int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool persistent, bool set)
+{
+  return ataGetSetSCTFeatureControl(device, 2 /* Enable/Disable Write Cache Reordering */,
+                                    (enable ? 1 : 2), persistent, set);
+}
+
+// Get/Set Write Cache (force enable, force disable,
+int ataGetSetSCTWriteCache(ata_device * device, unsigned short state, bool persistent, bool set)
+{
+  return ataGetSetSCTFeatureControl(device, 1 /* Enable/Disable Write Cache */,
+                                    state, persistent, set);
+}
 
 // Set SCT Temperature Logging Interval
 int ataSetSCTTempInterval(ata_device * device, unsigned interval, bool persistent)
@@ -2400,11 +2457,11 @@ int ataSetSCTTempInterval(ata_device * device, unsigned interval, bool persisten
 
   // swap endian order if needed
   if (isbigendian()) {
-    swapx(&cmd.action_code);
-    swapx(&cmd.function_code);
-    swapx(&cmd.feature_code);
-    swapx(&cmd.state);
-    swapx(&cmd.option_flags);
+    SWAPV(cmd.action_code);
+    SWAPV(cmd.function_code);
+    SWAPV(cmd.feature_code);
+    SWAPV(cmd.state);
+    SWAPV(cmd.option_flags);
   }
 
   // write command via SMART log page 0xe0
@@ -2452,10 +2509,10 @@ static int ataGetSetSCTErrorRecoveryControltime(ata_device * device, unsigned ty
 
   // swap endian order if needed
   if (isbigendian()) {
-    swapx(&cmd.action_code);
-    swapx(&cmd.function_code);
-    swapx(&cmd.selection_code);
-    swapx(&cmd.time_limit);
+    SWAPV(cmd.action_code);
+    SWAPV(cmd.function_code);
+    SWAPV(cmd.selection_code);
+    SWAPV(cmd.time_limit);
   }
 
   // write command via SMART log page 0xe0
index 5768677acd2fec3b18b13572ab1a2a2ec14d08f0..cbb20b62628969ccd11ec1adaa5e8c7d45e8c5fa 100644 (file)
--- a/atacmds.h
+++ b/atacmds.h
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-11 Bruce Allen
- * Copyright (C) 2008-15 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #ifndef ATACMDS_H_
 #define ATACMDS_H_
 
-#define ATACMDS_H_CVSID "$Id: atacmds.h 4162 2015-10-31 16:36:16Z chrfranke $"
+#define ATACMDS_H_CVSID "$Id: atacmds.h 4419 2017-04-17 13:20:31Z chrfranke $"
 
 #include "dev_interface.h" // ata_device
 
@@ -74,7 +74,10 @@ typedef enum {
 #define ATA_IDLE                        0xe3
 #define ATA_SMART_CMD                   0xb0
 #define ATA_SECURITY_FREEZE_LOCK        0xf5
+#ifndef ATA_SET_FEATURES
 #define ATA_SET_FEATURES                0xef
+#endif
+#define ATA_STANDBY                     0xe2
 #define ATA_STANDBY_IMMEDIATE           0xe0
 
 // SET_FEATURES subcommands
@@ -86,9 +89,11 @@ typedef enum {
 #define ATA_ENABLE_APM                  0x05
 #define ATA_ENABLE_WRITE_CACHE          0x02
 #define ATA_ENABLE_READ_LOOK_AHEAD      0xaa
+#define ATA_ENABLE_DISABLE_DSN          0x63
 
 // 48-bit commands
 #define ATA_READ_LOG_EXT                0x2F
+#define ATA_WRITE_LOG_EXT               0x3F
 
 // ATA Specification Feature Register Values (SMART Subcommands).
 // Note that some are obsolete as of ATA-7.
@@ -546,7 +551,8 @@ struct ata_sct_status_response
   unsigned int over_limit_count;    // 206-209: # intervals since last reset with temperature > Max Op Limit
   unsigned int under_limit_count;   // 210-213: # intervals since last reset with temperature < Min Op Limit
   unsigned short smart_status;      // 214-215: LBA(32:8) of SMART RETURN STATUS (0, 0x2cf4, 0xc24f) (ACS-4)
-  unsigned char bytes216_479[479-216+1]; // 216-479: reserved
+  unsigned short min_erc_time;      // 216-217: Minimum supported value for ERC (ACS-4)
+  unsigned char bytes216_479[479-218+1]; // 218-479: reserved
   unsigned char vendor_specific[32];// 480-511: vendor specific
 } ATTR_PACKED;
 #pragma pack()
@@ -779,6 +785,10 @@ int ataReadSelfTestLog(ata_device * device, ata_smart_selftestlog * data,
 int ataReadSelectiveSelfTestLog(ata_device * device, struct ata_selective_self_test_log *data);
 int ataReadLogDirectory(ata_device * device, ata_smart_log_directory *, bool gpl);
 
+// Write GP Log page(s)
+bool ataWriteLogExt(ata_device * device, unsigned char logaddr,
+                    unsigned page, void * data, unsigned nsectors);
+
 // Read GP Log page(s)
 bool ataReadLogExt(ata_device * device, unsigned char logaddr,
                    unsigned char features, unsigned page,
@@ -844,6 +854,12 @@ int ataSmartSupport(const ata_identify_device * drive);
 // -1: error
 int ataGetSetSCTWriteCacheReordering(ata_device * device, bool enable, bool persistent, bool set);
 
+// Return values:
+// 1: Write cache controled by ATA Set Features command
+// 2: Force enable write cache
+// 3: Force disable write cache
+int ataGetSetSCTWriteCache(ata_device * device, unsigned short state, bool persistent, bool set);
+
 // Return values:
 //  1: SMART enabled
 //  0: SMART disabled
index ec3c40edd7d3f5256442ce468748aec2d1598809..c56ba888a31190c7bb2762f1f515dac14a068de4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2012-15 Christian Franke
+ * Copyright (C) 2012-17 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #include "config.h"
 #include "ataidentify.h"
 
-const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 4120 2015-08-27 16:12:21Z samm2 $"
+const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 4573 2017-10-29 15:13:58Z chrfranke $"
   ATAIDENTIFY_H_CVSID;
 
 #include "int64.h"
@@ -34,7 +34,7 @@ const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 4120 2015-08-27 16:12
 // Tables 29 and 39 of T13/1699-D (ATA8-ACS) Revision 6a, September 6, 2008
 // Tables 50 and 61 of T13/2015-D (ACS-2) Revision 7, June 22, 2011
 // Tables 45 and 50 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
-// Table 44 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015 (ATAPI removed)
+// Table 55 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017 (ATAPI removed)
 
 const char * const identify_descriptions[] = {
   "  0 General configuration",
@@ -121,8 +121,8 @@ const char * const identify_descriptions[] = {
     ". 11 Cmds during sanitize as specified by this standard", // ACS-3
     ". 10 SANITIZE ANTIFREEZE LOCK EXT supported", // ACS-3
     ". 9 Reserved",
-    ". 8 Bits 7:0 are valid",
-    ". 7:0 Current sectors per DRQ on READ/WRITE MULTIPLE",
+    ". 8 Bits 7:0 are valid [OBS-ACS-4]",
+    ". 7:0 Current number of sectors per DRQ [OBS-ACS-4]",
 
   " 60-61 User addressable sectors for 28-bit commands (DWord)",
   " 62 Single Word DMA modes [OBS-3]",
@@ -190,7 +190,9 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 77 Serial ATA additional capabilities", // ACS-3
-    ". 15:7 Reserved for Serial ATA",
+    ". 15:9 Reserved for Serial ATA",
+    ". 8 Power Disable feature always enabled", // ACS-4
+    ". 7 DevSleep to ReducedPwrState supported", // ACS-4
     ". 6 RECEIVE/SEND FPDMA QUEUED supported",
     ". 5 NCQ Queue Management supported",
     ". 4 NCQ Streaming supported",
@@ -198,7 +200,12 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 78 Serial ATA features supported",
-    ". 15:8 Reserved for Serial ATA",
+    ". 15:13 Reserved for Serial ATA",
+    ". 12 Power Disable feature supported", // ACS-4
+    ". 11 Rebuild Assist feature set supported", // ACS-4
+    ". 10 Reserved for Serial ATA",
+    ". 9 Hybrid Information supported", // ACS-4
+    ". 8 Device Sleep feature supported", // ACS-4
     ". 7 NCQ Autosense supported", // ACS-3
     ". 6 Software Settings Preservation supported",
     ". 5 Hardware Feature Control supported", // ACS-3
@@ -209,7 +216,11 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 79 Serial ATA features enabled",
-    ". 15:8 Reserved for Serial ATA",
+    ". 15:12 Reserved for Serial ATA",
+    ". 11 Rebuild Assist feature set enabled", // ACS-4
+    ". 10 Power Disable feature enabled", // ACS-4
+    ". 9 Hybrid Information enabled", // ACS-4
+    ". 8 Device Sleep feature enabled", // ACS-4
     ". 7 Automatic Partial to Slumber transitions enabled", // ACS-3
     ". 6 Software Settings Preservation enabled",
     ". 5 Hardware Feature Control enabled", // ACS-3
@@ -225,9 +236,9 @@ const char * const identify_descriptions[] = {
     ". 10 ACS-3 supported",
     ". 9 ACS-2 supported",
     ". 8 ATA8-ACS supported",
-    ". 7 ATA/ATAPI-7 supported",
-    ". 6 ATA/ATAPI-6 supported",
-    ". 5 ATA/ATAPI-5 supported",
+    ". 7 ATA/ATAPI-7 supported [OBS-ACS-4]",
+    ". 6 ATA/ATAPI-6 supported [OBS-ACS-4]",
+    ". 5 ATA/ATAPI-5 supported [OBS-ACS-4]",
     ". 4 ATA/ATAPI-4 supported [OBS-8]",
     ". 3 ATA-3 supported [OBS-7]",
     ". 2 ATA-2 supported [OBS-6]",
@@ -278,10 +289,10 @@ const char * const identify_descriptions[] = {
     ". 10 URG bit for WRITE STREAM (DMA) EXT supported [OBS-8]",
     ". 9 URG bit for READ STREAM (DMA) EXT supported [OBS-8]",
     ". 8 64-bit World Wide Name supported",
-    ". 7 WRITE DMA QUEUED FUA EXT supported",
+    ". 7 WRITE DMA QUEUED FUA EXT supported [OBS-ACS-2]",
     ". 6 WRITE DMA/MULTIPLE FUA EXT supported",
     ". 5 GPL feature set supported",
-    ". 4 Streaming feature set supported [OBS-ACS-3]",
+    ". 4 Streaming feature set supported",
     ". 3 Media Card Pass Through Command supported [OBS-ACS-2]",
     ". 2 Media serial number supported [RES-ACS-3]",
     ". 1 SMART self-test supported",
@@ -406,7 +417,7 @@ const char * const identify_descriptions[] = {
     ". 3:0 2^X logical sectors per physical sector",
 
   "107 Inter-seek delay for ISO 7779 acoustic testing",
-  "108-111 64-bit World Wide Name",
+  "108-111 World Wide Name",
   "112-115 Reserved", // ATA-7: Reserved for world wide name extension to 128 bits
   "116 Reserved for TLC [OBS-ACS-3]",
   "117-118 Logical sector size (DWord)",
@@ -471,7 +482,7 @@ const char * const identify_descriptions[] = {
 
   "168 Form factor",
     ". 15:4 Reserved",
-    ". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, <1.8",
+    ". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, ...", // <1.8, ACS-4: mSATA, M.2, ...
 
   "169 DATA SET MANAGEMENT command support",
     ". 15:1 Reserved",
@@ -527,10 +538,11 @@ const char * const identify_descriptions[] = {
 
   "222 Transport major version number",
     ". 15:12 Transport: 0x0 = Parallel, 0x1 = Serial, 0xe = PCIe", // PCIe: ACS-4
-    ". 11:8 Reserved    | Reserved",
-    ". 7 Reserved    | SATA 3.2",
-    ". 6 Reserved    | SATA 3.1",
-    ". 5 Reserved    | SATA 3.0",
+    ". 11:9 Reserved    | Reserved",
+    ". 8 Reserved    | SATA 3.3", // ACS-4
+    ". 7 Reserved    | SATA 3.2", // ACS-4
+    ". 6 Reserved    | SATA 3.1", // ACS-3
+    ". 5 Reserved    | SATA 3.0", // ACS-2
     ". 4 Reserved    | SATA 2.6",
     ". 3 Reserved    | SATA 2.5",
     ". 2 Reserved    | SATA II: Extensions",
@@ -626,7 +638,7 @@ void ata_print_identify_data(const void * id, bool all_words, int bit_level)
     if (bit >= 0) {
       int b;
       if (bit2 >= 0)
-        b = (w >> bit2) & ~(~0 << (bit-bit2+1));
+        b = (w >> bit2) & ~(~0U << (bit-bit2+1));
       else
         b = (w >> bit) & 1;
 
index 76593b061d787e33b253d998bcc741e33755d35b..5efb4275952cf1335f05bc655998201e71df49de 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2012 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #ifndef ATAIDENTIFY_H
 #define ATAIDENTIFY_H
 
-#define ATAIDENTIFY_H_CVSID "$Id: ataidentify.h 4120 2015-08-27 16:12:21Z samm2 $"
+#define ATAIDENTIFY_H_CVSID "$Id: ataidentify.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 void ata_print_identify_data(const void * id, bool all_words, int bit_level);
 
index fe94593caa344a86c67956c44a95628c4c170285..451622214cf6d7f589b89a78808358c62e82fefb 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-11 Bruce Allen
- * Copyright (C) 2008-16 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@
 #include "utility.h"
 #include "knowndrives.h"
 
-const char * ataprint_cpp_cvsid = "$Id: ataprint.cpp 4256 2016-03-27 16:51:32Z chrfranke $"
+const char * ataprint_cpp_cvsid = "$Id: ataprint.cpp 4573 2017-10-29 15:13:58Z chrfranke $"
                                   ATAPRINT_H_CVSID;
 
 
@@ -440,7 +440,13 @@ static int find_msb(unsigned short word)
 
 static const char * get_ata_major_version(const ata_identify_device * drive)
 {
+  // Table 13 of T13/1153D (ATA/ATAPI-4) revision 18, August 19, 1998
+  // Table 48 of T13/BSR INCITS 529 (ACS-4) Revision 16, February 21, 2017
   switch (find_msb(drive->major_rev_num)) {
+    case 14: return "ACS >4 (14)";
+    case 13: return "ACS >4 (13)";
+    case 12: return "ACS >4 (12)";
+    case 11: return "ACS-4";
     case 10: return "ACS-3";
     case  9: return "ACS-2";
     case  8: return "ATA8-ACS";
@@ -540,20 +546,22 @@ static const char * get_pata_version(unsigned short word222, char (& buf)[32])
   }
 }
 
-static const char * get_sata_version(unsigned short word222, char (& buf)[32])
+static const char * get_sata_version(unsigned short word222)
 {
   switch (find_msb(word222 & 0x0fff)) {
-    default: snprintf(buf, sizeof(buf),
-                    "SATA >3.2 (0x%03x)", word222 & 0x0fff); return buf;
-    case 7:  return "SATA 3.2";
-    case 6:  return "SATA 3.1";
-    case 5:  return "SATA 3.0";
-    case 4:  return "SATA 2.6";
-    case 3:  return "SATA 2.5";
-    case 2:  return "SATA II Ext";
-    case 1:  return "SATA 1.0a";
-    case 0:  return "ATA8-AST";
-    case -1: return "Unknown";
+    case 11: return "SATA >3.3 (11)";
+    case 10: return "SATA >3.3 (10)";
+    case  9: return "SATA >3.3 (9)";
+    case  8: return "SATA 3.3";
+    case  7: return "SATA 3.2";
+    case  6: return "SATA 3.1";
+    case  5: return "SATA 3.0";
+    case  4: return "SATA 2.6";
+    case  3: return "SATA 2.5";
+    case  2: return "SATA II Ext";
+    case  1: return "SATA 1.0a";
+    case  0: return "ATA8-AST";
+    default: return "Unknown";
   }
 }
 
@@ -697,16 +705,17 @@ static void print_drive_info(const ata_identify_device * drive,
   pout("ATA Version is:   %s\n", infofound(ataver.c_str()));
 
   // Print Transport specific version
-    // cppcheck-suppress variableScope
-  char buf[32] = "";
   unsigned short word222 = drive->words088_255[222-88];
   if (word222 != 0x0000 && word222 != 0xffff) switch (word222 >> 12) {
     case 0x0: // PATA
-      pout("Transport Type:   Parallel, %s\n", get_pata_version(word222, buf));
+      {
+        char buf[32] = "";
+        pout("Transport Type:   Parallel, %s\n", get_pata_version(word222, buf));
+      }
       break;
     case 0x1: // SATA
       {
-        const char * sataver = get_sata_version(word222, buf);
+        const char * sataver = get_sata_version(word222);
         const char * maxspeed = get_sata_maxspeed(drive);
         const char * curspeed = get_sata_curspeed(drive);
         pout("SATA Version is:  %s%s%s%s%s%s\n", sataver,
@@ -1183,8 +1192,10 @@ static unsigned GetNumLogSectors(const ata_smart_log_directory * logdir, unsigne
 // Get name of log.
 static const char * GetLogName(unsigned logaddr)
 {
-    // Table 205 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015
+    // Table A.2 of T13/2015-D (ACS-2) Revision 7, June 22, 2011
     // Table 112 of Serial ATA Revision 3.2, August 7, 2013
+    // Table A.2 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
+    // Table 204 of T13/BSR INCITS 529 (ACS-4) Revision 16, February 21, 2017
     switch (logaddr) {
       case 0x00: return "Log Directory";
       case 0x01: return "Summary SMART error log";
@@ -1200,15 +1211,15 @@ static const char * GetLogName(unsigned logaddr)
       case 0x0b: return "Reserved for CFA"; // ACS-3
       case 0x0c: return "Pending Defects log"; // ACS-4
       case 0x0d: return "LPS Mis-alignment log"; // ACS-2
-
+      case 0x0e: return "Reserved for ZAC-2"; // ACS-4
       case 0x0f: return "Sense Data for Successful NCQ Cmds log"; // ACS-4
-      case 0x10: return "SATA NCQ Queued Error log";
+      case 0x10: return "NCQ Command Error log";
       case 0x11: return "SATA Phy Event Counters log";
-    //case 0x12: return "SATA NCQ Queue Management log"; // SATA 3.0/3.1
-      case 0x12: return "SATA NCQ NON-DATA log"; // SATA 3.2
-      case 0x13: return "SATA NCQ Send and Receive log"; // SATA 3.1
-      case 0x14: return "SATA Hybrid Information log"; // SATA 3.2
-      case 0x15: return "SATA Rebuild Assist log"; // SATA 3.2
+    //case 0x12: return "SATA NCQ Queue Management log"; // SATA 3.0/3.1, ACS-3
+      case 0x12: return "SATA NCQ Non-Data log"; // SATA 3.2, ACS-4
+      case 0x13: return "SATA NCQ Send and Receive log"; // SATA 3.1, ACS-3
+      case 0x14: return "Hybrid Information log"; // SATA 3.2, ACS-4
+      case 0x15: return "Rebuild Assist log"; // SATA 3.2, ACS-4
       case 0x16:
       case 0x17: return "Reserved for Serial ATA";
 
@@ -1221,6 +1232,7 @@ static const char * GetLogName(unsigned logaddr)
       case 0x24: return "Current Device Internal Status Data log"; // ACS-3
       case 0x25: return "Saved Device Internal Status Data log"; // ACS-3
 
+      case 0x2f: return "Set Sector Configuration";; // ACS-4
       case 0x30: return "IDENTIFY DEVICE data log"; // ACS-3
 
       case 0xe0: return "SCT Command/Status";
@@ -1371,7 +1383,7 @@ static void PrintLogPages(const char * type, const unsigned char * data,
 // Device statistics (Log 0x04)
 
 // Section A.5 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
-// Section 9.5 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015
+// Section 9.5 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017
 
 struct devstat_entry_info
 {
@@ -1396,6 +1408,8 @@ const devstat_entry_info devstat_info_0x01[] = {
   {  4, "Pending Error Count" }, // ACS-4
   {  2, "Workload Utilization" }, // ACS-4
   {  6, "Utilization Usage Rate" }, // ACS-4 (TODO: field provides 3 values)
+  {  2, "Resource Availability" }, // ACS-4
+  {  1, "Random Write Resources Used" }, // ACS-4
   {  0, 0 }
 };
 
@@ -1424,6 +1438,7 @@ const devstat_entry_info devstat_info_0x04[] = {
   {  4, "Number of Reported Uncorrectable Errors" },
 //{  4, "Number of Resets Between Command Acceptance and Command Completion" },
   {  4, "Resets Between Cmd Acceptance and Completion" },
+  {  4, "Physical Element Status Changed" }, // ACS-4
   {  0, 0 }
 };
 
@@ -1468,6 +1483,7 @@ const devstat_entry_info * devstat_infos[] = {
   devstat_info_0x05,
   devstat_info_0x06,
   devstat_info_0x07
+  // TODO: 0x08 Zoned Device Statistics (T13/f16136r7, January 2017)
 };
 
 const int num_devstat_infos = sizeof(devstat_infos)/sizeof(devstat_infos[0]);
@@ -1659,6 +1675,79 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
 }
 
 
+///////////////////////////////////////////////////////////////////////
+// Pending Defects log (Log 0x0c)
+
+// Section 9.26 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017
+
+// TODO: Move to utility.h:
+static inline unsigned le32_to_uint(const unsigned char * val)
+{
+  return (   (unsigned)val[0]
+          | ((unsigned)val[1] <<  8)
+          | ((unsigned)val[2] << 16)
+          | ((unsigned)val[3] << 24));
+}
+
+static inline uint64_t le64_to_uint(const unsigned char * val)
+{
+  return (le32_to_uint(val) | ((uint64_t)le32_to_uint(val + 4) << 32));
+}
+
+static bool print_pending_defects_log(ata_device * device, unsigned nsectors,
+  unsigned max_entries)
+{
+  // Read #entries from page 0
+  unsigned char page_buf[512] = {0, };
+  if (!ataReadLogExt(device, 0x0c, 0, 0, page_buf, 1)) {
+    pout("Read Pending Defects log page 0x00 failed\n\n");
+    return false;
+  }
+
+  pout("Pending Defects log (GP Log 0x0c)\n");
+  unsigned nentries = le32_to_uint(page_buf);
+  if (!nentries) {
+    pout("No Defects Logged\n\n");
+    return true;
+  }
+
+  // Print entries
+  pout("Index                LBA    Hours\n");
+  for (unsigned i = 0, pi = 1, page = 0; i < nentries && i < max_entries; i++, pi++) {
+    // Read new page if required
+    if (pi >= 32) {
+      if (++page >= nsectors) {
+        pout("Pending Defects count %u exceeds log size (#pages=%u)\n\n",
+             nentries, nsectors);
+        return false;
+      }
+      if (!ataReadLogExt(device, 0x0c, 0, page, page_buf, 1)) {
+        pout("Read Pending Defects log page 0x%02x failed\n\n", page);
+        return false;
+      }
+      pi = 0;
+    }
+
+    const unsigned char * entry = page_buf + 16 * pi;
+    unsigned hours = le32_to_uint(entry);
+    char hourstr[32];
+    if (hours != 0xffffffffU)
+      snprintf(hourstr, sizeof(hourstr), "%u", hours);
+    else
+      hourstr[0] = '-', hourstr[1] = 0;
+    uint64_t lba = le64_to_uint(entry + 8);
+    pout("%5u %18" PRIu64 " %8s\n", i, lba, hourstr);
+  }
+
+  if (nentries > max_entries)
+    pout("... (%u entries not shown)\n", nentries - max_entries);
+  // TODO: Remove when no longer EXPERIMENTAL
+  pout("Please send sample output of above table to:\n" PACKAGE_BUGREPORT "\n");
+  pout("\n");
+  return true;
+}
+
+
 ///////////////////////////////////////////////////////////////////////
 
 // Print log 0x11
@@ -2310,7 +2399,8 @@ static int ataPrintSCTStatus(const ata_sct_status_response * sts)
     // T13/e06152r0-3 (Additional SCT Temperature Statistics), August - October 2006
     // Table 60 of T13/1699-D (ATA8-ACS) Revision 3f, December 2006  (format version 2)
     // Table 80 of T13/1699-D (ATA8-ACS) Revision 6a, September 2008 (format version 3)
-    // Table 182 of T13/BSR INCITS 529 (ACS-4) Revision 02a, May 22, 2014 (smart_status field)
+    // Table 185 of T13/BSR INCITS 529 (ACS-4) Revision 16, February 21, 2017
+    // (smart_status, min_erc_time)
     pout("Current Temperature:                    %s Celsius\n",
       sct_ptemp(sts->hda_temp, buf1));
     pout("Power Cycle Min/Max Temperature:     %s/%s Celsius\n",
@@ -2328,6 +2418,10 @@ static int ataPrintSCTStatus(const ata_sct_status_response * sts)
            (sts->smart_status == 0x2cf4 ? "FAILED" :
             sts->smart_status == 0xc24f ? "PASSED" : "Reserved"));
 
+    if (sts->min_erc_time) // ACS-4
+      pout("Minimum supported ERC Time Limit:    %d (%0.1f seconds)\n",
+           sts->min_erc_time, sts->min_erc_time/10.0);
+
     if (nonempty(sts->vendor_specific, sizeof(sts->vendor_specific))) {
       pout("Vendor specific:\n");
       for (unsigned i = 0; i < sizeof(sts->vendor_specific); i++)
@@ -2468,7 +2562,7 @@ static void print_ata_security_status(const char * msg, unsigned short state)
     }
     else {
       s1 = "ENABLED, PW level ";
-      if (!(state & 0x0020))
+      if (!(state & 0x0100))
         s2 = "HIGH";
       else
         s2 = "MAX";
@@ -2568,8 +2662,8 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
     }
     if (powername) {
       if (options.powermode >= powerlimit) {
-        pout("Device is in %s mode, exit(%d)\n", powername, FAILPOWER);
-        return FAILPOWER;
+        pout("Device is in %s mode, exit(%d)\n", powername, options.powerexit);
+        return options.powerexit;
       }
       powerchg = (powermode != 0xff); // SMART tests will spin up drives
     }
@@ -2619,6 +2713,7 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
        || options.devstat_all_pages
        || options.devstat_ssd_page
        || !options.devstat_pages.empty()
+       || options.pending_defects_log
   );
 
   unsigned i;
@@ -2638,6 +2733,8 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
        || options.sct_erc_set
        || options.sct_wcache_reorder_get
        || options.sct_wcache_reorder_set
+       || options.sct_wcache_sct_get
+       || options.sct_wcache_sct_set
   );
 
   // Exit if no further options specified
@@ -2793,6 +2890,20 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
        !(drive.cfs_enable_1 & 0x0020) ? "Disabled" : "Enabled"); // word085
   }
 
+  // Print DSN status
+  unsigned short word120 = drive.words088_255[120-88];
+  unsigned short word119 = drive.words088_255[119-88];
+  if (options.get_dsn) {
+    if (!(drive.word086 & 0x8000) // word086
+       || ((word119 & 0xc200) != 0x4200) // word119
+       || ((word120 & 0xc000) != 0x4000)) // word120
+      pout("DSN feature is:   Unavailable\n");
+    else if (word120 & 0x200) // word120
+      pout("DSN feature is:   Enabled\n");
+    else
+      pout("DSN feature is:   Disabled\n");
+  }
+
   // Check for ATA Security LOCK
   unsigned short word128 = drive.words088_255[128-88];
   bool locked = ((word128 & 0x0007) == 0x0007); // LOCKED|ENABLED|SUPPORTED
@@ -2821,6 +2932,31 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
     }
   }
 
+  const char * sct_write_cache_state_desc[4] = {
+    "Unknown",            // 0: not defined in standard but returned on some drives if not set
+    "Controlled by ATA",  // 1: controlled ATA Set Features command
+    "Force Enabled",      // 2
+    "Force Disabled"      // 3
+  };
+
+  // Print SCT feature control of write cache
+  if (options.sct_wcache_sct_get) {
+    if (!isSCTFeatureControlCapable(&drive))
+      pout("SCT Write Cache Control: Unavailable\n");
+    else if (locked)
+      pout("SCT Write Cache Control: Unknown (SCT not supported if ATA Security is LOCKED)\n");
+    else {
+      int state = ataGetSetSCTWriteCache(device, 1, false /*persistent*/, false /*set*/);
+      if (-1 <= state && state <= 3)
+        pout("SCT Write Cache Control: %s\n",
+             (state == -1 ? "Unknown (SCT Feature Control command failed)" :
+              sct_write_cache_state_desc[state]));
+      else
+        pout("SCT Write Cache Control: Unknown (0x%02x)\n", state);
+    }
+  }
+
+
   // Print remaining drive info
   if (options.drive_info) {
     // Print the (now possibly changed) power mode if available
@@ -2839,7 +2975,7 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       || options.smart_auto_offl_disable || options.smart_auto_offl_enable
       || options.set_aam || options.set_apm || options.set_lookahead
       || options.set_wcache || options.set_security_freeze || options.set_standby
-      || options.sct_wcache_reorder_set)
+      || options.sct_wcache_reorder_set || options.sct_wcache_sct_set || options.set_dsn)
     pout("=== START OF ENABLE/DISABLE COMMANDS SECTION ===\n");
   
   // Enable/Disable AAM
@@ -2904,6 +3040,17 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       pout("Write cache %sabled\n", (enable ? "en" : "dis"));
   }
 
+  // Enable/Disable DSN
+  if (options.set_dsn) {
+    bool enable = (options.set_dsn > 0);
+    if (!ata_set_features(device, ATA_ENABLE_DISABLE_DSN, (enable ? 0x1 : 0x2))) {
+        pout("DSN %sable failed: %s\n", (enable ? "en" : "dis"), device->get_errmsg());
+        returnval |= FAILSMART;
+    }
+    else
+      pout("DSN %sabled\n", (enable ? "en" : "dis"));
+  }
+
   // Enable/Disable write cache reordering
   if (options.sct_wcache_reorder_set) {
     bool enable = (options.sct_wcache_reorder_set > 0);
@@ -2914,12 +3061,30 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       pout("Write cache reordering %sable failed: SCT not supported if ATA Security is LOCKED\n",
         (enable ? "en" : "dis"));
     else if (ataGetSetSCTWriteCacheReordering(device,
-               enable, false /*persistent*/, true /*set*/) < 0) {
+               enable, options.sct_wcache_reorder_set_pers, true /*set*/) < 0) {
       pout("Write cache reordering %sable failed: %s\n", (enable ? "en" : "dis"), device->get_errmsg());
       returnval |= FAILSMART;
     }
     else
-      pout("Write cache reordering %sabled\n", (enable ? "en" : "dis"));
+      pout("Write cache reordering %sabled (%s)\n", (enable ? "en" : "dis"),
+           (options.sct_wcache_reorder_set_pers ? "persistent" : "volatile"));
+  }
+
+  // Enable/Disable write cache in SCT
+  if (options.sct_wcache_sct_set) {
+    if (!isSCTFeatureControlCapable(&drive))
+      pout("SCT Feature Control of write cache failed: SCT Feature Control command not supported\n");
+    else if (locked)
+      pout("SCT Feature Control of write cache failed: SCT not supported if ATA Security is LOCKED\n");
+    else if (ataGetSetSCTWriteCache(device,
+               options.sct_wcache_sct_set, options.sct_wcache_sct_set_pers, true /*set*/) < 0) {
+      pout("SCT Feature Control of write cache failed: %s\n", device->get_errmsg());
+      returnval |= FAILSMART;
+    }
+    else
+      pout("Write cache SCT Feature Control is set to: %s (%s)\n",
+           sct_write_cache_state_desc[options.sct_wcache_sct_set],
+           (options.sct_wcache_sct_set_pers ? "persistent" : "volatile"));
   }
 
   // Freeze ATA security
@@ -2932,11 +3097,11 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       pout("ATA Security set to frozen mode\n");
   }
 
-  // Set standby timer
-  if (options.set_standby) {
+  // Set standby timer unless immediate standby is also requested
+  if (options.set_standby && !options.set_standby_now) {
     if (!ata_nodata_command(device, ATA_IDLE, options.set_standby-1)) {
-        pout("ATA IDLE command failed: %s\n", device->get_errmsg());
-        returnval |= FAILSMART;
+      pout("ATA IDLE command failed: %s\n", device->get_errmsg());
+      returnval |= FAILSMART;
     }
     else
       print_standby_timer("Standby timer set to ", options.set_standby-1, drive);
@@ -3055,7 +3220,7 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       || options.smart_auto_offl_disable || options.smart_auto_offl_enable
       || options.set_aam || options.set_apm || options.set_lookahead
       || options.set_wcache || options.set_security_freeze || options.set_standby
-      || options.sct_wcache_reorder_set)
+      || options.sct_wcache_reorder_set || options.set_dsn)
     pout("\n");
 
   // START OF READ-ONLY OPTIONS APART FROM -V and -i
@@ -3534,6 +3699,17 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
   }
 
+  // Print Pending Defects log
+  if (options.pending_defects_log || options.pending_defects_info) {
+    unsigned nsectors = GetNumLogSectors(gplogdir, 0x0c, true);
+    if (!nsectors)
+      pout("Pending Defects log (GP Log 0x0c) not supported\n\n");
+    else if (!options.pending_defects_log) // TODO: Remove when no longer EXPERIMENTAL
+      pout("Pending Defects log (GP Log 0x0c) supported [please try: '-l defects']\n\n");
+    else if (!print_pending_defects_log(device, nsectors, options.pending_defects_log))
+      failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
+  }
+
   // Print SATA Phy Event Counters
   if (options.sataphy) {
     unsigned nsectors = GetNumLogSectors(gplogdir, 0x11, true);
@@ -3556,15 +3732,27 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
     }
   }
 
-  // Set to standby (spindown) mode
+  // Set to standby (spindown) mode and set standby timer if not done above
   // (Above commands may spinup drive)
   if (options.set_standby_now) {
-    if (!ata_nodata_command(device, ATA_STANDBY_IMMEDIATE)) {
+    if (options.set_standby) {
+      if (!ata_nodata_command(device, ATA_STANDBY, options.set_standby-1)) {
+        pout("ATA STANDBY command failed: %s\n", device->get_errmsg());
+        returnval |= FAILSMART;
+      }
+      else {
+        print_standby_timer("Standby timer set to ", options.set_standby-1, drive);
+        pout("Device placed in STANDBY mode\n");
+      }
+    }
+    else {
+      if (!ata_nodata_command(device, ATA_STANDBY_IMMEDIATE)) {
         pout("ATA STANDBY IMMEDIATE command failed: %s\n", device->get_errmsg());
         returnval |= FAILSMART;
+      }
+      else
+        pout("Device placed in STANDBY mode\n");
     }
-    else
-      pout("Device placed in STANDBY mode\n");
   }
 
   // START OF THE TESTING SECTION OF THE CODE.  IF NO TESTING, RETURN
index b0b2f1bdbaa7ff00ab60dad2358568bf06716789..d7abd131f97571a90a72dd5ab6c56d198fd270b9 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-09 Bruce Allen
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #ifndef ATAPRINT_H_
 #define ATAPRINT_H_
 
-#define ATAPRINT_H_CVSID "$Id: ataprint.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define ATAPRINT_H_CVSID "$Id: ataprint.h 4572 2017-10-29 14:36:00Z chrfranke $\n"
 
 #include <vector>
 
@@ -64,6 +64,9 @@ struct ata_print_options
   bool devstat_all_pages, devstat_ssd_page;
   std::vector<int> devstat_pages;
 
+  bool pending_defects_info;
+  unsigned pending_defects_log;
+
   bool sct_temp_sts, sct_temp_hist;
   bool sct_erc_get;
   bool sct_erc_set;
@@ -92,6 +95,7 @@ struct ata_print_options
   bool ignore_presets; // Ignore presets from drive database
   bool show_presets; // Show presets and exit
   unsigned char powermode; // Skip check, if disk in idle or standby mode
+  unsigned char powerexit; // exit() code for low power mode
 
   bool get_set_used; // true if any get/set command is used
   bool get_aam; // print Automatic Acoustic Management status
@@ -108,6 +112,12 @@ struct ata_print_options
   int set_wcache; // disable(-1), enable(1) write cache
   bool sct_wcache_reorder_get; // print write cache reordering status
   int sct_wcache_reorder_set; // disable(-1), enable(1) write cache reordering
+  bool sct_wcache_reorder_set_pers;
+  bool sct_wcache_sct_get; // print SCT Feature Control of write cache status
+  int sct_wcache_sct_set; // determined by ata set features command(1), force enable(2), force disable(3)
+  bool sct_wcache_sct_set_pers; // persistent or volatile
+  bool get_dsn; // print DSN status
+  int set_dsn; // disable(02h), enable(01h) DSN
 
   ata_print_options()
     : drive_info(false),
@@ -123,6 +133,7 @@ struct ata_print_options
       smart_ext_selftest_log(0),
       retry_error_log(false), retry_selftest_log(false),
       devstat_all_pages(false), devstat_ssd_page(false),
+      pending_defects_info(false), pending_defects_log(0),
       sct_temp_sts(false), sct_temp_hist(false),
       sct_erc_get(false),
       sct_erc_set(false),
@@ -137,7 +148,7 @@ struct ata_print_options
       fix_swapped_id(false),
       ignore_presets(false),
       show_presets(false),
-      powermode(0),
+      powermode(0), powerexit(0),
       get_set_used(false),
       get_aam(false), set_aam(0),
       get_apm(false), set_apm(0),
@@ -145,7 +156,11 @@ struct ata_print_options
       set_standby(0), set_standby_now(false),
       get_security(false), set_security_freeze(false),
       get_wcache(false), set_wcache(0),
-      sct_wcache_reorder_get(false), sct_wcache_reorder_set(0)
+      sct_wcache_reorder_get(false), sct_wcache_reorder_set(0),
+      sct_wcache_reorder_set_pers(false),
+      sct_wcache_sct_get(false), sct_wcache_sct_set(0),
+      sct_wcache_sct_set_pers(false),
+      get_dsn(false), set_dsn(0)
     { }
 };
 
index f73610bf706599e327d348812090df5e1cf8a3fe..db212b852c069999ad0f863db6c4d6ea1d241ea0 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: autogen.sh 4115 2015-07-15 20:52:26Z chrfranke $
+# $Id: autogen.sh 4434 2017-09-14 18:05:12Z samm2 $
 #
 # Generate ./configure from configure.ac and Makefile.in from Makefile.am.
 # This also adds files like missing,depcomp,install-sh to the source
@@ -60,7 +60,7 @@ case "$ver" in
     # OK
     ;;
 
-  1.14|1.14.1|1.15)
+  1.14|1.14.1|1.15|1.15.1)
     # TODO: Enable 'subdir-objects' in configure.ac
     # For now, suppress 'subdir-objects' forward-incompatibility warning
     test -n "$warnings" || amwarnings="--warnings=no-unsupported"
diff --git a/compile b/compile
new file mode 100755 (executable)
index 0000000..2ab71e4
--- /dev/null
+++ b/compile
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
+       eat=1
+       case $2 in
+         *.o | *.obj)
+           ofile=$2
+           ;;
+         *)
+           set x "$@" -o "$2"
+           shift
+           ;;
+       esac
+       ;;
+      *.c)
+       cfile=$1
+       set x "$@" "$1"
+       shift
+       ;;
+      *)
+       set x "$@" "$1"
+       shift
+       ;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
new file mode 100755 (executable)
index 0000000..69ed3e5
--- /dev/null
@@ -0,0 +1,1466 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright 1992-2017 Free Software Foundation, Inc.
+
+timestamp='2017-03-05'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2017 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       if test x"$CC_FOR_BUILD" = x ; then
+         CC_FOR_BUILD=no_compiler_found ;
+       fi
+       ;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       eval $set_cc_for_build
+       cat <<-EOF > $dummy.c
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+       # NetBSD (nbsd) targets should (where applicable) match one or
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+       # switched to ELF, *-*-netbsd* would select the old
+       # object file format.  This provides both forward
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+           /sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || \
+           echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
+           earmv*)
+               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine=${arch}${endian}-unknown
+               ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+       esac
+       # The Operating System including object format, if it has switched
+       # to ELF recently (or will in the future) and ABI.
+       case "${UNAME_MACHINE_ARCH}" in
+           earm*)
+               os=netbsdelf
+               ;;
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep -q __ELF__
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               os=netbsd
+               ;;
+       esac
+       # Determine ABI tags.
+       case "${UNAME_MACHINE_ARCH}" in
+           earm*)
+               expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               ;;
+       esac
+       # The OS release
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               ;;
+       esac
+       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+       # contains redundant information, the shorter form:
+       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+       echo "${machine}-${os}${release}${abi}"
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
+    *:OpenBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
+    *:LibertyBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+       exit ;;
+    *:ekkoBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    *:MirBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    *:Sortix:*:*)
+       echo ${UNAME_MACHINE}-unknown-sortix
+       exit ;;
+    alpha:OSF1:*:*)
+       case $UNAME_RELEASE in
+       *4.0)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               ;;
+       *5.*)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               ;;
+       esac
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE=alpha ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE=alpha ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE=alpha ;;
+           "EV5 (21164)")
+               UNAME_MACHINE=alphaev5 ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE=alphaev56 ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE=alphapca56 ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE=alphapca57 ;;
+           "EV6 (21264)")
+               UNAME_MACHINE=alphaev6 ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE=alphaev67 ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE=alphaev69 ;;
+           "EV7 (21364)")
+               UNAME_MACHINE=alphaev7 ;;
+           "EV7.9 (21364A)")
+               UNAME_MACHINE=alphaev79 ;;
+       esac
+       # A Pn.n version is a patched version.
+       # A Vn.n version is a released version.
+       # A Tn.n version is a released field test version.
+       # A Xn.n version is an unreleased experimental baselevel.
+       # 1.2 uses "1.2" for uname -r.
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
+       exit ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-amigaos
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
+    *:OS400:*:*)
+       echo powerpc-ibm-os400
+       exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix${UNAME_RELEASE}
+       exit ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7; exit ;;
+       esac ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4H:SunOS:5.*:*)
+       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH=i386
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH=x86_64
+           fi
+       fi
+       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:6*:*)
+       # According to config.sub, this is the proper way to canonicalize
+       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+       # it's likely to be more like Solaris than SunOS4.
+       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit ;;
+    sun*:*:4.2BSD:*)
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos${UNAME_RELEASE}
+               ;;
+           sun4)
+               echo sparc-sun-sunos${UNAME_RELEASE}
+               ;;
+       esac
+       exit ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
+    m68k:machten:*:*)
+       echo m68k-apple-machten${UNAME_RELEASE}
+       exit ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten${UNAME_RELEASE}
+       exit ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix${UNAME_RELEASE}
+       exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit ;;
+    AViiON:dgux:*:*)
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       then
+           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+           else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
+       fi
+       exit ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
+               sed 's/^                //' << EOF >$dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       exit ;;
+    *:AIX:*:[4567])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/lslpp ] ; then
+               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit ;;
+    9000/[34678]??:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           9000/[678][0-9][0-9])
+               if [ -x /usr/bin/getconf ]; then
+                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   case "${sc_cpu_version}" in
+                     523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+                     528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+                     532)                      # CPU_PA_RISC2_0
+                       case "${sc_kernel_bits}" in
+                         32) HP_ARCH=hppa2.0n ;;
+                         64) HP_ARCH=hppa2.0w ;;
+                         '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
+                       esac ;;
+                   esac
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^            //' << EOF >$dummy.c
+
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
+
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
+
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
+EOF
+                   (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = hppa2.0w ]
+       then
+           eval $set_cc_for_build
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep -q __LP64__
+           then
+               HP_ARCH=hppa2.0w
+           else
+               HP_ARCH=hppa64
+           fi
+       fi
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit ;;
+    ia64:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux${HPUX_REV}
+       exit ;;
+    3050*:HI-UX:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
+       echo unknown-hitachi-hiuxwe2
+       exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+       exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+       exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+       exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+       exit ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*[A-Z]90:*:*:*)
+       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+             -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    *:UNICOS/mp:*:*)
+       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+       FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
+    5000:UNIX_System_V:4.*:*)
+       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+       echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:FreeBSD:*:*)
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case ${UNAME_PROCESSOR} in
+           amd64)
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
+       esac
+       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
+    *:MINGW*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit ;;
+    *:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
+    i*:PW*:*)
+       echo ${UNAME_MACHINE}-pc-pw32
+       exit ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i586-pc-interix
+       exit ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin
+       exit ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    *:GNU:*:*)
+       # the GNU system
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       exit ;;
+    *:GNU/*:*:*)
+       # other systems with GNU libc and userland
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       exit ;;
+    i*86:Minix:*:*)
+       echo ${UNAME_MACHINE}-pc-minix
+       exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+       esac
+       objdump --private-headers /bin/sh | grep -q ld.so.1
+       if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       else
+           if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+               | grep -q __ARM_PCS_VFP
+           then
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+           else
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+           fi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    cris:Linux:*:*)
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    crisv32:Linux:*:*)
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    e2k:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    frv:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    i*86:Linux:*:*)
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       exit ;;
+    ia64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    k1om:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m68*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       ;;
+    mips64el:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    openrisc*:Linux:*:*)
+       echo or1k-unknown-linux-${LIBC}
+       exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-${LIBC}
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-${LIBC}
+       exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+       # Look for CPU level
+       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
+       esac
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-${LIBC}
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-${LIBC}
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-${LIBC}
+       exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       exit ;;
+    x86_64:Linux:*:*)
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
+       echo i386-sequent-sysv4
+       exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # I am not positive that other SVR4 systems won't match this,
+       # I just have to hope.  -- rms.
+       # Use sysv4.2uw... so that sysv4* matches it.
+       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       exit ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       exit ;;
+    i*86:syllable:*:*)
+       echo ${UNAME_MACHINE}-pc-syllable
+       exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       exit ;;
+    i*86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit ;;
+    pc:*:*:*)
+       # Left here for compatibility:
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configure will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
+       exit ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       exit ;;
+    i860:*:4.*:*) # i860-SVR4
+       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+       fi
+       exit ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+       OS_REL=''
+       test -r /etc/.relid \
+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
+    *:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo hppa1.1-stratus-vos
+       exit ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit ;;
+    news*:NEWS-OS:6*:*)
+       echo mips-sony-newsos6
+       exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+       exit ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-ACE:SUPER-UX:*:*)
+       echo sxace-nec-superux${UNAME_RELEASE}
+       exit ;;
+    Power*:Rhapsody:*:*)
+       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Darwin:*:*)
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       fi
+       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+           if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+               if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                   grep IS_64BIT_ARCH >/dev/null
+               then
+                   case $UNAME_PROCESSOR in
+                       i386) UNAME_PROCESSOR=x86_64 ;;
+                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
+                   esac
+               fi
+           fi
+       elif test "$UNAME_PROCESSOR" = i386 ; then
+           # Avoid executing cc on OS X 10.9, as it ships with a stub
+           # that puts up a graphical alert prompting to install
+           # developer tools.  Any system running Mac OS X 10.7 or
+           # later (Darwin 11 and later) is required to have a 64-bit
+           # processor. This is not true of the ARM version of Darwin
+           # that Apple uses in portable devices.
+           UNAME_PROCESSOR=x86_64
+       fi
+       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = x86; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSX-?:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    *:NonStop-UX:*:*)
+       echo mips-compaq-nonstopux
+       exit ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit ;;
+    DS/*:UNIX_System_V:*:*)
+       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       exit ;;
+    *:Plan9:*:*)
+       # "uname -m" is not consistent, so use $cputype instead. 386
+       # is converted to i386 for consistency with other x86
+       # operating systems.
+       if test "$cputype" = 386; then
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo ${UNAME_MACHINE}-unknown-plan9
+       exit ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit ;;
+    SEI:*:*:SEIUX)
+       echo mips-sei-seiux${UNAME_RELEASE}
+       exit ;;
+    *:DragonFly:*:*)
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "${UNAME_MACHINE}" in
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+       exit ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       exit ;;
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
+       exit ;;
+    amd64:Isilon\ OneFS:*:*)
+       echo x86_64-unknown-onefs
+       exit ;;
+esac
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644 (file)
index 0000000..67c2dd1
--- /dev/null
@@ -0,0 +1,190 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* freebsd ciss header location */
+#undef CISS_LOCATION
+
+/* smartmontools CVS Tag */
+#undef CONFIG_H_CVSID
+
+/* Define to 1 if C++ compiler supports __attribute__((packed)) */
+#undef HAVE_ATTR_PACKED
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the <ddk/ntdddisk.h> header file. */
+#undef HAVE_DDK_NTDDDISK_H
+
+/* Define to 1 if you have the <dev/ata/atavar.h> header file. */
+#undef HAVE_DEV_ATA_ATAVAR_H
+
+/* Define to 1 if you have the <dev/ciss/cissio.h> header file. */
+#undef HAVE_DEV_CISS_CISSIO_H
+
+/* Define to 1 if you have the `ftime' function. */
+#undef HAVE_FTIME
+
+/* Define to 1 if you have the `getopt_long' function. */
+#undef HAVE_GETOPT_LONG
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if the system has the type `int64_t'. */
+#undef HAVE_INT64_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `cap-ng' library (-lcap-ng). */
+#undef HAVE_LIBCAP_NG
+
+/* Define to 1 if you have the `selinux' library (-lselinux). */
+#undef HAVE_LIBSELINUX
+
+/* Define to 1 if you have the `usb' library (-lusb). */
+#undef HAVE_LIBUSB
+
+/* Define to 1 if you have the <linux/cciss_ioctl.h> header file. */
+#undef HAVE_LINUX_CCISS_IOCTL_H
+
+/* Define to 1 if you have the <linux/compiler.h> header file. */
+#undef HAVE_LINUX_COMPILER_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <ntdddisk.h> header file. */
+#undef HAVE_NTDDDISK_H
+
+/* Define to 1 if you have the `regcomp' function. */
+#undef HAVE_REGCOMP
+
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
+
+/* Define to 1 if you have the `sigset' function. */
+#undef HAVE_SIGSET
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if you have the <sys/inttypes.h> header file. */
+#undef HAVE_SYS_INTTYPES_H
+
+/* Define to 1 if you have the <sys/int_types.h> header file. */
+#undef HAVE_SYS_INT_TYPES_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/tweio.h> header file. */
+#undef HAVE_SYS_TWEIO_H
+
+/* Define to 1 if you have the <sys/twereg.h> header file. */
+#undef HAVE_SYS_TWEREG_H
+
+/* Define to 1 if you have the <sys/tw_osl_ioctl.h> header file. */
+#undef HAVE_SYS_TW_OSL_IOCTL_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#undef HAVE_UINT64_T
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <wbemcli.h> header file. */
+#undef HAVE_WBEMCLI_H
+
+/* Define to 1 if the `snprintf' function is sane. */
+#undef HAVE_WORKING_SNPRINTF
+
+/* Define to 1 if os_*.cpp still uses the old interface */
+#undef OLD_INTERFACE
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* smartmontools Home Page */
+#undef PACKAGE_HOMEPAGE
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* smartmontools Build Host */
+#undef SMARTMONTOOLS_BUILD_HOST
+
+/* smartmontools Configure Arguments */
+#undef SMARTMONTOOLS_CONFIGURE_ARGS
+
+/* smartmontools Release Date */
+#undef SMARTMONTOOLS_RELEASE_DATE
+
+/* smartmontools Release Time */
+#undef SMARTMONTOOLS_RELEASE_TIME
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 to include NVMe devices in smartd DEVICESCAN. */
+#undef WITH_NVME_DEVICESCAN
+
+/* Define to 1 if SELinux support is enabled */
+#undef WITH_SELINUX
+
+/* Define to 1 to enable legacy ATA support on Solaris SPARC. */
+#undef WITH_SOLARIS_SPARC_ATA
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
diff --git a/config.sub b/config.sub
new file mode 100755 (executable)
index 0000000..87abeab
--- /dev/null
@@ -0,0 +1,1831 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright 1992-2017 Free Software Foundation, Inc.
+
+timestamp='2017-02-07'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2017 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+  kopensolaris*-gnu* | cloudabi*-eabi* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple | -axis | -knuth | -cray | -microblaze*)
+               os=
+               basic_machine=$1
+               ;;
+       -bluegene*)
+               os=-cnk
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5)
+               os=-sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       1750a | 580 \
+       | a29k \
+       | aarch64 | aarch64_be \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | ba \
+       | be32 | be64 \
+       | bfin \
+       | c4x | c8051 | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | e2k | epiphany \
+       | fido | fr30 | frv | ft32 \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | k1om \
+       | le32 | le64 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa32r6 | mipsisa32r6el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64r6 | mipsisa64r6el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 | nios2eb | nios2el \
+       | ns16k | ns32k \
+       | open8 | or1k | or1knd | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pru \
+       | pyramid \
+       | riscv32 | riscv64 \
+       | rl78 | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+       | visium \
+       | we32k \
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       leon|leon[3-9])
+               basic_machine=sparc-$basic_machine
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
+
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       580-* \
+       | a29k-* \
+       | aarch64-* | aarch64_be-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* | avr32-* \
+       | ba-* \
+       | be32-* | be64-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | e2k-* | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | k1om-* \
+       | le32-* | le64-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa32r6-* | mipsisa32r6el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64r6-* | mipsisa64r6el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pru-* \
+       | pyramid-* \
+       | riscv32-* | riscv64-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+       | tahoe-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
+       | visium-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-unknown
+               ;;
+       amigaos | amigados)
+               basic_machine=m68k-unknown
+               os=-amigaos
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-unknown
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       asmjs)
+               basic_machine=asmjs-unknown
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | j90)
+               basic_machine=j90-cray
+               os=-unicos
+               ;;
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
+               ;;
+       cr16 | cr16-*)
+               basic_machine=cr16-unknown
+               os=-elf
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
+       cris | cris-* | etrax*)
+               basic_machine=cris-axis
+               ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       e500v[12])
+               basic_machine=powerpc-unknown
+               os=$os"spe"
+               ;;
+       e500v[12]-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=$os"spe"
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       go32)
+               basic_machine=i386-pc
+               os=-go32
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               ;;
+       i*86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i*86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i*86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i*86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       leon-*|leon[3-9]-*)
+               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       microblaze*)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
+       mingw32)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
+       moxiebox)
+               basic_machine=moxie-unknown
+               os=-moxiebox
+               ;;
+       msdos)
+               basic_machine=i386-pc
+               os=-msdos
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       msys)
+               basic_machine=i686-pc
+               os=-msys
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
+       nonstopux)
+               basic_machine=mips-compaq
+               os=-nonstopux
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       nsx-tandem)
+               basic_machine=nsx-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       openrisc | openrisc-*)
+               basic_machine=or32-unknown
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc | ppcbe)    basic_machine=powerpc-unknown
+               ;;
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       pw32)
+               basic_machine=i586-unknown
+               os=-pw32
+               ;;
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       t3e)
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
+               os=-unicos
+               ;;
+       tile*)
+               basic_machine=$basic_machine-unknown
+               os=-linux-gnu
+               ;;
+       tx39)
+               basic_machine=mipstx39-unknown
+               ;;
+       tx39el)
+               basic_machine=mipstx39el-unknown
+               ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
+       xps | xps100)
+               basic_machine=xps100-honeywell
+               ;;
+       xscale-* | xscalee[bl]-*)
+               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp10)
+               # there are many clones, so DEC is not a safe bet
+               basic_machine=pdp10-unknown
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               basic_machine=sparc-sun
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+       # First match some system type aliases
+       # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -auroraux)
+               os=-auroraux
+               ;;
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* | -plan9* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* | -cloudabi* | -sortix* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+               ;;
+       -mac*)
+               os=`echo $os | sed -e 's|mac|macos|'`
+               ;;
+       -linux-dietlibc)
+               os=-linux-dietlibc
+               ;;
+       -linux*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -os400*)
+               os=-os400
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -tpf*)
+               os=-tpf
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
+               ;;
+       -ios)
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       score-*)
+               os=-elf
+               ;;
+       spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       c8051-*)
+               os=-elf
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
+               ;;
+       # This must come before the *-dec entry.
+       pdp10-*)
+               os=-tops20
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mep-*)
+               os=-elf
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       pru-*)
+               os=-elf
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-haiku)
+               os=-haiku
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-knuth)
+               os=-mmixware
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -cnk*|-aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..bb1c3ca
--- /dev/null
+++ b/configure
@@ -0,0 +1,8761 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for smartmontools 6.6.
+#
+# Report bugs to <smartmontools-support@listi.jpberlin.de>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: smartmontools-support@listi.jpberlin.de about your
+$0: system, including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='smartmontools'
+PACKAGE_TARNAME='smartmontools'
+PACKAGE_VERSION='6.6'
+PACKAGE_STRING='smartmontools 6.6'
+PACKAGE_BUGREPORT='smartmontools-support@listi.jpberlin.de'
+PACKAGE_URL=''
+
+ac_unique_file="smartctl.cpp"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+OS_WIN64_FALSE
+OS_WIN64_TRUE
+OS_WIN32_NSIS_FALSE
+OS_WIN32_NSIS_TRUE
+OS_WIN32_MINGW_FALSE
+OS_WIN32_MINGW_TRUE
+OS_WIN32_FALSE
+OS_WIN32_TRUE
+OS_SOLARIS_FALSE
+OS_SOLARIS_TRUE
+OS_DARWIN_FALSE
+OS_DARWIN_TRUE
+DRIVEDB_BRANCH
+os_win32_manifest
+os_man_filter
+os_nisdomainname
+os_dnsdomainname
+os_hostname
+os_mailer
+os_dltools
+os_libs
+os_deps
+smartmontools_release_time
+smartmontools_release_date
+releaseversion
+with_nvme_devicescan
+CAPNG_LDADD
+with_selinux
+smartd_suffix
+ENABLE_ATTRIBUTELOG_FALSE
+ENABLE_ATTRIBUTELOG_TRUE
+attributelogdir
+attributelog
+ENABLE_SAVESTATES_FALSE
+ENABLE_SAVESTATES_TRUE
+savestatesdir
+savestates
+ENABLE_SCRIPTPATH_FALSE
+ENABLE_SCRIPTPATH_TRUE
+scriptpath
+smartdplugindir
+smartdscriptdir
+gnupg
+ENABLE_UPDATE_SMART_DRIVEDB_FALSE
+ENABLE_UPDATE_SMART_DRIVEDB_TRUE
+with_update_smart_drivedb
+ENABLE_DRIVEDB_FALSE
+ENABLE_DRIVEDB_TRUE
+drivedbdir
+exampledir
+initdfile
+INSTALL_INITSCRIPT_FALSE
+INSTALL_INITSCRIPT_TRUE
+initddir
+systemdenvfile
+INSTALL_SYSTEMDUNIT_FALSE
+INSTALL_SYSTEMDUNIT_TRUE
+systemdsystemunitdir
+ASFLAGS
+gcc_have_attr_packed
+NEED_REGEX_FALSE
+NEED_REGEX_TRUE
+NEED_GETOPT_LONG_FALSE
+NEED_GETOPT_LONG_TRUE
+EGREP
+GREP
+CXXCPP
+IS_SVN_BUILD_FALSE
+IS_SVN_BUILD_TRUE
+svn_deps
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+MAKENSIS
+WINDRES
+WINDMC
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+ac_ct_CC
+CFLAGS
+CC
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CXX
+CPPFLAGS
+LDFLAGS
+CXXFLAGS
+CXX
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+with_systemdsystemunitdir
+with_systemdenvfile
+with_initscriptdir
+with_exampledir
+with_drivedbdir
+with_update_smart_drivedb
+with_gnupg
+with_smartdscriptdir
+with_smartdplugindir
+with_scriptpath
+with_savestates
+with_attributelog
+enable_sample
+with_os_deps
+with_selinux
+with_libcap_ng
+with_nvme_devicescan
+with_solaris_sparc_ata
+with_working_snprintf
+with_mingw_aslr
+with_cxx11_option
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CXX
+CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CCC
+CC
+CFLAGS
+CCAS
+CCASFLAGS
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+WINDMC
+WINDRES
+MAKENSIS
+CXXCPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures smartmontools 6.6 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/smartmontools]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of smartmontools 6.6:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --enable-sample         Enables appending .sample to the installed smartd rc
+                          script and configuration file
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-systemdsystemunitdir[=DIR|auto|yes|no]
+                          Location of systemd service files [auto]
+  --with-systemdenvfile[=FILE|auto|yes|no]
+                          Path of systemd EnvironmentFile [auto]
+  --with-initscriptdir[=DIR|auto|yes|no]
+                          Location of init scripts [auto]
+  --with-exampledir=DIR   Location of example scripts [DOCDIR/examplescripts]
+  --with-drivedbdir[=DIR|yes|no]
+                          Location of drive database file
+                          [DATADIR/smartmontools]
+  --with-update-smart-drivedb[=yes|no|X.Y]
+                          Install update-smart-drivedb script (and backport it
+                          to branches/RELEASE_X_Y_DRIVEDB) [yes]
+  --with-gnupg[=FILE|yes|no]
+                          GnuPG used to verify drivedb.h [gpg]
+  --with-smartdscriptdir=DIR
+                          Location of smartd_warning.sh script [SYSCONFDIR]
+  --with-smartdplugindir=[DIR|no]
+                          Location of smartd_warning.sh plugin scripts
+                          [SMARTDSCRIPTDIR/smartd_warning.d]
+  --with-scriptpath=[PATH|no]
+                          PATH variable set within scripts [/usr/bin:/bin]
+  --with-savestates[=PREFIX|yes|no]
+                          Enable default smartd state files [no]
+                          (yes=LOCALSTATEDIR/lib/smartmontools/smartd.)
+  --with-attributelog[=PREFIX|yes|no]
+                          Enable default smartd attribute log files [no]
+                          (yes=LOCALSTATEDIR/lib/smartmontools/attrlog.)
+  --with-os-deps='os_module.o ...'
+                          Specify OS dependent module(s) [guessed]
+  --with-selinux[=yes|no] Enables SELinux support [no]
+  --with-libcap-ng[=auto|yes|no]
+                          Add Libcap-ng support to smartd [auto]
+  --with-nvme-devicescan[=yes|no]
+                          Include NVMe devices in smartd DEVICESCAN [no]
+  --with-solaris-sparc-ata[=yes|no]
+                          Enable legacy ATA support on Solaris SPARC (requires
+                          os_solaris_ata.s from SVN repository) [no]
+  --with-working-snprintf[=yes|no]
+                          Function snprintf() handles output truncation as
+                          specified by C99 [MinGW:guessed,others:yes]
+  --with-mingw-aslr[=auto|yes|low|no]
+                          Enable ASLR for MinGW executables [auto]
+  --with-cxx11-option[=OPTION|auto|no]
+                          Compiler option to enable C++11 support for future
+                          versions of smartmontools, 'no' if unsupported
+                          [auto]
+
+Some influential environment variables:
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  CCAS        assembler compiler command (defaults to CC)
+  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  WINDMC      Windows message compiler command
+  WINDRES     Windows resource compiler command
+  MAKENSIS    NSIS compiler command
+  CXXCPP      C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <smartmontools-support@listi.jpberlin.de>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+smartmontools configure 6.6
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_cxx_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------------------------------ ##
+## Report this to smartmontools-support@listi.jpberlin.de ##
+## ------------------------------------------------------ ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_header_mongrel
+
+# ac_fn_cxx_try_run LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_cxx_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_run
+
+# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_cxx_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_header_compile
+
+# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES
+# ---------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_cxx_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_type
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_cxx_check_func LINENO FUNC VAR
+# ------------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_cxx_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by smartmontools $as_me 6.6, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+am__api_version='1.15'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='smartmontools'
+ VERSION='6.6'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+
+smartmontools_cvs_tag=`echo '$Id: configure.ac 4594 2017-11-05 15:21:35Z chrfranke $'`
+smartmontools_release_date=2017-11-05
+smartmontools_release_time="15:20:58 UTC"
+
+
+cat >>confdefs.h <<_ACEOF
+#define SMARTMONTOOLS_CONFIGURE_ARGS "$ac_configure_args"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SMARTMONTOOLS_RELEASE_DATE "$smartmontools_release_date"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SMARTMONTOOLS_RELEASE_TIME "$smartmontools_release_time"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONFIG_H_CVSID "$smartmontools_cvs_tag"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_HOMEPAGE "http://www.smartmontools.org/"
+_ACEOF
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+# By default we simply use the C compiler to build assembly code.
+
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+
+
+
+depcc="$CCAS"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CCAS_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CCAS_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CCAS_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
+CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
+  am__fastdepCCAS_TRUE=
+  am__fastdepCCAS_FALSE='#'
+else
+  am__fastdepCCAS_TRUE='#'
+  am__fastdepCCAS_FALSE=
+fi
+
+
+
+
+
+if test "$cross_compiling" = "no"; then
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
+fi
+
+
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+case "${host}" in
+  *-*-mingw*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windmc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windmc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WINDMC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$WINDMC"; then
+  ac_cv_prog_WINDMC="$WINDMC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_WINDMC="${ac_tool_prefix}windmc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+WINDMC=$ac_cv_prog_WINDMC
+if test -n "$WINDMC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDMC" >&5
+$as_echo "$WINDMC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_WINDMC"; then
+  ac_ct_WINDMC=$WINDMC
+  # Extract the first word of "windmc", so it can be a program name with args.
+set dummy windmc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_WINDMC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_WINDMC"; then
+  ac_cv_prog_ac_ct_WINDMC="$ac_ct_WINDMC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_WINDMC="windmc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_WINDMC=$ac_cv_prog_ac_ct_WINDMC
+if test -n "$ac_ct_WINDMC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDMC" >&5
+$as_echo "$ac_ct_WINDMC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_WINDMC" = x; then
+    WINDMC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    WINDMC=$ac_ct_WINDMC
+  fi
+else
+  WINDMC="$ac_cv_prog_WINDMC"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_WINDRES+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
+$as_echo "$WINDRES" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_WINDRES"; then
+  ac_ct_WINDRES=$WINDRES
+  # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_WINDRES"; then
+  ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_WINDRES="windres"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
+$as_echo "$ac_ct_WINDRES" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_WINDRES" = x; then
+    WINDRES=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    WINDRES=$ac_ct_WINDRES
+  fi
+else
+  WINDRES="$ac_cv_prog_WINDRES"
+fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for makensis" >&5
+$as_echo_n "checking for makensis... " >&6; }
+    if test -z "$MAKENSIS"; then
+      if test -n "$PROGRAMFILES" && "$PROGRAMFILES/NSIS/makensis" -VERSION >/dev/null 2>&1; then
+        MAKENSIS="$PROGRAMFILES/NSIS/makensis"
+      elif makensis -VERSION >/dev/null 2>&1; then
+        MAKENSIS=makensis
+      fi
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${MAKENSIS:-no}" >&5
+$as_echo "${MAKENSIS:-no}" >&6; }
+    ;;
+esac
+
+# Check for SVN.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is a build from SVN" >&5
+$as_echo_n "checking whether this is a build from SVN... " >&6; }
+is_svn_build=no
+svn_deps=
+if test -f "$srcdir/.svn/wc.db"; then
+  # SVN 1.7, 1.8 working copy
+  svn_deps='${srcdir}/.svn/wc.db'
+elif test -f "${srcdir}/.svn/entries"; then
+  # SVN <= 1.6 working copy (SVN 1.7 has empty entries file)
+  svn_deps='${srcdir}/.svn/entries'
+fi
+if test -n "$svn_deps"; then
+  is_svn_build=unknown
+  if (cd "$srcdir" && svn --version && svnversion && svn info) >/dev/null 2>&1; then
+    is_svn_build=yes
+  fi
+fi
+
+ if test "$is_svn_build" = "yes"; then
+  IS_SVN_BUILD_TRUE=
+  IS_SVN_BUILD_FALSE='#'
+else
+  IS_SVN_BUILD_TRUE='#'
+  IS_SVN_BUILD_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $is_svn_build" >&5
+$as_echo "$is_svn_build" >&6; }
+
+# Note: On Linux, clock_gettime() requires -lrt which implies -lpthreads
+# Check ommitted for now, gettimeofday() provides reasonable precision
+# AC_SEARCH_LIBS(clock_gettime, rt)
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in locale.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
+if test "x$ac_cv_header_locale_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LOCALE_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in dev/ata/atavar.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "dev/ata/atavar.h" "ac_cv_header_dev_ata_atavar_h" "$ac_includes_default"
+if test "x$ac_cv_header_dev_ata_atavar_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DEV_ATA_ATAVAR_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in inttypes.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_inttypes_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H 1
+_ACEOF
+
+fi
+
+done
+               for ac_header in stdint.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
+
+fi
+
+done
+               for ac_header in sys/inttypes.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_inttypes_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_INTTYPES_H 1
+_ACEOF
+
+fi
+
+done
+       for ac_header in sys/int_types.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/int_types.h" "ac_cv_header_sys_int_types_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_int_types_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_INT_TYPES_H 1
+_ACEOF
+
+fi
+
+done
+       for ac_header in sys/tweio.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/tweio.h" "ac_cv_header_sys_tweio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_tweio_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TWEIO_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/twereg.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/twereg.h" "ac_cv_header_sys_twereg_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_twereg_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TWEREG_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/tw_osl_ioctl.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "sys/tw_osl_ioctl.h" "ac_cv_header_sys_tw_osl_ioctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_tw_osl_ioctl_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TW_OSL_IOCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in linux/compiler.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "linux/compiler.h" "ac_cv_header_linux_compiler_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_compiler_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_COMPILER_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in dev/ciss/cissio.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "dev/ciss/cissio.h" "ac_cv_header_dev_ciss_cissio_h" "$ac_includes_default"
+if test "x$ac_cv_header_dev_ciss_cissio_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DEV_CISS_CISSIO_H 1
+_ACEOF
+
+$as_echo "#define CISS_LOCATION <dev/ciss/cissio.h>" >>confdefs.h
+
+else
+
+$as_echo "#define CISS_LOCATION \"cissio_freebsd.h\"" >>confdefs.h
+
+
+fi
+
+done
+
+for ac_header in linux/cciss_ioctl.h
+do :
+  ac_fn_cxx_check_header_compile "$LINENO" "linux/cciss_ioctl.h" "ac_cv_header_linux_cciss_ioctl_h" "$ac_includes_default
+#ifdef HAVE_LINUX_COMPILER_H
+# include <linux/compiler.h>
+#endif
+
+"
+if test "x$ac_cv_header_linux_cciss_ioctl_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_CCISS_IOCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in ntdddisk.h ddk/ntdddisk.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+#include <windows.h>
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in wbemcli.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "wbemcli.h" "ac_cv_header_wbemcli_h" "$ac_includes_default"
+if test "x$ac_cv_header_wbemcli_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WBEMCLI_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ac_fn_cxx_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default"
+if test "x$ac_cv_type_int64_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT64_T 1
+_ACEOF
+
+
+fi
+ac_fn_cxx_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint64_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT64_T 1
+_ACEOF
+
+
+fi
+
+
+for ac_func in getopt_long
+do :
+  ac_fn_cxx_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
+if test "x$ac_cv_func_getopt_long" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_LONG 1
+_ACEOF
+ need_getopt_long=no
+else
+  need_getopt_long=yes
+fi
+done
+
+ if test "$need_getopt_long" = "yes"; then
+  NEED_GETOPT_LONG_TRUE=
+  NEED_GETOPT_LONG_FALSE='#'
+else
+  NEED_GETOPT_LONG_TRUE='#'
+  NEED_GETOPT_LONG_FALSE=
+fi
+
+for ac_func in regcomp
+do :
+  ac_fn_cxx_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp"
+if test "x$ac_cv_func_regcomp" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_REGCOMP 1
+_ACEOF
+ need_regex=no
+else
+  need_regex=yes
+fi
+done
+
+ if test "$need_regex" = "yes"; then
+  NEED_REGEX_TRUE=
+  NEED_REGEX_FALSE='#'
+else
+  NEED_REGEX_TRUE='#'
+  NEED_REGEX_FALSE=
+fi
+
+
+for ac_func in sigset
+do :
+  ac_fn_cxx_check_func "$LINENO" "sigset" "ac_cv_func_sigset"
+if test "x$ac_cv_func_sigset" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGSET 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strtoull
+do :
+  ac_fn_cxx_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
+if test "x$ac_cv_func_strtoull" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STRTOULL 1
+_ACEOF
+
+fi
+done
+
+for ac_func in uname
+do :
+  ac_fn_cxx_check_func "$LINENO" "uname" "ac_cv_func_uname"
+if test "x$ac_cv_func_uname" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UNAME 1
+_ACEOF
+
+fi
+done
+
+for ac_func in clock_gettime ftime gettimeofday
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Check byte ordering (defines WORDS_BIGENDIAN)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
+else
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+# check for __attribute__((packed))
+# (sizeof() check is required to avoid false positives if other
+# __attribute__((x)) are supported)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports __attribute__((packed))" >&5
+$as_echo_n "checking whether $CXX supports __attribute__((packed))... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+    struct s { char a; short b; } __attribute__((packed));
+    typedef char t[sizeof(struct s) == 3 ? 1 : -1];
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  gcc_have_attr_packed=yes
+else
+  gcc_have_attr_packed=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "$gcc_have_attr_packed" = "yes"; then
+
+$as_echo "#define HAVE_ATTR_PACKED 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_have_attr_packed" >&5
+$as_echo "$gcc_have_attr_packed" >&6; }
+
+
+
+
+
+
+# Check whether --with-systemdsystemunitdir was given.
+if test "${with_systemdsystemunitdir+set}" = set; then :
+  withval=$with_systemdsystemunitdir;
+else
+  with_systemdsystemunitdir=auto
+fi
+
+
+systemdsystemunitdir=
+case "$with_systemdsystemunitdir" in
+ auto|yes)
+   if test -n "$PKG_CONFIG"; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemdsystemunitdir" >&5
+$as_echo_n "checking for systemdsystemunitdir... " >&6; }
+     systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd 2>/dev/null`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${systemdsystemunitdir:-no}" >&5
+$as_echo "${systemdsystemunitdir:-no}" >&6; }
+   fi
+   case "$with_systemdsystemunitdir:$sysconfdir:$systemdsystemunitdir" in
+     yes:*:) as_fn_error $? "Location of systemd service files not found" "$LINENO" 5 ;;
+     yes:*:*|auto:*:|auto:/etc:*) ;;
+     *) systemdsystemunitdir='${prefix}'$systemdsystemunitdir ;;
+   esac ;;
+ no) ;;
+ *) systemdsystemunitdir="$with_systemdsystemunitdir" ;;
+esac
+
+ if test -n "$systemdsystemunitdir"; then
+  INSTALL_SYSTEMDUNIT_TRUE=
+  INSTALL_SYSTEMDUNIT_FALSE='#'
+else
+  INSTALL_SYSTEMDUNIT_TRUE='#'
+  INSTALL_SYSTEMDUNIT_FALSE=
+fi
+
+
+
+# Check whether --with-systemdenvfile was given.
+if test "${with_systemdenvfile+set}" = set; then :
+  withval=$with_systemdenvfile;
+else
+  with_systemdenvfile=auto
+fi
+
+
+systemdenvfile=
+case "$with_systemdenvfile:$cross_compiling:$systemdsystemunitdir" in
+  auto:no:?*|yes:*:?*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for path of systemd EnvironmentFile" >&5
+$as_echo_n "checking for path of systemd EnvironmentFile... " >&6; }
+    for dir in sysconfig default; do
+      if test -d /etc/$dir; then
+        systemdenvfile='${sysconfdir}'/$dir/smartmontools
+        break
+      fi
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${systemdenvfile:-no}" >&5
+$as_echo "${systemdenvfile:-no}" >&6; }
+    case "$with_systemdenvfile:$systemdenvfile" in
+      yes:) as_fn_error $? "Path of systemd EnvironmentFile not found" "$LINENO" 5 ;;
+    esac ;;
+  auto:*|no:*) ;;
+  *:*:) as_fn_error $? "Location of systemd service files not found" "$LINENO" 5 ;;
+  *) systemdenvfile="$with_systemdenvfile"
+esac
+
+
+
+# Check whether --with-initscriptdir was given.
+if test "${with_initscriptdir+set}" = set; then :
+  withval=$with_initscriptdir;
+else
+  with_initscriptdir=auto
+fi
+
+
+initddir=
+case "$with_initscriptdir:$cross_compiling:$systemdsystemunitdir" in
+  auto:no:|yes:*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for init (rc) directory" >&5
+$as_echo_n "checking for init (rc) directory... " >&6; }
+    for dir in rc.d/init.d init.d rc.d; do
+      if test -d /etc/$dir; then
+        initddir='${sysconfdir}'/$dir
+        break
+      fi
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${initddir:-no}" >&5
+$as_echo "${initddir:-no}" >&6; }
+    case "$with_initscriptdir:$initddir" in
+      yes:) as_fn_error $? "Location of init scripts not found" "$LINENO" 5 ;;
+    esac ;;
+  auto:*|no:*) ;;
+  *) initddir="$with_initscriptdir" ;;
+esac
+
+ if test -n "$initddir"; then
+  INSTALL_INITSCRIPT_TRUE=
+  INSTALL_INITSCRIPT_FALSE='#'
+else
+  INSTALL_INITSCRIPT_TRUE='#'
+  INSTALL_INITSCRIPT_FALSE=
+fi
+
+
+# use different init script templates for different OS
+case "${host}" in
+  *-*-freebsd*)
+    initdfile="smartd.freebsd.initd"
+    ;;
+  *-apple-darwin*)
+    initdfile="com.smartmontools.smartd.plist"
+    ;;
+  *)
+    initdfile="smartd.initd"
+    ;;
+esac
+
+
+
+# Check whether --with-exampledir was given.
+if test "${with_exampledir+set}" = set; then :
+  withval=$with_exampledir; exampledir="$withval"
+else
+  exampledir='${docdir}/examplescripts'
+fi
+
+
+
+drivedbdir='${datadir}/${PACKAGE}'
+
+# Check whether --with-drivedbdir was given.
+if test "${with_drivedbdir+set}" = set; then :
+  withval=$with_drivedbdir; case "$withval" in yes) ;; no) drivedbdir= ;; *) drivedbdir="$withval" ;; esac
+fi
+
+
+ if test -n "$drivedbdir"; then
+  ENABLE_DRIVEDB_TRUE=
+  ENABLE_DRIVEDB_FALSE='#'
+else
+  ENABLE_DRIVEDB_TRUE='#'
+  ENABLE_DRIVEDB_FALSE=
+fi
+
+
+drivedb_version=$VERSION
+
+# Check whether --with-update-smart_drivedb was given.
+if test "${with_update_smart_drivedb+set}" = set; then :
+  withval=$with_update_smart_drivedb;  case "$withval" in
+      yes|no) ;;
+      5.4[0-3]|6.[0-9]) drivedb_version=$withval; with_update_smart_drivedb=yes ;;
+      *) as_fn_error $? "Invalid drivedb branch version: $withval" "$LINENO" 5 ;;
+    esac
+
+else
+  with_update_smart_drivedb=yes
+fi
+
+test -n "$drivedbdir" || with_update_smart_drivedb=no
+
+ if test "$with_update_smart_drivedb" = "yes"; then
+  ENABLE_UPDATE_SMART_DRIVEDB_TRUE=
+  ENABLE_UPDATE_SMART_DRIVEDB_FALSE='#'
+else
+  ENABLE_UPDATE_SMART_DRIVEDB_TRUE='#'
+  ENABLE_UPDATE_SMART_DRIVEDB_FALSE=
+fi
+
+
+gnupg="gpg"
+# Also check for '--with-gnupg[=yes]' because 'yes' is a valid command with infinite output
+
+# Check whether --with-gnupg was given.
+if test "${with_gnupg+set}" = set; then :
+  withval=$with_gnupg; case "$withval" in yes) ;; no) gnupg= ;; *) gnupg="$withval" ;; esac
+fi
+
+
+
+case "$with_update_smart_drivedb:$gnupg" in
+  no:?*)
+    as_fn_error $? "
+'--without-update-smart-drivedb' now requires '--without-gnupg'.
+NEWS: update-smart-drivedb now verifies the downloaded drivedb.h file with GnuPG." "$LINENO" 5
+    ;;
+esac
+
+
+# Check whether --with-smartdscriptdir was given.
+if test "${with_smartdscriptdir+set}" = set; then :
+  withval=$with_smartdscriptdir; smartdscriptdir="$withval"
+else
+  smartdscriptdir='${sysconfdir}'
+fi
+
+
+
+
+# Check whether --with-smartdplugindir was given.
+if test "${with_smartdplugindir+set}" = set; then :
+  withval=$with_smartdplugindir; smartdplugindir=; test "$withval" != "no" && smartdplugindir="$withval"
+else
+  smartdplugindir='${smartdscriptdir}/smartd_warning.d'
+fi
+
+
+
+
+# Check whether --with-scriptpath was given.
+if test "${with_scriptpath+set}" = set; then :
+  withval=$with_scriptpath; scriptpath=; test "$withval" != "no" && scriptpath="$withval"
+else
+  scriptpath="/usr/bin:/bin"
+fi
+
+
+ if test -n "$scriptpath"; then
+  ENABLE_SCRIPTPATH_TRUE=
+  ENABLE_SCRIPTPATH_FALSE='#'
+else
+  ENABLE_SCRIPTPATH_TRUE='#'
+  ENABLE_SCRIPTPATH_FALSE=
+fi
+
+
+savestates=
+
+# Check whether --with-savestates was given.
+if test "${with_savestates+set}" = set; then :
+  withval=$with_savestates; case "$withval" in yes) savestates='${localstatedir}/lib/${PACKAGE}/smartd.' ;;
+                      no) ;; *) savestates="$withval" ;; esac
+fi
+
+savestatesdir="${savestates%/*}"
+
+
+ if test -n "$savestates"; then
+  ENABLE_SAVESTATES_TRUE=
+  ENABLE_SAVESTATES_FALSE='#'
+else
+  ENABLE_SAVESTATES_TRUE='#'
+  ENABLE_SAVESTATES_FALSE=
+fi
+
+
+attributelog=
+
+# Check whether --with-attributelog was given.
+if test "${with_attributelog+set}" = set; then :
+  withval=$with_attributelog; case "$withval" in yes) attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.' ;;
+                      no) ;; *) attributelog="$withval" ;; esac
+fi
+
+attributelogdir="${attributelog%/*}"
+
+
+ if test -n "$attributelog"; then
+  ENABLE_ATTRIBUTELOG_TRUE=
+  ENABLE_ATTRIBUTELOG_FALSE='#'
+else
+  ENABLE_ATTRIBUTELOG_TRUE='#'
+  ENABLE_ATTRIBUTELOG_FALSE=
+fi
+
+
+# Check whether --enable-sample was given.
+if test "${enable_sample+set}" = set; then :
+  enableval=$enable_sample; smartd_suffix=; test "$enableval" = "yes" && smartd_suffix=".sample"
+else
+  smartd_suffix=;
+fi
+
+
+
+
+# Check whether --with-os-deps was given.
+if test "${with_os_deps+set}" = set; then :
+  withval=$with_os_deps;  for x in $with_os_deps; do
+      case $x in
+        *.o) ;;
+        *) as_fn_error $? "non-object file specified by --with-os-deps" "$LINENO" 5 ;;
+      esac
+    done
+
+fi
+
+
+
+# Check whether --with-selinux was given.
+if test "${with_selinux+set}" = set; then :
+  withval=$with_selinux;  if test "$withval" = "yes"; then
+      for ac_header in selinux/selinux.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
+if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SELINUX_SELINUX_H 1
+_ACEOF
+
+else
+  as_fn_error $? "Missing SELinux header files" "$LINENO" 5
+fi
+
+done
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for matchpathcon in -lselinux" >&5
+$as_echo_n "checking for matchpathcon in -lselinux... " >&6; }
+if ${ac_cv_lib_selinux_matchpathcon+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char matchpathcon ();
+int
+main ()
+{
+return matchpathcon ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_selinux_matchpathcon=yes
+else
+  ac_cv_lib_selinux_matchpathcon=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_matchpathcon" >&5
+$as_echo "$ac_cv_lib_selinux_matchpathcon" >&6; }
+if test "x$ac_cv_lib_selinux_matchpathcon" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+  LIBS="-lselinux $LIBS"
+
+else
+  as_fn_error $? "Missing or incorrect SELinux library files" "$LINENO" 5
+fi
+
+    fi
+
+fi
+
+
+if test "$with_selinux" = "yes"; then
+
+$as_echo "#define WITH_SELINUX 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-libcap-ng was given.
+if test "${with_libcap_ng+set}" = set; then :
+  withval=$with_libcap_ng;
+else
+  with_libcap_ng=auto
+fi
+
+
+use_libcap_ng=no
+if test "$with_libcap_ng" != "no"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for capng_clear in -lcap-ng" >&5
+$as_echo_n "checking for capng_clear in -lcap-ng... " >&6; }
+if ${ac_cv_lib_cap_ng_capng_clear+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcap-ng  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char capng_clear ();
+int
+main ()
+{
+return capng_clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_cap_ng_capng_clear=yes
+else
+  ac_cv_lib_cap_ng_capng_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_ng_capng_clear" >&5
+$as_echo "$ac_cv_lib_cap_ng_capng_clear" >&6; }
+if test "x$ac_cv_lib_cap_ng_capng_clear" = xyes; then :
+
+$as_echo "#define HAVE_LIBCAP_NG 1" >>confdefs.h
+      CAPNG_LDADD="-lcap-ng"; use_libcap_ng=yes
+fi
+
+
+  if test "$use_libcap_ng" = "yes"; then
+    ac_fn_cxx_check_header_mongrel "$LINENO" "cap-ng.h" "ac_cv_header_cap_ng_h" "$ac_includes_default"
+if test "x$ac_cv_header_cap_ng_h" = xyes; then :
+
+else
+  as_fn_error $? "libcap-ng libraries found but headers are missing" "$LINENO" 5
+fi
+
+
+  elif test "$with_libcap_ng" = "yes"; then
+    as_fn_error $? "libcap-ng support was requested but the library was not found" "$LINENO" 5
+  fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libcap-ng" >&5
+$as_echo_n "checking whether to use libcap-ng... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libcap_ng" >&5
+$as_echo "$use_libcap_ng" >&6; }
+
+# TODO: Remove when NVMe support is no longer EXPERIMENTAL
+
+# Check whether --with-nvme-devicescan was given.
+if test "${with_nvme_devicescan+set}" = set; then :
+  withval=$with_nvme_devicescan;
+fi
+
+
+if test "$with_nvme_devicescan" = "yes"; then
+
+$as_echo "#define WITH_NVME_DEVICESCAN 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-solaris-sparc-ata was given.
+if test "${with_solaris_sparc_ata+set}" = set; then :
+  withval=$with_solaris_sparc_ata;
+fi
+
+
+case "$host:$with_solaris_sparc_ata" in
+  sparc-*-solaris*:yes)
+    if test ! -f "$srcdir/os_solaris_ata.s"; then
+      as_fn_error $? "Missing source file: $srcdir/os_solaris_ata.s
+This file is no longer included in the source tarball but still
+available in the SVN repository." "$LINENO" 5
+    fi
+
+$as_echo "#define WITH_SOLARIS_SPARC_ATA 1" >>confdefs.h
+
+    ;;
+esac
+
+# Assume broken snprintf only on Windows with MSVCRT (MinGW without ANSI stdio support)
+libc_have_working_snprintf=yes
+
+case "$host" in
+  *-*-mingw*)
+    case " $CPPFLAGS $CXXFLAGS" in
+      *\ -[DU]__USE_MINGW_ANSI_STDIO*)
+        ;;
+      *)
+        # Older MinGW do not properly define PRI?64 if __USE_MINGW_ANSI_STDIO is set
+        # Newer MinGW set __USE_MINGW_ANSI_STDIO in first C++ include which may be too late
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __USE_MINGW_ANSI_STDIO is defined by C++ includes" >&5
+$as_echo_n "checking whether __USE_MINGW_ANSI_STDIO is defined by C++ includes... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+          #undef __USE_MINGW_ANSI_STDIO
+          #include <iostream>
+          #ifndef __USE_MINGW_ANSI_STDIO
+            #error false
+          #endif
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  CXXFLAGS="-D__USE_MINGW_ANSI_STDIO $CXXFLAGS"
+else
+  libc_have_working_snprintf=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_have_working_snprintf" >&5
+$as_echo "$libc_have_working_snprintf" >&6; }
+        ;;
+    esac ;;
+esac
+
+
+# Check whether --with-working-snprintf was given.
+if test "${with_working_snprintf+set}" = set; then :
+  withval=$with_working_snprintf; libc_have_working_snprintf=$withval
+fi
+
+
+if test "$libc_have_working_snprintf" = "yes"; then
+
+$as_echo "#define HAVE_WORKING_SNPRINTF 1" >>confdefs.h
+ fi
+
+
+# Check whether --with-mingw-aslr was given.
+if test "${with_mingw_aslr+set}" = set; then :
+  withval=$with_mingw_aslr;
+else
+  with_mingw_aslr=auto
+fi
+
+
+case "$host:${LDFLAGS+set}" in
+  *-*-mingw*:) # MinGW defaults: link statically and indicate DEP and TS compatibility
+    LDFLAGS="-static -Wl,--nxcompat,--tsaware" ;;
+esac
+
+case "$host:$with_mingw_aslr" in
+  x86_64-*-mingw*:auto)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports --high-entropy-va" >&5
+$as_echo_n "checking whether $CXX supports --high-entropy-va... " >&6; }
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup,--high-entropy-va,--image-base,0x140000000"
+    # Link libstdc++ to detect MinGW 6.3.0 problems with high --image-base
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+        #include <string>
+        std::string s(42, '.');
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  with_mingw_aslr=yes
+else
+  with_mingw_aslr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_mingw_aslr" >&5
+$as_echo "$with_mingw_aslr" >&6; }
+    test "$with_mingw_aslr" = "yes" || with_mingw_aslr=low
+    ;;
+esac
+
+case "$host:$with_mingw_aslr" in
+  x86_64-*-mingw*:yes)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup,--high-entropy-va,--image-base,0x140000000" ;;
+  x86_64-*-mingw*:low)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup" ;;
+  *-*-mingw*:auto|*-*-mingw*:yes|*-*-mingw*:low)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-e_mainCRTStartup" ;;
+esac
+
+os_win32_manifest=
+case "$host" in
+  *-*-mingw*)
+    # Newer MinGW may add a default manifest
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX adds an application manifest" >&5
+$as_echo_n "checking whether $CXX adds an application manifest... " >&6; }
+    cc_adds_manifest=no
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+        if "$WINDRES" -O rc conftest.exe 2>/dev/null | grep '^1.*RT_MANIFEST' >/dev/null 2>&1; then
+          cc_adds_manifest=incomplete
+          # Manifest must provide a Win 10 compatibility ID
+          if "$WINDRES" -O rc conftest.exe 2>/dev/null | grep '{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}' >/dev/null 2>&1; then
+            cc_adds_manifest=yes
+          fi
+        fi
+else
+  as_fn_error $? "test compile failed" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_adds_manifest" >&5
+$as_echo "$cc_adds_manifest" >&6; }
+    test "$cc_adds_manifest" = "yes" || os_win32_manifest='os_win32/default.manifest'
+    ;;
+esac
+
+
+# Check whether --with-cxx11-option was given.
+if test "${with_cxx11_option+set}" = set; then :
+  withval=$with_cxx11_option;
+else
+  with_cxx11_option=auto
+fi
+
+
+check_cxx11_support()
+{
+  save_CXXFLAGS=$CXXFLAGS
+  CXXFLAGS=$1
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+      #if __cplusplus < 201103L
+      #error false
+      #endif
+      // use some C++11 features (and return v * 42 :-)
+      auto cxx11(long v) noexcept -> decltype(v) {
+        typedef decltype(v) t; t r = v;
+        static const t a[] = { -7, -1, 1, 2, 3 };
+        static_assert(sizeof(r) == sizeof(a[0]), "fail");
+        auto f = [](t x, t y){ return x * y; };
+        for (const auto & e : a) r = f(r, e);
+        return r;
+      }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  CXXFLAGS=$save_CXXFLAGS; return 0
+else
+  CXXFLAGS=$save_CXXFLAGS; return 1
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+}
+
+case "$with_cxx11_option" in
+  no) ;;
+  auto)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CXX option to accept C++11" >&5
+$as_echo_n "checking for $CXX option to accept C++11... " >&6; }
+    with_cxx11_option=unknown
+    for option in "" "-std=gnu++11" "-std=gnu++0x" "-std=c++11" "-std=c++0x"; do
+      if check_cxx11_support "$option"; then with_cxx11_option=$option; break; fi
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_cxx11_option:-none needed}" >&5
+$as_echo "${with_cxx11_option:-none needed}" >&6; }
+    test "$with_cxx11_option" != "unknown" || as_fn_error $? "
+This version of smartmontools does not use C++11 features, but future
+versions possibly will.
+This script was unable to determine a compiler option to enable C++11.
+Use option '--with-cxx11-option=OPTION' to specify the compiler option
+(it will be checked, but not used in the actual build).
+Use option '--without-cxx11-option' to suppress this error message if the
+compiler lacks C++11 support.
+In both cases, please send info about compiler and platform to
+$PACKAGE_BUGREPORT - Thanks!" "$LINENO" 5
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX $with_cxx11_option accepts C++11" >&5
+$as_echo_n "checking whether $CXX $with_cxx11_option accepts C++11... " >&6; }
+    res=no; check_cxx11_support "$with_cxx11_option" && res=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $res" >&5
+$as_echo "$res" >&6; }
+    test "$res" = "yes" || as_fn_error $? "$CXX $with_cxx11_option does not accept C++11" "$LINENO" 5
+    ;;
+esac
+
+
+releaseversion='${PACKAGE}-${VERSION}'
+
+
+
+
+# Set platform-specific modules and symbols
+os_libs=
+os_dltools='curl wget lynx svn'
+os_mailer=mail
+os_hostname="'hostname'"
+os_dnsdomainname=
+os_nisdomainname="'domainname'"
+os_darwin=no
+os_solaris=no
+os_win32=no
+os_win32_mingw=no
+os_win64=no
+os_man_filter=
+case "${host}" in
+  *-*-linux*)
+    os_deps='os_linux.o cciss.o dev_areca.o'
+    os_dnsdomainname="'dnsdomainname' 'hostname -d'"
+    os_nisdomainname="'nisdomainname' 'hostname -y' 'domainname'"
+    os_man_filter=Linux
+    ;;
+  *-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*)
+    os_deps='os_freebsd.o cciss.o dev_areca.o'
+    os_libs='-lcam'
+    os_dltools='curl wget lynx fetch svn'
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb20_dev_get_device_desc in -lusb" >&5
+$as_echo_n "checking for libusb20_dev_get_device_desc in -lusb... " >&6; }
+if ${ac_cv_lib_usb_libusb20_dev_get_device_desc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lusb  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char libusb20_dev_get_device_desc ();
+int
+main ()
+{
+return libusb20_dev_get_device_desc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_usb_libusb20_dev_get_device_desc=yes
+else
+  ac_cv_lib_usb_libusb20_dev_get_device_desc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_libusb20_dev_get_device_desc" >&5
+$as_echo "$ac_cv_lib_usb_libusb20_dev_get_device_desc" >&6; }
+if test "x$ac_cv_lib_usb_libusb20_dev_get_device_desc" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUSB 1
+_ACEOF
+
+  LIBS="-lusb $LIBS"
+
+fi
+
+    os_man_filter=FreeBSD
+    ;;
+  sparc-*-solaris*)
+    os_deps='os_solaris.o'
+    test "$with_solaris_sparc_ata" = "yes" \
+      && os_deps="$os_deps os_solaris_ata.o"
+    os_mailer='mailx'
+    os_solaris=yes
+    os_man_filter=Solaris
+    ;;
+  *-pc-solaris*)
+    os_deps='os_solaris.o'
+    os_mailer='mailx'
+    os_solaris=yes
+    os_man_filter=Solaris
+    ;;
+  *-*-netbsd*)
+    os_deps='os_netbsd.o'
+    os_libs='-lutil'
+    os_man_filter=NetBSD
+    ;;
+  *-*-openbsd*)
+    os_deps='os_openbsd.o'
+    os_libs='-lutil'
+    os_dltools='curl wget lynx ftp svn'
+    os_man_filter=OpenBSD
+    ;;
+  *-*-cygwin*)
+    os_deps='os_win32.o dev_areca.o'
+    os_mailer='email'
+    os_hostname="'hostname' 'echo "'"${HOSTNAME?unset}"'"'"
+    os_dnsdomainname="'dnsdomainname' 'hostname -d' 'echo "'"${USERDNSDOMAIN?unset}"'"'"
+    os_nisdomainname=
+    os_win32=yes
+    os_man_filter=Cygwin
+    ;;
+  x86_64-*-mingw*)
+    os_deps='os_win32.o dev_areca.o'
+    os_win32=yes
+    os_win32_mingw=yes
+    os_win64=yes
+    os_man_filter=Windows
+    ;;
+  *-*-mingw*)
+    os_deps='os_win32.o dev_areca.o'
+    os_win32=yes
+    os_win32_mingw=yes
+    os_man_filter=Windows
+    ;;
+  *-*-darwin*)
+    os_deps='os_darwin.o'
+    os_libs='-framework CoreFoundation -framework IOKit'
+    os_darwin=yes
+    os_man_filter=Darwin
+    ;;
+  *-*-nto-qnx*)
+    os_deps='os_qnxnto.o'
+    ;;
+  *-*-os2-*)
+    os_deps='os_os2.o'
+    ;;
+  *)
+    os_deps='os_generic.o'
+    ;;
+esac
+
+# Replace if '--with-os-deps' was specified
+test -z "$with_os_deps" || os_deps="$with_os_deps"
+
+# Check if we need adapter to old interface (dev_legacy.cpp)
+os_src=`echo "${os_deps}"|sed -n 's,^\([^ .]*\)\.o.*$,\1.cpp,p'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${os_src} uses new interface" >&5
+$as_echo_n "checking whether ${os_src} uses new interface... " >&6; }
+if grep "smart_interface" "${srcdir}/${os_src}" >/dev/null 2>&1; then
+  os_new_interface=yes
+else
+  os_new_interface=no
+  os_deps="${os_deps} dev_legacy.o"
+
+$as_echo "#define OLD_INTERFACE 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_new_interface" >&5
+$as_echo "$os_new_interface" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+# Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
+DRIVEDB_BRANCH=`echo "$drivedb_version" | sed 's,^\([0-9]*\.[0-9]*\)\..*$,\1,' \
+                | sed -n 's,^\([0-9][0-9]*\)\.\([0-9][0-9]*\)$,RELEASE_\1_\2_DRIVEDB,p'`
+if test -z "$DRIVEDB_BRANCH"; then
+  as_fn_error $? "Unable to create DRIVEDB_BRANCH for version: $drivedb_version" "$LINENO" 5
+fi
+
+
+# Enable platform-specific makefile sections
+ if test "$os_darwin" = "yes"; then
+  OS_DARWIN_TRUE=
+  OS_DARWIN_FALSE='#'
+else
+  OS_DARWIN_TRUE='#'
+  OS_DARWIN_FALSE=
+fi
+
+ if test "$os_solaris" = "yes"; then
+  OS_SOLARIS_TRUE=
+  OS_SOLARIS_FALSE='#'
+else
+  OS_SOLARIS_TRUE='#'
+  OS_SOLARIS_FALSE=
+fi
+
+ if test "$os_win32" = "yes"; then
+  OS_WIN32_TRUE=
+  OS_WIN32_FALSE='#'
+else
+  OS_WIN32_TRUE='#'
+  OS_WIN32_FALSE=
+fi
+
+ if test "$os_win32_mingw" = "yes"; then
+  OS_WIN32_MINGW_TRUE=
+  OS_WIN32_MINGW_FALSE='#'
+else
+  OS_WIN32_MINGW_TRUE='#'
+  OS_WIN32_MINGW_FALSE=
+fi
+
+ if test -n "$MAKENSIS"; then
+  OS_WIN32_NSIS_TRUE=
+  OS_WIN32_NSIS_FALSE='#'
+else
+  OS_WIN32_NSIS_TRUE='#'
+  OS_WIN32_NSIS_FALSE=
+fi
+
+ if test "$os_win64" = "yes"; then
+  OS_WIN64_TRUE=
+  OS_WIN64_FALSE='#'
+else
+  OS_WIN64_TRUE='#'
+  OS_WIN64_FALSE=
+fi
+
+
+if test "$GXX" = "yes"; then
+  # Add -Wall and -W[extra] if its not already specified
+  case " $CXXFLAGS " in
+    *\ -Wall\ *) ;;
+    *) CXXFLAGS="$CXXFLAGS -Wall" ;;
+  esac
+  case " $CXXFLAGS " in
+    *\ -W\ *|*\ -Wextra\ *) ;;
+    *) CXXFLAGS="$CXXFLAGS -W" ;;
+  esac
+  # Add -Wformat=2 (GCC 3.0) -fstack-protector[-strong] (GCC 4.1[4.9]) if supported
+  # and CXXFLAGS was not set in configure cmdline (TODO: -Wformat-signedness)
+  case "${ac_test_CXXFLAGS+set}:$ac_test_CXXFLAGS" in
+    set:)
+      for option in "-Wformat=2" "-fstack-protector-strong" "-fstack-protector"; do
+        case " $CXXFLAGS:$option" in *\ -fstack-p*:-fstack-p*) continue ;; esac
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports $option" >&5
+$as_echo_n "checking whether $CXX supports $option... " >&6; }
+        save_CXXFLAGS=$CXXFLAGS
+        CXXFLAGS="$CXXFLAGS $option"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  res=yes
+else
+  res=no; CXXFLAGS=$save_CXXFLAGS
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $res" >&5
+$as_echo "$res" >&6; }
+      done
+      ;;
+  esac
+else
+  # We are NOT using gcc, so enable host-specific compiler flags
+  case "${host}" in
+    sparc*-*-solaris*)
+      # Tell the Solaris/SPARC C++ compiler about packed ATA structures
+      case " $CXXFLAGS" in
+        *\ -xmemalign*) ;;
+        *) CXXFLAGS="-xmemalign=1i $CXXFLAGS" ;;
+      esac ;;
+  esac
+  case "${host}" in
+    *-*-solaris*)
+      # Turn on optimization if user has not explicitly set its value
+      case " $CXXFLAGS" in
+        *\ -xO*) ;;
+        *) CXXFLAGS="-xO2 $CXXFLAGS" ;;
+      esac
+      # Suppress trivial warnings
+      case " $CXXFLAGS" in
+        *\ -erroff*) ;;
+        *) CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS" ;;
+      esac ;;
+  esac
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define SMARTMONTOOLS_BUILD_HOST "${host}"
+_ACEOF
+
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${IS_SVN_BUILD_TRUE}" && test -z "${IS_SVN_BUILD_FALSE}"; then
+  as_fn_error $? "conditional \"IS_SVN_BUILD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_GETOPT_LONG_TRUE}" && test -z "${NEED_GETOPT_LONG_FALSE}"; then
+  as_fn_error $? "conditional \"NEED_GETOPT_LONG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_REGEX_TRUE}" && test -z "${NEED_REGEX_FALSE}"; then
+  as_fn_error $? "conditional \"NEED_REGEX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+if test -z "${INSTALL_SYSTEMDUNIT_TRUE}" && test -z "${INSTALL_SYSTEMDUNIT_FALSE}"; then
+  as_fn_error $? "conditional \"INSTALL_SYSTEMDUNIT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_INITSCRIPT_TRUE}" && test -z "${INSTALL_INITSCRIPT_FALSE}"; then
+  as_fn_error $? "conditional \"INSTALL_INITSCRIPT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_DRIVEDB_TRUE}" && test -z "${ENABLE_DRIVEDB_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_DRIVEDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_UPDATE_SMART_DRIVEDB_TRUE}" && test -z "${ENABLE_UPDATE_SMART_DRIVEDB_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_UPDATE_SMART_DRIVEDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_SCRIPTPATH_TRUE}" && test -z "${ENABLE_SCRIPTPATH_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_SCRIPTPATH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_SAVESTATES_TRUE}" && test -z "${ENABLE_SAVESTATES_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_SAVESTATES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_ATTRIBUTELOG_TRUE}" && test -z "${ENABLE_ATTRIBUTELOG_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_ATTRIBUTELOG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_DARWIN_TRUE}" && test -z "${OS_DARWIN_FALSE}"; then
+  as_fn_error $? "conditional \"OS_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_SOLARIS_TRUE}" && test -z "${OS_SOLARIS_FALSE}"; then
+  as_fn_error $? "conditional \"OS_SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then
+  as_fn_error $? "conditional \"OS_WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_WIN32_MINGW_TRUE}" && test -z "${OS_WIN32_MINGW_FALSE}"; then
+  as_fn_error $? "conditional \"OS_WIN32_MINGW\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_WIN32_NSIS_TRUE}" && test -z "${OS_WIN32_NSIS_FALSE}"; then
+  as_fn_error $? "conditional \"OS_WIN32_NSIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_WIN64_TRUE}" && test -z "${OS_WIN64_FALSE}"; then
+  as_fn_error $? "conditional \"OS_WIN64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by smartmontools $as_me 6.6, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <smartmontools-support@listi.jpberlin.de>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+smartmontools config.status 6.6
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# Note: Use `...` here as some shells do not properly parse '$(... case $x in X) ...)'
+info=`
+  echo "-----------------------------------------------------------------------------"
+  echo "${PACKAGE}-${VERSION} configuration:"
+  echo "host operating system:  $host"
+  echo "C++ compiler:           $CXX"
+  echo "C compiler:             $CC"
+  echo "preprocessor flags:     $CPPFLAGS"
+  echo "C++ compiler flags:     $CXXFLAGS"
+  echo "C compiler flags:       $CFLAGS"
+  echo "linker flags:           $LDFLAGS"
+  echo "OS specific modules:    $os_deps $os_libs $LIBS"
+
+  case "$host_os" in
+    mingw*)
+      echo "application manifest:   ${os_win32_manifest:-built-in}"
+      echo "resource compiler:      $WINDRES"
+      echo "message compiler:       $WINDMC"
+      echo "NSIS compiler:          $MAKENSIS"
+      if test -n "$drivedbdir"; then
+        echo "drive database file:    EXEDIR/drivedb.h"
+        if test -n "$MAKENSIS"; then
+          echo "database update tool:   EXEDIR/update-smart-drivedb.exe"
+        fi
+      else
+        echo "drive database file:    [disabled]"
+      fi
+      if test -n "$savestates"; then
+        echo "smartd save files:      \`eval eval eval echo $savestates\`MODEL-SERIAL.TYPE.state"
+      fi
+      if test -n "$attributelog"; then
+        echo "smartd attribute logs:  \`eval eval eval echo $attributelog\`MODEL-SERIAL.TYPE.csv"
+      fi
+      echo "NVMe DEVICESCAN:        ${with_nvme_devicescan-no}"
+      ;;
+
+    *)
+      echo "binary install path:    \`eval eval eval echo $sbindir\`"
+      echo "man page install path:  \`eval eval eval echo $mandir\`"
+      echo "doc file install path:  \`eval eval eval echo $docdir\`"
+      echo "examples install path:  \`eval eval eval echo $exampledir\`"
+      if test -n "$drivedbdir"; then
+        echo "drive database file:    \`eval eval eval echo $drivedbdir\`/drivedb.h"
+        if test "$with_update_smart_drivedb" = "yes"; then
+          echo "database update script: \`eval eval eval echo $sbindir\`/update-smart-drivedb"
+          if test "$drivedb_version" != "$VERSION"; then
+            echo "... backported to:      branches/$DRIVEDB_BRANCH"
+          fi
+          echo "download tools:         \`eval eval eval echo $os_dltools\`"
+          if test -n "$gnupg"; then
+            echo "GnuPG for verification: \`eval eval eval echo $gnupg\`"
+          else
+            echo "GnuPG for verification: [disabled]"
+          fi
+        else
+          echo "database update script: [disabled]"
+        fi
+      else
+        echo "drive database file:    [disabled]"
+      fi
+      echo "local drive database:   \`eval eval eval echo $sysconfdir\`/smart_drivedb.h"
+      echo "smartd config file:     \`eval eval eval echo $sysconfdir\`/smartd.conf${smartd_suffix}"
+      echo "smartd warning script:  \`eval eval eval echo $smartdscriptdir\`/smartd_warning.sh"
+      if test -n "$smartdplugindir"; then
+        echo "smartd plugin path:     \`eval eval eval echo $smartdplugindir\`"
+      else
+        echo "smartd plugin path:     [disabled]"
+      fi
+      if test -n "$scriptpath"; then
+        echo "PATH within scripts:    \`eval eval eval echo $scriptpath\`"
+      else
+        echo "PATH within scripts:    [inherited]"
+      fi
+      if test -n "$initddir"; then
+        echo "smartd initd script:    \`eval eval eval echo $initddir\`/${initdfile}"
+      elif test -z "$systemdsystemunitdir"; then
+        echo "smartd initd script:    [disabled]"
+      fi
+      if test -n "$systemdsystemunitdir"; then
+        echo "smartd systemd file:    \`eval eval eval echo $systemdsystemunitdir\`/smartd.service"
+        if test -n "$systemdenvfile"; then
+          echo "smartd environ file:    \`eval eval eval echo $systemdenvfile\`"
+        else
+          echo "smartd environ file:    [disabled]"
+        fi
+      fi
+      if test -n "$savestates"; then
+        echo "smartd save files:      \`eval eval eval echo $savestates\`MODEL-SERIAL.TYPE.state"
+      else
+        echo "smartd save files:      [disabled]"
+      fi
+      if test -n "$attributelog"; then
+        echo "smartd attribute logs:  \`eval eval eval echo $attributelog\`MODEL-SERIAL.TYPE.csv"
+      else
+        echo "smartd attribute logs:  [disabled]"
+      fi
+      echo "libcap-ng support:      $use_libcap_ng"
+      case "$host_os" in
+        linux*) echo "SELinux support:        ${with_selinux-no}" ;;
+      esac
+      case "$host_os" in
+        linux*|darwin*|netbsd*|cygwin*)
+          echo "NVMe DEVICESCAN:        ${with_nvme_devicescan-no}" ;;
+      esac
+      ;;
+  esac
+  echo "-----------------------------------------------------------------------------"
+`
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}:
+$info
+" >&5
+$as_echo "$as_me:
+$info
+" >&6;}
+
+# TODO: Remove when NVMe support is no longer EXPERIMENTAL
+case "$host_os:${with_nvme_devicescan+set}" in
+  linux*:|darwin*:|netbsd*:|cygwin*:|mingw*:)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+This version of smartmontools provides NVMe support which is still
+EXPERIMENTAL.  NVMe devices are not yet included in smartd.conf
+'DEVICESCAN' and 'smartctl --scan' unless '-d nvme' is specified.
+Use option '--with-nvme-devicescan' to include NVMe devices.
+Use option '--without-nvme-devicescan' to suppress this warning.
+" >&5
+$as_echo "$as_me: WARNING:
+This version of smartmontools provides NVMe support which is still
+EXPERIMENTAL.  NVMe devices are not yet included in smartd.conf
+'DEVICESCAN' and 'smartctl --scan' unless '-d nvme' is specified.
+Use option '--with-nvme-devicescan' to include NVMe devices.
+Use option '--without-nvme-devicescan' to suppress this warning.
+" >&2;}
+    ;;
+esac
+
+# TODO: Remove after smartmontools 6.6
+case "$host:${with_solaris_sparc_ata+set}" in
+  sparc-*-solaris*:)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+Legacy ATA support is no longer enabled by default on Solaris SPARC.
+The required source file 'os_solaris_ata.s' is no longer included in
+the source tarball but still available in the SVN repository.
+Use option '--with-solaris-sparc-ata' to enable legacy ATA support.
+Use option '--without-solaris-sparc-ata' to suppress this warning.
+" >&5
+$as_echo "$as_me: WARNING:
+Legacy ATA support is no longer enabled by default on Solaris SPARC.
+The required source file 'os_solaris_ata.s' is no longer included in
+the source tarball but still available in the SVN repository.
+Use option '--with-solaris-sparc-ata' to enable legacy ATA support.
+Use option '--without-solaris-sparc-ata' to suppress this warning.
+" >&2;}
+    ;;
+esac
index f0d47338198bb05a0c40b02c1604918c2a64e7e9..91cf6d7aafb532a3da280826ed971502f887bee1 100644 (file)
@@ -1,14 +1,14 @@
 #
-# $Id: configure.ac 4319 2016-05-07 12:14:20Z chrfranke $
+# $Id: configure.ac 4594 2017-11-05 15:21:35Z chrfranke $
 #
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.60])
-AC_INIT(smartmontools, 6.6, smartmontools-support@lists.sourceforge.net)
+AC_INIT(smartmontools, 6.6, smartmontools-support@listi.jpberlin.de)
 AM_INIT_AUTOMAKE([1.10 foreign])
 
-smartmontools_cvs_tag=`echo '$Id: configure.ac 4319 2016-05-07 12:14:20Z chrfranke $'`
-smartmontools_release_date=2016-05-07
-smartmontools_release_time="11:17:46 UTC"
+smartmontools_cvs_tag=`echo '$Id: configure.ac 4594 2017-11-05 15:21:35Z chrfranke $'`
+smartmontools_release_date=2017-11-05
+smartmontools_release_time="15:20:58 UTC"
 
 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args",            [smartmontools Configure Arguments])
 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE,   "$smartmontools_release_date",   [smartmontools Release Date])
@@ -244,13 +244,36 @@ AC_ARG_WITH(drivedbdir,
 AC_SUBST(drivedbdir)
 AM_CONDITIONAL(ENABLE_DRIVEDB, [test -n "$drivedbdir"])
 
+drivedb_version=$VERSION
 AC_ARG_WITH(update-smart_drivedb,
-  [AS_HELP_STRING([--with-update-smart-drivedb@<:@=yes|no@:>@], [Install update-smart-drivedb script [yes]])],
-  [], [with_update_smart_drivedb=yes])
+  [AS_HELP_STRING([--with-update-smart-drivedb@<:@=yes|no|X.Y@:>@],
+    [Install update-smart-drivedb script (and backport it to branches/RELEASE_X_Y_DRIVEDB) [yes]])],
+  [ case "$withval" in
+      yes|no) ;;
+      5.4[[0-3]]|6.[[0-9]]) drivedb_version=$withval; with_update_smart_drivedb=yes ;;
+      *) AC_MSG_ERROR([Invalid drivedb branch version: $withval]) ;;
+    esac
+  ],
+  [with_update_smart_drivedb=yes])
 test -n "$drivedbdir" || with_update_smart_drivedb=no
 AC_SUBST(with_update_smart_drivedb)
 AM_CONDITIONAL(ENABLE_UPDATE_SMART_DRIVEDB, [test "$with_update_smart_drivedb" = "yes"])
 
+gnupg="gpg"
+# Also check for '--with-gnupg[=yes]' because 'yes' is a valid command with infinite output
+AC_ARG_WITH(gnupg,
+  [AS_HELP_STRING([--with-gnupg@<:@=FILE|yes|no@:>@], [GnuPG used to verify drivedb.h [gpg]])],
+  [case "$withval" in yes) ;; no) gnupg= ;; *) gnupg="$withval" ;; esac], [])
+AC_SUBST(gnupg)
+
+case "$with_update_smart_drivedb:$gnupg" in
+  no:?*)
+    AC_MSG_ERROR([
+'--without-update-smart-drivedb' now requires '--without-gnupg'.
+NEWS: update-smart-drivedb now verifies the downloaded drivedb.h file with GnuPG.])
+    ;;
+esac
+
 AC_ARG_WITH(smartdscriptdir,
   [AS_HELP_STRING([--with-smartdscriptdir=DIR], [Location of smartd_warning.sh script [SYSCONFDIR]])],
   [smartdscriptdir="$withval"], [smartdscriptdir='${sysconfdir}'])
@@ -263,6 +286,14 @@ AC_ARG_WITH(smartdplugindir,
   [smartdplugindir='${smartdscriptdir}/smartd_warning.d'])
 AC_SUBST(smartdplugindir)
 
+AC_ARG_WITH(scriptpath,
+  [AS_HELP_STRING([--with-scriptpath=@<:@PATH|no@:>@],
+    [PATH variable set within scripts [/usr/bin:/bin]])],
+  [scriptpath=; test "$withval" != "no" && scriptpath="$withval"],
+  [scriptpath="/usr/bin:/bin"])
+AC_SUBST(scriptpath)
+AM_CONDITIONAL(ENABLE_SCRIPTPATH, [test -n "$scriptpath"])
+
 savestates=
 AC_ARG_WITH(savestates,
   [AS_HELP_STRING([--with-savestates@<:@=PREFIX|yes|no@:>@],
@@ -392,11 +423,45 @@ if test "$libc_have_working_snprintf" = "yes"; then
   AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane.]) dnl `vim syntax
 fi
 
+AC_ARG_WITH(mingw-aslr,
+  [AS_HELP_STRING([--with-mingw-aslr@<:@=auto|yes|low|no@:>@], [Enable ASLR for MinGW executables [auto]])],
+  [], [with_mingw_aslr=auto])
+
+case "$host:${LDFLAGS+set}" in
+  *-*-mingw*:) # MinGW defaults: link statically and indicate DEP and TS compatibility
+    LDFLAGS="-static -Wl,--nxcompat,--tsaware" ;;
+esac
+
+case "$host:$with_mingw_aslr" in
+  x86_64-*-mingw*:auto)
+    AC_MSG_CHECKING([whether $CXX supports --high-entropy-va])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup,--high-entropy-va,--image-base,0x140000000"
+    # Link libstdc++ to detect MinGW 6.3.0 problems with high --image-base
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+        #include <string>
+        std::string s(42, '.');]])],
+      [with_mingw_aslr=yes], [with_mingw_aslr=no])
+    LDFLAGS=$save_LDFLAGS
+    AC_MSG_RESULT([$with_mingw_aslr])
+    test "$with_mingw_aslr" = "yes" || with_mingw_aslr=low
+    ;;
+esac
+
+case "$host:$with_mingw_aslr" in
+  x86_64-*-mingw*:yes)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup,--high-entropy-va,--image-base,0x140000000" ;;
+  x86_64-*-mingw*:low)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-emainCRTStartup" ;;
+  *-*-mingw*:auto|*-*-mingw*:yes|*-*-mingw*:low)
+    LDFLAGS="$LDFLAGS -pie -Wl,--dynamicbase,-e_mainCRTStartup" ;;
+esac
+
 os_win32_manifest=
 case "$host" in
   *-*-mingw*)
     # Newer MinGW may add a default manifest
-    AC_MSG_CHECKING([whether $CC adds an application manifest])
+    AC_MSG_CHECKING([whether $CXX adds an application manifest])
     cc_adds_manifest=no
     AC_LINK_IFELSE([AC_LANG_PROGRAM()], [
         if "$WINDRES" -O rc conftest.exe 2>/dev/null | grep '^1.*RT_MANIFEST' >/dev/null 2>&1; then
@@ -408,24 +473,62 @@ case "$host" in
         fi],
       [AC_MSG_ERROR([test compile failed])])
     AC_MSG_RESULT([$cc_adds_manifest])
-    test "$cc_adds_manifest" = "yes" || os_win32_manifest='default.manifest.o'
+    test "$cc_adds_manifest" = "yes" || os_win32_manifest='os_win32/default.manifest'
     ;;
 esac
 
-# TODO: Remove after smartmontools 6.5
-AC_ARG_WITH(docdir,
-  [AS_HELP_STRING([--with-docdir=DIR], [(removed, use --docdir=DIR instead)])],
-  [AC_MSG_ERROR([--with-docdir is no longer supported, use --docdir instead])])
-AC_ARG_ENABLE(drivedb,
-  [AS_HELP_STRING([--disable-drivedb], [(removed, use --without-drivedbdir instead)])])
-AC_ARG_ENABLE(savestates,
-  [AS_HELP_STRING([--enable-savestates], [(removed, use --with-savestates@<:@=yes@:>@ instead)])])
-AC_ARG_ENABLE(attributelog,
-  [AS_HELP_STRING([--enable-attributelog], [(removed, use --with-attributelog@<:@=yes@:>@ instead)])])
-if test -n "${enable_drivedb+set}${enable_savestates+set}${enable_attributelog+set}"; then
-  AC_MSG_ERROR([Options --disable-drivedb, --enable-savestates, --enable-attributelog are no longer supported.
-Use --without-drivedbdir, --with-savestates, --with-attributelog instead.])
-fi
+AC_ARG_WITH(cxx11-option,
+  [AS_HELP_STRING([--with-cxx11-option@<:@=OPTION|auto|no@:>@],
+    [Compiler option to enable C++11 support for future versions of smartmontools, 'no' if unsupported [auto]])],
+  [], [with_cxx11_option=auto])
+
+check_cxx11_support()
+{
+  save_CXXFLAGS=$CXXFLAGS
+  CXXFLAGS=$1
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+      #if __cplusplus < 201103L
+      #error false
+      #endif
+      // use some C++11 features (and return v * 42 :-)
+      auto cxx11(long v) noexcept -> decltype(v) {
+        typedef decltype(v) t; t r = v;
+        static const t a[] = { -7, -1, 1, 2, 3 };
+        static_assert(sizeof(r) == sizeof(a[0]), "fail");
+        auto f = [](t x, t y){ return x * y; };
+        for (const auto & e : a) r = f(r, e);
+        return r;
+      }]])],
+    [CXXFLAGS=$save_CXXFLAGS; return 0], [CXXFLAGS=$save_CXXFLAGS; return 1])
+}
+
+case "$with_cxx11_option" in
+  no) ;;
+  auto)
+    AC_MSG_CHECKING([for $CXX option to accept C++11])
+    with_cxx11_option=unknown
+    for option in "" "-std=gnu++11" "-std=gnu++0x" "-std=c++11" "-std=c++0x"; do
+      if check_cxx11_support "$option"; then with_cxx11_option=$option; break; fi
+    done
+    AC_MSG_RESULT([${with_cxx11_option:-none needed}])
+    test "$with_cxx11_option" != "unknown" || AC_MSG_ERROR([
+This version of smartmontools does not use C++11 features, but future
+versions possibly will.
+This script was unable to determine a compiler option to enable C++11.
+Use option '--with-cxx11-option=OPTION' to specify the compiler option
+(it will be checked, but not used in the actual build).
+Use option '--without-cxx11-option' to suppress this error message if the
+compiler lacks C++11 support.
+In both cases, please send info about compiler and platform to
+$PACKAGE_BUGREPORT - Thanks!])
+    ;;
+  *)
+    AC_MSG_CHECKING([whether $CXX $with_cxx11_option accepts C++11])
+    res=no; check_cxx11_support "$with_cxx11_option" && res=yes
+    AC_MSG_RESULT([$res])
+    test "$res" = "yes" || AC_MSG_ERROR([$CXX $with_cxx11_option does not accept C++11])
+    ;;
+esac
 
 
 AC_SUBST(releaseversion,['${PACKAGE}-${VERSION}'])
@@ -515,6 +618,9 @@ case "${host}" in
   *-*-nto-qnx*)
     os_deps='os_qnxnto.o'
     ;;
+  *-*-os2-*)
+    os_deps='os_os2.o'
+    ;;
   *)
     os_deps='os_generic.o'
     ;;
@@ -546,10 +652,10 @@ AC_SUBST([os_man_filter])
 AC_SUBST([os_win32_manifest])
 
 # Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
-DRIVEDB_BRANCH=`echo $VERSION | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
+DRIVEDB_BRANCH=`echo "$drivedb_version" | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
                 | sed -n 's,^\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\)$,RELEASE_\1_\2_DRIVEDB,p'`
 if test -z "$DRIVEDB_BRANCH"; then
-  AC_MSG_ERROR([Unable to create DRIVEDB_BRANCH from VERSION=$VERSION])
+  AC_MSG_ERROR([Unable to create DRIVEDB_BRANCH for version: $drivedb_version])
 fi
 AC_SUBST([DRIVEDB_BRANCH])
 
@@ -561,37 +667,53 @@ AM_CONDITIONAL(OS_WIN32_MINGW, [test "$os_win32_mingw" = "yes"])
 AM_CONDITIONAL(OS_WIN32_NSIS, [test -n "$MAKENSIS"])
 AM_CONDITIONAL(OS_WIN64, [test "$os_win64" = "yes"])
 
-dnl Add -Wall and -W if using g++ and its not already specified.
 if test "$GXX" = "yes"; then
-  if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
-      CXXFLAGS="$CXXFLAGS -Wall"
-  fi
-# In the next line, do NOT delete the 2 spaces inside double quotes.
-  if test -z "`echo "$CXXFLAGS " | grep "\-W " 2> /dev/null`" ; then
-      CXXFLAGS="$CXXFLAGS -W"
-  fi
-
+  # Add -Wall and -W[extra] if its not already specified
+  case " $CXXFLAGS " in
+    *\ -Wall\ *) ;;
+    *) CXXFLAGS="$CXXFLAGS -Wall" ;;
+  esac
+  case " $CXXFLAGS " in
+    *\ -W\ *|*\ -Wextra\ *) ;;
+    *) CXXFLAGS="$CXXFLAGS -W" ;;
+  esac
+  # Add -Wformat=2 (GCC 3.0) -fstack-protector[-strong] (GCC 4.1[4.9]) if supported
+  # and CXXFLAGS was not set in configure cmdline (TODO: -Wformat-signedness)
+  case "${ac_test_CXXFLAGS+set}:$ac_test_CXXFLAGS" in
+    set:)
+      for option in "-Wformat=2" "-fstack-protector-strong" "-fstack-protector"; do
+        case " $CXXFLAGS:$option" in *\ -fstack-p*:-fstack-p*) continue ;; esac
+        AC_MSG_CHECKING([whether $CXX supports $option])
+        save_CXXFLAGS=$CXXFLAGS
+        CXXFLAGS="$CXXFLAGS $option"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [res=yes], [res=no; CXXFLAGS=$save_CXXFLAGS])
+        AC_MSG_RESULT([$res])
+      done
+      ;;
+  esac
 else
- dnl We are NOT using gcc, so enable host-specific compiler flags
- case "${host}" in
-       sparc*-*-solaris*) 
-          dnl set CXXFLAGS for Solaris/SPARC C++ compiler
-          if test -z "`echo "$CXXFLAGS" | grep "\-xmemalign" 2> /dev/null`" ; then
-            dnl we have to tell the compilers about packed ATA structures
-            CXXFLAGS="-xmemalign=1i $CXXFLAGS"
-          fi
- esac
- case "${host}" in
-       *-*-solaris*) 
-          if test -z "`echo "$CXXFLAGS" | grep "\-xO" 2> /dev/null`" ; then
-            dnl turn on optimization if user has not explicitly set its value
-            CXXFLAGS="-xO2 $CXXFLAGS"
-          fi
-          if test -z "`echo "$CXXFLAGS" | grep "\-erroff" 2> /dev/null`" ; then
-           dnl suppress trivial warnings
-           CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS"
-         fi
- esac
+  # We are NOT using gcc, so enable host-specific compiler flags
+  case "${host}" in
+    sparc*-*-solaris*)
+      # Tell the Solaris/SPARC C++ compiler about packed ATA structures
+      case " $CXXFLAGS" in
+        *\ -xmemalign*) ;;
+        *) CXXFLAGS="-xmemalign=1i $CXXFLAGS" ;;
+      esac ;;
+  esac
+  case "${host}" in
+    *-*-solaris*)
+      # Turn on optimization if user has not explicitly set its value
+      case " $CXXFLAGS" in
+        *\ -xO*) ;;
+        *) CXXFLAGS="-xO2 $CXXFLAGS" ;;
+      esac
+      # Suppress trivial warnings
+      case " $CXXFLAGS" in
+        *\ -erroff*) ;;
+        *) CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS" ;;
+      esac ;;
+  esac
 fi
 
 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_BUILD_HOST,     "${host}",                       [smartmontools Build Host])
@@ -647,7 +769,15 @@ info=`
         echo "drive database file:    \`eval eval eval echo $drivedbdir\`/drivedb.h"
         if test "$with_update_smart_drivedb" = "yes"; then
           echo "database update script: \`eval eval eval echo $sbindir\`/update-smart-drivedb"
+          if test "$drivedb_version" != "$VERSION"; then
+            echo "... backported to:      branches/$DRIVEDB_BRANCH"
+          fi
           echo "download tools:         \`eval eval eval echo $os_dltools\`"
+          if test -n "$gnupg"; then
+            echo "GnuPG for verification: \`eval eval eval echo $gnupg\`"
+          else
+            echo "GnuPG for verification: [[disabled]]"
+          fi
         else
           echo "database update script: [[disabled]]"
         fi
@@ -662,6 +792,11 @@ info=`
       else
         echo "smartd plugin path:     [[disabled]]"
       fi
+      if test -n "$scriptpath"; then
+        echo "PATH within scripts:    \`eval eval eval echo $scriptpath\`"
+      else
+        echo "PATH within scripts:    [[inherited]]"
+      fi
       if test -n "$initddir"; then
         echo "smartd initd script:    \`eval eval eval echo $initddir\`/${initdfile}"
       elif test -z "$systemdsystemunitdir"; then
@@ -690,7 +825,8 @@ info=`
         linux*) echo "SELinux support:        ${with_selinux-no}" ;;
       esac
       case "$host_os" in
-        linux*|cygwin*) echo "NVMe DEVICESCAN:        ${with_nvme_devicescan-no}" ;;
+        linux*|darwin*|netbsd*|cygwin*)
+          echo "NVMe DEVICESCAN:        ${with_nvme_devicescan-no}" ;;
       esac
       ;;
   esac
@@ -703,17 +839,18 @@ $info
 
 # TODO: Remove when NVMe support is no longer EXPERIMENTAL
 case "$host_os:${with_nvme_devicescan+set}" in
-  linux*:|cygwin*:|mingw*:)
+  linux*:|darwin*:|netbsd*:|cygwin*:|mingw*:)
     AC_MSG_WARN([
 This version of smartmontools provides NVMe support which is still
 EXPERIMENTAL.  NVMe devices are not yet included in smartd.conf
 'DEVICESCAN' and 'smartctl --scan' unless '-d nvme' is specified.
 Use option '--with-nvme-devicescan' to include NVMe devices.
-Use option '--without-nvme-devicescan' to suppress this warning.])
+Use option '--without-nvme-devicescan' to suppress this warning.
+])
     ;;
 esac
 
-# TODO: Remove after smartmontools 6.5
+# TODO: Remove after smartmontools 6.6
 case "$host:${with_solaris_sparc_ata+set}" in
   sparc-*-solaris*:)
     AC_MSG_WARN([
@@ -721,6 +858,7 @@ Legacy ATA support is no longer enabled by default on Solaris SPARC.
 The required source file 'os_solaris_ata.s' is no longer included in
 the source tarball but still available in the SVN repository.
 Use option '--with-solaris-sparc-ata' to enable legacy ATA support.
-Use option '--without-solaris-sparc-ata' to suppress this warning.])
+Use option '--without-solaris-sparc-ata' to suppress this warning.
+])
     ;;
 esac
diff --git a/depcomp b/depcomp
new file mode 100755 (executable)
index 0000000..b39f98f
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'.  On the theory
+## that the space means something, we add a space to the output as
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using '\' :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for ':'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        shift
+        shift
+        ;;
+    *)
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
index 91edb03f1949356c4a16df7f71e8f0d731d82635..f3bb7cd8c33c9ae53eee1ada09701f7660ba07dc 100644 (file)
@@ -21,7 +21,7 @@
 #include "dev_interface.h"
 #include "dev_areca.h"
 
-const char * dev_areca_cpp_cvsid = "$Id: dev_areca.cpp 4209 2016-01-22 20:49:44Z chrfranke $"
+const char * dev_areca_cpp_cvsid = "$Id: dev_areca.cpp 4582 2017-11-03 20:54:56Z chrfranke $"
   DEV_ARECA_H_CVSID;
 
 #include "atacmds.h"
@@ -157,6 +157,7 @@ int generic_areca_device::arcmsr_command_handler(unsigned long arcmsr_cmd, unsig
       sBuf.srbioctl.Length = data_len;
       memcpy((unsigned char *)sBuf.ioctldatabuffer, (unsigned char *)data, data_len);
     }
+    /* FALLTHRU */
     // commands for clearing related buffer of driver
   case ARCMSR_CLEAR_RQBUFFER:
   case ARCMSR_CLEAR_WQBUFFER:
index 93cb339c5209a71093907eed13944168554557f4..1e08cdd282ce6cd8afa9b3edf336b88d0ffa51c3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2008 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 
 #include <errno.h>
 
-const char * dev_ata_cmd_set_cpp_cvsid = "$Id: dev_ata_cmd_set.cpp 4122 2015-08-27 19:08:07Z chrfranke $"
+const char * dev_ata_cmd_set_cpp_cvsid = "$Id: dev_ata_cmd_set.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   DEV_ATA_CMD_SET_H_CVSID;
 
 
index 7cdddc198f3ea96189115e65d9efba12708a5c38..2f98901accf770460db4b2c80876009f0498676a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2008 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #ifndef DEV_ATA_CMD_SET_H
 #define DEV_ATA_CMD_SET_H
 
-#define DEV_ATA_CMD_SET_H_CVSID "$Id: dev_ata_cmd_set.h 4122 2015-08-27 19:08:07Z chrfranke $"
+#define DEV_ATA_CMD_SET_H_CVSID "$Id: dev_ata_cmd_set.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 #include "atacmds.h" // smart_command_set
 #include "dev_interface.h"
diff --git a/dev_intelliprop.cpp b/dev_intelliprop.cpp
new file mode 100644 (file)
index 0000000..b0ab275
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * dev_intelliprop.cpp
+ *
+ * Home page of code is: http://www.smartmontools.org
+ *
+ * Copyright (C) 2016 Casey Biemiller  <cbiemiller@intelliprop.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * You should have received a copy of the GNU General Public License
+ * (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "config.h"
+#include "int64.h"
+#include "atacmds.h" //ATTR_PACKED and ASSERT_SIZEOF_STRUCT
+#include "dev_interface.h"
+#include "dev_intelliprop.h"
+#include "dev_tunnelled.h"
+#include <errno.h>
+
+const char * dev_intelliprop_cpp_cvsid = "$Id: dev_intelliprop.cpp 4370 2017-01-11 20:35:38Z chrfranke $"
+  DEV_INTELLIPROP_H_CVSID;
+
+//Vendor Specific log addresses
+#define LOG_C0           0xc0
+
+// VS LOG MODE CONTROL BITS
+enum {
+  IPROP_VS_LOG_MODE_CTL_AUTO_SUPPORTED   = (0 << 0), // NOTE: Not supported
+  IPROP_VS_LOG_MODE_CTL_MANUAL_SUPPORTED = (1 << 1),
+  IPROP_VS_LOG_MODE_CTL_AUTO_ENABLED     = (0 << 2), // NOTE: Not supported
+  IPROP_VS_LOG_MODE_CTL_MANUAL_ENABLED   = (1 << 3),
+};
+
+// VS LOG PORT SETTING BITS
+enum {
+  IPROP_VS_LOG_PORT_WRITE_ENABLE_MASK  = 0xC000,
+  IPROP_VS_LOG_PORT_WRITE_ENABLE_VALID = 0x8000,
+  IPROP_VS_LOG_PORT_RX_DC_GAIN_MASK    = 0x3000,
+  IPROP_VS_LOG_PORT_RX_DC_GAIN_SHIFT   = 12,
+  IPROP_VS_LOG_PORT_RX_EQ_MASK         = 0x0F00,
+  IPROP_VS_LOG_PORT_RX_EQ_SHIFT        = 8,
+  IPROP_VS_LOG_PORT_TX_PREEMP_MASK     = 0x00F8,
+  IPROP_VS_LOG_PORT_TX_PREEMP_SHIFT    = 3,
+  IPROP_VS_LOG_PORT_TX_VOD_MASK        = 0x0007,
+  IPROP_VS_LOG_PORT_TX_VOD_SHIFT       = 0,
+};
+
+//This struct is used for the Vendor Specific log C0 on devices that support it.
+#pragma pack(1)
+struct iprop_internal_log
+{
+  uint32_t drive_select;       // Bytes - [  3:  0] of Log C0
+  uint32_t obsolete;           // Bytes - [  7:  4] of Log C0
+  uint8_t  mode_control;       // Byte  - [      8] of Log C0
+  uint8_t  log_passthrough;    // Byte  - [      9] of Log C0
+  uint16_t tier_id;            // Bytes - [ 11: 10] of Log C0
+  uint32_t hw_version;         // Bytes - [ 15: 12] of Log C0
+  uint32_t fw_version;         // Bytes - [ 19: 16] of Log C0
+  uint8_t  variant[8];         // Bytes - [ 27: 20] of Log C0
+  uint8_t  reserved[228];      // Bytes - [255: 28] of Log C0
+  uint16_t port_0_settings[3]; // Bytes - [263:256] of Log C0
+  uint16_t port_0_reserved;
+  uint16_t port_1_settings[3]; // Bytes - [271:264] of Log C0
+  uint16_t port_1_reserved;
+  uint16_t port_2_settings[3]; // Bytes - [279:272] of Log C0
+  uint16_t port_2_reserved;
+  uint16_t port_3_settings[3]; // Bytes - [287:280] of Log C0
+  uint16_t port_3_reserved;
+  uint16_t port_4_settings[3]; // Bytes - [295:288] of Log C0
+  uint16_t port_4_reserved;
+  uint8_t  reserved2[214];     // Bytes - [509:296] of Log C0
+  uint16_t crc;                // Bytes - [511:510] of Log C0
+} ATTR_PACKED;
+#pragma pack()
+ASSERT_SIZEOF_STRUCT(iprop_internal_log, 512);
+
+/**
+ * buffer is a pointer to a buffer of bytes, which should include data and
+ *   also CRC if the function is being used to check CRC
+ * len is the number of bytes in the buffer (including CRC if it is present)
+ * check_crc is a boolean value, set true to check an existing CRC, false
+ *   to calculate a new CRC
+ */
+static uint16_t iprop_crc16_1(uint8_t * buffer, uint32_t len, bool check_crc)
+{
+  uint8_t crc[16];
+  uint16_t crc_final = 0;
+  uint8_t crc_msb;
+  uint8_t data_msb;
+  uint32_t total_len;
+
+  // Initialize CRC array
+  for (uint32_t ii = 0; ii < 16; ii++) {
+    crc[ii] = 0;
+    //crc[ii] = (crc_in >> ii) & 1;
+  }
+
+  // If calculating a new CRC, we need to pad the data with extra zeroes
+  total_len = check_crc ? len : len + 2;
+
+  // Loop for each byte, plus extra for the CRC itself
+  for (uint32_t ii = 0; ii < total_len; ii++) {
+    uint8_t data = (ii < len) ? buffer[ii] : 0;
+
+    // Loop for each bit
+    for (uint32_t jj = 0; jj < 8; jj++) {
+      crc_msb = crc[15];
+      data_msb = (data >> (8 - jj - 1)) & 1;
+
+      crc[15] = crc[14] ^ crc_msb;
+      crc[14] = crc[13];
+      crc[13] = crc[12];
+      crc[12] = crc[11];
+      crc[11] = crc[10] ^ crc_msb;
+      crc[10] = crc[9];
+      crc[9] = crc[8] ^ crc_msb;
+      crc[8] = crc[7] ^ crc_msb;
+      crc[7] = crc[6] ^ crc_msb;
+      crc[6] = crc[5];
+      crc[5] = crc[4] ^ crc_msb;
+      crc[4] = crc[3] ^ crc_msb;
+      crc[3] = crc[2];
+      crc[2] = crc[1] ^ crc_msb;
+      crc[1] = crc[0] ^ crc_msb;
+      crc[0] = data_msb ^ crc_msb;
+    }
+  }
+
+  // Convert CRC array to final value
+  for (uint32_t ii = 0; ii < 16; ii++) {
+    if (crc[ii] == 1) {
+      crc_final |= (1 << ii);
+    } else {
+      crc_final &= ~(1 << ii);
+    }
+  }
+
+  return crc_final;
+}
+
+static void iprop_dump_log_structure(struct iprop_internal_log const * const log)
+{
+  pout("Dumping LOG Structure:\n");
+  pout("  drive_select:           0x%08x\n", log->drive_select);
+  pout("  obsolete:               0x%08x\n", log->obsolete);
+  pout("  mode_control:           0x%02x\n", log->mode_control);
+  pout("  log_passthrough:        0x%02x\n", log->log_passthrough);
+  pout("  tier_id:                0x%04x\n", log->tier_id);
+  pout("  hw_version:             0x%08x\n", log->hw_version);
+  pout("  fw_version:             0x%08x\n", log->fw_version);
+  pout("  variant:                \"");
+  for (int ii = 0; ii < 8; ii++) {
+    pout("%c", (char)log->variant[ii]);
+  }
+  pout("\"\n");
+  pout("  port_0_settings(Gen 1): 0x%08x\n", log->port_0_settings[0]);
+  pout("  port_0_settings(Gen 2): 0x%08x\n", log->port_0_settings[1]);
+  pout("  port_0_settings(Gen 3): 0x%08x\n", log->port_0_settings[2]);
+  pout("  port_1_settings(Gen 1): 0x%08x\n", log->port_1_settings[0]);
+  pout("  port_1_settings(Gen 2): 0x%08x\n", log->port_1_settings[1]);
+  pout("  port_1_settings(Gen 3): 0x%08x\n", log->port_1_settings[2]);
+  pout("  port_2_settings(Gen 1): 0x%08x\n", log->port_2_settings[0]);
+  pout("  port_2_settings(Gen 2): 0x%08x\n", log->port_2_settings[1]);
+  pout("  port_2_settings(Gen 3): 0x%08x\n", log->port_2_settings[2]);
+  pout("  port_3_settings(Gen 1): 0x%08x\n", log->port_3_settings[0]);
+  pout("  port_3_settings(Gen 2): 0x%08x\n", log->port_3_settings[1]);
+  pout("  port_3_settings(Gen 3): 0x%08x\n", log->port_3_settings[2]);
+  pout("  port_4_settings(Gen 1): 0x%08x\n", log->port_4_settings[0]);
+  pout("  port_4_settings(Gen 2): 0x%08x\n", log->port_4_settings[1]);
+  pout("  port_4_settings(Gen 3): 0x%08x\n", log->port_4_settings[2]);
+  pout("  crc:                    0x%04x\n", log->crc);
+  pout("\n");
+}
+
+static bool iprop_switch_routed_drive(ata_device * device, int drive_select)
+{
+  // Declare a log page buffer and initialize it with what is on the drive currently
+  iprop_internal_log write_payload;
+  if (!ataReadLogExt(device, LOG_C0, 0, 0, &write_payload, 1))
+    return device->set_err(EIO, "intelliprop: Initial Read Log failed: %s", device->get_errmsg());
+
+  // Check the returned data is good
+  uint16_t const crc_check = iprop_crc16_1((uint8_t *)&write_payload,
+                                           sizeof(struct iprop_internal_log),
+                                           false);
+
+
+   //If this first read fails the crc check, the log can be still sent with routing information
+   //as long as everything else in the log is zeroed. So there is no need to return false.
+  if (crc_check != 0) {
+    if (ata_debugmode)
+      pout("Intelliprop WARNING: Received log crc(0x%04X) is invalid!\n", crc_check);
+    iprop_dump_log_structure(&write_payload);
+    memset(&write_payload, 0, sizeof(struct iprop_internal_log));
+  }
+
+  //The option to read the log, even if successful, could be useful
+  if (ata_debugmode)
+    iprop_dump_log_structure(&write_payload);
+
+  // Modify the current drive select to what we were given
+  write_payload.drive_select = (uint32_t)drive_select;
+  if (ata_debugmode)
+    pout("Intelliprop - Change to port 0x%08X.\n", write_payload.drive_select);
+  write_payload.log_passthrough = 0; // TEST (Set to 1, non hydra member drive will abort --> test error handling)
+  write_payload.tier_id = 0; // TEST (Set to non-zero, non hydra member drive will abort --> test error handling)
+
+  // Update the CRC area
+  uint16_t const crc_new = iprop_crc16_1((uint8_t *)&write_payload,
+                                         sizeof(struct iprop_internal_log) - sizeof(uint16_t),
+                                         false);
+  write_payload.crc = (crc_new >> 8) | (crc_new << 8);
+
+  // Check our CRC work
+  uint16_t const crc_check2 = iprop_crc16_1((uint8_t *)&write_payload,
+                                            sizeof(struct iprop_internal_log),
+                                            false);
+  if (crc_check2 != 0)
+    return device->set_err(EIO, "intelliprop: Re-calculated log crc(0x%04X) is invalid!", crc_check2);
+
+  // Apply the Write LOG
+  if (!ataWriteLogExt(device, LOG_C0, 0, &write_payload, 1))
+    return device->set_err(EIO, "intelliprop: Write Log failed: %s", device->get_errmsg());
+
+  // Check that the Write LOG was applied
+  iprop_internal_log check_payload;
+  if (!ataReadLogExt(device, LOG_C0, 0, 0, &check_payload, 1))
+    return device->set_err(EIO, "intelliprop: Secondary Read Log failed: %s", device->get_errmsg());
+
+  if (check_payload.drive_select != write_payload.drive_select) {
+    if (ata_debugmode > 1)
+      iprop_dump_log_structure(&check_payload);
+    return device->set_err(EIO, "intelliprop: Current drive select val(0x%08X) is not expected(0x%08X)",
+         check_payload.drive_select,
+         write_payload.drive_select);
+  }
+
+  return true;
+}
+
+namespace intelliprop {
+
+class intelliprop_device
+: public tunnelled_device<
+    /*implements*/ ata_device,
+    /*by using an*/ ata_device
+  >
+{
+public:
+  intelliprop_device(smart_interface * intf, unsigned phydrive, ata_device * atadev);
+
+  virtual ~intelliprop_device() throw();
+
+  virtual bool open();
+
+  virtual bool ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);
+
+private:
+  unsigned m_phydrive;
+};
+
+
+intelliprop_device::intelliprop_device(smart_interface * intf, unsigned phydrive, ata_device * atadev)
+: smart_device(intf, atadev->get_dev_name(), "intelliprop", "intelliprop"),
+  tunnelled_device<ata_device, ata_device>(atadev),
+  m_phydrive(phydrive)
+{
+  set_info().info_name = strprintf("%s [intelliprop_disk_%u]", atadev->get_info_name(), phydrive);
+}
+
+intelliprop_device::~intelliprop_device() throw()
+{
+}
+
+bool intelliprop_device::open()
+{
+  if (!tunnelled_device<ata_device, ata_device>::open())
+    return false;
+
+  ata_device * atadev = get_tunnel_dev();
+  if (!iprop_switch_routed_drive(atadev, m_phydrive)) {
+    close();
+    return set_err(atadev->get_err());
+  }
+
+  return true;
+}
+
+bool intelliprop_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
+{
+  return get_tunnel_dev()->ata_pass_through(in, out);
+}
+}//namespace
+
+ata_device * get_intelliprop_device(smart_interface * intf, unsigned phydrive, ata_device * atadev)
+{
+  return new intelliprop::intelliprop_device(intf, phydrive, atadev);
+}
diff --git a/dev_intelliprop.h b/dev_intelliprop.h
new file mode 100644 (file)
index 0000000..5d8665e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * dev_intelliprop.h
+ *
+ * Home page of code is: http://www.smartmontools.org
+ *
+ * Copyright (C) 2012 Hank Wu <hank@areca.com.tw>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * You should have received a copy of the GNU General Public License
+ * (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DEV_INTELLIPROP_H
+#define DEV_INTELLIPROP_H
+
+#define DEV_INTELLIPROP_H_CVSID "$Id: dev_intelliprop.h 4370 2017-01-11 20:35:38Z chrfranke $"
+
+ata_device * get_intelliprop_device(smart_interface * intf, unsigned phydrive, ata_device * atadev);
+
+#endif
index dd428413a393b8b7e308e6267a3986bee24d1603..1f5b23fcc2a23508e9ae5f6ab9ae873e1bb1610e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2008-16 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-16 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 #include "config.h"
 #include "int64.h"
 #include "dev_interface.h"
+#include "dev_intelliprop.h"
 #include "dev_tunnelled.h"
 #include "atacmds.h" // ATA_SMART_CMD/STATUS
 #include "utility.h"
@@ -32,7 +33,7 @@
 #include <sys/timeb.h>
 #endif
 
-const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 4283 2016-04-10 12:55:59Z chrfranke $"
+const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   DEV_INTERFACE_H_CVSID;
 
 /////////////////////////////////////////////////////////////////////////////
@@ -281,8 +282,8 @@ std::string smart_interface::get_valid_dev_types_str()
 {
   // default
   std::string s =
-    "ata, scsi, nvme[,NSID], sat[,auto][,N][+TYPE], "
-    "usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus";
+    "ata, scsi, nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], "
+    "usbjmicron[,p][,x][,N], usbprolific, usbsunplus, intelliprop,N[+TYPE]";
   // append custom
   std::string s2 = get_valid_custom_dev_types_str();
   if (!s2.empty()) {
@@ -422,6 +423,31 @@ smart_device * smart_interface::get_smart_device(const char * name, const char *
     return get_sat_device(sattype.c_str(), basedev.release()->to_scsi());
   }
 
+  else if (str_starts_with(type, "intelliprop")) {
+    // Parse "intelliprop,N[+base...]"
+    unsigned phydrive = ~0; int n = -1; char c = 0;
+    sscanf(type, "intelliprop,%u%n%c", &phydrive, &n, &c);
+    if (!((n == (int)strlen(type) || c == '+') && phydrive <= 3)) {
+      set_err(EINVAL, "Option '-d intelliprop,N' requires N between 0 and 3");
+      return 0;
+    }
+    const char * basetype = (type[n] ? type + n + 1 : "");
+    // Recurse to allocate base device, default is standard ATA
+    if (!*basetype)
+      basetype = "ata";
+    smart_device_auto_ptr basedev( get_smart_device(name, basetype) );
+    if (!basedev) {
+      set_err(EINVAL, "Type '%s': %s", type, get_errmsg());
+      return 0;
+    }
+    // Result must be ATA
+    if (!basedev->is_ata()) {
+      set_err(EINVAL, "Type '%s': Device type '%s' is not ATA", type, basetype);
+      return 0;
+    }
+    return get_intelliprop_device(this, phydrive, basedev.release()->to_ata());
+  }
+
   else {
     set_err(EINVAL, "Unknown device type '%s'", type);
     return 0;
index 4d4c0faa54dca0fe072fe1de15aadc1b09a744c6..1666122409c9e29a7a22b1e4eb7434b469c10649 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2008-16 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-16 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 
 #include <errno.h>
 
-const char * dev_legacy_cpp_cvsid = "$Id: dev_legacy.cpp 4251 2016-03-26 16:48:32Z chrfranke $"
+const char * dev_legacy_cpp_cvsid = "$Id: dev_legacy.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   DEV_INTERFACE_H_CVSID;
 
 /////////////////////////////////////////////////////////////////////////////
index aa4ff2b0679078d081fee727aa9f1f4a6b173f44..23ac55d2161d9f58489c303afb3b0402a1fa0eb1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2008 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #ifndef DEV_TUNNELLED_H
 #define DEV_TUNNELLED_H
 
-#define DEV_TUNNELLED_H_CVSID "$Id: dev_tunnelled.h 4122 2015-08-27 19:08:07Z chrfranke $"
+#define DEV_TUNNELLED_H_CVSID "$Id: dev_tunnelled.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 #include "dev_interface.h"
 
diff --git a/do_release b/do_release
deleted file mode 100755 (executable)
index 64e21dc..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/bin/bash
-#
-# do a smartmontools release
-# (C) 2003-11 Bruce Allen, Guido Guenther
-# (C) 2006-15 Christian Franke
-# $Id: do_release 4071 2015-04-26 18:25:12Z chrfranke $
-
-# Notes on generating releases:
-# (1) update NEWS
-# (2) update ChangeLog -- put in release number
-# (3) update release number in configure.ac
-# (4) to test, run without '--commit'
-# (5) when satisfied, add option '--commit'
-
-set -e
-
-# Smartmontools Signing Key (through 2016)
-KEYID=0xC4A4903A
-
-inc_release()
-{
-  MINOR=`echo $VERSION | cut -d. -f2`
-  MAJOR=`echo $VERSION | cut -d. -f1`
-  PERL_OLD=$MAJOR\\.$MINOR
-  ((++MINOR))
-  NEW_VERSION=$MAJOR.$MINOR
-  PERL_NEW=$MAJOR\\.$MINOR     
-  NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
-  echo "New Version: $NEW_VERSION"
-  echo "New Release: $NEW_RELEASE"
-}
-
-COMMIT=
-RC=
-
-case "$1" in
-  --commit) COMMIT=yes; shift ;;
-esac
-
-case "$*" in
-  RC[1-9]) RC="$1" ;;
-  FINAL) ;;
-  *) echo "Usage: $0 [--commit] RC[1-9]|FINAL"; exit 1 ;;
-esac
-
-# Check workdir
-case "`/bin/pwd`" in
-  */trunk/smartmontools)      WDROOT="../..";    DIRPAT="trunk"      ;;
-  */branches/*/smartmontools) WDROOT="../../.."; DIRPAT="branches/*" ;;
-  *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;;
-esac
-
-if [ ! -d "$WDROOT/tags" ]; then
-  echo "tags directory missing"; exit 1
-fi
-
-REVX="`(cd $WDROOT && svnversion)`" || exit 1
-REV="${REVX/%[PM]/}"; REV="${REV/%[PM]/}"
-if [ -n "${REV//[0-9]/}" ]; then
-  echo "Working directory not clean: $REVX"; exit 1
-fi
-
-(cd $WDROOT && svn status) | while read s; do
-  case "`echo $s | tr -s ' '`" in
-    "M "$DIRPAT/smartmontools/ChangeLog)    echo "$s: OK";;
-    "M "$DIRPAT/smartmontools/NEWS)         echo "$s: OK";;
-    "M "$DIRPAT/smartmontools/configure.ac) echo "$s: OK";;
-    *) echo "$s: not allowed"; exit 1;;
-  esac
-done
-if [ $? -ne 0 ]; then
-  exit 1
-fi
-
-# Get release number
-VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.ac`
-if [ -z "$VERSION" ]; then
-  echo "AC_INIT not found in configure.ac"; exit 1
-fi
-VERSIONRC="$VERSION"
-RELEASE="RELEASE_${VERSION//\./_}"
-
-if [ "$RC" ]; then
-  VERSIONRC="${VERSION}-${RC/#RC/rc}"
-  RELEASE="${RELEASE}_${RC}"
-fi
-
-if [ -e "$WDROOT/tags/$RELEASE" ]; then
-  echo "tags/$RELEASE exists"; exit 1
-fi
-
-echo "r$REV: Release $VERSIONRC $RELEASE"
-
-# Update timestamp
-smartmontools_release_date=`date -u +"%Y-%m-%d"`
-smartmontools_release_time=`date -u +"%T %Z"`
-cat configure.ac  | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
-cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.ac
-rm -f configure.tmp
-
-# Review changes
-svn diff
-echo "==================================================================="
-echo ">>> Continuing in 20 seconds ..."
-sleep 20
-set -v
-
-# Create tag and commit
-if [ "$COMMIT" = "yes" ]; then
-  svn mkdir $WDROOT/tags/$RELEASE
-  svn copy ../smartmontools $WDROOT/tags/$RELEASE/smartmontools
-  svn commit -m "Release $VERSIONRC $RELEASE" $WDROOT
-fi
-
-# Build
-./autogen.sh
-
-mkdir build
-cd build
-../configure
-make distcheck || exit 1
-make maintainer-clean
-cd ..
-
-TARFILE=smartmontools-$VERSIONRC.tar.gz
-
-mv -f build/smartmontools-$VERSION.tar.gz $TARFILE
-rm -rvf build
-
-md5sum $TARFILE > $TARFILE.md5
-
-# Increase release number
-if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
-  inc_release
-  if [ "$COMMIT" = "yes" ]; then
-    perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.ac
-    # svn commit -m "Bump release number to $NEW_VERSION" configure.ac
-  fi
-fi
-
-# Sign tarball
-if [ -n "$KEYID" ] && gpg --list-secret-keys $KEYID >/dev/null 2>/dev/null; then
-  gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSIONRC.tar.gz
-fi
-
index 65c1c4527fa0b78cca0519148de2f3848e9870fa..cf444c86a4be3e033f197f8ae21076b0adcbb184 100644 (file)
--- a/drivedb.h
+++ b/drivedb.h
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2003-11 Philip Williams, Bruce Allen
- * Copyright (C) 2008-16 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -75,7 +75,7 @@
 /*
 const drive_settings builtin_knowndrives[] = {
  */
-  { "$Id: drivedb.h 4324 2016-05-31 20:45:50Z chrfranke $",
+  { "$Id: drivedb.h 4591 2017-11-04 22:40:53Z chrfranke $",
     "-", "-",
     "This is a dummy entry to hold the SVN-Id of drivedb.h",
     ""
@@ -175,15 +175,15 @@ const drive_settings builtin_knowndrives[] = {
     "-v 241,raw48,Host_Writes_GiB "     //  ]  guessed (ticket #655)
     "-v 242,raw48,Host_Reades_GiB "     //  ]
   },
-  { "Apple SD/SM/TS...E/F SSDs", // SanDisk/Samsung/Toshiba?
-    "APPLE SSD (S[DM]|TS)0?(128|256|512|768)[EFG]", // tested with APPLE SSD SD256E/1021AP, SD0128F/A223321
-     // APPLE SSD SM768E/CXM90A1Q, SM0512F/UXM2JA1Q, TS0256F/109L0704, SM0512G/BXW1SA0Q
+  { "Apple SD/SM/TS...E/F/G SSDs", // SanDisk/Samsung/Toshiba?
+    "APPLE SSD (S[DM]|TS)0?(128|256|512|768|1024)[EFG]", // tested with APPLE SSD SD256E/1021AP, SD0128F/A223321
+     // APPLE SSD SM768E/CXM90A1Q, SM0512F/UXM2JA1Q, TS0256F/109L0704, SM0512G/BXW1SA0Q, SM1024G/BXW1SA0Q
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
-  //"-v 169,raw48,Unknown_Attribute "
+    "-v 169,raw48,Unknown_Apple_Attrib "
     "-v 173,raw48,Wear_Leveling_Count " // ]
     "-v 174,raw48,Host_Reads_MiB "      // ] guessed (ticket #342), S[DM]*F only
     "-v 175,raw48,Host_Writes_MiB "     // ]
@@ -193,11 +193,10 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 199,raw48,UDMA_CRC_Error_Count "
   //"-v 240,raw48,Unknown_SSD_Attribute "
   },
-  { "Crucial/Micron RealSSD C300/M500", // Marvell 88SS91xx
-    "C300-CTFDDA[AC](064|128|256)MAG|" // Marvell 88SS9174 BJP2, tested with C300-CTFDDAC128MAG/0002,
+  { "Crucial/Micron RealSSD C300/P300", // Marvell 88SS9174
+    "C300-CTFDDA[AC](064|128|256)MAG|" // tested with C300-CTFDDAC128MAG/0002,
       // C300-CTFDDAC064MAG/0006
-    "Crucial_CT(120|240|480)M500SSD[13]", // Marvell 88SS9187 BLD2, tested with Crucial_CT120M500SSD3/MU02,
-      // Crucial_CT120M500SSD1/MU02, Crucial_CT240M500SSD1/MU03, Crucial_CT480M500SSD1/MU03
+    "P300-MTFDDAC(050|100|200)SAL", // tested with P300-MTFDDAC100SAL/0003
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
@@ -222,16 +221,14 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 199,raw48,UDMA_CRC_Error_Count "
     "-v 202,raw48,Percent_Lifetime_Used "
     "-v 206,raw48,Write_Error_Rate "
-    "-v 210,raw48,Success_RAIN_Recov_Cnt "
-    "-v 246,raw48,Total_Host_Sector_Write "
-    "-v 247,raw48,Host_Program_Page_Count "
-    "-v 248,raw48,Bckgnd_Program_Page_Cnt"
   },
   { "Crucial/Micron RealSSD m4/C400/P400", // Marvell 9176, fixed firmware
     "C400-MTFDDA[ACK](064|128|256|512)MAM|"
-    "M4-CT(064|128|256|512)M4SSD[123]|" // tested with M4-CT512M4SSD2/0309
-    "MTFDDAK(064|128|256|512|050|100|200|400)MA[MNR]-1[JKS]1.*", // tested with
-       // MTFDDAK256MAR-1K1AA/MA52, MTFDDAK256MAM-1K12/08TH
+    // M4-CT032M4SSD3/04MH
+    "M4-CT(032|064|128|256|512)M4SSD[123]|" // tested with M4-CT512M4SSD2/0309
+    "MTFDDA[AK](064|128|256|512|050|100|200|400)MA[MNR]-1[JKS]1.*", // tested with
+       // MTFDDAK256MAR-1K1AA/MA52, MTFDDAK256MAM-1K12/08TH,
+       // MTFDDAA064MAR-1J1AB  49Y5835 49Y5838IBM/MA49 (P400e)
     "030[9-Z]|03[1-Z].|0[4-Z]..|[1-Z]....*", // >= "0309"
     "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
@@ -256,11 +253,14 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 198,raw48,Offline_Uncorrectable "
   //"-v 199,raw48,UDMA_CRC_Error_Count "
     "-v 202,raw48,Perc_Rated_Life_Used "
-    "-v 206,raw48,Write_Error_Rate"
+    "-v 206,raw48,Write_Error_Rate "
+    "-v 225,raw48,Unknown_Marvell_Attr " // P400e
+    "-v 231,raw48,Unknown_Marvell_Attr " // P400e
+    "-v 242,raw48,Host_Reads" // P400e: 2MiB?
   },
   { "Crucial/Micron RealSSD m4/C400", // Marvell 9176, buggy or unknown firmware
     "C400-MTFDDA[ACK](064|128|256|512)MAM|" // tested with C400-MTFDDAC256MAM/0002
-    "M4-CT(064|128|256|512)M4SSD[123]", // tested with M4-CT064M4SSD2/0002,
+    "M4-CT(032|064|128|256|512)M4SSD[123]", // tested with M4-CT064M4SSD2/0002,
       // M4-CT064M4SSD2/0009, M4-CT256M4SSD3/000F
     "",
     "This drive may hang after 5184 hours of power-on time:\n"
@@ -279,23 +279,32 @@ const drive_settings builtin_knowndrives[] = {
     "-v 202,raw48,Perc_Rated_Life_Used "
     "-v 206,raw48,Write_Error_Rate"
   },
-  { "Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs",
-    "Crucial_CT(128|256|512)MX100SSD1|"// tested with Crucial_CT256MX100SSD1/MU01
-    "Crucial_CT(200|250|256|500|512|1000|1024)MX200SSD[1346]|" // tested with Crucial_CT500MX200SSD1/MU01,
-      // Crucial_CT1024MX200SSD1/MU01, Crucial_CT250MX200SSD3/MU01, Crucial_CT250MX200SSD1/MU03
-    "Crucial_CT(120|240|480|960)M500SSD[134]|" // tested with Crucial_CT960M500SSD1/MU03,
-      // Crucial_CT240M500SSD4/MU05
-    "Crucial_CT(128|256|512|1024)M550SSD[13]|" // tested with Crucial_CT512M550SSD3/MU01,
-      // Crucial_CT1024M550SSD1/MU01
+  { "Crucial/Micron MX1/2/300, M5/600, 1100 Client SSDs",
+    "Crucial_CT(128|256|512)MX100SSD1|"// Marvell 88SS9189, tested with Crucial_CT256MX100SSD1/MU01
+    "Crucial_CT(200|250|256|500|512|1000|1024)MX200SSD[1346]|" // Marvell 88SS9189, tested with
+      // Crucial_CT500MX200SSD1/MU01, Crucial_CT1024MX200SSD1/MU01, Crucial_CT250MX200SSD3/MU01,
+      // Crucial_CT250MX200SSD1/MU03
+    "Crucial_CT(275|525|1050|2050)MX300SSD[14]|" // Marvell 88SS1074, tested with
+      // Crucial_CT525MX300SSD1/M0CR021, Crucial_CT2050MX300SSD1/M0CR031, Crucial_CT275MX300SSD1/M0CR040
+    "Crucial_CT(120|240|480|960)M500SSD[134]|" // Marvell 88SS9187, tested with
+      // Crucial_CT120M500SSD1/MU02, Crucial_CT120M500SSD3/MU02, Crucial_CT240M500SSD1/MU03,
+      // Crucial_CT480M500SSD1/MU03, Crucial_CT960M500SSD1/MU03, Crucial_CT240M500SSD4/MU05
+    "Crucial_CT(128|256|512|1024)M550SSD[134]|" // tested with Crucial_CT512M550SSD3/MU01,
+      // Crucial_CT1024M550SSD1/MU01, Crucial_CT128M550SSD4/MU02
     "Micron_M500_MTFDDA[KTV](120|240|480|960)MAV|"// tested with Micron_M500_MTFDDAK960MAV/MU05
     "(Micron_)?M510[_-]MTFDDA[KTV](128|256)MAZ|" // tested with M510-MTFDDAK256MAZ/MU01
     "(Micron_)?M550[_-]MTFDDA[KTV](064|128|256|512|1T0)MAY|" // tested with M550-MTFDDAK256MAY/MU01
-    "Micron_M600_(EE|MT)FDDA[KTV](128|256|512|1T0)MBF[25Z]?", // tested with Micron_M600_MTFDDAK1T0MBF/MU01
+    "Micron_M600_(EE|MT)FDDA[KTV](128|256|512|1T0)MBF[25Z]?|" // tested with Micron_M600_MTFDDAK1T0MBF/MU01
+    "Micron_M500DC_(EE|MT)FDDA[AK](120|240|480|800)MBB|" // tested with Micron_M500DC_EEFDDAA120MBB/129, Micron_M500DC_MTFDDAK800MBB/0129
+    "Micron_1100_MTFDDA[KV](256|512|1T0|2T0)TBN|" // Marvell 88SS1074, tested Micron_1100_MTFDDAK256TBN/M0MU020
+    "MICRON_M510DC_(EE|MT)FDDAK(120|240|480|800|960)MBP|" // Micron_M510DC_MTFDDAK240MBP/0005
+    "Micron_5100_(EE|MT)FDDA[KV](240|480|960|1T9|3T8|7T6)T(BY|CB|CC)", // tested with Micron_5100_MTFDDAK1T9TBY
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
     "-v 5,raw48,Reallocate_NAND_Blk_Cnt "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
+    "-v 170,raw48,Reserved_Block_Count "
     "-v 171,raw48,Program_Fail_Count "
     "-v 172,raw48,Erase_Fail_Count "
     "-v 173,raw48,Ave_Block-Erase_Count "
@@ -303,6 +312,7 @@ const drive_settings builtin_knowndrives[] = {
     "-v 180,raw48,Unused_Reserve_NAND_Blk "
     "-v 183,raw48,SATA_Interfac_Downshift "
     "-v 184,raw48,Error_Correction_Count "
+    "-v 195,raw48,Cumulativ_Corrected_ECC "
   //"-v 187,raw48,Reported_Uncorrect "
   //"-v 194,tempminmax,Temperature_Celsius "
   //"-v 196,raw16(raw16),Reallocated_Event_Count "
@@ -383,6 +393,7 @@ const drive_settings builtin_knowndrives[] = {
     "ATP Velocity MIV (60|120|240|480)GB|" // tested with ATP Velocity MIV 480GB/110719
     "Corsair CSSD-F(40|60|80|115|120|160|240)GBP?2.*|" // Corsair Force, tested with
       // Corsair CSSD-F40GB2/1.1, Corsair CSSD-F115GB2-A/2.1a
+    "Corsair Voyager GTX|" // Corsair Voyager GTX/S9FM02J6
     "Corsair Force ((3 |LS )?SSD|GS|GT)|" // SF-2281, tested with
       // Corsair Force SSD/5.05, 3 SSD/1.3.2, GT/1.3.3, GS/5.03,
       // Corsair Force LS SSD/S8FM06.5, S9FM01.8, S9FM02.0
@@ -486,11 +497,30 @@ const drive_settings builtin_knowndrives[] = {
     "-v 241,raw48,Lifetime_Writes_GiB "
     "-v 242,raw48,Lifetime_Reads_GiB"
   },
+  {
+    "StorFly CFast SATA 6Gbps SSDs",
+    // http://datasheet.octopart.com/VSFCS2CC060G-100-Virtium-datasheet-82287733.pdf
+    // tested with StorFly VSFCS2CC060G-100/0409-000
+    "StorFly VSFCS2C[CI](016|030|060|120|240)G-...",
+    // C - commercial, I industrial
+    "", "",
+    "-v 192,raw48,Unsafe_Shutdown_Count "
+    "-v 160,raw48,Uncorrectable_Error_Cnt "
+    // 0729 - remaining in block life. In 0828  remaining is normalized to 100% then decreases
+    "-v 161,raw48,Spares_Remaining " 
+    "-v 241,raw48,Host_Writes_32MiB "
+    "-v 242,raw48,Host_Reads_32MiB "
+    "-v 169,raw48,Lifetime_Remaining% "
+    "-v 248,raw48,Lifetime_Remaining% " //  later then 0409 FW.
+    "-v 249,raw48,Spares_Remaining_Perc " //  later then 0409 FW.
+  },
   { "Phison Driven SSDs", // see MKP_521_Phison_SMART_attribute.pdf
     "KINGSTON SUV300S37A(120|240|480)G|" // UV300 SSD, tested with KINGSTON SUV300S37A120G/SAFM11.K
     "KINGSTON SKC310S3B?7A960G|" // SSDNow KC310, KINGSTON SKC310S37A960G/SAFM00.r
     "KINGSTON SKC400S37(128G|256G|512G|1T)|" // SSDNow KC400, KINGSTON SKC400S37128G
     "KINGSTON SV310S3(7A|D7|N7A|B7A)960G|" // SSDNow V310
+    "GOODRAM|" // GOODRAM/SAFM12.2 (CX200), model name is missing in the SMART!
+    "PNY CS1311 (120|240|480|960)GB SSD|" // tested with PNY CS1311 120GB SSD/CS131122
     "KINGSTON SHSS3B?7A(120|240|480|960)G", // HyperX Savage
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
@@ -525,6 +555,46 @@ const drive_settings builtin_knowndrives[] = {
     "-v 245,raw48,Max_Erase_Count "
     "-v 246,raw48,Total_Erase_Count "
   },
+  // this is a copy of the Phison bases record for the OEM drives with a very
+  // weak information in the model. Detection is based on Firmware.
+  // Tested with FoxLine flssd240x4se (SATA SSD/SBFM10.5) and Supermicro 
+  // SSD-DM032-PHI (SATA SSD/S9FM02.1)
+  { "Phison Driven OEM SSDs", // see MKP_521_Phison_SMART_attribute.pdf
+    "SATA SSD",
+    "(S9FM02\\.1|SBFM10\\.5)",
+    "",
+  //"-v 1,raw48,Raw_Read_Error_Rate "
+    "-v 2,raw48,Not_In_Use "
+    "-v 3,raw48,Not_In_Use "
+    "-v 5,raw48,Not_In_Use "
+    "-v 7,raw48,Not_In_Use "
+    "-v 8,raw48,Not_In_Use "
+  //"-v 9,raw24(raw8),Power_On_Hours "
+    "-v 5,raw48,Retired_Block_Count "
+  //"-v 9,raw24(raw8),Power_On_Hours "
+    "-v 10,raw48,Not_In_Use "
+  //"-v 12,raw48,Power_Cycle_Count "
+    "-v 168,raw48,SATA_Phy_Error_Count "
+    "-v 170,raw24/raw24:z54z10,Bad_Blk_Ct_Erl/Lat " // Early bad block/Later bad block
+    "-v 173,raw16(avg16),MaxAvgErase_Ct "
+    "-v 175,raw48,Not_In_Use "
+    "-v 183,raw48,Unknown_Attribute "
+  //"-v 187,raw48,Reported_Uncorrect "
+    "-v 192,raw48,Unsafe_Shutdown_Count "
+  //"-v 194,tempminmax,Temperature_Celsius "
+    "-v 196,raw48,Not_In_Use "
+    "-v 197,raw48,Not_In_Use "
+    "-v 199,raw48,CRC_Error_Count "
+    "-v 218,raw48,CRC_Error_Count "
+    "-v 231,raw48,SSD_Life_Left "
+    "-v 233,raw48,Flash_Writes_GiB "
+    "-v 240,raw48,Not_In_Use "
+    "-v 241,raw48,Lifetime_Writes_GiB "
+    "-v 242,raw48,Lifetime_Reads_GiB "
+    "-v 244,raw48,Average_Erase_Count "
+    "-v 245,raw48,Max_Erase_Count "
+    "-v 246,raw48,Total_Erase_Count "
+  },
   { "Indilinx Barefoot based SSDs",
     "Corsair CSSD-V(32|60|64|128|256)GB2|" // Corsair Nova, tested with Corsair CSSD-V32GB2/2.2
     "Corsair CMFSSD-(32|64|128|256)D1|" // Corsair Extreme, tested with Corsair CMFSSD-128D1/1.0
@@ -651,8 +721,9 @@ const drive_settings builtin_knowndrives[] = {
     "-v 251,raw48,Total_NAND_Read_Ct_GiB"
   },
   {
-    "OCZ Trion SSDs",
-    "OCZ-TRION1[05]0", // tested with OCZ-TRION100/SAFM11.2A, TRION150/SAFZ72.2
+    "OCZ/Toshiba Trion SSDs",
+    "OCZ-TRION1[05]0|" // tested with OCZ-TRION100/SAFM11.2A, TRION150/SAFZ72.2
+    "TOSHIBA-TR150", // tested with TOSHIBA-TR150/SAFZ12.3
     "", "",
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
@@ -688,8 +759,9 @@ const drive_settings builtin_knowndrives[] = {
     "-v 236,raw48,Unstable_Power_Count "
     "-v 240,raw48,Write_Head"
   },
-  { "Innodisk 3ME SSDs", // tested with 2.5" SATA SSD 3ME/S140714
-    "((1\\.8|2\\.5)\"? SATA SSD|SATA Slim) 3ME",
+  { "Innodisk 1ME3/3ME/3SE SSDs", // tested with 2.5" SATA SSD 3ME/S140714,
+      // Mini PCIeDOM 1ME3/S15604, InnoDisk Corp. - mSATA 3SE/S130710
+    "((1\\.8|2\\.5)\"? SATA SSD|InnoDisk Corp\\. - mSATA|Mini PCIeDOM|SATA Slim) (1ME3|3[MS]E)",
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 2,raw48,Throughput_Performance "
@@ -701,7 +773,7 @@ const drive_settings builtin_knowndrives[] = {
     "-v 10,raw48,Spin_Retry_Count "     // ?
   //"-v 12,raw48,Power_Cycle_Count "
     "-v 168,raw48,SATA_PHY_Error_Count "
-    "-v 169,raw48,Unknown_Innodisk_Attr "
+    "-v 169,hex48,Unknown_Innodisk_Attr "
     "-v 170,raw16,Bad_Block_Count "
     "-v 173,raw16,Erase_Count "
     "-v 175,raw48,Bad_Cluster_Table_Count "
@@ -715,10 +787,11 @@ const drive_settings builtin_knowndrives[] = {
     "-v 236,raw48,Unstable_Power_Count "
     "-v 240,raw48,Write_Head"
   },
-  { "Innodisk 3IE2/3MG2/3SE2-P SSDs", // tested with 2.5" SATA SSD 3MG2-P/M140402,
+  { "Innodisk 3IE2/3ME2/3MG2/3SE2 SSDs", // tested with 2.5" SATA SSD 3MG2-P/M140402,
       // 1.8 SATA SSD 3IE2-P/M150821, 2.5" SATA SSD 3IE2-P/M150821,
-      // SATA Slim 3MG2-P/M141114, M.2 (S80) 3MG2-P/M141114, M.2 (S42) 3SE2-P/M150821
-    "((1\\.8|2\\.5)\"? SATA SSD|SATA Slim|M\\.2 \\(S(42|80)\\)) 3(IE|MG|SE)2-P",
+      // SATA Slim 3MG2-P/M141114, M.2 (S80) 3MG2-P/M141114, M.2 (S42) 3SE2-P/M150821,
+      // M.2 (S42) 3ME2/M151013
+    "((1\\.8|2\\.5)\"? SATA SSD|SATA Slim|M\\.2 \\(S(42|80)\\)) 3(IE|ME|MG|SE)2(-P)?",
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 2,raw48,Throughput_Performance "
@@ -755,7 +828,7 @@ const drive_settings builtin_knowndrives[] = {
     "-v 242,raw48,Host_Reads_32MiB "
     "-v 245,raw48,Flash_Writes_32MiB"
   },
-  { "Innodisk 3IE3/3ME3 SSDs", // tested with 2.5" SATA SSD 3ME3/S15A19, CFast 3ME3/S15A19
+  { "Innodisk 3IE3/3ME3/3ME4 SSDs", // tested with 2.5" SATA SSD 3ME3/S15A19, CFast 3ME3/S15A19
       // InnoDisk Corp. - mSATA 3ME3/S15A19, mSATA mini 3ME3/S15A19, M.2 (S42) 3ME3,
       // SATA Slim 3ME3/S15A19, SATADOM-MH 3ME3/S15A19, SATADOM-ML 3ME3/S15A19,
       // SATADOM-MV 3ME3/S15A19, SATADOM-SL 3ME3/S15A19, SATADOM-SV 3ME3/S15A19,
@@ -763,8 +836,10 @@ const drive_settings builtin_knowndrives[] = {
       // InnoDisk Corp. - mSATA 3IE3/S15C14i, Mini PCIeDOM 1IE3/S15C14i,
       // mSATA mini 3IE3/S15C14i, M.2 (S42) 3IE3/S15C14i, SATA Slim 3IE3/S15C14i,
       // SATADOM-SH 3IE3 V2/S15C14i, SATADOM-SL 3IE3 V2/S15A19i, SATADOM-SV 3IE3 V2/S15C14i
-    "(2.5\" SATA SSD|CFast|InnoDisk Corp\\. - mSATA|Mini PCIeDOM|mSATA mini|"
-    "M\\.2 \\(S42\\)|SATA Slim|SATADOM-[MS][HLV]) 3[IM]E3( V2)?",
+      // mSATA 3ME4/L16711, M.2 (S42) 3ME4/L16711, SATADOM-MH 3ME4/L16B01,
+      // SATADOM-SH 3ME4/L16B01, SATADOM-SH Type C 3ME4/L16B01, SATADOM-SH Type D 3ME4/L16B01
+    "(2.5\" SATA SSD|CFast|InnoDisk Corp\\. - mSATA|Mini PCIeDOM|mSATA( mini)?|"
+    "M\\.2 \\(S42\\)|SATA Slim|SATADOM-[MS][HLV]( Type [CD])?) 3([IM]E3|ME4)( V2)?",
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 2,raw48,Throughput_Performance "
@@ -1077,10 +1152,28 @@ const drive_settings builtin_knowndrives[] = {
     "-v 242,raw48,Host_Reads_32MiB "
     "-v 249,raw48,NAND_Writes_1GiB"
   },
+  // https://www.intel.com/content/www/us/en/solid-state-drives/ssd-540s-series-spec.html
+  // https://www.intel.com/content/www/us/en/solid-state-drives/ssd-540s-series-m2-spec.html
+  { "Intel 540 Series SSDs", // INTEL SSDSC2KW120H6/LSF036C, INTEL SSDSC2KW480H6/LSF036C
+    "INTEL SSDSC[K2]KW(120H|180H|240H|360H|480H|010X)6", 
+    "", "",
+    "-v 9,msec24hour32,Power_On_Hours_and_Msec "
+    "-v 170,raw48,Available_Reservd_Space "
+    "-v 171,raw48,Program_Fail_Count "
+    "-v 172,raw48,Erase_Fail_Count "
+    "-v 174,raw48,Unexpect_Power_Loss_Ct "
+    "-v 183,raw48,SATA_Downshift_Count "
+    "-v 187,raw48,Uncorrectable_Error_Cnt "
+    "-v 225,raw48,Host_Writes_32MiB "
+    "-v 226,raw48,Workld_Media_Wear_Indic "
+    "-v 227,raw48,Workld_Host_Reads_Perc "
+    "-v 228,raw48,Workload_Minutes "
+    "-v 249,raw48,NAND_Writes_1GiB"
+  },
   { "Intel 730 and DC S35x0/3610/3700 Series SSDs", // tested with INTEL SSDSC2BP480G4, SSDSC2BB120G4/D2010355,
       // INTEL SSDSC2BB800G4T, SSDSC2BA200G3/5DV10250, SSDSC2BB080G6/G2010130,  SSDSC2BX200G4/G2010110,
-      // INTEL SSDSC2BB016T6/G2010140, SSDSC2BX016T4/G2010140
-    "INTEL SSDSC(1N|2B)[ABPX]((080|100|120|160|200|240|300|400|480|600|800)G[346]T?|(012|016)T[46])",
+      // INTEL SSDSC2BB016T6/G2010140, SSDSC2BX016T4/G2010140, SSDSC2BB150G7/N2010101
+    "INTEL SSDSC(1N|2B)[ABPX]((080|100|120|150|160|200|240|300|400|480|600|800)G[3467]T?|(012|016)T[46])",
       // A = S3700, B*4 = S3500, B*6 = S3510, P = 730, X = S3610
     "", "",
   //"-v 3,raw16(avg16),Spin_Up_Time "
@@ -1113,6 +1206,23 @@ const drive_settings builtin_knowndrives[] = {
     "-v 243,raw48,NAND_Writes_32MiB " // S3510/3610
     "-F xerrorlba" // tested with SSDSC2BB600G4/D2010355
   },
+  { "Intel 3710 Series SSDs", // INTEL SSDSC2BA200G4R/G201DL2B (dell)
+    "INTEL SSDSC2BA(200G|400G|800G|012T)4.?",
+    "", "",
+    "-v 9,msec24hour32,Power_On_Hours_and_Msec "
+    "-v 170,raw48,Available_Reservd_Space "
+    "-v 171,raw48,Program_Fail_Count "
+    "-v 172,raw48,Erase_Fail_Count "
+    "-v 174,raw48,Unexpect_Power_Loss_Ct "
+    "-v 183,raw48,SATA_Downshift_Count "
+    "-v 187,raw48,Uncorrectable_Error_Cnt "
+    "-v 225,raw48,Host_Writes_32MiB "
+    "-v 226,raw48,Workld_Media_Wear_Indic "
+    "-v 227,raw48,Workld_Host_Reads_Perc "
+    "-v 228,raw48,Workload_Minutes "
+    "-v 234,raw24/raw32:04321,Thermal_Throttle "
+    "-v 243,raw48,NAND_Writes_32MiB "
+  },
   { "Kingston branded X25-V SSDs", // fixed firmware
     "KINGSTON SSDNow 40GB",
     "2CV102(J[89A-Z]|[K-Z].)", // >= "2CV102J8"
@@ -1236,33 +1346,55 @@ const drive_settings builtin_knowndrives[] = {
   { "Samsung based SSDs",
     "SAMSUNG SSD PM800 .*GB|"  // SAMSUNG PM800 SSDs, tested with SAMSUNG SSD PM800 TH 64GB/VBM25D1Q
     "SAMSUNG SSD PM810 .*GB|"  // SAMSUNG PM810 (470 series) SSDs, tested with SAMSUNG SSD PM810 2.5" 128GB/AXM06D1Q
-    "SAMSUNG SSD PM851 (mSATA )?(128|256|512)GB|" // tested with SAMSUNG SSD PM851 mSATA 128GB
+    "SAMSUNG SSD PM851 (mSATA |M\\.2 )?(2280 )?(128|256|512)GB|" // tested with SAMSUNG SSD PM851 mSATA 128GB,
+      // SAMSUNG SSD PM851 M.2 2280 256GB/EXT25D0Q
     "SAMSUNG SSD SM841N (mSATA )?(128|256|512)GB|" // tested with SAMSUNG SSD SM841N mSATA 256GB
     "SAMSUNG 470 Series SSD|"  // tested with SAMSUNG 470 Series SSD 64GB/AXM09B1Q
+    "Samsung SSD 750 EVO (120|250|500)GB|" // tested with Samsung SSD 750 EVO 250GB/MAT01B6Q
     "SAMSUNG SSD 830 Series|"  // tested with SAMSUNG SSD 830 Series 64GB/CXM03B1Q
+    "SAMSUNG SSD PM830 .*|" // SAMSUNG SSD PM830 2.5" 7mm 128GB/CXM03D1Q
     "MZ7PC(512|256|128|064)HA(GH|FU|DR)-000.*|" // probably PM830, tested with SAMSUNG MZ7PC128HAFU-000L1/CXM04L1Q
     "Samsung SSD 840 (PRO )?Series|" // tested with Samsung SSD 840 PRO Series 128GB/DXM04B0Q,
       // Samsung SSD 840 Series/DXT06B0Q
-    "Samsung SSD 8[45]0 EVO (mSATA |M\\.2 )?((120|250|500|750)G|1T)B( mSATA)?|" // tested with
+    "Samsung SSD 8[45]0 EVO .*|" // tested with
       // Samsung SSD 840 EVO (120|250|500|750)GB/EXT0AB0Q,
       // Samsung SSD 840 EVO (120|250)GB/EXT0BB6Q, 1TB/EXT0BB0Q, 120GB mSATA/EXT41B6Q,
       // Samsung SSD 850 EVO 250GB/EMT01B6Q
       // Samsung SSD 850 EVO M.2 250GB/EMT21B6Q
       // Samsung SSD 850 EVO mSATA 120GB/EMT41B6Q
+      // Samsung SSD 850 EVO 2TB/EMT02B6Q
     "Samsung SSD 850 PRO ((128|256|512)G|1T)B|" // tested with Samsung SSD 850 PRO 128GB/EXM01B6Q,
       // Samsung SSD 850 PRO 1TB/EXM01B6Q
+    "SAMSUNG MZ7PA256HMDR-.*|" // PM810 (470 Series), tested with SAMSUNG MZ7PA256HMDR-010H1/AXM07H1Q
+    "Samsung SSD 845DC EVO .*|" // Samsung SSD 845DC EVO 960GB/EXT03X3Q
+    "SAMSUNG MZ[7M]PC(032|064|128|256|512)HBCD-.*|" // PM830, tested with SAMSUNG MZMPC032HBCD-000L1/CXM12L1Q
+    "SAMSUNG MZ7TD(128|256)HAFV-.*|" // 840 Series, tested with SAMSUNG MZ7TD256HAFV-000L7/DXT06L6Q
     "SAMSUNG MZ7WD((120|240)H[AC]FV|480HAGM|960HAGP)-00003|" // SM843T Series, tested with
       // SAMSUNG MZ7WD120HAFV-00003/DXM85W3Q, SAMSUNG MZ7WD120HCFV-00003/DXM9203Q
+    "SAMSUNG MZ[7N]TE(128|256|512)HMHP-.*|" // PM851, tested with SAMSUNG MZ7TE256HMHP-000L7/EXT09L6Q,
+      // SAMSUNG MZNTE256HMHP-000H1/EXT22H0Q
     "SAMSUNG MZ7GE(240HMGR|(480|960)HMHP)-00003|" // SM853T Series, tested with
       // SAMSUNG MZ7GE240HMGR-00003/EXT0303Q
     "SAMSUNG MZ7LM(120|240|480|960|1T9|3T8)HC(JM|HP|GR|FD)-.*|" // PM863 Series, tested with
       // SAMSUNG MZ7LM960HCHP-0E003/GXT3003Q
     "SAMSUNG MZ7KM(120|240|480|960|1T9)HA(JM|HP|GR|FD|JM)-.*|" // SM863, tested with MZ7KM480HAHP-0E005/GXM1003Q
-    "SAMSUNG MZ[7N]LN(128|256|512)HC(HP|GR|JH)-.*", // PM871 Series, tested with SAMSUNG MZ7LN128HCHP
+    "SAMSUNG MZN(LF|TY)(128|256)H[CD]HP-.*|" // CM871/871a, tested with SAMSUNG MZNLF128HCHP-000H1/FXT21H1Q,
+      // SAMSUNG MZNTY256HDHP-000/MAT21K0Q
+    "SAMSUNG MZ[7N]LN(128|256|512|1T0)H[ACM](GR|HP|HQ|J[HPQ]|LR)-.*|" // PM871/871a/b, tested with
+      // SAMSUNG MZ7LN128HCHP-00000/EMT0100Q, SAMSUNG MZ7LN256HAHQ-000H1/MVT03H6Q,
+      // SAMSUNG MZNLN256HMHQ-000H1/MAV21H3Q
+    "SAMSUNG SSD PM871 .*|" // SAMSUNG SSD PM871 2.5 7mm 256GB/EMT02D0Q
+      // SAMSUNG MZ7LN256HMJP-00000/MAV0100Q, SAMSUNG MZ7LN512HMJP-00000/MAV0100Q
+    "SAMSUNG MZHPV(128|256|512)HDGL-.*", // SM951, tested with SAMSUNG MZHPV512HDGL-00000/BXW2500Q
     "", "",
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
+    "-v 170,raw48,Unused_Rsvd_Blk_Ct_Chip " // CM871
+    "-v 171,raw48,Program_Fail_Count_Chip " // CM871
+    "-v 172,raw48,Erase_Fail_Count_Chip " // CM871
+    "-v 173,raw48,Wear_Leveling_Count " // CM871
+    "-v 174,raw48,Unexpect_Power_Loss_Ct " // CM871
   //"-v 175,raw48,Program_Fail_Count_Chip "
   //"-v 176,raw48,Erase_Fail_Count_Chip "
   //"-v 177,raw48,Wear_Leveling_Count "
@@ -1275,13 +1407,20 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 184,raw48,End-to-End_Error " // SM843T Series
     "-v 187,raw48,Uncorrectable_Error_Cnt "
   //"-v 190,tempminmax,Airflow_Temperature_Cel "  // seems to be some sort of temperature value for 470 Series?
+    "-v 191,raw48,Unknown_Samsung_Attr " // PM810
   //"-v 194,tempminmax,Temperature_Celsius "
     "-v 195,raw48,ECC_Error_Rate "
+  //"-v 196,raw16(raw16),Reallocated_Event_Count "
   //"-v 198,raw48,Offline_Uncorrectable "
     "-v 199,raw48,CRC_Error_Count "
     "-v 201,raw48,Supercap_Status "
     "-v 202,raw48,Exception_Mode_Status "
-    "-v 235,raw48,POR_Recovery_Count " // 830/840/850 Series
+  //"-v 233,raw48,Media_Wearout_Indicator // PM851, 840
+    "-v 234,raw48,Unknown_Samsung_Attr " // PM851, 840
+    "-v 235,raw48,POR_Recovery_Count " // PM851, 830/840/850
+    "-v 236,raw48,Unknown_Samsung_Attr " // PM851, 840
+    "-v 237,raw48,Unknown_Samsung_Attr " // PM851, 840
+    "-v 238,raw48,Unknown_Samsung_Attr " // PM851, 840
   //"-v 241,raw48,Total_LBAs_Written "
   //"-v 242,raw48,Total_LBAs_Read " // PM851, SM841N
     "-v 243,raw48,SATA_Downshift_Ct " // PM863
@@ -1289,6 +1428,7 @@ const drive_settings builtin_knowndrives[] = {
     "-v 245,raw48,Timed_Workld_Media_Wear " // PM863
     "-v 246,raw48,Timed_Workld_RdWr_Ratio " // PM863
     "-v 247,raw48,Timed_Workld_Timer " // PM863
+    "-v 249,raw48,Unknown_Samsung_Attr " // CM871a
     "-v 250,raw48,SATA_Iface_Downshift " // from the spec
     "-v 251,raw48,NAND_Writes" // PM863
   },
@@ -1296,9 +1436,12 @@ const drive_settings builtin_knowndrives[] = {
     "SanDisk SD5SG2[0-9]*G1052E|" // X100 (88SS9174), tested with SanDisk SD5SG2256G1052E/10.04.01
     "SanDisk SD6S[BF][12]M[0-9]*G(1022I?)?|" // X110/X210 (88SS9175/187?), tested with SanDisk SD6SB1M064G1022I/X231600,
       // SanDisk SD6SB1M256G1022I/X231600, SanDisk SD6SF1M128G1022/X231200, SanDisk SD6SB2M512G1022I/X210400
-    "SanDisk SD7SB6S(128|256|512)G1122|" // X300 (88SS9189?), tested with SanDisk SD7SB6S128G1122/X3310000
+    "SanDisk SD7S[BN]6S-?(128|256|512)G(1122|-1006)|" // X300 (88SS9189?), tested with
+      // SanDisk SD7SB6S128G1122/X3310000, SanDisk SD7SN6S-512G-1006/X3511006
+    "SanDisk SD8SB8U((128|256|512)G|1T00)1122|" // X400 (88SS1074), tested with SanDisk SD8SB8U128G1122/X4120000
     "SanDisk SDSSDHP[0-9]*G|" // Ultra Plus (88SS9175), tested with SanDisk SDSSDHP128G/X23[01]6RL
-    "SanDisk SDSSDHII[0-9]*G|" // Ultra II (88SS9190/88SS9189), tested with SanDisk SDSSDHII120G/X31200RL
+    "SanDisk (SDSSDHII|Ultra II )[0-9]*GB?|" // Ultra II (88SS9190/88SS9189), tested with
+      // SanDisk SDSSDHII120G/X31200RL, SanDisk Ultra II 960GB/X41100RL
     "SanDisk SDSSDXPS?[0-9]*G", // Extreme II/Pro (88SS9187), tested with SanDisk SDSSDXP480G/R1311,
       // SanDisk SDSSDXPS480G/X21200RL
     "", "",
@@ -1356,13 +1499,78 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 242,raw48,Total_LBAs_Read "
     "-v 244,raw48,Thermal_Throttle "
   },
+  //  SDLF1DAR-480G-1HAW/ZR07RE41
+  // SDLF1DAR-480G-1JA1/RP41ZH06
+  { "Sandisk SATA Cloudspeed Max and GEN2 ESS SSDs",
+   "SD[A-Z0-9]{2}[1-3][A-Z]{3}-?[0-9]{3}[GT]-?1[A-Z0-9]{3}",
+   "","",
+   "-v 13,raw48,Lifetime_UECC_Ct "
+   "-v 32,raw48,Lifetime_Write_AmpFctr "
+   "-v 33,raw48,Write_AmpFctr "
+   "-v 170,raw48,Reserve_Erase_BlkCt "
+   "-v 171,raw48,Program_Fail_Ct "
+   "-v 172,raw48,Erase_Fail_Ct "
+   "-v 173,raw48,Percent_Life_Used "
+   "-v 174,raw48,Unexpect_Power_Loss "
+   "-v 175,raw48,Lifetime_Die_Failure_Ct "
+   "-v 177,raw48,Lifetime_Remaining% "
+   "-v 178,raw48,SSD_LifeLeft(0.01%) "
+   "-v 180,raw48,Undetected_Data_Err_Ct "
+   "-v 183,raw48,LT_Link_Rate_DwnGrd_Ct "
+   "-v 191,raw48,Clean_Shutdown_Ct "
+   "-v 192,raw48,Unclean_Shutdown_Ct "
+   "-v 196,raw48,Lifetime_Retried_Blk_Ct "
+   "-v 204,raw48,Average_Block-Erase_Ct "
+   "-v 205,raw48,Read_Retry_Enable_Ct "
+   "-v 206,raw48,Successful_RaidRecov_Ct "
+   "-v 207,raw48,Trimmed_Sector_Ct "
+   "-v 211,raw48,Read_Disturb_ReallocEvt "
+   "-v 233,raw48,Lifetime_Nand_Writes "
+   "-v 235,raw48,Capacitor_Health "
+   "-v 244,raw48,Therm_Throt_Activation "
+   "-v 245,raw48,Drive_Life_Remaining% "
+   "-v 253,raw48,SPI_Test_Remaining "
+ },
+ { "Sandisk SATA CS1K GEN1 ESS SSDs",
+   "SD[A-Z0-9]{2}[NO][A-Z0-9]{3}-?[0-9]{3}[GT]-?1[A-Z0-9]{3}",
+   "","",
+   "-v 1,raw48,UECC_Ct "
+   "-v 2,raw48,Internal_File_Check "
+   "-v 5,raw16(raw16),Retried_Blk_Ct "
+   "-v 32,raw48,Write_Ampflication "
+   "-v 170,raw48,Reserve_Blk_Remaining "
+   "-v 171,raw48,Program_Fail_Ct "
+   "-v 172,raw48,Erase_Fail_Ct "
+   "-v 173,raw48,Drive_Life_Used% "
+   "-v 174,raw48,Unexpect_PwrLoss_Ct "
+   "-v 175,raw48,PwrLoss_ProtectionFail "
+   "-v 177,raw48,DriveLife_Remaining% "
+   "-v 178,raw48,SSD_Life_Left "
+   "-v 180,raw48,End_to_End_Err_Detect "
+   "-v 190,raw48,Drive_Temp_Warning "
+   "-v 195,raw48,Uncorrectable_Err_Ct "
+   "-v 202,raw48,Exception_Mode_Status "
+   "-v 233,raw48,Number_Of_Write_Ct "
+   "-v 245,raw48,DriveLife_Used% "
+ },
   { "SiliconMotion based SSDs", // SM2246EN (Transcend TS6500)
+    "R3SL(120|240|480|960)G|" // AMD Radeon Solid State Drives,
     "CT(120|250|500|1000)BX100SSD1|" // Crucial BX100, tested with CT250BX100SSD1/MU02,
       // CT500BX100SSD1/MU02, CT1000BX100SSD1/MU02
     "CT(240|480|960)BX200SSD1|" // Crucial BX200 Solid State Drive, tested with CT480BX200SSD1/MU02.6
     "TS((16|32|64|128|256|512)G|1T)(SSD|MSA)(370S?|420I?)|" // Transcend SSD370/420 SATA/mSATA, TS6500,
       // tested with TS32GMSA370/20140402, TS16GMSA370/20140516, TS64GSSD370/20140516,
       // TS256GSSD370/N0815B, TS256GSSD370S/N1114H, TS512GSSD370S/N1114H, TS32GSSD420I/N1114H
+      // TS256GMTS400
+    "TS(16|32|64|128|512|256)GMTS400S?|"
+    "TS(120|240)GMTS420|" // Transcend MTS420, TS(120|240)GMTS420
+    "TS(128G|256G|512G|1T)SSD230S|" // TS128GSSD230S/P1025F8
+    "TS(120|240|480|960)GSSD220S|" // TS480GSSD220S/P0520AA
+    "TS(16G|32G|64G|128G|256G|512G|1T)MTS800S?|" // MTS800, tested with TS1TMTS800/O1225H1
+    "TS(16|32|64)GMSA630|" // MSA630 mSATA SSD, tested with TS32GMSA630/N0113E1
+    "MKNSSDRE(1TB|2TB|512GB|500GB|256GB|250GB)|" // MKNSSDRE256GB/N1007C
+    "MKNSSDTR(240|500|250|120|480|240)GB(-LT)?|" // MKNSSDTR500GB/O1126A
+    "LITEON LMH-(128|256|512)V2M-.*|" // LITEON LMH-256V2M-11 MSATA 256GB/FM8110C
     "ADATA SP550", // ADATA SP550/O0803B5a
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
@@ -1404,6 +1612,39 @@ const drive_settings builtin_knowndrives[] = {
     "-v 246,raw48,SLC_Writes_32MiB "
     "-v 247,raw48,Raid_Recoverty_Ct"
   },
+  { "SMART Modular Technologies mSATA XL+ SLC SSDs", // tested with SH9MST6D16GJSI01
+    "SH9MST6D[0-9]*GJSI?[0-9]*", // based on http://www.smartm.com/salesLiterature/embedded/mSATA_overview.pdf
+    "", "", // attributes info from http://www.mouser.com/ds/2/723/smartmodular_09302015_SH9MST6DxxxGJSxxx_rA[1]-770719.pdf
+    "-v 1,raw48,Uncorrectable_ECC_Cnt "
+  //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
+    "-v 9,raw48,Power_On_Hours " // override default raw24(raw8) format
+  //"-v 12,raw48,Power_Cycle_Count "
+    "-v 14,raw48,Device_Capacity_LBAs "
+    "-v 15,raw48,User_Capacity_LBAs " // spec DecID is wrong, HexID is right
+    "-v 16,raw48,Init_Spare_Blocks_Avail " // spec DecID is wrong, HexID is right
+    "-v 17,raw48,Spare_Blocks_Remaining " // spec DecID is wrong, HexID is right
+    "-v 100,raw48,Total_Erase_Count "
+    "-v 168,raw48,SATA_PHY_Err_Ct "
+    "-v 170,raw48,Initial_Bad_Block_Count "
+    "-v 172,raw48,Erase_Fail_Count "
+    "-v 173,raw48,Max_Erase_Count "
+    "-v 174,raw48,Unexpect_Power_Loss_Ct "
+    "-v 175,raw48,Average_Erase_Count "
+  //"-v 181,raw48,Program_Fail_Cnt_Total "
+  //"-v 187,raw48,Reported_Uncorrect "
+  //"-v 194,tempminmax,Temperature_Celsius "
+    "-v 197,raw48,Not_In_Use "
+    "-v 198,raw48,Not_In_Use "
+    "-v 199,raw48,SATA_CRC_Error_Count "
+    "-v 202,raw48,Perc_Rated_Life_Used "
+    "-v 231,raw48,Perc_Rated_Life_Remain "
+    "-v 232,raw48,Read_Fail_Count "
+    "-v 234,raw48,Flash_Reads_LBAs "
+    "-v 235,raw48,Flash_Writes_LBAs "
+    "-v 241,raw48,Host_Writes_LBAs "
+    "-v 242,raw48,Host_Reads_LBAs"
+    //  247-248 Missing in specification from April 2015
+  },
   { "Smart Storage Systems Xcel-10 SSDs",  // based on http://www.smartm.com/files/salesLiterature/storage/xcel10.pdf
     "SMART A25FD-(32|64|128)GI32N", // tested with SMART A25FD-128GI32N/B9F23D4K
     "",
@@ -1876,7 +2117,8 @@ const drive_settings builtin_knowndrives[] = {
     "SAMSUNG HN-M(320|500|750|101)XBB",
     "", "", ""
   },
-  { "Seagate Samsung SpinPoint M8U (USB)", // tested with ST1000LM025 HN-M101ABB/2AR10001
+  { "Seagate Samsung SpinPoint M8U (USB)", // tested with ST1000LM025 HN-M101ABB/2AR10001,
+      // ST1000LM025 HN-M101ABB/2BA30003 (0x04e8:0x61b6)
     "ST(250|320|500|640|750|1000)LM0[012][3459] HN-M[0-9]*ABB",
     "", "", ""
   },
@@ -1885,6 +2127,17 @@ const drive_settings builtin_knowndrives[] = {
     "ST(1500|2000)LM0(03|04|06|07|10) HN-M[0-9]*RAD",
     "", "", ""
   },
+  // Flash accelerated, no SMART info in the specs
+  // ST1000LX015-1U7172/SDM1
+  { "Seagate FireCuda 2.5", // 
+    "ST(500|1000|2000)LX0(01|15|25)-.*",
+    "", "", "-v 240,msec24hour32 "
+  },
+  // ST1000DX002/CC41
+  { "Seagate FireCuda 3.5", // ST2000DX002-2DV164/CC41
+    "ST[12]000DX002-.*",
+    "", "", "-v 240,msec24hour32 "
+  },
   { "Seagate Samsung SpinPoint M9TU (USB)", // tested with ST1500LM008 HN-M151AAD/2BC10001
        // (0x04e8:0x61b5), ST2000LM005 HN-M201AAD2BC10001 (0x04e8:0x61b4)
     "ST(1500|2000)LM00[58] HN-M[0-9]*AAD",
@@ -1912,6 +2165,36 @@ const drive_settings builtin_knowndrives[] = {
     "SAMSUNG HS(122H|2[05]YJ)Z",
     "", "", ""
   },
+  { "SK hynix SATA SSDs",
+    "SK ?hynix SC(210|300|308|313).*|" // tested with
+      // SK hynix SC210 mSATA 256GB/20002L00,
+      // SKhynix SC300 HFS256G32MND-3210A/20131P00,
+      // SK hynix SC308 SATA 128GB/30001P10,
+      // SK hynix SC313 HFS256G32TNF-N3A0A/70000P10
+    "HFS(128|256|512)G32MND-(2200|3210)A|" // HFS128G32MND-2200A/20200L00,
+      // HFS512G32MND-3210A/20100P00
+    "HFS(120|250|500)G32TND-N1A2A", // HFS500G32TND-N1A2A/30000P10
+    "", "",
+    "-v 5,raw48,Retired_Block_Count "
+    "-v 100,raw48,Total_Erase_Count "
+    "-v 168,raw48,Min_Erase_Count "
+    "-v 169,raw48,Max_Erase_Count "
+    "-v 171,raw48,Program_Fail_Count "
+    "-v 172,raw48,Erase_Fail_Count "
+    "-v 173,raw48,Wear_Leveling_Count "
+    "-v 174,raw48,Unexpect_Power_Loss_Ct "
+    "-v 176,raw48,Unused_Rsvd_Blk_Cnt_Tot "
+    "-v 180,raw48,Erase_Fail_Count "
+    "-v 181,raw48,Non4k_Aligned_Access "
+    "-v 183,raw48,SATA_Downshift_Count "
+    "-v 201,raw48,Percent_Lifetime_Remain "
+    "-v 212,raw48,Phy_Error_Count "
+    "-v 231,raw48,SSD_Life_Left "
+    "-v 241,raw48,Total_Writes_GiB "
+    "-v 242,raw48,Total_Reads_GiB "
+    "-v 243,raw48,Total_Media_Writes "
+    "-v 250,raw48,Read_Retry_Count "
+  },
   { "Maxtor Fireball 541DX",
     "Maxtor 2B0(0[468]|1[05]|20)H1",
     "",
@@ -2371,7 +2654,8 @@ const drive_settings builtin_knowndrives[] = {
     "", "", ""
   },
   { "HGST Travelstar 7K1000", // tested with HGST HTS721010A9E630/JB0OA3B0
-    "HGST HTS721010A9E630",
+    // HGST HTS721075A9E630/JB2OA3J0
+    "HGST HT[ES]7210(10|75)A9E63[01]",
     "", "", ""
   },
   { "IBM Deskstar 14GXP and 16GP",
@@ -2398,6 +2682,10 @@ const drive_settings builtin_knowndrives[] = {
     "Hitachi HCS5C32(25|32)SLA380",
     "", "", ""
   },
+  { "Hitachi CinemaStar 5K1000", // Hitachi HCS5C1010CLA382/JC4OA3EA
+    "Hitachi HCS5C10(10|75|50|32|25|16)CLA382",
+    "", "", ""
+  },
   { "Hitachi Deskstar 5K3000", // tested with HDS5C3030ALA630/MEAOA5C0,
        // Hitachi HDS5C3020BLE630/MZ4OAAB0 (OEM, Toshiba Canvio Desktop)
     "(Hitachi )?HDS5C30(15|20|30)(ALA|BLE)63[02].*",
@@ -2468,12 +2756,14 @@ const drive_settings builtin_knowndrives[] = {
     "Hitachi HDS722020ALA330",
     "", "", ""
   },
-  { "Hitachi Deskstar 7K3000", // tested with HDS723030ALA640/MKAOA3B0
-    "Hitachi HDS7230((15|20)BLA642|30ALA640)",
+  { "Hitachi Deskstar 7K3000", // tested with Hitachi HDS723030ALA640/MKAOA3B0,
+      // Hitachi HDS723030BLE640/MX6OAAB0
+    "Hitachi HDS7230((15|20)BLA642|30ALA640|30BLE640)",
     "", "", ""
   },
-  { "Hitachi/HGST Deskstar 7K4000", // tested with Hitachi HDS724040ALE640/MJAOA250
-    "Hitachi HDS724040ALE640",
+  { "Hitachi/HGST Deskstar 7K4000", // tested with Hitachi HDS724040ALE640/MJAOA250,
+      // HGST HDS724040ALE640/MJAOA580
+    "(Hitachi|HGST) HDS724040ALE640",
     "", "", ""
   },
   { "HGST Deskstar NAS", // tested with HGST HDN724040ALE640/MJAOA5E0,
@@ -2501,6 +2791,15 @@ const drive_settings builtin_knowndrives[] = {
     "(Hitachi|HGST) HUS7240(20|30|40)AL[AE]64[01]",
     "", "", ""
   },
+  { "Hitachi/HGST Ultrastar 7K2", //
+    "(Hitachi|HGST) HUS722T[12]TALA604",
+    "", "",
+    "-v 16,raw48,Gas_Gauge"
+  },
+  { "HGST Ultrastar 7K6000", // tested with HGST HUS726060ALE614/APGNW517
+    "HGST HUS7260[2456]0AL[AEN]61[014]",
+    "", "", ""
+  },
   { "HGST Ultrastar He6", // tested with HGST HUS726060ALA640/AHGNT1E2
     "HGST HUS726060ALA64[01]",
     "", "",
@@ -2511,6 +2810,11 @@ const drive_settings builtin_knowndrives[] = {
     "", "",
     "-v 22,raw48,Helium_Level"
   },
+  { "HGST Ultrastar He10", // tested with HGST HUH7210100ALE600/0F27452
+    "HGST HUH7210(08|10)AL[EN]60[014]",
+    "", "",
+    "-v 22,raw48,Helium_Level"
+  },
   { "HGST MegaScale 4000", // tested with HGST HMS5C4040ALE640/MPAOA580
     "HGST HMS5C4040[AB]LE64[01]", // B = DC 4000.B
     "", "", ""
@@ -2539,6 +2843,15 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MK8050GACY",
     "", "", ""
   },
+  { "Toshiba 2.5\" HDD MK..34GSX", // tested with TOSHIBA MK8034GSX/AH301E
+    "TOSHIBA MK(80|12|10)34GSX",
+    "", "", ""
+  },
+  //
+  { "Toshiba 2.5\" HDD MK..32GSX", // tested with TOSHIBA MK1032GSX/AS021G
+    "TOSHIBA MK(10|80|60|40)32GSX",
+    "", "", ""
+  },
   { "Toshiba 2.5\" HDD MK..51GSY", // tested with TOSHIBA MK1251GSY/LD101D
     "TOSHIBA MK(80|12|16|25)51GSY",
     "",
@@ -2610,15 +2923,25 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MQ01ABF(050|075|100)",
     "", "", ""
   },
-  { "Toshiba 2.5\" HDD MQ01UBB... (USB 3.0)", // tested with TOSHIBA MQ01UBB200/AY000U (0x0480:0xa100)
+  { "Toshiba 2.5\" HDD MQ01UBB... (USB 3.0)", // tested with TOSHIBA MQ01UBB200/AY000U (0x0480:0xa100),
+      // TOSHIBA MQ01UBB200/34MATMZ5T (0x05ac:0x8406)
     "TOSHIBA MQ01UBB200",
     "", "", ""
   },
   { "Toshiba 2.5\" HDD MQ01UBD... (USB 3.0)", // tested with TOSHIBA MQ01UBD050/AX001U (0x0480:0xa007),
-      // TOSHIBA MQ01UBD100/AX001U (0x0480:0x0201, 0x0480:0xa200)
+      // TOSHIBA MQ01UBD100/AX001U (0x0480:0x0201, 0x0480:0xa200),
+      // TOSHIBA MQ01UBD050/AX101U (0x0480:0xa202)
     "TOSHIBA MQ01UBD(050|075|100)",
     "", "", ""
   },
+  { "Toshiba 2.5\" HDD MQ03ABB...", // tested with TOSHIBA MQ03ABB300
+    "TOSHIBA MQ03ABB[23]00",
+    "", "", ""
+  },
+  { "Toshiba 2.5\" HDD MQ03UBB...", // tested with TOSHIBA MQ03UBB200/37I7T0NJT
+    "TOSHIBA MQ03UBB(300|200|250)",
+    "", "", ""
+  },
   { "Toshiba 3.5\" HDD MK.002TSKB", // tested with TOSHIBA MK1002TSKB/MT1A
     "TOSHIBA MK(10|20)02TSKB",
     "", "", ""
@@ -2631,6 +2954,10 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MD04ACA[2345]00",
     "", "", ""
   },
+  { "Toshiba 3.5\" MG04ACA... Enterprise HDD", // tested with TOSHIBA MG04ACA600A/FS2B
+    "TOSHIBA MG04ACA[23456]00[AE].?",
+    "", "", ""
+  },
   { "Toshiba 3.5\" DT01ABA... Desktop HDD", // tested with TOSHIBA DT01ABA300/MZ6OABB0
     "TOSHIBA DT01ABA(100|150|200|300)",
     "", "", ""
@@ -2640,6 +2967,14 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA DT01ACA(025|032|050|075|100|150|200|300)",
     "", "", ""
   },
+  { "Toshiba X300", // tested with TOSHIBA HDWE160/FS2A
+    "TOSHIBA HDWE1[456]0",
+    "", "", ""
+  },
+  { "Toshiba P300", // tested with TOSHIBA HDWD120/MX4OACF0
+    "TOSHIBA HDWD1(30|20|10|05)",
+    "", "", ""
+  },
   { "Toshiba 1.8\" HDD",
     "TOSHIBA MK[23468]00[4-9]GA[HL]",
     "", "", ""
@@ -2652,6 +2987,17 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MK6022GAX",
     "", "", ""
   },
+  { "Toshiba HG6 Series SSD", // TOSHIBA THNSNJ512GCST/JTRA0102
+    // http://www.farnell.com/datasheets/1852757.pdf
+    // TOSHIBA THNSFJ256GCSU/JULA1102
+    // TOSHIBA THNSFJ256GDNU A/JYLA1102
+    "TOSHIBA THNS[NF]J(060|128|256|512)G[BCAM8VD][SCN][TU].*",
+    "", "", 
+    "-v 167,raw48,SSD_Protect_Mode "
+    "-v 168,raw48,SATA_PHY_Error_Count "
+    "-v 169,raw48,Bad_Block_Count "
+    "-v 173,raw48,Erase_Count "
+  },
   { "", // TOSHIBA MK6409MAV
     "TOSHIBA MK6409MAV",
     "", "", ""
@@ -2767,9 +3113,9 @@ const drive_settings builtin_knowndrives[] = {
     "ST(160|250|320)LT0(07|09|11|14)-.*",
     "", "", ""
   },
-  { "Seagate Laptop Thin HDD", // tested with ST500LT012-9WS142/0001SDM1,
-      // ST500LM021-1KJ152/0002LIM1
-    "ST((250|320|500)LT0(12|15|25)|(320|500)LM0(10|21))-.*",
+  { "Seagate Laptop HDD", // tested with ST500LT012-9WS142/0001SDM1,
+      // ST500LM021-1KJ152/0002LIM1, ST4000LM016-1N2170/0003
+    "ST((25|32|50)0LT0(12|15|25)|(32|50)0LM0(10|21)|[34]00LM016)-.*",
     "", "", ""
   },
   { "Seagate Laptop SSHD", // tested with ST500LM000-1EJ162/SM11
@@ -2908,7 +3254,10 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "Seagate Barracuda 7200.12", // tested with ST3250312AS/JC45, ST31000524AS/JC45,
       // ST3500413AS/JC4B, ST3750525AS/JC4B
-    "ST3(160318|25031[128]|320418|50041[038]|750(518|52[358])|100052[348])AS",
+      // ST3160316AS/JC45
+      // Possible options: ST31000524AS, ST3500413AS, ST3250312AS ,
+      // ST3750525AS, ST3320413AS, ST3160316AS
+    "ST3(160318|25031[128]|320418|50041[038]|750(518|52[358])|100052[348]|320413|160316)AS",
     "", "", ""
   },
   { "Seagate Barracuda XT", // tested with ST32000641AS/CC13,
@@ -2950,13 +3299,22 @@ const drive_settings builtin_knowndrives[] = {
     "", "",
     "-v 188,raw16 -v 240,msec24hour32"
   },
+  // should be ST4000DM005, ST3000DM008,ST3000DM009,ST2000DM006,ST2000DM007
+  // ST1000DM010, ST500DM009
+  // tested: ST3000DM008-2DM166/CC26
+  { "Seagate Barracuda 3.5", // tested on ST1000DM010-2EP102/Z9ACZM97
+    "ST(4000DM00[45]|3000DM008|3000DM009|2000DM006|2000DM007|1000DM010|500DM009)-.*",
+    "", "",
+    "-v 188,raw16 -v 240,msec24hour32"
+  },
   { "Seagate Barracuda 7200.14 (AF)", // < 1TB, tested with ST250DM000-1BC141
     "ST(250|320|500|750)DM00[0-3]-.*",
     "", "",
     "-v 188,raw16 -v 240,msec24hour32"
   },
-  { "Seagate Desktop HDD.15", // tested with ST4000DM000-1CD168/CC43, ST5000DM000-1FK178/CC44
-    "ST[45]000DM000-.*",
+  { "Seagate Desktop HDD.15", // tested with ST4000DM000-1CD168/CC43, ST5000DM000-1FK178/CC44,
+      // ST6000DM001-1XY17Z/CC48
+    "ST[4568]000DM00[012]-.*",
     "", "",
     "-v 188,raw16 -v 240,msec24hour32"
   },
@@ -2998,6 +3356,13 @@ const drive_settings builtin_knowndrives[] = {
     "ST3(250[68]2|32062|40062|50063|75064)0NS",
     "", "", ""
   },
+  // ST5000LM000, ST4000LM024, ST3000LM024, ST2000LM015, ST1000LM048, ST500LM030
+  { "Seagate Barracuda 2.5 5400", // ST2000LM015-2E8174/SDM1, ST4000LM024-2AN17V/0001
+    "ST(5000LM000|[34]000LM024|2000LM015|1000LM048|500LM030)-.*",
+    "",
+    "",
+    "-v 183,raw48,SATA_Downshift_Count "
+  },
   { "Seagate Barracuda ES.2", // fixed firmware
     "ST3(25031|50032|75033|100034)0NS",
     "SN[01]6|"         // http://knowledge.seagate.com/articles/en_US/FAQ/207963en
@@ -3027,12 +3392,16 @@ const drive_settings builtin_knowndrives[] = {
     "ST9(160511|500530)NS",
     "", "", ""
   },
-  { "Seagate Constellation ES (SATA)", // tested with ST31000524NS/SN11
-    "ST3(50051|100052|200064)4NS",
+  { "Seagate Constellation ES (SATA)", // tested with ST31000524NS/SN11,
+      // MB0500EAMZD/HPG1
+    "ST3(50051|100052|200064)4NS|"
+    "MB0500EAMZD", // HP OEM
     "", "", ""
   },
-  { "Seagate Constellation ES (SATA 6Gb/s)", // tested with ST1000NM0011/SN02
-    "ST(5|10|20)00NM0011",
+  { "Seagate Constellation ES (SATA 6Gb/s)", // tested with ST1000NM0011/SN02,
+      // MB1000GCEEK/HPG1
+    "ST(5|10|20)00NM0011|"
+    "MB1000GCEEK", // HP OEM
     "", "", ""
   },
   { "Seagate Constellation ES.2 (SATA 6Gb/s)", // tested with ST32000645NS/0004, ST33000650NS,
@@ -3041,8 +3410,10 @@ const drive_settings builtin_knowndrives[] = {
     "MB3000EBKAB", // HP OEM
     "", "", ""
   },
-  { "Seagate Constellation ES.3", // tested with ST1000NM0033-9ZM173/0001, ST4000NM0033-9ZM170/SN03
-    "ST[1234]000NM00[35]3-.*",
+  { "Seagate Constellation ES.3", // tested with ST1000NM0033-9ZM173/0001,
+      // ST4000NM0033-9ZM170/SN03, MB1000GCWCV/HPGC
+    "ST[1234]000NM00[35]3-.*|"
+    "MB1000GCWCV", // HP OEM
     "", "", ""
   },
   { "Seagate Constellation CS", // tested with ST3000NC000/CE02, ST3000NC002-1DY166/CN02
@@ -3054,15 +3425,33 @@ const drive_settings builtin_knowndrives[] = {
     "MM1000GBKAL", // HP OEM
     "", "", ""
   },
-  { "Seagate Enterprise Capacity 3.5 HDD", // tested with ST6000NM0024-1HT17Z/SN02
-    "ST[2456]000NM0[01][248]4-.*", // *[069]4 = 4Kn
+  // ST6000NM0004, ST6000NM0024, ST6000NM0044, ST6000NM0084, ST5000NM0024,
+  // ST5000NM0044, ST4000NM0024, ST4000NM0044, ST2000NM0024, ST2000NM0044
+  // ST4000NM0035, ST3000NM0005, ST2000NM0055, ST1000NM0055, ST4000NM0045,
+  // ST3000NM0015, ST2000NM0065, ST1000NM0065, ST4000NM0105, ST3000NM0055
+  { "Seagate Enterprise Capacity 3.5 HDD", // tested with ST6000NM0024-1HT17Z/SN02,
+      // ST10000NM0016-1TT101/SNB0
+      // ST4000NM0085-1YY107/ZC11SXPH
+      // ST8000NM0045-1RL112/NN02
+      // ST6000NM0004-1FT17Z/NN01
+      // ST4000NM0035-1V4107/TNC3
+    "ST([24568]|10)000NM0[01][0-48][456]-.*", // *[069]4 = 4Kn
     "", "", 
-    "-v 188,raw16"
+    "-v 188,raw16 -v 240,msec24hour32"
   },
+  // new models: ST8000VN0002, ST6000VN0021, ST4000VN000
+  //             ST8000VN0012, ST6000VN0031, ST4000VN003
+  // tested with ST8000VN0002-1Z8112/ZA13YGNF
   { "Seagate NAS HDD", // tested with ST2000VN000-1H3164/SC42, ST3000VN000-1H4167/SC43
-    "ST[234]000VN000-.*",
+    "ST([234]000VN000|[468]000VN00(02|21|12|31|3))-.*",
     "", "", ""
   },
+  // ST10000VN0004, ST8000VN0022, ST6000VN0041, ST4000VN008, ST3000VN007,
+  // ST2000VN004, ST1000VN002
+  { "Seagate IronWolf", // tested with ST6000VN0041-2EL11C/SC61
+    "ST(10|8|6|4|3|2|1)000VN00(04|22|41|8|7|2|4)-.*",
+    "", "", ""
+  },  
   { "Seagate Archive HDD", // tested with ST8000AS0002-1NA17Z/AR13
     "ST[568]000AS00[01][12]-.*",
     "", "", ""
@@ -3103,8 +3492,12 @@ const drive_settings builtin_knowndrives[] = {
     "ST3(250311|500410|1000525)SV",
     "", "", ""
   },
-  { "Seagate SV35", // tested with ST1000VX001-1HH162/CV11, ST2000VX000-9YW164/CV12
-    "ST([123]000VX00[012]|31000526SV|3500411SV)(-.*)?",
+  // ST6000VX0001,ST6000VX0011,ST5000VX0001,ST5000VX0011,ST4000VX000
+  // ST4000VX002, ST3000VX002, ST2000VX003, ST1000VX001, ST1000VX002
+  // ST3000VX000, ST3000VX004, ST2000VX000, ST2000VX004, ST1000VX000
+  { "Seagate Surveillance", // tested with ST1000VX001-1HH162/CV11, ST2000VX000-9YW164/CV12,
+      // ST4000VX000-1F4168/CV14, ST2000VX003-1HH164/CV12
+    "ST([1-6]000VX00[01234]1?|31000526SV|3500411SV)(-.*)?",
     "", "", ""
   },
   { "Seagate DB35", // tested with ST3250823ACE/3.03, ST3300831SCE/3.03
@@ -3127,6 +3520,35 @@ const drive_settings builtin_knowndrives[] = {
     "ST6[468]022CF",
     "", "", ""
   },
+  { "WD Blue PC SSD", // tested with WDC WDS100T1B0A-00H9H0
+    "WDC WDS...[TG]1B0[AB].*",
+    "", "",
+  //"-v 5,raw48,Reallocated_Sector_Ct " // Reassigned Block Count
+  //"-v 9,raw48,Power_On_Hours "
+  //"-v 12,raw48,Power_Cycle_Count "
+    "-v 165,raw48,Block_Erase_Count "
+    "-v 166,raw48,Minimum_PE_Cycles_TLC "
+    "-v 167,raw48,Max_Bad_Blocks_per_Die "
+    "-v 168,raw48,Maximum_PE_Cycles_TLC "
+    "-v 169,raw48,Total_Bad_Blocks "
+    "-v 170,raw48,Grown_Bad_Blocks "
+    "-v 171,raw48,Program_Fail_Count "
+    "-v 172,raw48,Erase_Fail_Count "
+    "-v 173,raw48,Average_PE_Cycles_TLC "
+    "-v 174,raw48,Unexpected_Power_Loss "
+  //"-v 184,raw48,End-to-end_Error " // Detection/Correction Count
+  //"-v 187,raw48,Reported_Uncorrect " // Uncorrectable Errors
+  //"-v 188,raw48,Command_Timeout
+  //"-v 194,tempminmax,Temperature_Celsius " 
+  //"-v 199,raw48,UDMA_CRC_Error_Count  // SATA CRC Errors 
+    "-v 230,hex48,Media_Wearout_Indicator " // Maybe hex16
+  //"-v 232,raw48,Available_Reserve_Space"
+    "-v 233,raw48,NAND_GB_Written_TLC "
+    "-v 234,raw48,NAND_GB_Written_SLC "
+    "-v 241,raw48,Total_Host_GB_Written "
+    "-v 242,raw48,Total_Host_GB_Read "
+    "-v 244,raw48,Temp_Throttle_Status "
+  },
   { "Western Digital Protege",
   /* Western Digital drives with this comment all appear to use Attribute 9 in
    * a  non-standard manner.  These entries may need to be updated when it
@@ -3248,7 +3670,8 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "Western Digital RE4", // tested with WDC WD2003FYYS-18W0B0/01.01D02,
       // WDC WD1003FBYZ-010FB0/01.01V03
-    "WDC WD((25|50)03ABYX|1003FBY[XZ]|(15|20)03FYYS)-.*",
+      // WDC WD5003ABYZ-011FA0/01.01S03
+    "WDC WD((25|50)03ABY[XZ]|1003FBY[XZ]|(15|20)03FYYS)-.*",
     "", "", ""
   },
   { "Western Digital RE4-GP", // tested with WDC WD2002FYPS-02W3B0/04.01G01,
@@ -3258,9 +3681,11 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "Western Digital Re", // tested with WDC WD1004FBYZ-01YCBB0/RR02,
       // WDC WD2000FYYZ-01UL1B0/01.01K01, WDC WD2000FYYZ-01UL1B1/01.01K02,
-      // WDC WD4000FYYZ-01UL1B2/01.01K03, WD2000FYYX/00.0D1K2
+      // WDC WD4000FYYZ-01UL1B2/01.01K03, WD2000FYYX/00.0D1K2,
+      // WDC WD1004FBYZ-01YCBB1/RR04
     "WDC WD([12]004FBYZ|[1-6]00[01M]F[SXY]YZ)-.*|WD2000FYYX",
-    "", "", ""
+    "", "",
+    "-v 16,raw48,Total_LBAs_Read" // WDC WD1004FBYZ-01YCBB1/RR04
   },
   { "Western Digital Se", // tested with WDC WD2000F9YZ-09N20L0/01.01A01
     "WDC WD(1002|2000|3000|4000)F9YZ-.*",
@@ -3294,12 +3719,12 @@ const drive_settings builtin_knowndrives[] = {
       // WDC WD1003FZEX-00MK2A0/01.01A01, WDC WD3001FAEX-00MJRA0/01.01L01,
       // WDC WD3003FZEX-00Z4SA0/01.01A01, WDC WD4001FAEX-00MJRA0/01.01L01
       // WDC WD4003FZEX-00Z4SA0/01.01A01, WDC WD5003AZEX-00RKKA0/80.00A80,
-    "WDC WD(6001|2003|5001|1003|4003|5003|3003|3001)(FZW|FZE|AZE)X-.*|" // could be
+      // WDC WD4004FZWX-00GBGB0/81.H0A81
+    "WDC WD(6001|2003|5001|1003|4003|4004|5003|3003|3001)(FZW|FZE|AZE)X-.*|" // could be
     // new series  WD6001FZWX WD2003FZEX WD5001FZWX WD1003FZEX
-    //             WD4003FZEX WD5003AZEX WD3003FZEX
-    "WDC WD(4001|3001|2002|1002|5003|7500|5000|3200|2500|1600)(FAE|AZE|B[PE]K)[XT]-.*",
+    //             WD4003FZEX WD5003AZEX WD3003FZEX WD4004FZWX
+    "WDC WD(4001|3001|2002|1002|5003|7500|5000|3200|2500|1600)(FAE|AZE)X-.*",
     // old series: WD4001FAEX WD3001FAEX WD2002FAEX WD1002FAEX  WD5003AZEX
-    //             WD7500BPKT  WD5000BPKT WD3200BEKT WD2500BEKT WD1600BEKT
     "", "", ""
   },
   { "Western Digital AV ATA", // tested with WDC WD3200AVJB-63J5A0/01.03E01
@@ -3370,19 +3795,25 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "Western Digital Red", // tested with WDC WD10EFRX-68JCSN0/01.01A01,
       // WDC WD10JFCX-68N6GN0/01.01A01, WDC WD40EFRX-68WT0N0/80.00A80,
-      // WDC WD60EFRX-68MYMN1/82.00A82, WDC WD80EFZX-68UW8N0/83.H0A83
-    "WDC WD(7500BFC|10JFC|[1-6]0EFR|80EFZ)X-.*",
+      // WDC WD60EFRX-68MYMN1/82.00A82, WDC WD80EFAX-68LHPN0/83.H0A83,
+      // WDC WD80EFZX-68UW8N0/83.H0A83
+    "WDC WD(7500BFC|10JFC|[1-6]0EFR|80EF[AZ])X-.*",
     "", "",
     "-v 22,raw48,Helium_Level" // WD80EFZX
   },
-  { "Western Digital Red Pro", // tested with WDC WD2001FFSX-68JNUN0/81.00A81
-    "WDC WD[234]001FFSX-.*",
+  { "Western Digital Red Pro", // tested with WDC WD2001FFSX-68JNUN0/81.00A81,
+      // WDC WD6002FFWX-68TZ4N0/83.H0A83
+    "WDC WD([2-68]00[12])FF[SW]X-.*",
     "", "", ""
   },
   { "Western Digital Purple", // tested with WDC WD40PURX-64GVNY0/80.00A80
     "WDC WD[123456]0PURX-.*",
     "", "", ""
   },
+  { "Western Digital Gold", // tested with WDC WD4002FYYZ-01B7CB0/01.01M02
+    "WDC WD(101KR|[68]002FR|4002FY)YZ-.*",
+    "", "", ""
+  },
   { "Western Digital Blue Mobile", // tested with WDC WD5000LPVX-08V0TT2/03.01A03,
       // WDC WD20NPVZ-00WFZT0/01.01A01
     "WDC WD((25|32|50|75)00[BLM]|10[JS]|20N)P[CV][TXZ]-.*",
@@ -3392,8 +3823,9 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD(15|20)NPV[TX]-.*",
     "", "", ""
   },
-  { "Western Digital Black Mobile", // tested with WDC WD7500BPKX-22HPJT0/01.01A01
-    "WDC WD((16|25|32)00BE|(50|75)00BP)KX-.*",
+  { "Western Digital Black Mobile", // tested with WDC WD7500BPKX-22HPJT0/01.01A01,
+      // WDC WD10JPLX-00MBPT0/01.01H01
+    "WDC WD((16|25|32)00BEK[TX]|(25|32|50|75)00(BPK|LPL)X|10JPLX)-.*",
     "", "", ""
   },
   { "Western Digital Elements / My Passport (USB)", // tested with WDC WD5000BMVW-11AMCS0/01.01A01
@@ -3411,9 +3843,13 @@ const drive_settings builtin_knowndrives[] = {
       // WDC WD10TMVW-11ZSMS5/01.01A01,
       // WDC WD20NMVW-11AV3S2/01.01A01 (0x1058:0x0822),
       // WDC WD20NMVW-11AV3S3/01.01A01 (0x1058:0x0837),
+      // WDC WD20NMVW-11EDZS6/01.01A01 (0x1058-0x259f),
+      // WDC WD20NMVW-11EDZS7/01.01A01 (0x1058:0x259d/25a1),
       // WDC WD20NMVW-11W68S0/01.01A01,
-      // WDC WD30NMVW-11C3NS4/01.01A01
-    "WDC WD(5000[LK]|7500[BK]|10[JT]|[23]0N)MV[VW]-.*", // *W-* = USB 3.0
+      // WDC WD20NMVW-59AV3S3/01.01A01 (0x1058:0x107d),
+      // WDC WD30NMVW-11C3NS4/01.01A01,
+      // WDC WD40NMZW-11GX6S1/01.01A01 (0x1058:0x2599/25e2/25fa)
+    "WDC WD(5000[LK]|7500[BK]|10[JT]|[234]0N)M[VZ][VW]-.*", // *W-* = USB 3.0
     "", "", ""
   },
   { "Quantum Bigfoot", // tested with TS10.0A/A21.0G00, TS12.7A/A21.0F00
@@ -3516,20 +3952,9 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Buffalo MiniStation Stealth HD-PCTU2; ",
-    "0x0411:0x01d9",
-    "", // 0x0108
-    "",
-    "-d sat"
-  },
-  { "USB: Buffalo MiniStationHD-PCFU3; ",
-    "0x0411:0x0240",
-    "",
-    "",
-    "-d sat"
-  },
-  { "USB: Buffalo MiniStation Safe HD-PNFU3; ", // 1TB
-    "0x0411:0x0251",
+  { "USB: Buffalo MiniStation; ",
+    "0x0411:0x0(1[df]9|240|251)", // 0x01d9: HD-PCTU2 (0x0108),
+      // 0x01f9: HD-PZU3 (0x0100), 0x0240: HD-PCFU3, 0x0251: HD-PNFU3
     "",
     "",
     "-d sat"
@@ -3543,7 +3968,9 @@ const drive_settings builtin_knowndrives[] = {
   },
   // Hitachi (?)
   { "USB: ; Renesas uPD720231A", // USB2/3->SATA
-    "0x045b:0x022a", // DeLock 62652 converter SATA 6GB/s > USB 3.0
+    // 0x0229: Pi-102 Raspberry Pi USB to mSATA Converter Board
+    // 0x022a: DeLock 62652 converter SATA 6GB/s > USB 3.0
+    "0x045b:0x022[9a]",
     "",
     "",
     "-d sat"
@@ -3580,12 +4007,6 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Toshiba Canvio 3.0 Portable Hard Drive; ", // TOSHIBA MQ01UBD050
-    "0x0480:0xa007",
-    "", // 0x0001
-    "",
-    "-d sat"
-  },
   { "USB: Toshiba Stor.E; ",
     "0x0480:0xa00[9ace]",
     "", // 0x0000 (0xa00e)
@@ -3593,8 +4014,11 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Toshiba Canvio; ",
-    "0x0480:0xa(100|20[0c])", // 0xa100: TOSHIBA MQ01UBB200, 0xa200: TOSHIBA MQ01UBD100,
-    "",  // 0xa20c: TOSHIBA MQ01ABB200
+    "0x0480:0x(a(007|100|20[027c])|" // 0xa007 TOSHIBA MQ01UBD050,
+              "b207)", // 0xa100: TOSHIBA MQ01UBB200, 0xa200: TOSHIBA MQ01UBD100,
+        // 0xa202: TOSHIBA MQ01UBD050, 0xa207: TOSHIBA MQ01ABD100,
+        // 0xa20c: TOSHIBA MQ01ABB200, 0xb207: TOSHIBA MQ03UBB200
+    "", // 0x0001 (0xa007)
     "",
     "-d sat"
   },
@@ -3755,7 +4179,8 @@ const drive_settings builtin_knowndrives[] = {
     "-d usbsunplus"
   },
   { "USB: Iomega; JMicron",
-    "0x059b:0x0(47[05]|575)", // 0x0470: LPHD-UP, 0x0475: GDHDU2 (0x0100), 0x0575: LDHD-UP
+    "0x059b:0x0(47[05]|57[15])", // 0x0470: LPHD-UP, 0x0475: GDHDU2 (0x0100),
+      // 0x0575: LDHD-UP
     "",
     "",
     "-d usbjmicron"
@@ -3773,6 +4198,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "" // unsupported
   },
+  { "USB: LaCie d2 Quadra; Oxford OXUF934SSA-LQAG ", // USB+IEEE1394+eSATA->SATA
+    "0x059f:0x0828",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: LaCie hard disk; JMicron",
     "0x059f:0x0951",
     "",
@@ -3785,6 +4216,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: LaCie Desktop Hard Drive;",
+    "0x059f:0x1010",
+    "",
+    "",
+    "-d usbsunplus"
+  },
   { "USB: LaCie Desktop Hard Drive; ",
     "0x059f:0x101[68]", // 0x1016: SAMSUNG HD103UJ
     "", // 0x0001
@@ -3821,6 +4258,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron,x"
   },
+  { "USB: LaCie D2 USB3; LucidPort USB300 ",
+    "0x059f:0x103d",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: LaCie rikiki USB 3.0; ",
     "0x059f:0x10(49|57)",
     "",
@@ -3839,9 +4282,9 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: LaCie; ",
-    "0x059f:0x106f",
-    "", // 0x0001
+  { "USB: LaCie; ", // 0x1070: ASMedia 1053 ?
+    "0x059f:0x10(6f|7[05])",
+    "", // 6f/70=0x0001, 75=0x0000
     "",
     "-d sat"
   },
@@ -3852,6 +4295,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbcypress"
   },
+  // Apple
+  { "USB: Apple; ",
+    "0x05ac:0x8406", // TOSHIBA MQ01UBB200
+    "",
+    "",
+    "-d sat"
+  },
   // Genesys Logic
   { "USB: ; Genesys Logic GL881E",
     "0x05e3:0x0702",
@@ -3924,6 +4374,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: Freecom Quattro 3.0; ", // USB3.0+IEEE1394+eSATA->SATA
+    "0x07ab:0xfc77",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: Freecom Mobile Drive XXS; JMicron",
     "0x07ab:0xfc88",
     "", // 0x0101
@@ -4012,6 +4468,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  // Neodio Technologies
+  { "USB: Neodio; Initio INIC-1810PL",
+    "0x0aec:0x3050",
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
   // Seagate
   { "USB: Seagate External Drive; Cypress",
     "0x0bc2:0x0503",
@@ -4032,8 +4495,8 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Seagate Expansion Portable; ",
-    "0x0bc2:0x23(00|12|20|21|22)",
-    "", // 12=0x0219, 22=0x0000
+    "0x0bc2:0x23(00|12|1a|20|21|22)",
+    "", // 12=0x0219, 1a=0x0707, 22=0x0000
     "",
     "-d sat"
   },
@@ -4061,9 +4524,9 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Seagate Expansion External; ",
-    "0x0bc2:0x33(00|12|20|21|32)", // 0x3321: Expansion Desktop 4TB
-    "",
+  { "USB: Seagate Expansion Desktop; ",
+    "0x0bc2:0x33(00|1[2a]|2[012]|3[02])", // 1a=5TB, 21=4TB
+    "", // 1a=0x0909
     "",
     "-d sat"
   },
@@ -4073,6 +4536,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: Seagate FreeAgent GoFlex USB 3.0; ",
+    "0x0bc2:0x5030",
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
   { "USB: Seagate FreeAgent GoFlex USB 3.0; ",
     "0x0bc2:0x5031",
     "",
@@ -4103,9 +4572,18 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Seagate FreeAgent GoFlex Pro for Mac; ",
-    "0x0bc2:0x6121",
-    "", // 0x0148
+  { "USB: Seagate FreeAgent / Maxtor D3; ",
+    // 0x6121: Seagate FreeAgent GoFlex Pro for Mac (0x0148)
+    // 0x6123: Maxtor D3 Station 3TB (0x0209)
+    // 0x6126: Maxtor D3 Station 5TB (0x0209)
+    "0x0bc2:0x612[136]",
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: Maxtor M3 Portable; ",
+    "0x0bc2:0x61b7", // Maxtor M3 Portable 4TB (0x0000)
+    "",
     "",
     "-d sat"
   },
@@ -4116,7 +4594,7 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Seagate Backup Plus Desktop USB 3.0; ",
-    "0x0bc2:0xa(0a[14]|b31)", // 4TB, 3TB (8 LBA/1 PBA offset), 5TB
+    "0x0bc2:0xa(0a[14]|b3[14])", // 4TB, 3TB (8 LBA/1 PBA offset), 5TB, ?
     "",
     "",
     "-d sat"
@@ -4128,8 +4606,12 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Seagate Backup Plus USB 3.0; ",
-    "0x0bc2:0xab2[0145]", // 0xab24: Slim (ticket #443), 0xab25: Mac
-    "", // 0x0100
+    // 0xab1e: Seagate Backup Plus 4TB
+    // 0xab24: Seagate Backup Plus Slim (0x0100) (ticket #443)
+    // 0xab25: Seagate Backup Plus for Mac (0x0100)
+    // 0xab38: Seagate Backup Plus 8TB (0x0100) (ticket #786)
+    "0x0bc2:0xab(1e|2[01458]|38)",
+    "",
     "",
     "-d sat"
   },
@@ -4147,6 +4629,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbcypress"
   },
+  { "USB: Dura Micro; Initio",
+    "0x0c0b:0xb136",
+    "", // 0x0108
+    "",
+    "-d sat"
+  },
   { "USB: Dura Micro 509; Sunplus",
     "0x0c0b:0xb159",
     "", // 0x0103
@@ -4231,39 +4719,28 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbcypress"
   },
-  { "USB: WD My Passport; ",
-    "0x1058:0x0(70[245a]|71a|730|74[0128a]|7a[8e]|81[06]|82[02]|83[37a])",
-    "", // 822=0x1007, 837=0x1072
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book; ",
-    "0x1058:0x09(00|06|10)",
-    "", // 06=0x0012, 10=0x0106
-    "",
-    "-d sat"
-  },
   { "USB: WD Elements Desktop; ",
     "0x1058:0x10(01|03|21|7c)",
     "", // 01=0x0104, 03=0x0175, 21=0x2002, 7c=0x1065
     "",
     "-d sat"
   },
-  { "USB: WD Elements; ",
-    "0x1058:0x10(10|23|42|48|a2|a8|b8)",
-    "", // 10=0x0105, a8=0x1042, b8=0x1007
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book; ",
-    "0x1058:0x11(0[01245]|1[0d]|30|40)",
-    "", // 00/01=0x0165, 02=0x1028, 10=0x1030, 1d=0x1020, 30=0x1012, 40=0x1003
+  { "USB: WD Elements / My Passport; ", // 2.5" with integrated USB
+    "0x1058:0x(07(0[245a]|1a|30|4[0128a]|a[8e])|"
+              "08(1[06]|2[02]|3[37a])|"
+              "10(10|23|4[28]|7d|a[28]|b8)|"
+              "25(9[9df]|a[12]|e2|fa))",
+    "", // 0x0822=0x1007, 37=0x1072
+        // 0x1010=0x0105, 7d=0x1073, a8=0x1042, b8=0x1007
+        // 0x2599=0x1012, 9d/a1=0x1005, 9f/a2=0x1004
     "",
     "-d sat"
   },
-  { "USB: WD Elements; ",
-    "0x1058:0x25a2",
-    "", // 0x1004
+  { "USB: WD My Book / Easystore; ", // 3.5"
+    "0x1058:0x(09(0[06]|10)|11(0[01245]|1[0d]|30|40)|1230|25(a3|fb))",
+    "", // 0x0906=0x0012, 10=0x0106
+        // 0x1100/01=0x0165, 02=0x1028, 10=0x1030, 1d=0x1020, 30=0x1012, 40=0x1003
+        // 0x1230=0x1065, 0x25a3=0x1013, 0x25fb=0x3004
     "",
     "-d sat"
   },
@@ -4387,6 +4864,18 @@ const drive_settings builtin_knowndrives[] = {
     "", // 0x0205, 2.05, Mediasonic ProBox HF2-SU3S2 Rev 3 (port multiplier, ticket #504)
     "-d sat"
   },
+  { "USB: ; JMicron JMS578", // USB->SATA
+    "0x152d:0x0578",
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
+  { "USB: ; JMicron",
+    "0x152d:0x0579", // Intenso External
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
   { "USB: OCZ THROTTLE OCZESATATHR8G; JMicron JMF601",
     "0x152d:0x0602",
     "",
@@ -4471,9 +4960,15 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: ; JMicron JMS561U", // USB3->2xSATA
+    "0x152d:0x8561",
+    "", // 0x0107
+    "",
+    "-d sat"
+  },
   // ASMedia
-  { "USB: ; ASMedia ASM1053/1153",
-    "0x174c:0x1[01]53",
+  { "USB: ; ASMedia ASM1053/1153/1351",
+    "0x174c:0x1([01]53|351)",
     "",
     "",
     "-d sat"
@@ -4573,6 +5068,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "" // unsupported
   },
+  // Corsair
+  { "USB: Voyager GTX; ",
+    "0x1b1c:0x1a0e",
+    "",
+    "",
+    "-d sat"
+  },
   // SunplusIT
   { "USB: ; SunplusIT",
     "0x1bcf:0x0c31",
@@ -4601,10 +5103,10 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: ; Innostor IS888", // USB3->SATA
-    "0x1f75:0x0888", // Sharkoon SATA QuickDeck Pro USB 3.0
-    "", // 0x0034
-    "",
-    "" // unsupported
+    "0x1f75:0x0888",
+    "", // 0x0034, Sharkoon SATA QuickDeck Pro USB 3.0 (unsupported)
+    "", // 0x0036, works with -d sat (ticket #827)
+    "-d sat"
   },
   // VIA Labs
   { "USB: ; VIA VL701", // USB2/3->SATA
@@ -4633,6 +5135,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  // Power Quotient International
+  { "USB: PQI bridge; ",
+    "0x3538:0x0064",
+    "",
+    "",
+    "-d usbsunplus"
+  },
   // Sharkoon
   { "USB: Sharkoon QuickPort XT USB 3.0; ",
      "0x357d:0x7788",
@@ -4654,7 +5163,7 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat" // ATA output registers missing
   },
   { "USB: Hitachi Touro Mobile; ", // 1TB
-    "0x4971:0x102[04]",
+    "0x4971:0x102[034]",
     "", // 0x0100
     "",
     "-d sat"
@@ -4685,9 +5194,17 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  // JMicron II
+  { "USB: ; JMicron JMS566",
+    "0xa152:0xb566",
+    "", // 0x0223
+    "",
+    "-d sat"
+  },
   // 0xabcd (?)
   { "USB: ; ",
-    "0xabcd:0x6103", // LogiLink AU0028A V1.0 USB 3.0 to IDE & SATA Adapter
+    "0xabcd:0x610[34]", // 0x6103: LogiLink AU0028A V1.0 USB 3.0 to IDE & SATA Adapter
+      // 0x6104: LogiLink PCCloneEX Lite
     "",
     "",
     "-d sat"
index e950fd5ec8f7c04a2b102f3086c540ef15fc4bad..f5761430ea44cbd1613aa7d05cf33694a1e810f3 100644 (file)
@@ -31,6 +31,7 @@
 
 #define        NVME_PASSTHROUGH_CMD    _IOWR('n', 0, struct nvme_pt_command)
 
+#if __FreeBSD_version < 1100110
 struct nvme_command
 {
        /* dword 0 */
@@ -143,6 +144,9 @@ struct nvme_pt_command {
         */
        struct mtx *            driver_lock;
 };
+#else
+#include <dev/nvme/nvme.h>
+#endif
 
 #define nvme_completion_is_error(cpl)                                  \
        ((cpl)->status.sc != 0 || (cpl)->status.sct != 0)
diff --git a/install-sh b/install-sh
new file mode 100755 (executable)
index 0000000..0360b79
--- /dev/null
@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2016-01-11.22; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab='  '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/int64.h b/int64.h
index c71353861333841cc8053cef465a612654cff218..6212f3fe5ecdc1b51e076dc2280a62d1946b26db 100644 (file)
--- a/int64.h
+++ b/int64.h
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2002-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-11 Bruce Allen
  * Copyright (C) 2004-11 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,7 @@
 #ifndef INT64_H_
 #define INT64_H_
 
-#define INT64_H_CVSID "$Id: int64.h 4120 2015-08-27 16:12:21Z samm2 $"
+#define INT64_H_CVSID "$Id: int64.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 // 64 bit integer typedefs and format strings
 
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644 (file)
index 0000000..82bea96
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,275 @@
+dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29.1)
+dnl
+dnl Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright Â© 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
diff --git a/missing b/missing
new file mode 100755 (executable)
index 0000000..c6e3795
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2016-01-11.22; # UTC
+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try '$0 --help' for more information"
+  exit 1
+fi
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'autom4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/netbsd_nvme_ioctl.h b/netbsd_nvme_ioctl.h
new file mode 100644 (file)
index 0000000..477139c
--- /dev/null
@@ -0,0 +1,183 @@
+/*     $NetBSD: nvmereg.h,v 1.1 2016/05/01 10:21:02 nonaka Exp $       */
+/*     $OpenBSD: nvmereg.h,v 1.10 2016/04/14 11:18:32 dlg Exp $ */
+
+/*
+ * Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/param.h>
+
+struct nvme_sge {
+       uint8_t         id;
+       uint8_t         _reserved[15];
+} __packed __aligned(8);
+
+struct nvme_sqe {
+       uint8_t         opcode;
+       uint8_t         flags;
+       uint16_t        cid;
+
+       uint32_t        nsid;
+
+       uint8_t         _reserved[8];
+
+       uint64_t        mptr;
+
+       union {
+               uint64_t        prp[2];
+               struct nvme_sge sge;
+       } __packed      entry;
+
+       uint32_t        cdw10;
+       uint32_t        cdw11;
+       uint32_t        cdw12;
+       uint32_t        cdw13;
+       uint32_t        cdw14;
+       uint32_t        cdw15;
+} __packed __aligned(8);
+
+struct nvme_cqe {
+       uint32_t        cdw0;
+
+       uint32_t        _reserved;
+
+       uint16_t        sqhd; /* SQ Head Pointer */
+       uint16_t        sqid; /* SQ Identifier */
+
+       uint16_t        cid; /* Command Identifier */
+       uint16_t        flags;
+#define NVME_CQE_DNR           __BIT(15)
+#define NVME_CQE_M             __BIT(14)
+#define NVME_CQE_SCT(_f)       ((_f) & (0x07 << 8))
+#define  NVME_CQE_SCT_GENERIC          (0x00 << 8)
+#define  NVME_CQE_SCT_COMMAND          (0x01 << 8)
+#define  NVME_CQE_SCT_MEDIAERR         (0x02 << 8)
+#define  NVME_CQE_SCT_VENDOR           (0x07 << 8)
+#define NVME_CQE_SC(_f)                ((_f) & (0x7f << 1))
+#define  NVME_CQE_SC_SUCCESS           (0x00 << 1)
+#define  NVME_CQE_SC_INVALID_OPCODE    (0x01 << 1)
+#define  NVME_CQE_SC_INVALID_FIELD     (0x02 << 1)
+#define  NVME_CQE_SC_CID_CONFLICT      (0x03 << 1)
+#define  NVME_CQE_SC_DATA_XFER_ERR     (0x04 << 1)
+#define  NVME_CQE_SC_ABRT_BY_NO_PWR    (0x05 << 1)
+#define  NVME_CQE_SC_INTERNAL_DEV_ERR  (0x06 << 1)
+#define  NVME_CQE_SC_CMD_ABRT_REQD     (0x07 << 1)
+#define  NVME_CQE_SC_CMD_ABDR_SQ_DEL   (0x08 << 1)
+#define  NVME_CQE_SC_CMD_ABDR_FUSE_ERR (0x09 << 1)
+#define  NVME_CQE_SC_CMD_ABDR_FUSE_MISS        (0x0a << 1)
+#define  NVME_CQE_SC_INVALID_NS                (0x0b << 1)
+#define  NVME_CQE_SC_CMD_SEQ_ERR       (0x0c << 1)
+#define  NVME_CQE_SC_INVALID_LAST_SGL  (0x0d << 1)
+#define  NVME_CQE_SC_INVALID_NUM_SGL   (0x0e << 1)
+#define  NVME_CQE_SC_DATA_SGL_LEN      (0x0f << 1)
+#define  NVME_CQE_SC_MDATA_SGL_LEN     (0x10 << 1)
+#define  NVME_CQE_SC_SGL_TYPE_INVALID  (0x11 << 1)
+#define  NVME_CQE_SC_LBA_RANGE         (0x80 << 1)
+#define  NVME_CQE_SC_CAP_EXCEEDED      (0x81 << 1)
+#define  NVME_CQE_NS_NOT_RDY           (0x82 << 1)
+#define  NVME_CQE_RSV_CONFLICT         (0x83 << 1)
+#define NVME_CQE_PHASE         __BIT(0)
+} __packed __aligned(8);
+
+/*-
+ * Copyright (C) 2012-2013 Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#define        NVME_PASSTHROUGH_CMD            _IOWR('n', 0, struct nvme_pt_command)
+
+#define        nvme_completion_is_error(cpl)                                   \
+       ((NVME_CQE_SC((cpl)->flags) != NVME_CQE_SC_SUCCESS)             \
+           || (NVME_CQE_SCT((cpl)->flags) != NVME_CQE_SCT_GENERIC))
+
+struct nvme_pt_command {
+
+       /*
+        * cmd is used to specify a passthrough command to a controller or
+        *  namespace.
+        *
+        * The following fields from cmd may be specified by the caller:
+        *      * opcode
+        *      * nsid (namespace id) - for admin commands only
+        *      * cdw10-cdw15
+        *
+        * Remaining fields must be set to 0 by the caller.
+        */
+       struct nvme_sqe         cmd;
+
+       /*
+        * cpl returns completion status for the passthrough command
+        *  specified by cmd.
+        *
+        * The following fields will be filled out by the driver, for
+        *  consumption by the caller:
+        *      * cdw0
+        *      * flags (except for phase)
+        *
+        * Remaining fields will be set to 0 by the driver.
+        */
+       struct nvme_cqe         cpl;
+
+       /* buf is the data buffer associated with this passthrough command. */
+       void                    *buf;
+
+       /*
+        * len is the length of the data buffer associated with this
+        *  passthrough command.
+        */
+       uint32_t                len;
+
+       /*
+        * is_read = 1 if the passthrough command will read data into the
+        *  supplied buffer from the controller.
+        *
+        * is_read = 0 if the passthrough command will write data from the
+        *  supplied buffer to the controller.
+        */
+       uint32_t                is_read;
+
+       /*
+        * timeout (unit: ms)
+        *
+        * 0: use default timeout value
+        */
+       uint32_t                timeout;
+};
+
+#define NVME_PREFIX            "/dev/nvme"
+#define NVME_NS_PREFIX         "ns"
index eff9ee082adc848a3573c24522dd690b30689349..3e8f62f84789379ef3f2500f9fa1d265ac82b2c2 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef NVMECMDS_H
 #define NVMECMDS_H
 
-#define NVMECMDS_H_CVSID "$Id: nvmecmds.h 4297 2016-04-16 16:48:01Z chrfranke $"
+#define NVMECMDS_H_CVSID "$Id: nvmecmds.h 4488 2017-09-25 11:54:15Z samm2 $"
 
 #include "int64.h"
 
@@ -92,7 +92,8 @@ struct nvme_id_ctrl {
   unsigned int    rtd3r;
   unsigned int    rtd3e;
   unsigned int    oaes;
-  unsigned char   rsvd96[160];
+  unsigned int    ctratt;
+  unsigned char   rsvd100[156];
   unsigned short  oacs;
   unsigned char   acl;
   unsigned char   aerl;
@@ -110,10 +111,18 @@ struct nvme_id_ctrl {
   unsigned char   tnvmcap[16];
   unsigned char   unvmcap[16];
   unsigned int    rpmbs;
-  unsigned char   rsvd316[196];
+  unsigned short  edstt;
+  unsigned char   dsto;
+  unsigned char   fwug;
+  unsigned short  kas;
+  unsigned short  hctma;
+  unsigned short  mntmt;
+  unsigned short  mxtmt;
+  unsigned int    sanicap;
+  unsigned char   rsvd332[180];
   unsigned char   sqes;
   unsigned char   cqes;
-  unsigned char   rsvd514[2];
+  unsigned short  maxcmd;
   unsigned int    nn;
   unsigned short  oncs;
   unsigned short  fuses;
@@ -126,7 +135,15 @@ struct nvme_id_ctrl {
   unsigned short  acwu;
   unsigned char   rsvd534[2];
   unsigned int    sgls;
-  unsigned char   rsvd540[1508];
+  unsigned char   rsvd540[228];
+  char                       subnqn[256];
+  unsigned char   rsvd1024[768];
+  unsigned int    ioccsz;
+  unsigned int    iorcsz;
+  unsigned short  icdoff;
+  unsigned char   ctrattr;
+  unsigned char   msdbd;
+  unsigned char   rsvd1804[244];
   struct nvme_id_power_state  psd[32];
   unsigned char   vs[1024];
 };
@@ -187,7 +204,11 @@ struct nvme_smart_log {
   unsigned int   warning_temp_time;
   unsigned int   critical_comp_time;
   unsigned short temp_sensor[8];
-  unsigned char  rsvd216[296];
+  unsigned int   thm_temp1_trans_count;
+  unsigned int   thm_temp2_trans_count;
+  unsigned int   thm_temp1_total_time;
+  unsigned int   thm_temp2_total_time;
+  unsigned char  rsvd232[280];
 };
 
 enum nvme_admin_opcode {
index 2714fe6cbf18d978071f84e18e00e178900c8ab9..fe7053e13c9ae747e66716d7eb04daaf03573662 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2016 Christian Franke
+ * Copyright (C) 2016-17 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #include "config.h"
 #include "nvmeprint.h"
 
-const char * nvmeprint_cvsid = "$Id: nvmeprint.cpp 4311 2016-04-27 21:03:01Z chrfranke $"
+const char * nvmeprint_cvsid = "$Id: nvmeprint.cpp 4580 2017-11-03 19:41:14Z chrfranke $"
   NVMEPRINT_H_CVSID;
 
 #include "int64.h"
@@ -156,6 +156,11 @@ static void print_drive_info(const nvme_id_ctrl & id_ctrl, const nvme_id_ns & id
            lbacap_to_str(buf, id_ns.nuse, fmt_lba_bits));
 
     pout("Namespace %u Formatted LBA Size:   %s%u\n", nsid, align, (1U << fmt_lba_bits));
+
+    if (show_all || nonempty(id_ns.eui64, sizeof(id_ns.eui64)))
+      pout("Namespace %u IEEE EUI-64:          %s%02x%02x%02x %02x%02x%02x%02x%02x\n",
+           nsid, align, id_ns.eui64[0], id_ns.eui64[1], id_ns.eui64[2], id_ns.eui64[3],
+           id_ns.eui64[4], id_ns.eui64[5], id_ns.eui64[6], id_ns.eui64[7]);
   }
 
   char td[DATEANDEPOCHLEN]; dateandtimezone(td);
@@ -187,16 +192,21 @@ static void print_drive_capabilities(const nvme_id_ctrl & id_ctrl, const nvme_id
        ((id_ctrl.frmw & 0x10) ? ", no Reset required" : ""));
 
   if (show_all || id_ctrl.oacs)
-    pout("Optional Admin Commands (0x%04x):  %s%s%s%s%s%s\n", id_ctrl.oacs,
+    pout("Optional Admin Commands (0x%04x):  %s%s%s%s%s%s%s%s%s%s%s\n", id_ctrl.oacs,
          (!id_ctrl.oacs ? " -" : ""),
          ((id_ctrl.oacs & 0x0001) ? " Security" : ""),
          ((id_ctrl.oacs & 0x0002) ? " Format" : ""),
          ((id_ctrl.oacs & 0x0004) ? " Frmw_DL" : ""),
          ((id_ctrl.oacs & 0x0008) ? " NS_Mngmt" : ""),
-         ((id_ctrl.oacs & ~0x000f) ? " *Other*" : ""));
+         ((id_ctrl.oacs & 0x0010) ? " Self_Test" : ""), // NVMe 1.3 ...
+         ((id_ctrl.oacs & 0x0020) ? " Directvs" : ""),
+         ((id_ctrl.oacs & 0x0040) ? " MI_Snd/Rec" : ""),
+         ((id_ctrl.oacs & 0x0080) ? " Vrt_Mngmt" : ""),
+         ((id_ctrl.oacs & 0x0100) ? " Drbl_Bf_Cfg" : ""),
+         ((id_ctrl.oacs & ~0x01ff) ? " *Other*" : ""));
 
   if (show_all || id_ctrl.oncs)
-    pout("Optional NVM Commands (0x%04x):    %s%s%s%s%s%s%s%s\n", id_ctrl.oncs,
+    pout("Optional NVM Commands (0x%04x):    %s%s%s%s%s%s%s%s%s\n", id_ctrl.oncs,
          (!id_ctrl.oncs ? " -" : ""),
          ((id_ctrl.oncs & 0x0001) ? " Comp" : ""),
          ((id_ctrl.oncs & 0x0002) ? " Wr_Unc" : ""),
@@ -204,7 +214,8 @@ static void print_drive_capabilities(const nvme_id_ctrl & id_ctrl, const nvme_id
          ((id_ctrl.oncs & 0x0008) ? " Wr_Zero" : ""),
          ((id_ctrl.oncs & 0x0010) ? " Sav/Sel_Feat" : ""),
          ((id_ctrl.oncs & 0x0020) ? " Resv" : ""),
-         ((id_ctrl.oncs & ~0x003f) ? " *Other*" : ""));
+         ((id_ctrl.oncs & 0x0040) ? " Timestmp" : ""), // NVMe 1.3
+         ((id_ctrl.oncs & ~0x007f) ? " *Other*" : ""));
 
   if (id_ctrl.mdts)
     pout("Maximum Data Transfer Size:         %u Pages\n", (1U << id_ctrl.mdts));
@@ -220,12 +231,13 @@ static void print_drive_capabilities(const nvme_id_ctrl & id_ctrl, const nvme_id
 
   if (nsid && (show_all || id_ns.nsfeat)) {
     const char * align = &("  "[nsid < 10 ? 0 : (nsid < 100 ? 1 : 2)]);
-    pout("Namespace %u Features (0x%02x):     %s%s%s%s%s%s\n", nsid, id_ns.nsfeat, align,
+    pout("Namespace %u Features (0x%02x):     %s%s%s%s%s%s%s\n", nsid, id_ns.nsfeat, align,
          (!id_ns.nsfeat ? " -" : ""),
          ((id_ns.nsfeat & 0x01) ? " Thin_Prov" : ""),
          ((id_ns.nsfeat & 0x02) ? " NA_Fields" : ""),
          ((id_ns.nsfeat & 0x04) ? " Dea/Unw_Error" : ""),
-         ((id_ns.nsfeat & ~0x07) ? " *Other*" : ""));
+         ((id_ns.nsfeat & 0x08) ? " No_ID_Reuse" : ""), // NVMe 1.3
+         ((id_ns.nsfeat & ~0x0f) ? " *Other*" : ""));
   }
 
   // Print Power States
@@ -313,6 +325,14 @@ static void print_smart_log(const nvme_smart_log & smart_log, unsigned nsid,
       pout("Temperature Sensor %d:               %s\n", i + 1,
            kelvin_to_str(buf, smart_log.temp_sensor[i]));
   }
+  if (show_all || smart_log.thm_temp1_trans_count)
+    pout("Thermal Temp. 1 Transition Count:   %d\n", smart_log.thm_temp1_trans_count);
+  if (show_all || smart_log.thm_temp2_trans_count)
+    pout("Thermal Temp. 2 Transition Count:   %d\n", smart_log.thm_temp2_trans_count);
+  if (show_all || smart_log.thm_temp1_total_time)
+    pout("Thermal Temp. 1 Total Time:         %d\n", smart_log.thm_temp1_total_time);
+  if (show_all || smart_log.thm_temp2_total_time)
+    pout("Thermal Temp. 2 Total Time:         %d\n", smart_log.thm_temp2_total_time);
   pout("\n");
 }
 
index 53a0f4609c60c5dfdc01ac8d92317e8c1acd22fe..134f510efa9467ccad01d8ddbe36a2430a58d998 100644 (file)
 #include <IOKit/storage/ata/ATASMARTLib.h>
 #include <CoreFoundation/CoreFoundation.h>
 
-  // No, I don't know why there isn't a header for this.
-#define kIOATABlockStorageDeviceClass   "IOATABlockStorageDevice"
-
 #include "config.h"
 #include "int64.h"
 #include "atacmds.h"
 #include "scsicmds.h"
+#include "nvmecmds.h"
 #include "utility.h"
 #include "os_darwin.h"
 #include "dev_interface.h"
 
+#define ARGUSED(x) ((void)(x))
 // Needed by '-V' option (CVS versioning) of smartd/smartctl
-const char *os_darwin_cpp_cvsid="$Id: os_darwin.cpp 4214 2016-01-24 22:53:37Z samm2 $" \
+const char *os_darwin_cpp_cvsid="$Id: os_darwin.cpp 4552 2017-10-11 10:11:35Z samm2 $" \
 ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_DARWIN_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
 
 // examples for smartctl
@@ -75,10 +74,11 @@ static const char  smartctl_examples[] =
 static struct {
   io_object_t ioob;
   IOCFPlugInInterface **plugin;
-  IOATASMARTInterface **smartIf;
+  IOATASMARTInterface **smartIf; // ATA devices
+  IONVMeSMARTInterface **smartIfNVMe;
 } devices[20];
 
-const char * dev_darwin_cpp_cvsid = "$Id: os_darwin.cpp 4214 2016-01-24 22:53:37Z samm2 $"
+const char * dev_darwin_cpp_cvsid = "$Id: os_darwin.cpp 4552 2017-10-11 10:11:35Z samm2 $"
   DEV_INTERFACE_H_CVSID;
 
 /////////////////////////////////////////////////////////////////////////////
@@ -109,7 +109,6 @@ protected:
   int get_fd() const
     { return m_fd; }
     
-
 private:
   int m_fd; ///< filedesc, -1 if not open.
   const char * m_mode; ///< Mode string for deviceopen().
@@ -128,15 +127,24 @@ bool darwin_smart_device::is_open() const
 }
 
 // Determine whether 'dev' is a SMART-capable device.
-static bool is_smart_capable (io_object_t dev) {
-  CFTypeRef smartCapableKey;
+static bool is_smart_capable (io_object_t dev, const char * type) {
+  CFTypeRef smartCapableKey = NULL;
   CFDictionaryRef diskChars;
 
   // If the device has kIOPropertySMARTCapableKey, then it's capable,
   // no matter what it looks like.
+  if (!strcmp("ATA", type))  {
   smartCapableKey = IORegistryEntryCreateCFProperty
     (dev, CFSTR (kIOPropertySMARTCapableKey),
      kCFAllocatorDefault, 0);
+  }
+
+  else if (!strcmp("NVME", type)) {
+    smartCapableKey = IORegistryEntryCreateCFProperty
+      (dev, CFSTR (kIOPropertyNVMeSMARTCapableKey),
+       kCFAllocatorDefault, 0);
+  }
+
   if (smartCapableKey)
     {
       CFRelease (smartCapableKey);
@@ -145,6 +153,7 @@ static bool is_smart_capable (io_object_t dev) {
 
   // If it's an kIOATABlockStorageDeviceClass then we're successful
   // only if its ATA features indicate it supports SMART.
+  // This will be broken for NVMe, however it is not needed
   if (IOObjectConformsTo (dev, kIOATABlockStorageDeviceClass)
     && (diskChars = (CFDictionaryRef)IORegistryEntryCreateCFProperty                                                                                                           
       (dev, CFSTR (kIOPropertyDeviceCharacteristicsKey),
@@ -180,7 +189,7 @@ bool darwin_smart_device::open()
   const char *pathname = get_dev_name();
   char *type = const_cast<char*>(m_mode);
   
-  if (strcmp (type, "ATA") != 0)
+  if (!(strcmp("ATA", type) || strcmp("NVME", type)))
     {
       set_err (EINVAL);
       return false;
@@ -205,7 +214,7 @@ bool darwin_smart_device::open()
     // allow user to just say 'disk0'
     devname = pathname;
 
-  // Find the device.
+  // Find the device. This part should be the same for the NVMe and ATA
   if (devname)
     {
       CFMutableDictionaryRef matcher;
@@ -216,15 +225,13 @@ bool darwin_smart_device::open()
     {
       disk = IORegistryEntryFromPath (kIOMasterPortDefault, pathname);
     }
-
   if (! disk)
     {
       set_err(ENOENT);
       return false;
     }
-  
   // Find a SMART-capable driver which is a parent of this device.
-  while (! is_smart_capable (disk))
+  while (! is_smart_capable (disk, type))
     {
       IOReturn err;
       io_object_t prevdisk = disk;
@@ -246,17 +253,35 @@ bool darwin_smart_device::open()
   
     devices[devnum].plugin = NULL;
     devices[devnum].smartIf = NULL;
+    devices[devnum].smartIfNVMe = NULL;
+
+    CFUUIDRef pluginType = NULL;
+    CFUUIDRef smartInterfaceId = NULL;
+    void ** SMARTptr = NULL;
+
+    if (!strcmp("ATA", type))  {
+      pluginType = kIOATASMARTUserClientTypeID;
+      smartInterfaceId = kIOATASMARTInterfaceID;
+      SMARTptr = (void **)&devices[devnum].smartIf;
+    }
+    else if (!strcmp("NVME", type)) {
+      pluginType = kIONVMeSMARTUserClientTypeID;
+      smartInterfaceId = kIONVMeSMARTInterfaceID;
+      SMARTptr = (void **)&devices[devnum].smartIfNVMe;
+    }
 
     // Create an interface to the ATA SMART library.
     if (IOCreatePlugInInterfaceForService (disk,
-      kIOATASMARTUserClientTypeID,
+      pluginType,
       kIOCFPlugInInterfaceID,
       &devices[devnum].plugin,
       &dummy) == kIOReturnSuccess)
     (*devices[devnum].plugin)->QueryInterface
     (devices[devnum].plugin,
-      CFUUIDGetUUIDBytes ( kIOATASMARTInterfaceID),
-      (void **)&devices[devnum].smartIf);
+      CFUUIDGetUUIDBytes ( smartInterfaceId),
+      SMARTptr);
+    else
+      return set_err(ENOSYS, "IOCreatePlugInInterfaceForService failed");
   }
 
 
@@ -273,6 +298,8 @@ bool darwin_smart_device::close()
   int fd = m_fd; m_fd = -1;
   if (devices[fd].smartIf)
     (*devices[fd].smartIf)->Release (devices[fd].smartIf);
+  if (devices[fd].smartIfNVMe)
+    (*devices[fd].smartIfNVMe)->Release (devices[fd].smartIfNVMe);
   if (devices[fd].plugin)
     IODestroyPlugInInterface (devices[fd].plugin);
   IOObjectRelease (devices[fd].ioob);
@@ -293,9 +320,9 @@ static int make_device_names (char*** devlist, const char* name) {
   int result;
   int index;
 
-  // We treat all devices as ATA so long as they support SMARTLib.
-  if (strcmp (name, "ATA") != 0)
+  if (!(strcmp("ATA", name) || strcmp("NVME", name))) {
     return 0;
+  }
 
   err = IOServiceGetMatchingServices 
     (kIOMasterPortDefault, IOServiceMatching (kIOBlockStorageDeviceClass), &i);
@@ -305,7 +332,7 @@ static int make_device_names (char*** devlist, const char* name) {
   // Count the devices.
   result = 0;
   while ((device = IOIteratorNext (i)) != MACH_PORT_NULL) {
-    if (is_smart_capable (device))
+    if (is_smart_capable (device, name))
       result++;
     IOObjectRelease (device);
   }
@@ -317,7 +344,7 @@ static int make_device_names (char*** devlist, const char* name) {
   *devlist = (char**)calloc (result, sizeof (char *)); 
   index = 0;
   while ((device = IOIteratorNext (i)) != MACH_PORT_NULL) {
-    if (is_smart_capable (device))
+    if (is_smart_capable (device, name))
     {
       io_string_t devName;
       IORegistryEntryGetPath(device, kIOServicePlane, devName);
@@ -504,11 +531,64 @@ protected:
   
   virtual scsi_device * get_scsi_device(const char * name, const char * type);
 
+  virtual nvme_device * get_nvme_device(const char * name, const char * type,
+    unsigned nsid);
+
   virtual smart_device * autodetect_smart_device(const char * name);
 
 };
 
+/////////////////////////////////////////////////////////////////////////////
+/// NVMe support
+
+class darwin_nvme_device
+: public /*implements*/ nvme_device,
+  public /*extends*/ darwin_smart_device
+{
+public:
+  darwin_nvme_device(smart_interface * intf, const char * dev_name,
+    const char * req_type, unsigned nsid);
 
+  virtual bool nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out);
+};
+
+darwin_nvme_device::darwin_nvme_device(smart_interface * intf, const char * dev_name,
+  const char * req_type, unsigned nsid)
+: smart_device(intf, dev_name, "nvme", req_type),
+  nvme_device(nsid),
+  darwin_smart_device("NVME")
+{
+}
+
+bool darwin_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out)
+{
+  ARGUSED(out);
+  int fd = get_fd();
+  IONVMeSMARTInterface **ifp = devices[fd].smartIfNVMe;
+  IONVMeSMARTInterface *smartIfNVMe ;
+  IOReturn err = 0;
+  unsigned int page = in.cdw10 & 0xff;
+
+  if (! ifp)
+    return -1;
+  smartIfNVMe = *ifp;
+  // currently only GetIdentifyData and SMARTReadData are supported
+  switch (in.opcode) {
+    case smartmontools::nvme_admin_identify:
+      err = smartIfNVMe->GetIdentifyData(ifp, (struct nvme_id_ctrl *) in.buffer, in.nsid); // FIXME
+      break;
+    case smartmontools::nvme_admin_get_log_page:
+       if(page == 0x02)
+         err = smartIfNVMe->SMARTReadData(ifp, (struct nvme_smart_log *) in.buffer);
+       else /* GetLogPage() is not working yet */
+         return set_err(ENOSYS, "NVMe admin command:0x%02x/page:0x%02x is not supported",
+          in.opcode, page);
+      break;
+    default:
+      return set_err(ENOSYS, "NVMe admin command 0x%02x is not supported", in.opcode);
+  }
+  return true;
+}
 //////////////////////////////////////////////////////////////////////
 
 std::string darwin_smart_interface::get_os_version_str()
@@ -537,9 +617,78 @@ scsi_device * darwin_smart_interface::get_scsi_device(const char *, const char *
   return 0; // scsi devices are not supported [yet]
 }
 
+nvme_device * darwin_smart_interface::get_nvme_device(const char * name, const char * type,
+  unsigned nsid)
+{
+  return new darwin_nvme_device(this, name, type, nsid);
+}
 
 smart_device * darwin_smart_interface::autodetect_smart_device(const char * name)
-{
+{ // TODO - refactor as a function
+  // Acceptable device names are:
+  // /dev/disk*
+  // /dev/rdisk*
+  // disk*
+  // IOService:*
+  // IODeviceTree:*
+  const char *devname = NULL;
+  io_object_t disk;
+  
+  if (strncmp (name, "/dev/rdisk", 10) == 0)
+    devname = name + 6;
+  else if (strncmp (name, "/dev/disk", 9) == 0)
+    devname = name + 5;
+  else if (strncmp (name, "disk", 4) == 0)
+    // allow user to just say 'disk0'
+    devname = name;
+  // Find the device. This part should be the same for the NVMe and ATA
+  if (devname) {
+      CFMutableDictionaryRef matcher;
+      matcher = IOBSDNameMatching (kIOMasterPortDefault, 0, devname);
+      disk = IOServiceGetMatchingService (kIOMasterPortDefault, matcher);
+  }
+  else {
+      disk = IORegistryEntryFromPath (kIOMasterPortDefault, name);
+  }
+  if (! disk) {
+      return 0;
+  }
+  io_registry_entry_t tmpdisk=disk;
+  
+  
+  while (! is_smart_capable (tmpdisk, "ATA"))
+    {
+      IOReturn err;
+      io_object_t prevdisk = tmpdisk;
+
+      // Find this device's parent and try again.
+      err = IORegistryEntryGetParentEntry (tmpdisk, kIOServicePlane, &tmpdisk);
+      if (err != kIOReturnSuccess || ! tmpdisk)
+      {
+        IOObjectRelease (prevdisk);
+        break;
+      }
+    }
+    if (tmpdisk)
+      return new darwin_ata_device(this, name, "");
+    tmpdisk=disk;
+    while (! is_smart_capable (tmpdisk, "NVME"))
+      {
+        IOReturn err;
+        io_object_t prevdisk = tmpdisk;
+
+        // Find this device's parent and try again.
+        err = IORegistryEntryGetParentEntry (tmpdisk, kIOServicePlane, &tmpdisk);
+        if (err != kIOReturnSuccess || ! tmpdisk)
+        {
+          IOObjectRelease (prevdisk);
+          break;
+        }
+      }  
+    if (tmpdisk)
+      return new darwin_nvme_device(this, name, "", 0);
+
+  // try ATA as a last option, for compatibility
   return new darwin_ata_device(this, name, "");
 }
 
@@ -567,6 +716,20 @@ bool darwin_smart_interface::scan_smart_devices(smart_device_list & devlist,
       return false;
     }
   }
+  char * * nvmenames = 0; int numnvme = 0;
+  if (
+#ifdef WITH_NVME_DEVICESCAN // TODO: Remove when NVMe support is no longer EXPERIMENTAL
+      !type ||
+#else
+      type &&
+#endif
+               !strcmp(type, "nvme")) {
+    numnvme = make_device_names(&nvmenames, "NVME");
+    if (numnvme < 0) {
+      set_err(ENOMEM);
+      return false;
+    }
+  }
 
   // Add to devlist
   int i;
@@ -578,6 +741,14 @@ bool darwin_smart_interface::scan_smart_devices(smart_device_list & devlist,
       devlist.push_back(atadev);
   }
   free_devnames(atanames, numata);
+
+  for (i = 0; i < numnvme; i++) {
+    nvme_device * nvmedev = get_nvme_device(nvmenames[i], type, 0); // default nsid
+    if (nvmedev)
+      devlist.push_back(nvmedev);
+  }  
+  free_devnames(nvmenames, numnvme);
+
   return true;
 }
 
index 8031b73251da0ea57e26d6fc0e83149c66f91cd3..2ac40fe29178a5ae89e1508f9d9d123c51db280b 100644 (file)
@@ -24,7 +24,9 @@
 #ifndef OS_DARWIN_H_
 #define OS_DARWIN_H_
 
-#define OS_DARWIN_H_CVSID "$Id: os_darwin.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_DARWIN_H_CVSID "$Id: os_darwin.h 4438 2017-09-20 18:00:42Z samm2 $\n"
+
+#define kIOATABlockStorageDeviceClass   "IOATABlockStorageDevice"
 
 // Isn't in 10.3.9?
 
 #define kIOPropertySMARTCapableKey     "SMART Capable"
 #endif
 
+// NVMe definitions, non documented, experimental
+#define kIOPropertyNVMeSMARTCapableKey "NVMe SMART Capable"
+
+// Constant to init driver
+#define kIONVMeSMARTUserClientTypeID           CFUUIDGetConstantUUIDWithBytes(NULL,      \
+                                                                               0xAA, 0x0F, 0xA6, 0xF9, 0xC2, 0xD6, 0x45, 0x7F, 0xB1, 0x0B, \
+                    0x59, 0xA1, 0x32, 0x53, 0x29, 0x2F)
+
+// Constant to use plugin interface
+#define kIONVMeSMARTInterfaceID                CFUUIDGetConstantUUIDWithBytes(NULL,                              \
+                    0xcc, 0xd1, 0xdb, 0x19, 0xfd, 0x9a, 0x4d, 0xaf, 0xbf, 0x95, \
+                    0x12, 0x45, 0x4b, 0x23, 0xa, 0xb6)
+
+// interface structure, obtained using lldb, could be incomplete or wrong
+typedef struct IONVMeSMARTInterface
+{
+        IUNKNOWN_C_GUTS;
+
+        UInt16 version;
+        UInt16 revision;
+
+                               // NVMe smart data, returns nvme_smart_log structure
+        IOReturn ( *SMARTReadData )( void *  interface,
+                                     struct nvme_smart_log * NVMeSMARTData );
+
+                               // NVMe IdentifyData, returns nvme_id_ctrl per namespace
+        IOReturn ( *GetIdentifyData )( void *  interface,
+                                      struct nvme_id_ctrl * NVMeIdentifyControllerStruct,
+                                      unsigned int ns );
+
+                               // Always getting kIOReturnDeviceError
+        IOReturn ( *GetFieldCounters )( void *   interface,
+                                        char * FieldCounters );
+                               // Returns 0
+        IOReturn ( *ScheduleBGRefresh )( void *   interface);
+
+                               // Always returns kIOReturnDeviceError, probably expects pointer to some
+                               // structure as an argument
+        IOReturn ( *GetLogPage )( void *  interface, void * data, unsigned int, unsigned int);
+
+
+                               /* GetSystemCounters Looks like a table with an attributes. Sample result:
+
+                               0x101022200: 0x01 0x00 0x08 0x00 0x00 0x00 0x00 0x00
+                               0x101022208: 0x00 0x00 0x00 0x00 0x02 0x00 0x08 0x00
+                               0x101022210: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x101022218: 0x03 0x00 0x08 0x00 0xf1 0x74 0x26 0x01
+                               0x101022220: 0x00 0x00 0x00 0x00 0x04 0x00 0x08 0x00
+                               0x101022228: 0x0a 0x91 0xb1 0x00 0x00 0x00 0x00 0x00
+                               0x101022230: 0x05 0x00 0x08 0x00 0x24 0x9f 0xfe 0x02
+                               0x101022238: 0x00 0x00 0x00 0x00 0x06 0x00 0x08 0x00
+                               0x101022240: 0x9b 0x42 0x38 0x02 0x00 0x00 0x00 0x00
+                               0x101022248: 0x07 0x00 0x08 0x00 0xdd 0x08 0x00 0x00
+                               0x101022250: 0x00 0x00 0x00 0x00 0x08 0x00 0x08 0x00
+                               0x101022258: 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x101022260: 0x09 0x00 0x08 0x00 0x00 0x00 0x00 0x00
+                               0x101022268: 0x00 0x00 0x00 0x00 0x0a 0x00 0x04 0x00
+                               .........
+                               0x101022488: 0x74 0x00 0x08 0x00 0x00 0x00 0x00 0x00
+                               0x101022490: 0x00 0x00 0x00 0x00 0x75 0x00 0x40 0x02
+                               0x101022498: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               */
+        IOReturn ( *GetSystemCounters )( void *  interface, char *, unsigned int *);
+
+
+                               /* GetAlgorithmCounters returns mostly 0
+                               0x102004000: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004008: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004010: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004018: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004020: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004028: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004038: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004040: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004048: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004050: 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00
+                               0x102004058: 0x80 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004060: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004068: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004070: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004078: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004080: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004088: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004090: 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00
+                               0x102004098: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+
+                               */
+        IOReturn ( *GetAlgorithmCounters )( void *  interface, char *, unsigned int *);
+} IONVMeSMARTInterface;
+
+
 #endif /* OS_DARWIN_H_ */
index 05da8d1b1f10628a58926915620e8ffca9d6d14b..dd9ea3be0bb3985d5fe091da169ad5d1afe7fb86 100644 (file)
@@ -80,7 +80,7 @@
 #define PATHINQ_SETTINGS_SIZE   128
 #endif
 
-const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp 4257 2016-03-27 23:32:54Z samm2 $" \
+const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp 4425 2017-04-24 16:34:16Z samm2 $" \
 ATACMDS_H_CVSID CCISS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_FREEBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
 
 #define NO_RETURN 0
@@ -322,38 +322,6 @@ bool freebsd_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & o
   out.out_regs.sector_count_16 = request.u.ata.count;
   out.out_regs.lba_48 = request.u.ata.lba;
 
-
-  // Command specific processing
-  if (in.in_regs.command == ATA_SMART_CMD
-       && in.in_regs.features == ATA_SMART_STATUS
-       && in.out_needed.lba_high)
-  {
-    unsigned const char normal_lo=0x4f, normal_hi=0xc2;
-    unsigned const char failed_lo=0xf4, failed_hi=0x2c;
-
-    // Cyl low and Cyl high unchanged means "Good SMART status"
-    if (!(out.out_regs.lba_mid==normal_lo && out.out_regs.lba_high==normal_hi)
-    // These values mean "Bad SMART status"
-        && !(out.out_regs.lba_mid==failed_lo && out.out_regs.lba_high==failed_hi))
-
-    {
-      // We haven't gotten output that makes sense; print out some debugging info
-      char buf[512];
-      snprintf(buf, sizeof(buf),
-        "CMD=0x%02x\nFR =0x%02x\nNS =0x%02x\nSC =0x%02x\nCL =0x%02x\nCH =0x%02x\nRETURN =0x%04x\n",
-        (int)request.u.ata.command,
-        (int)request.u.ata.feature,
-        (int)request.u.ata.count,
-        (int)((request.u.ata.lba) & 0xff),
-        (int)((request.u.ata.lba>>8) & 0xff),
-        (int)((request.u.ata.lba>>16) & 0xff),
-        (int)request.error);
-      printwarning(BAD_SMART,buf);
-      out.out_regs.lba_high = failed_hi; 
-      out.out_regs.lba_mid = failed_lo;
-    }
-  }
-
   return true;
 }
 
@@ -397,15 +365,16 @@ int freebsd_atacam_device::do_cmd( struct ata_ioc_request* request, bool is_48bi
   union ccb ccb;
   int camflags;
 
-  // FIXME:
   // 48bit commands are broken in ATACAM before r242422/HEAD
   // and may cause system hang
-  // Waiting for MFC to make sure that bug is fixed,
-  // later version check needs to be added
+  // First version with working support should be FreeBSD 9.2.0/RELEASE
+
+#if (FREEBSDVER < 902001)
   if(!strcmp("ata",m_camdev->sim_name) && is_48bit_cmd) {
     set_err(ENOSYS, "48-bit ATA commands not implemented for legacy controllers");
     return -1;
   }
+#endif
 
   memset(&ccb, 0, sizeof(ccb));
 
@@ -1936,6 +1905,8 @@ smart_device * freebsd_smart_interface::autodetect_smart_device(const char * nam
   int i;
   const char * test_name = name;
 
+  memset(&ccb, 0, sizeof(ccb));
+
   // if dev_name null, or string length zero
   if (!name || !*name)
     return 0;
index 4832154399dad36f6f76a47e2cf74c7974bdd693..49b0299709de650e767f445538f9ec8ca41dfc15 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2003-8 Eduard Martinescu <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 Eduard Martinescu
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -82,7 +82,7 @@
 #ifndef OS_FREEBSD_H_
 #define OS_FREEBSD_H_
 
-#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 4120 2015-08-27 16:12:21Z samm2 $"
+#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 #define MAX_NUM_DEV 26
 
index de39f551bc20a3075e3bebcb52facc838cadbf60..c094a20e8baa9d5e87c1e9921da9b52c038b564d 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) YEAR YOUR_NAME <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2003-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) YEAR YOUR_NAME
+ * Copyright (C) 2003-8 Bruce Allen
+ * Copyright (C) 2008 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
 
  To port smartmontools to the OS of your choice, please:
 
- [0] Contact smartmontools-support@lists.sourceforge.net to check
+ [0] Contact smartmontools-support@listi.jpberlin.de to check
      that it's not already been done.
 
  [1] Make copies of os_generic.h and os_generic.cpp called os_myOS.h
@@ -56,7 +56,7 @@
      skeletons below.  You can entirely eliminate the function
      'unsupported()'.
 
- [5] Contact smartmontools-support@lists.sourceforge.net to see
+ [5] Contact smartmontools-support@listi.jpberlin.de to see
      about checking your code into the smartmontools CVS archive.
 */
 
@@ -83,7 +83,7 @@
 // should have one *_H_CVSID macro appearing below for each file
 // appearing with #include "*.h" above.  Please list these (below) in
 // alphabetic/dictionary order.
-const char * os_XXXX_cpp_cvsid="$Id: os_generic.cpp 4120 2015-08-27 16:12:21Z samm2 $"
+const char * os_XXXX_cpp_cvsid="$Id: os_generic.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_GENERIC_H_CVSID UTILITY_H_CVSID;
 
 // This is here to prevent compiler warnings for unused arguments of
index 211ce1ea4bbb0e1fb96462e74e94507060e0030c..0220cb3e12953cc67de981f8439b4e2b00fe0d2f 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) YEAR YOUR_NAME <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2003-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) YEAR YOUR_NAME
+ * Copyright (C) 2003-8 Bruce Allen
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 // In the three following lines, change 'GENERIC' to your OS name
 #ifndef OS_GENERIC_H_
 #define OS_GENERIC_H_
-#define OS_GENERIC_H_CVSID "$Id: os_generic.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_GENERIC_H_CVSID "$Id: os_generic.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Additional material should start here.  Note: to keep the '-V' CVS
 // reporting option working as intended, you should only #include
index 629792f52b272b52aed4940ff9cbbd97151d61d8..134d5bc9e715a4d103275059c96229da4365d969 100644 (file)
@@ -63,6 +63,7 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_ioctl.h>
 #include <scsi/sg.h>
+#include <linux/bsg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
 
 #define ARGUSED(x) ((void)(x))
 
-const char * os_linux_cpp_cvsid = "$Id: os_linux.cpp 4295 2016-04-15 20:01:32Z chrfranke $"
+const char * os_linux_cpp_cvsid = "$Id: os_linux.cpp 4582 2017-11-03 20:54:56Z chrfranke $"
   OS_LINUX_H_CVSID;
 extern unsigned char failuretest_permissive;
 
@@ -510,28 +511,32 @@ int linux_ata_device::ata_command_interface(smart_command_set command, int selec
 #define SCSI_IOCTL_SEND_COMMAND 1
 #endif
 
-#define SG_IO_PRESENT_UNKNOWN 0
-#define SG_IO_PRESENT_YES 1
-#define SG_IO_PRESENT_NO 2
+#define SG_IO_USE_DETECT 0
+#define SG_IO_UNSUPP 1
+#define SG_IO_USE_V3 3
+#define SG_IO_USE_V4 4
 
 static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
-                         int unknown);
+                         int sgio_ver);
 static int sisc_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report);
 
-static int sg_io_state = SG_IO_PRESENT_UNKNOWN;
+static int sg_io_state = SG_IO_USE_DETECT;
 
 /* Preferred implementation for issuing SCSI commands in linux. This
  * function uses the SG_IO ioctl. Return 0 if command issued successfully
  * (various status values should still be checked). If the SCSI command
  * cannot be issued then a negative errno value is returned. */
 static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
-                         int unknown)
+                         int sg_io_ver)
 {
 #ifndef SG_IO
     ARGUSED(dev_fd); ARGUSED(iop); ARGUSED(report);
     return -ENOTTY;
 #else
-    struct sg_io_hdr io_hdr;
+
+    /* we are filling structures for both versions, but using only one requested */
+    struct sg_io_hdr io_hdr_v3;
+    struct sg_io_v4  io_hdr_v4;
 
     if (report > 0) {
         int k, j;
@@ -540,6 +545,7 @@ static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
         char buff[256];
         const int sz = (int)sizeof(buff);
 
+        pout(">>>> do_scsi_cmnd_io: sg_io_ver=%d\n", sg_io_ver);
         np = scsi_get_opcode_name(ucp[0]);
         j = snprintf(buff, sz, " [%s: ", np ? np : "<unknown opcode>");
         for (k = 0; k < (int)iop->cmnd_len; ++k)
@@ -558,47 +564,111 @@ static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
             snprintf(&buff[j], (sz > j ? (sz - j) : 0), "]\n");
         pout("%s", buff);
     }
-    memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
-    io_hdr.interface_id = 'S';
-    io_hdr.cmd_len = iop->cmnd_len;
-    io_hdr.mx_sb_len = iop->max_sense_len;
-    io_hdr.dxfer_len = iop->dxfer_len;
-    io_hdr.dxferp = iop->dxferp;
-    io_hdr.cmdp = iop->cmnd;
-    io_hdr.sbp = iop->sensep;
+    memset(&io_hdr_v3, 0, sizeof(struct sg_io_hdr));
+    memset(&io_hdr_v4, 0, sizeof(struct sg_io_v4));
+
+    io_hdr_v3.interface_id =       'S';
+    io_hdr_v3.cmd_len =            iop->cmnd_len;
+    io_hdr_v3.mx_sb_len =          iop->max_sense_len;
+    io_hdr_v3.dxfer_len =          iop->dxfer_len;
+    io_hdr_v3.dxferp =             iop->dxferp;
+    io_hdr_v3.cmdp =               iop->cmnd;
+    io_hdr_v3.sbp =                iop->sensep;
     /* sg_io_hdr interface timeout has millisecond units. Timeout of 0
        defaults to 60 seconds. */
-    io_hdr.timeout = ((0 == iop->timeout) ? 60 : iop->timeout) * 1000;
+    io_hdr_v3.timeout =         ((0 == iop->timeout) ? 60 : iop->timeout) * 1000;
+
+    io_hdr_v4.guard =              'Q';
+    io_hdr_v4.request_len =        iop->cmnd_len;
+    io_hdr_v4.request =            __u64(iop->cmnd);
+    io_hdr_v4.max_response_len =   iop->max_sense_len;
+    io_hdr_v4.response =           __u64(iop->sensep);
+    io_hdr_v4.timeout =            ((0 == iop->timeout) ? 60 : iop->timeout) * 1000; // msec
+
     switch (iop->dxfer_dir) {
         case DXFER_NONE:
-            io_hdr.dxfer_direction = SG_DXFER_NONE;
+            io_hdr_v3.dxfer_direction = SG_DXFER_NONE;
             break;
         case DXFER_FROM_DEVICE:
-            io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
+            io_hdr_v3.dxfer_direction = SG_DXFER_FROM_DEV;
+            io_hdr_v4.din_xfer_len =    iop->dxfer_len;
+            io_hdr_v4.din_xferp =       __u64(iop->dxferp);
             break;
         case DXFER_TO_DEVICE:
-            io_hdr.dxfer_direction = SG_DXFER_TO_DEV;
+            io_hdr_v3.dxfer_direction = SG_DXFER_TO_DEV;
+            io_hdr_v4.dout_xfer_len =   iop->dxfer_len;
+            io_hdr_v4.dout_xferp =      __u64(iop->dxferp);
             break;
         default:
             pout("do_scsi_cmnd_io: bad dxfer_dir\n");
             return -EINVAL;
     }
+
     iop->resp_sense_len = 0;
     iop->scsi_status = 0;
     iop->resid = 0;
-    if (ioctl(dev_fd, SG_IO, &io_hdr) < 0) {
-        if (report && (! unknown))
-            pout("  SG_IO ioctl failed, errno=%d [%s]\n", errno,
-                 strerror(errno));
+
+    void * io_hdr = NULL;
+
+    switch (sg_io_ver) {
+      case SG_IO_USE_V3:
+          io_hdr = &io_hdr_v3;
+          break;
+      case SG_IO_USE_V4:
+          io_hdr = &io_hdr_v4;
+          break;
+      default:
+          // should never be reached
+          errno = EOPNOTSUPP;
+          return -errno;
+    }
+
+    if (ioctl(dev_fd, SG_IO, io_hdr) < 0) {
+        if (report)
+            pout("  SG_IO ioctl failed, errno=%d [%s], SG_IO_V%d\n", errno,
+                 strerror(errno), sg_io_ver);
         return -errno;
     }
-    iop->resid = io_hdr.resid;
-    iop->scsi_status = io_hdr.status;
+
+    unsigned int sg_driver_status = 0,  sg_transport_status = 0, sg_info = 0,
+        sg_duration = 0;
+
+    if (sg_io_ver == SG_IO_USE_V3) {
+        iop->resid =            io_hdr_v3.resid;
+        iop->scsi_status =      io_hdr_v3.status;
+        sg_driver_status =      io_hdr_v3.driver_status;
+        sg_transport_status =   io_hdr_v3.host_status;
+        sg_info =               io_hdr_v3.info;
+        iop->resp_sense_len =   io_hdr_v3.sb_len_wr;
+        sg_duration =           io_hdr_v3.duration;
+    }
+
+    if (sg_io_ver == SG_IO_USE_V4) {
+       switch (iop->dxfer_dir) {
+           case DXFER_NONE:
+               iop->resid = 0;
+               break;
+           case DXFER_FROM_DEVICE:
+               iop->resid = io_hdr_v4.din_resid;
+               break;
+           case DXFER_TO_DEVICE:
+               iop->resid = io_hdr_v4.dout_resid;
+               break;
+       }
+       iop->scsi_status =       io_hdr_v4.device_status;
+       sg_driver_status =       io_hdr_v4.driver_status;
+       sg_transport_status =    io_hdr_v4.transport_status;
+       sg_info =                io_hdr_v4.info;
+       iop->resp_sense_len =    io_hdr_v4.response_len;
+       sg_duration =            io_hdr_v4.duration;
+    }
+
     if (report > 0) {
-        pout("  scsi_status=0x%x, host_status=0x%x, driver_status=0x%x\n"
-             "  info=0x%x  duration=%d milliseconds  resid=%d\n", io_hdr.status,
-             io_hdr.host_status, io_hdr.driver_status, io_hdr.info,
-             io_hdr.duration, io_hdr.resid);
+        pout("  scsi_status=0x%x, sg_transport_status=0x%x, sg_driver_status=0x%x\n"
+             "  sg_info=0x%x  sg_duration=%d milliseconds  resid=%d\n", iop->scsi_status,
+             sg_transport_status, sg_driver_status, sg_info,
+             sg_duration, iop->resid);
+
         if (report > 1) {
             if (DXFER_FROM_DEVICE == iop->dxfer_dir) {
                 int trunc, len;
@@ -616,17 +686,17 @@ static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
         }
     }
 
-    if (io_hdr.info & SG_INFO_CHECK) { /* error or warning */
-        int masked_driver_status = (LSCSI_DRIVER_MASK & io_hdr.driver_status);
+    if (sg_info & SG_INFO_CHECK) { /* error or warning */
+        int masked_driver_status = (LSCSI_DRIVER_MASK & sg_driver_status);
 
-        if (0 != io_hdr.host_status) {
-            if ((LSCSI_DID_NO_CONNECT == io_hdr.host_status) ||
-                (LSCSI_DID_BUS_BUSY == io_hdr.host_status) ||
-                (LSCSI_DID_TIME_OUT == io_hdr.host_status))
+        if (0 != sg_transport_status) {
+            if ((LSCSI_DID_NO_CONNECT == sg_transport_status) ||
+                (LSCSI_DID_BUS_BUSY == sg_transport_status) ||
+                (LSCSI_DID_TIME_OUT == sg_transport_status))
                 return -ETIMEDOUT;
             else
                /* Check for DID_ERROR - workaround for aacraid driver quirk */
-               if (LSCSI_DID_ERROR != io_hdr.host_status) {
+               if (LSCSI_DID_ERROR != sg_transport_status) {
                        return -EIO; /* catch all if not DID_ERR */
                }
         }
@@ -638,7 +708,6 @@ static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report,
         }
         if (LSCSI_DRIVER_SENSE == masked_driver_status)
             iop->scsi_status = SCSI_STATUS_CHECK_CONDITION;
-        iop->resp_sense_len = io_hdr.sb_len_wr;
         if ((SCSI_STATUS_CHECK_CONDITION == iop->scsi_status) &&
             iop->sensep && (iop->resp_sense_len > 0)) {
             if (report > 1) {
@@ -807,22 +876,33 @@ static int do_normal_scsi_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop,
      * other than ENODEV (no device) or permission then assume
      * SCSI_IOCTL_SEND_COMMAND is the only option. */
     switch (sg_io_state) {
-    case SG_IO_PRESENT_UNKNOWN:
+    case SG_IO_USE_DETECT:
         /* ignore report argument */
-        if (0 == (res = sg_io_cmnd_io(dev_fd, iop, report, 1))) {
-            sg_io_state = SG_IO_PRESENT_YES;
+        /* Try SG_IO V3 first */
+        if (0 == (res = sg_io_cmnd_io(dev_fd, iop, report, SG_IO_USE_V3))) {
+            sg_io_state = SG_IO_USE_V3;
             return 0;
         } else if ((-ENODEV == res) || (-EACCES == res) || (-EPERM == res))
             return res;         /* wait until we see a device */
-        sg_io_state = SG_IO_PRESENT_NO;
-        /* drop through by design */
-    case SG_IO_PRESENT_NO:
+        /* See if we can use SG_IO V4 * */
+        if (0 == (res = sg_io_cmnd_io(dev_fd, iop, report, SG_IO_USE_V4))) {
+            sg_io_state = SG_IO_USE_V4;
+            return 0;
+        } else if ((-ENODEV == res) || (-EACCES == res) || (-EPERM == res))
+            return res;         /* wait until we see a device */
+        /* fallback to the SCSI_IOCTL_SEND_COMMAND */
+        sg_io_state = SG_IO_UNSUPP;
+        /* FALLTHRU */
+    case SG_IO_UNSUPP:
+        /* depricated SCSI_IOCTL_SEND_COMMAND ioctl */
         return sisc_cmnd_io(dev_fd, iop, report);
-    case SG_IO_PRESENT_YES:
-        return sg_io_cmnd_io(dev_fd, iop, report, 0);
+    case SG_IO_USE_V3:
+    case SG_IO_USE_V4:
+        /* use SG_IO V3 or V4 ioctl, depending on availabiliy */
+        return sg_io_cmnd_io(dev_fd, iop, report, sg_io_state);
     default:
         pout(">>>> do_scsi_cmnd_io: bad sg_io_state=%d\n", sg_io_state);
-        sg_io_state = SG_IO_PRESENT_UNKNOWN;
+        sg_io_state = SG_IO_USE_DETECT;
         return -EIO;    /* report error and reset state */
     }
 }
@@ -972,7 +1052,7 @@ bool linux_aacraid_device::scsi_pass_through(scsi_cmnd_io *iop)
     j  = snprintf(buff, sz, " [%s: ", np ? np : "<unknown opcode>");
     for (k = 0; k < (int)iop->cmnd_len; ++k)
       j += snprintf(&buff[j], (sz > j ? (sz - j) : 0), "%02x ", ucp[k]);
-      if ((report > 1) &&
+    if ((report > 1) &&
         (DXFER_TO_DEVICE == iop->dxfer_dir) && (iop->dxferp)) {
         int trunc = (iop->dxfer_len > 256) ? 1 : 0;
 
@@ -3091,6 +3171,50 @@ static unsigned get_kernel_release()
   return x * 100000 + y * 1000 + z;
 }
 
+// Check for SCSI host proc_name "hpsa"
+static bool is_hpsa(const char * name)
+{
+  char path[128];
+  snprintf(path, sizeof(path), "/sys/block/%s/device", name);
+  char * syshostpath = canonicalize_file_name(path);
+  if (!syshostpath)
+    return false;
+
+  char * syshost = strrchr(syshostpath, '/');
+  if (!syshost) {
+    free(syshostpath);
+    return false;
+  }
+
+  char * hostsep = strchr(++syshost, ':');
+  if (hostsep)
+    *hostsep = 0;
+
+  snprintf(path, sizeof(path), "/sys/class/scsi_host/host%s/proc_name", syshost);
+  free(syshostpath);
+  int fd = open(path, O_RDONLY);
+  if (fd < 0)
+    return false;
+
+  char proc_name[32];
+  ssize_t n = read(fd, proc_name, sizeof(proc_name) - 1);
+  close(fd);
+  if (n < 4)
+    return false;
+
+  proc_name[n] = 0;
+  if (proc_name[n - 1] == '\n')
+    proc_name[n - 1] = 0;
+
+  if (scsi_debugmode > 1)
+    pout("%s -> %s: \"%s\"\n", name, path, proc_name);
+
+  if (strcmp(proc_name, "hpsa"))
+    return false;
+
+  return true;
+}
+
 // Guess device type (ata or scsi) based on device name (Linux
 // specific) SCSI device name in linux can be sd, sr, scd, st, nst,
 // osst, nosst and sg.
@@ -3143,7 +3267,11 @@ smart_device * linux_smart_interface::autodetect_smart_device(const char * name)
       return get_sat_device(usbtype, new linux_scsi_device(this, name, ""));
     }
 
-    // No USB bridge found, assume regular SCSI device
+    // Fail if hpsa driver
+    if (is_hpsa(test_name))
+      return missing_option("-d cciss,N");
+
+    // No USB bridge or hpsa driver found, assume regular SCSI device
     return new linux_scsi_device(this, name, "");
   }
 
@@ -3151,6 +3279,10 @@ smart_device * linux_smart_interface::autodetect_smart_device(const char * name)
   if (str_starts_with(test_name, "scsi/"))
     return new linux_scsi_device(this, name, "");
 
+  // form /dev/bsg/* or bsg/*
+  if (str_starts_with(test_name, "bsg/"))
+    return new linux_scsi_device(this, name, "");
+
   // form /dev/ns* or ns*
   if (str_starts_with(test_name, "ns"))
     return new linux_scsi_device(this, name, "");
index 104d17619570f349122e93ec88112162a646f762..e9f6e8d5a54e77c0e9b58b2305d249e9a9745e6a 100644 (file)
@@ -3,7 +3,7 @@
  * 
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2003-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 Bruce Allen
  *
  * Derived from code that was
  *
@@ -38,7 +38,7 @@
 #ifndef OS_LINUX_H_
 #define OS_LINUX_H_
 
-#define OS_LINUX_H_CVSID "$Id: os_linux.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_LINUX_H_CVSID "$Id: os_linux.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 /* 
    The following definitions/macros/prototypes are used for three
index ebcd013ee2739b882489aa0088ff64180c86031f..9b818970335c70c635f732123bb8f416b881c6c9 100644 (file)
@@ -3,7 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2003-8 Sergey Svishchev <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 Sergey Svishchev
+ * Copyright (C) 2016 Kimihiro Nonaka
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include "utility.h"
 #include "os_netbsd.h"
 
+#include <sys/drvctlio.h>
+#include <sys/utsname.h>
 #include <errno.h>
 #include <unistd.h>
 
-const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 4320 2016-05-10 13:39:19Z chrfranke $"
+// based on "sys/dev/ic/nvmeio.h" from NetBSD kernel sources
+#include "netbsd_nvme_ioctl.h" // NVME_PASSTHROUGH_CMD, nvme_completion_is_error
+
+const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   OS_NETBSD_H_CVSID;
 
 enum warnings {
@@ -48,323 +54,384 @@ printwarning(int msgNo, const char *extra)
       printed[msgNo] = 1;
       pout("%s", message[msgNo]);
       if (extra)
-       pout("%s", extra);
+        pout("%s", extra);
     }
   }
   return;
 }
 
-static const char *net_dev_prefix = "/dev/r";
+#define ARGUSED(x) ((void)(x))
+
+/////////////////////////////////////////////////////////////////////////////
+
+namespace os_netbsd { // No need to publish anything, name provided for Doxygen
+
+static const char *net_dev_prefix = "/dev/";
+static const char *net_dev_raw_prefix = "/dev/r";
 static const char *net_dev_ata_disk = "wd";
 static const char *net_dev_scsi_disk = "sd";
 static const char *net_dev_scsi_tape = "enrst";
+static const char *net_dev_nvme_ctrl = "nvme";
+
+/////////////////////////////////////////////////////////////////////////////
+/// Implement shared open/close routines with old functions.
 
-/* Guess device type (ATA or SCSI) based on device name */
-int
-guess_device_type(const char *dev_name)
+class netbsd_smart_device
+: virtual public /*implements*/ smart_device
 {
-  int len;
-  int dev_prefix_len = strlen(net_dev_prefix);
+public:
+  explicit netbsd_smart_device()
+    : smart_device(never_called),
+      m_fd(-1) { }
 
-  if (!dev_name || !(len = strlen(dev_name)))
-    return CONTROLLER_UNKNOWN;
+  virtual ~netbsd_smart_device() throw();
 
-  if (!strncmp(net_dev_prefix, dev_name, dev_prefix_len)) {
-    if (len <= dev_prefix_len)
-      return CONTROLLER_UNKNOWN;
-    else
-      dev_name += dev_prefix_len;
-  }
-  if (!strncmp(net_dev_ata_disk, dev_name, strlen(net_dev_ata_disk)))
-    return CONTROLLER_ATA;
+  virtual bool is_open() const;
+
+  virtual bool open();
+
+  virtual bool close();
+
+protected:
+  /// Return filedesc for derived classes.
+  int get_fd() const
+    { return m_fd; }
 
-  if (!strncmp(net_dev_scsi_disk, dev_name, strlen(net_dev_scsi_disk)))
-    return CONTROLLER_SCSI;
+  void set_fd(int fd)
+    { m_fd = fd; }
 
-  if (!strncmp(net_dev_scsi_tape, dev_name, strlen(net_dev_scsi_tape)))
-    return CONTROLLER_SCSI;
+private:
+  int m_fd; ///< filedesc, -1 if not open.
+};
 
-  return CONTROLLER_UNKNOWN;
+netbsd_smart_device::~netbsd_smart_device() throw()
+{
+  if (m_fd >= 0)
+    os_netbsd::netbsd_smart_device::close();
 }
 
-int
-get_dev_names(char ***names, const char *prefix)
+bool netbsd_smart_device::is_open() const
 {
-  char *disknames, *p, **mp;
-  int n = 0;
-  int sysctl_mib[2];
-  size_t sysctl_len;
+  return (m_fd >= 0);
+}
 
-  *names = NULL;
 
-  sysctl_mib[0] = CTL_HW;
-  sysctl_mib[1] = HW_DISKNAMES;
-  if (-1 == sysctl(sysctl_mib, 2, NULL, &sysctl_len, NULL, 0)) {
-    pout("Failed to get value of sysctl `hw.disknames'\n");
-    return -1;
-  }
-  if (!(disknames = (char *)malloc(sysctl_len))) {
-    pout("Out of memory constructing scan device list\n");
-    return -1;
-  }
-  if (-1 == sysctl(sysctl_mib, 2, disknames, &sysctl_len, NULL, 0)) {
-    pout("Failed to get value of sysctl `hw.disknames'\n");
-    return -1;
-  }
-  if (!(mp = (char **) calloc(strlen(disknames) / 2, sizeof(char *)))) {
-    pout("Out of memory constructing scan device list\n");
-    return -1;
-  }
-  for (p = strtok(disknames, " "); p; p = strtok(NULL, " ")) {
-    if (strncmp(p, prefix, strlen(prefix))) {
-      continue;
+bool netbsd_smart_device::open()
+{
+  const char *dev = get_dev_name();
+  int fd;
+
+  if (is_scsi()) {
+    fd = ::open(dev,O_RDWR|O_NONBLOCK);
+    if (fd < 0 && errno == EROFS)
+      fd = ::open(dev,O_RDONLY|O_NONBLOCK);
+    if (fd < 0) {
+      set_err(errno);
+      return false;
     }
-    mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);
-    if (!mp[n]) {
-      pout("Out of memory constructing scan device list\n");
-      return -1;
+  } else if (is_ata() || is_nvme()) {
+    if ((fd = ::open(dev,O_RDWR|O_NONBLOCK))<0) {
+      set_err(errno);
+      return false;
     }
-    sprintf(mp[n], "%s%s%c", net_dev_prefix, p, 'a' + getrawpartition());
-    n++;
-  }
+  } else
+    return false;
 
-  char ** tmp = (char **)realloc(mp, n * (sizeof(char *)));
-  if (NULL == tmp) {
-    pout("Out of memory constructing scan device list\n");
-    free(mp);
-    return -1;
-  }
-  else
-    mp = tmp;
-  *names = mp;
-  return n;
+  set_fd(fd);
+  return true;
 }
 
-int
-make_device_names(char ***devlist, const char *name)
+bool netbsd_smart_device::close()
 {
-  if (!strcmp(name, "SCSI"))
-    return get_dev_names(devlist, net_dev_scsi_disk);
-  else if (!strcmp(name, "ATA"))
-    return get_dev_names(devlist, net_dev_ata_disk);
-  else
-    return 0;
+  int failed = 0;
+  // close device, if open
+  if (is_open())
+    failed=::close(get_fd());
+
+  set_fd(-1);
+
+  if(failed) return false;
+    else return true;
 }
 
-int
-deviceopen(const char *pathname, char *type)
+/////////////////////////////////////////////////////////////////////////////
+/// Implement standard ATA support
+
+class netbsd_ata_device
+: public /*implements*/ ata_device,
+  public /*extends*/ netbsd_smart_device
+{
+public:
+  netbsd_ata_device(smart_interface * intf, const char * dev_name, const char * req_type);
+  virtual bool ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);
+
+protected:
+  virtual int do_cmd(struct atareq* request, bool is_48bit_cmd);
+};
+
+netbsd_ata_device::netbsd_ata_device(smart_interface * intf, const char * dev_name, const char * req_type)
+: smart_device(intf, dev_name, "ata", req_type),
+  netbsd_smart_device()
 {
-  if (!strcmp(type, "SCSI")) {
-    int fd = open(pathname, O_RDWR | O_NONBLOCK);
-    if (fd < 0 && errno == EROFS)
-      fd = open(pathname, O_RDONLY | O_NONBLOCK);
-    return fd;
-  } else if (!strcmp(type, "ATA"))
-    return open(pathname, O_RDWR | O_NONBLOCK);
-  else
-    return -1;
 }
 
-int
-deviceclose(int fd)
+int netbsd_ata_device::do_cmd( struct atareq* request, bool is_48bit_cmd)
 {
-  return close(fd);
+  int fd = get_fd(), ret;
+  ARGUSED(is_48bit_cmd); // no support for 48 bit commands in the ATAIOCCOMMAND
+  ret = ioctl(fd, ATAIOCCOMMAND, request);
+  if (ret) set_err(errno);
+  return ret;
 }
 
-int
-ata_command_interface(int fd, smart_command_set command, int select, char *data)
+bool netbsd_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
 {
-  struct atareq req;
-  unsigned char inbuf[DEV_BSIZE];
-  int retval, copydata = 0;
+  bool ata_48bit = false; // no ata_48bit_support via ATAIOCCOMMAND
+
+  if (!ata_cmd_is_ok(in,
+    true,  // data_out_support
+    true,  // multi_sector_support
+    ata_48bit)
+    ) {
+      set_err(ENOSYS, "48-bit ATA commands not implemented");
+      return false;
+    }
 
+  struct atareq req;
   memset(&req, 0, sizeof(req));
+
   req.timeout = 1000;
+  req.command = in.in_regs.command;
+  req.features = in.in_regs.features;
+  req.sec_count = in.in_regs.sector_count;
+  req.sec_num = in.in_regs.lba_low;
+  req.head = in.in_regs.device;
+  req.cylinder = le16toh(in.in_regs.lba_mid | (in.in_regs.lba_high << 8));
+
+  switch (in.direction) {
+    case ata_cmd_in::no_data:
+      req.flags = ATACMD_READREG;
+      break;
+    case ata_cmd_in::data_in:
+      req.flags = ATACMD_READ | ATACMD_READREG;
+      req.databuf = (char *)in.buffer;
+      req.datalen = in.size;
+      break;
+    case ata_cmd_in::data_out:
+      req.flags = ATACMD_WRITE | ATACMD_READREG;
+      req.databuf = (char *)in.buffer;
+      req.datalen = in.size;
+      break;
+    default:
+      return set_err(ENOSYS);
+  }
 
-  memset(&inbuf, 0, sizeof(inbuf));
-
-  switch (command) {
-  case READ_VALUES:
-    req.flags = ATACMD_READ;
-    req.features = WDSM_RD_DATA;
-    req.command = WDCC_SMART;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    req.cylinder = WDSMART_CYL;
-    copydata = 1;
-    break;
-  case READ_THRESHOLDS:
-    req.flags = ATACMD_READ;
-    req.features = WDSM_RD_THRESHOLDS;
-    req.command = WDCC_SMART;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    req.cylinder = WDSMART_CYL;
-    copydata = 1;
-    break;
-  case READ_LOG:
-    req.flags = ATACMD_READ;
-    req.features = ATA_SMART_READ_LOG_SECTOR;  /* XXX missing from wdcreg.h */
-    req.command = WDCC_SMART;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    req.cylinder = WDSMART_CYL;
-    req.sec_num = select;
-    req.sec_count = 1;
-    copydata = 1;
-    break;
-  case WRITE_LOG:
-    memcpy(inbuf, data, 512);
-    req.flags = ATACMD_WRITE;
-    req.features = ATA_SMART_WRITE_LOG_SECTOR; /* XXX missing from wdcreg.h */
-    req.command = WDCC_SMART;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    req.cylinder = WDSMART_CYL;
-    req.sec_num = select;
-    req.sec_count = 1;
-    break;
-  case IDENTIFY:
-    req.flags = ATACMD_READ;
-    req.command = WDCC_IDENTIFY;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    copydata = 1;
-    break;
-  case PIDENTIFY:
-    req.flags = ATACMD_READ;
-    req.command = ATAPI_IDENTIFY_DEVICE;
-    req.databuf = (char *)inbuf;
-    req.datalen = sizeof(inbuf);
-    copydata = 1;
-    break;
-  case ENABLE:
-    req.flags = ATACMD_READREG;
-    req.features = WDSM_ENABLE_OPS;
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    break;
-  case DISABLE:
-    req.flags = ATACMD_READREG;
-    req.features = WDSM_DISABLE_OPS;
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    break;
-  case AUTO_OFFLINE:
-    /* NOTE: According to ATAPI 4 and UP, this command is obsolete */
-    req.flags = ATACMD_READREG;
-    req.features = ATA_SMART_AUTO_OFFLINE;     /* XXX missing from wdcreg.h */
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    req.sec_count = select;
-    break;
-  case AUTOSAVE:
-    req.flags = ATACMD_READREG;
-    req.features = ATA_SMART_AUTOSAVE; /* XXX missing from wdcreg.h */
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    req.sec_count = select;
-    break;
-  case IMMEDIATE_OFFLINE:
-    /* NOTE: According to ATAPI 4 and UP, this command is obsolete */
-    req.flags = ATACMD_READREG;
-    req.features = ATA_SMART_IMMEDIATE_OFFLINE;        /* XXX missing from wdcreg.h */
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    req.sec_num = select;
-    req.sec_count = 1;
-    break;
-  case STATUS:         /* should return 0 if SMART is enabled at all */
-  case STATUS_CHECK:   /* should return 0 if disk's health is ok */
-    req.flags = ATACMD_READREG;
-    req.features = WDSM_STATUS;
-    req.command = WDCC_SMART;
-    req.cylinder = WDSMART_CYL;
-    break;
-  case CHECK_POWER_MODE:
-    req.flags = ATACMD_READREG;
-    req.command = WDCC_CHECK_PWR;
-    break;
-  default:
-    pout("Unrecognized command %d in ata_command_interface()\n", command);
-    errno = ENOSYS;
-    return -1;
+  clear_err();
+  errno = 0;
+  if (do_cmd(&req, in.in_regs.is_48bit_cmd()))
+      return false;
+  if (req.retsts != ATACMD_OK)
+      return set_err(EIO, "request failed, error code 0x%02x", req.retsts);
+
+  out.out_regs.error = req.error;
+  out.out_regs.sector_count = req.sec_count;
+  out.out_regs.lba_low = req.sec_num;
+  out.out_regs.device = req.head;
+  out.out_regs.lba_mid = le16toh(req.cylinder);
+  out.out_regs.lba_high = le16toh(req.cylinder) >> 8;
+  out.out_regs.status = req.command;
+
+  // Command specific processing
+  if (in.in_regs.command == ATA_SMART_CMD
+       && in.in_regs.features == ATA_SMART_STATUS
+       && in.out_needed.lba_high)
+  {
+    unsigned const char normal_lo=0x4f, normal_hi=0xc2;
+    unsigned const char failed_lo=0xf4, failed_hi=0x2c;
+
+    // Cyl low and Cyl high unchanged means "Good SMART status"
+    if (!(out.out_regs.lba_mid==normal_lo && out.out_regs.lba_high==normal_hi)
+    // These values mean "Bad SMART status"
+        && !(out.out_regs.lba_mid==failed_lo && out.out_regs.lba_high==failed_hi))
+
+    {
+      // We haven't gotten output that makes sense; print out some debugging info
+      char buf[512];
+      snprintf(buf, sizeof(buf),
+        "CMD=0x%02x\nFR =0x%02x\nNS =0x%02x\nSC =0x%02x\nCL =0x%02x\nCH =0x%02x\nRETURN =0x%04x\n",
+        (int)req.command,
+        (int)req.features,
+        (int)req.sec_count,
+        (int)req.sec_num,
+        (int)(le16toh(req.cylinder) & 0xff),
+        (int)((le16toh(req.cylinder) >> 8) & 0xff),
+        (int)req.error);
+      printwarning(BAD_SMART,buf);
+      out.out_regs.lba_high = failed_hi;
+      out.out_regs.lba_mid = failed_lo;
+    }
   }
 
-  if (command == STATUS_CHECK || command == AUTOSAVE || command == AUTO_OFFLINE) {
-    char buf[512];
+  return true;
+}
 
-    unsigned const short normal = WDSMART_CYL, failed = 0x2cf4;
+/////////////////////////////////////////////////////////////////////////////
+/// NVMe support
 
-    if ((retval = ioctl(fd, ATAIOCCOMMAND, &req))) {
-      perror("Failed command");
-      return -1;
+class netbsd_nvme_device
+: public /*implements*/ nvme_device,
+  public /*extends*/ netbsd_smart_device
+{
+public:
+  netbsd_nvme_device(smart_interface * intf, const char * dev_name,
+    const char * req_type, unsigned nsid);
+
+  virtual bool open();
+
+  virtual bool nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out);
+};
+
+netbsd_nvme_device::netbsd_nvme_device(smart_interface * intf, const char * dev_name,
+  const char * req_type, unsigned nsid)
+: smart_device(intf, dev_name, "nvme", req_type),
+  nvme_device(nsid),
+  netbsd_smart_device()
+{
+}
+
+bool netbsd_nvme_device::open()
+{
+  const char *dev = get_dev_name();
+  if (strncmp(dev, NVME_PREFIX, strlen(NVME_PREFIX))) {
+    set_err(EINVAL, "NVMe controller controller/namespace ids must begin with '%s'",
+      NVME_PREFIX);
+    return false;
+  }
+
+  int nsid = -1, ctrlid = -1;
+  char tmp;
+
+  if(sscanf(dev, NVME_PREFIX"%d%c", &ctrlid, &tmp) == 1)
+  {
+    if(ctrlid < 0) {
+      set_err(EINVAL, "Invalid NVMe controller number");
+      return false;
     }
-    if (req.retsts != ATACMD_OK) {
-      return -1;
+    nsid = 0xFFFFFFFF; // broadcast id
+  }
+  else if (sscanf(dev, NVME_PREFIX"%d"NVME_NS_PREFIX"%d%c",
+    &ctrlid, &nsid, &tmp) == 2)
+  {
+    if(ctrlid < 0 || nsid <= 0) {
+      set_err(EINVAL, "Invalid NVMe controller/namespace number");
+      return false;
     }
-    /* Cyl low and Cyl high unchanged means "Good SMART status" */
-    if (req.cylinder == normal)
-      return 0;
-
-    /* These values mean "Bad SMART status" */
-    if (req.cylinder == failed)
-      return 1;
-
-    /* We haven't gotten output that makes sense; 
-     * print out some debugging info */
-    snprintf(buf, sizeof(buf),
-      "CMD=0x%02x\nFR =0x%02x\nNS =0x%02x\nSC =0x%02x\nCL =0x%02x\nCH =0x%02x\nRETURN =0x%04x\n",
-      (int) req.command, (int) req.features, (int) req.sec_count, (int) req.sec_num,
-      (int) (le16toh(req.cylinder) & 0xff), (int) ((le16toh(req.cylinder) >> 8) & 0xff),
-      (int) req.error);
-    printwarning(BAD_SMART, buf);
-    return 0;
+  }
+  else {
+    set_err(EINVAL, "Invalid NVMe controller/namespace syntax");
+    return false;
   }
 
-  retval = ioctl(fd, ATAIOCCOMMAND, &req);
-  if (retval < 0) {
-    perror("Failed command");
-    return -1;
+  // we should always open controller, not namespace device
+  char full_path[64];
+  snprintf(full_path, sizeof(full_path), NVME_PREFIX"%d", ctrlid);
+
+  int fd;
+  if ((fd = ::open(full_path, O_RDWR))<0) {
+    set_err(errno);
+    return false;
   }
-  if (req.retsts != ATACMD_OK) {
-    return -1;
+  set_fd(fd);
+
+  if (!get_nsid()) {
+    set_nsid(nsid);
   }
 
-  if (command == CHECK_POWER_MODE)
-    data[0] = req.sec_count;
+  return true;
+}
 
-  if (copydata)
-    memcpy(data, inbuf, 512);
+bool netbsd_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out)
+{
+  struct nvme_pt_command pt;
+  memset(&pt, 0, sizeof(pt));
 
-  return 0;
+  pt.cmd.opcode = in.opcode;
+  pt.cmd.nsid = in.nsid;
+  pt.buf = in.buffer;
+  pt.len = in.size;
+  pt.cmd.cdw10 = in.cdw10;
+  pt.cmd.cdw11 = in.cdw11;
+  pt.cmd.cdw12 = in.cdw12;
+  pt.cmd.cdw13 = in.cdw13;
+  pt.cmd.cdw14 = in.cdw14;
+  pt.cmd.cdw15 = in.cdw15;
+  pt.is_read = 1; // should we use in.direction()?
+
+  int status = ioctl(get_fd(), NVME_PASSTHROUGH_CMD, &pt);
+
+  if (status < 0)
+    return set_err(errno, "NVME_PASSTHROUGH_CMD: %s", strerror(errno));
+
+  out.result=pt.cpl.cdw0; // Command specific result (DW0)
+
+  if (nvme_completion_is_error(&pt.cpl))
+    return set_nvme_err(out, nvme_completion_is_error(&pt.cpl));
+
+  return true;
 }
 
-int
-do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
+/////////////////////////////////////////////////////////////////////////////
+/// Standard SCSI support
+
+class netbsd_scsi_device
+: public /*implements*/ scsi_device,
+  public /*extends*/ netbsd_smart_device
 {
-  struct scsireq sc;
+public:
+  netbsd_scsi_device(smart_interface * intf, const char * dev_name, const char * req_type, bool scanning = false);
+
+  virtual smart_device * autodetect_open();
+
+  virtual bool scsi_pass_through(scsi_cmnd_io * iop);
+
+private:
+  bool m_scanning; ///< true if created within scan_smart_devices
+};
+
+netbsd_scsi_device::netbsd_scsi_device(smart_interface * intf,
+  const char * dev_name, const char * req_type, bool scanning /* = false */)
+: smart_device(intf, dev_name, "scsi", req_type),
+  netbsd_smart_device(),
+  m_scanning(scanning)
+{
+}
 
-  if (report > 0) {
-    size_t k;
+bool netbsd_scsi_device::scsi_pass_through(scsi_cmnd_io * iop)
+{
+  struct scsireq sc;
+  int fd = get_fd();
 
-    const unsigned char *ucp = iop->cmnd;
-    const char *np;
+  if (scsi_debugmode) {
+    unsigned int k;
+    const unsigned char * ucp = iop->cmnd;
+    const char * np;
 
     np = scsi_get_opcode_name(ucp[0]);
     pout(" [%s: ", np ? np : "<unknown opcode>");
     for (k = 0; k < iop->cmnd_len; ++k)
       pout("%02x ", ucp[k]);
-    if ((report > 1) &&
+    if ((scsi_debugmode > 1) &&
       (DXFER_TO_DEVICE == iop->dxfer_dir) && (iop->dxferp)) {
-      int trunc = (iop->dxfer_len > 256) ? 1 : 0;
+    int trunc = (iop->dxfer_len > 256) ? 1 : 0;
 
-      pout("]\n  Outgoing data, len=%d%s:\n", (int) iop->dxfer_len,
-       (trunc ? " [only first 256 bytes shown]" : ""));
-      dStrHex(iop->dxferp, (trunc ? 256 : iop->dxfer_len), 1);
-    } else
-      pout("]");
+    pout("]\n  Outgoing data, len=%d%s:\n", (int)iop->dxfer_len,
+      (trunc ? " [only first 256 bytes shown]" : ""));
+    dStrHex(iop->dxferp, (trunc ? 256 : iop->dxfer_len) , 1);
+      }
+      else
+        pout("]\n");
   }
+
   memset(&sc, 0, sizeof(sc));
   memcpy(sc.cmd, iop->cmnd, iop->cmnd_len);
   sc.cmdlen = iop->cmnd_len;
@@ -377,8 +444,10 @@ do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
     (iop->dxfer_dir == DXFER_FROM_DEVICE ? SCCMD_READ : SCCMD_WRITE));
 
   if (ioctl(fd, SCIOCCOMMAND, &sc) < 0) {
-    warn("error sending SCSI ccb");
-    return -1;
+    if (scsi_debugmode) {
+      pout("  error sending SCSI ccb\n");
+    }
+    return set_err(EIO);
   }
   iop->resid = sc.datalen - sc.datalen_used;
   iop->scsi_status = sc.status;
@@ -386,7 +455,7 @@ do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
     memcpy(iop->sensep, sc.sense, sc.senselen_used);
     iop->resp_sense_len = sc.senselen_used;
   }
-  if (report > 0) {
+  if (scsi_debugmode) {
     int trunc;
 
     pout("  status=0\n");
@@ -398,43 +467,417 @@ do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
   }
   switch (sc.retsts) {
     case SCCMD_OK:
-      return 0;
+      break;
     case SCCMD_TIMEOUT:
-      return -ETIMEDOUT;
+      return set_err(ETIMEDOUT);
     case SCCMD_BUSY:
-      return -EBUSY;
+      return set_err(EBUSY);
     default:
-      return -EIO;
+      return set_err(EIO);
   }
+
+  return true;
 }
 
-/* print examples for smartctl */
-void 
-print_smartctl_examples()
+/////////////////////////////////////////////////////////////////////////////
+///// SCSI open with autodetection support
+
+smart_device * netbsd_scsi_device::autodetect_open()
 {
-  char p;
+  // Open device
+  if (!open())
+    return this;
+
+  // No Autodetection if device type was specified by user
+  bool sat_only = false;
+  if (*get_req_type()) {
+    // Detect SAT if device object was created by scan_smart_devices().
+    if (!(m_scanning && !strcmp(get_req_type(), "sat")))
+      return this;
+    sat_only = true;
+  }
 
-  p = 'a' + getrawpartition();
-  printf("=================================================== SMARTCTL EXAMPLES =====\n\n");
+  // The code below is based on smartd.cpp:SCSIFilterKnown()
+
+  // Get INQUIRY
+  unsigned char req_buff[64] = {0, };
+  int req_len = 36;
+  if (scsiStdInquiry(this, req_buff, req_len)) {
+    // Marvell controllers fail on a 36 bytes StdInquiry, but 64 suffices
+    // watch this spot ... other devices could lock up here
+    req_len = 64;
+    if (scsiStdInquiry(this, req_buff, req_len)) {
+      // device doesn't like INQUIRY commands
+      close();
+      set_err(EIO, "INQUIRY failed");
+      return this;
+    }
+  }
+
+  int avail_len = req_buff[4] + 5;
+  int len = (avail_len < req_len ? avail_len : req_len);
+  if (len < 36) {
+    if (sat_only) {
+      close();
+      set_err(EIO, "INQUIRY too short for SAT");
+    }
+    return this;
+  }
+
+  // Use INQUIRY to detect type
+
+  // SAT or USB, skip MFI controllers because of bugs
+  {
+    smart_device * newdev = smi()->autodetect_sat_device(this, req_buff, len);
+    if (newdev) {
+      // NOTE: 'this' is now owned by '*newdev'
+      return newdev;
+    }
+  }
+
+  // Nothing special found
+
+  if (sat_only) {
+    close();
+    set_err(EIO, "Not a SAT device");
+  }
+  return this;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/// Implement platform interface with old functions.
+
+class netbsd_smart_interface
+: public /*implements*/ smart_interface
+{
+public:
+  virtual std::string get_os_version_str();
+
+  virtual std::string get_app_examples(const char * appname);
+
+  virtual bool scan_smart_devices(smart_device_list & devlist, const char * type,
+    const char * pattern = 0);
+
+protected:
+  virtual ata_device * get_ata_device(const char * name, const char * type);
+
+  virtual scsi_device * get_scsi_device(const char * name, const char * type);
+
+  virtual nvme_device * get_nvme_device(const char * name, const char * type,
+    unsigned nsid);
+
+  virtual smart_device * autodetect_smart_device(const char * name);
+
+  virtual smart_device * get_custom_smart_device(const char * name, const char * type);
+
+  virtual std::string get_valid_custom_dev_types_str();
+
+private:
+  int get_dev_names(char ***, const char *);
+
+  bool get_nvme_devlist(smart_device_list & devlist, const char * type);
+};
+
+
+//////////////////////////////////////////////////////////////////////
+
+std::string netbsd_smart_interface::get_os_version_str()
+{
+  struct utsname osname;
+  uname(&osname);
+  return strprintf("%s %s %s", osname.sysname, osname.release, osname.machine);
+}
+
+std::string netbsd_smart_interface::get_app_examples(const char * appname)
+{
+  if (!strcmp(appname, "smartctl")) {
+    char p;
+
+    p = 'a' + getrawpartition();
+    return strprintf(
+        "=================================================== SMARTCTL EXAMPLES =====\n\n"
 #ifdef HAVE_GETOPT_LONG
-  printf(
-    "  smartctl -a /dev/wd0%c                      (Prints all SMART information)\n\n"
-    "  smartctl --smart=on --offlineauto=on --saveauto=on /dev/wd0%c\n"
-    "                                              (Enables SMART on first disk)\n\n"
-    "  smartctl -t long /dev/wd0%c             (Executes extended disk self-test)\n\n"
-    "  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/wd0%c\n"
-    "                                      (Prints Self-Test & Attribute errors)\n",
-    p, p, p, p
-    );
+      "  smartctl -a /dev/wd0%c                      (Prints all SMART information)\n\n"
+      "  smartctl --smart=on --offlineauto=on --saveauto=on /dev/wd0%c\n"
+      "                                              (Enables SMART on first disk)\n\n"
+      "  smartctl -t long /dev/wd0%c             (Executes extended disk self-test)\n\n"
+      "  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/wd0%c\n"
+      "                                      (Prints Self-Test & Attribute errors)\n"
 #else
-  printf(
-    "  smartctl -a /dev/wd0%c                     (Prints all SMART information)\n"
-    "  smartctl -s on -o on -S on /dev/wd0%c        (Enables SMART on first disk)\n"
-    "  smartctl -t long /dev/wd0%c            (Executes extended disk self-test)\n"
-    "  smartctl -A -l selftest -q errorsonly /dev/wd0%c"
-    "                                      (Prints Self-Test & Attribute errors)\n",
-    p, p, p, p
-    );
+      "  smartctl -a /dev/wd0%c                     (Prints all SMART information)\n"
+      "  smartctl -s on -o on -S on /dev/wd0%c        (Enables SMART on first disk)\n"
+      "  smartctl -t long /dev/wd0%c            (Executes extended disk self-test)\n"
+      "  smartctl -A -l selftest -q errorsonly /dev/wd0%c"
+      "                                      (Prints Self-Test & Attribute errors)\n"
 #endif
-  return;
+      , p, p, p, p);
+  }
+  return "";
+}
+
+ata_device * netbsd_smart_interface::get_ata_device(const char * name, const char * type)
+{
+  return new netbsd_ata_device(this, name, type);
+}
+
+scsi_device * netbsd_smart_interface::get_scsi_device(const char * name, const char * type)
+{
+  return new netbsd_scsi_device(this, name, type);
 }
+
+nvme_device * netbsd_smart_interface::get_nvme_device(const char * name, const char * type, unsigned nsid)
+{
+  return new netbsd_nvme_device(this, name, type, nsid);
+}
+
+int netbsd_smart_interface::get_dev_names(char ***names, const char *prefix)
+{
+  char *disknames, *p, **mp;
+  int n = 0;
+  int sysctl_mib[2];
+  size_t sysctl_len;
+
+  *names = NULL;
+
+  sysctl_mib[0] = CTL_HW;
+  sysctl_mib[1] = HW_DISKNAMES;
+  if (-1 == sysctl(sysctl_mib, 2, NULL, &sysctl_len, NULL, 0)) {
+    pout("Failed to get value of sysctl `hw.disknames'\n");
+    return -1;
+  }
+  if (!(disknames = (char *)malloc(sysctl_len))) {
+    pout("Out of memory constructing scan device list\n");
+    return -1;
+  }
+  if (-1 == sysctl(sysctl_mib, 2, disknames, &sysctl_len, NULL, 0)) {
+    pout("Failed to get value of sysctl `hw.disknames'\n");
+    return -1;
+  }
+  if (!(mp = (char **) calloc(strlen(disknames) / 2, sizeof(char *)))) {
+    pout("Out of memory constructing scan device list\n");
+    return -1;
+  }
+  for (p = strtok(disknames, " "); p; p = strtok(NULL, " ")) {
+    if (strncmp(p, prefix, strlen(prefix))) {
+      continue;
+    }
+    mp[n] = (char *)malloc(strlen(net_dev_raw_prefix) + strlen(p) + 2);
+    if (!mp[n]) {
+      pout("Out of memory constructing scan device list\n");
+      return -1;
+    }
+    sprintf(mp[n], "%s%s%c", net_dev_raw_prefix, p, 'a' + getrawpartition());
+    n++;
+  }
+
+  char ** tmp = (char **)realloc(mp, n * (sizeof(char *)));
+  if (NULL == tmp) {
+    pout("Out of memory constructing scan device list\n");
+    free(mp);
+    return -1;
+  }
+  else
+    mp = tmp;
+  *names = mp;
+  return n;
+}
+
+bool netbsd_smart_interface::get_nvme_devlist(smart_device_list & devlist,
+    const char * type)
+{
+  char ctrlpath[64], nspath[64];
+  struct stat sb;
+  struct devlistargs laa;
+  nvme_device * nvmedev;
+
+  int drvfd = ::open(DRVCTLDEV, O_RDONLY, 0);
+  if (drvfd < 0) {
+    set_err(errno);
+    return false;
+  }
+
+  for (int ctrl = 0;; ctrl++) {
+    snprintf(ctrlpath, sizeof(ctrlpath), NVME_PREFIX"%d", ctrl);
+    if (stat(ctrlpath, &sb) == -1 || !S_ISCHR(sb.st_mode))
+      break;
+
+    snprintf(laa.l_devname, sizeof(laa.l_devname), "%s%d", net_dev_nvme_ctrl,
+      ctrl);
+    laa.l_childname = NULL;
+    laa.l_children = 0;
+    if (ioctl(drvfd, DRVLISTDEV, &laa) == -1) {
+      if (errno == ENXIO)
+        continue;
+      break;
+    }
+
+    nvmedev = get_nvme_device(ctrlpath, type, 0);
+    if (nvmedev)
+      devlist.push_back(nvmedev);
+
+    uint32_t n = 0;
+    for (int nsid = 1; n < laa.l_children; nsid++) {
+      snprintf(nspath, sizeof(nspath), NVME_PREFIX"%d"NVME_NS_PREFIX"%d",
+        ctrl, nsid);
+      if (stat(nspath, &sb) == -1 || !S_ISCHR(sb.st_mode))
+        break;
+      int nsfd = ::open(nspath, O_RDONLY, 0);
+      if (nsfd < 0)
+        continue;
+      ::close(nsfd);
+
+      n++;
+      nvmedev = get_nvme_device(nspath, type, nsid);
+      if (nvmedev)
+        devlist.push_back(nvmedev);
+    }
+  }
+
+  ::close(drvfd);
+  return true;
+}
+
+bool netbsd_smart_interface::scan_smart_devices(smart_device_list & devlist,
+  const char * type, const char * pattern /*= 0*/)
+{
+  if (pattern) {
+    set_err(EINVAL, "DEVICESCAN with pattern not implemented yet");
+    return false;
+  }
+
+  if (type == NULL)
+    type = "";
+
+  bool scan_ata = !*type || !strcmp(type, "ata");
+  bool scan_scsi = !*type || !strcmp(type, "scsi") || !strcmp(type, "sat");
+
+#ifdef WITH_NVME_DEVICESCAN // TODO: Remove when NVMe support is no longer EXPERIMENTAL
+  bool scan_nvme = !*type || !strcmp(type, "nvme");
+#else
+  bool scan_nvme =           !strcmp(type, "nvme");
+#endif
+
+  // Make namelists
+  char * * atanames = 0; int numata = 0;
+  if (scan_ata) {
+    numata = get_dev_names(&atanames, net_dev_ata_disk);
+    if (numata < 0) {
+      set_err(ENOMEM);
+      return false;
+    }
+  }
+
+  char * * scsinames = 0; int numscsi = 0;
+  char * * scsitapenames = 0; int numscsitape = 0;
+  if (scan_scsi) {
+    numscsi = get_dev_names(&scsinames, net_dev_scsi_disk);
+    if (numscsi < 0) {
+      set_err(ENOMEM);
+      return false;
+    }
+    numscsitape = get_dev_names(&scsitapenames, net_dev_scsi_tape);
+    if (numscsitape < 0) {
+      set_err(ENOMEM);
+      return false;
+    }
+  }
+
+  // Add to devlist
+  int i;
+  for (i = 0; i < numata; i++) {
+    ata_device * atadev = get_ata_device(atanames[i], type);
+    if (atadev)
+      devlist.push_back(atadev);
+    free(atanames[i]);
+  }
+  if(numata) free(atanames);
+
+  for (i = 0; i < numscsi; i++) {
+    scsi_device * scsidev = new netbsd_scsi_device(this, scsinames[i], type, true /*scanning*/);
+    if (scsidev)
+      devlist.push_back(scsidev);
+    free(scsinames[i]);
+  }
+  if(numscsi) free(scsinames);
+
+  for (i = 0; i < numscsitape; i++) {
+    scsi_device * scsidev = get_scsi_device(scsitapenames[i], type);
+    if (scsidev)
+      devlist.push_back(scsidev);
+    free(scsitapenames[i]);
+  }
+  if(numscsitape) free(scsitapenames);
+
+  if (scan_nvme)
+    get_nvme_devlist(devlist, type);
+
+  return true;
+}
+
+smart_device * netbsd_smart_interface::autodetect_smart_device(const char * name)
+{
+  const char * test_name = name;
+
+  // if dev_name null, or string length zero
+  if (!name || !*name)
+    return 0;
+
+  // Dereference symlinks
+  struct stat st;
+  std::string pathbuf;
+  if (!lstat(name, &st) && S_ISLNK(st.st_mode)) {
+    char * p = realpath(name, (char *)0);
+    if (p) {
+      pathbuf = p;
+      free(p);
+      test_name = pathbuf.c_str();
+    }
+  }
+
+  if (str_starts_with(test_name, net_dev_raw_prefix)) {
+    test_name += strlen(net_dev_raw_prefix);
+    if (!strncmp(net_dev_ata_disk, test_name, strlen(net_dev_ata_disk)))
+      return get_ata_device(test_name, "ata");
+    if (!strncmp(net_dev_scsi_disk, test_name, strlen(net_dev_scsi_disk))) {
+      // XXX Try to detect possible USB->(S)ATA bridge
+      // XXX get USB vendor ID, product ID and version from sd(4)/umass(4).
+      // XXX check sat device via get_usb_dev_type_by_id().
+
+      // No USB bridge found, assume regular SCSI device
+      return get_scsi_device(test_name, "scsi");
+    }
+    if (!strncmp(net_dev_scsi_tape, test_name, strlen(net_dev_scsi_tape)))
+      return get_scsi_device(test_name, "scsi");
+  } else if (str_starts_with(test_name, net_dev_prefix)) {
+    if (!strncmp(NVME_PREFIX, test_name, strlen(NVME_PREFIX)))
+      return get_nvme_device(test_name, "nvme", 0 /* use default nsid */);
+  }
+
+  // device type unknown
+  return 0;
+}
+
+smart_device * netbsd_smart_interface::get_custom_smart_device(const char * name, const char * type)
+{
+  ARGUSED(name);
+  ARGUSED(type);
+  return 0;
+}
+
+std::string netbsd_smart_interface::get_valid_custom_dev_types_str()
+{
+  return "";
+}
+
+} // namespace
+
+/////////////////////////////////////////////////////////////////////////////
+/// Initialize platform interface and register with smi()
+
+void smart_interface::init()
+{
+  static os_netbsd::netbsd_smart_interface the_interface;
+  smart_interface::set(&the_interface);
+}
+
+/* vim: set ts=2 sw=2 et ff=unix : */
index 7bf7b762843c857a033181ad16759581b18b335d..51ee5a30204ecb7cc9c18285c7bd693572af50c8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2003-8 Sergey Svishchev <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 Sergey Svishchev
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 #ifndef OS_NETBSD_H_
 #define OS_NETBSD_H_
 
-#define OS_NETBSD_H_CVSID "$Id: os_netbsd.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_NETBSD_H_CVSID "$Id: os_netbsd.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 #include <sys/device.h>
 #include <sys/param.h>
index 1ddef187571ae817d3b9986de4e4a722dee5026b..1c947fee8933486d68bcb7ca07912f47ddee0501 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-10 David Snyder <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-10 David Snyder
  *
- * Derived from os_netbsd.cpp by Sergey Svishchev <smartmontools-support@lists.sourceforge.net>, Copyright (C) 2003-8 
+ * Derived from os_netbsd.cpp by Sergey Svishchev, Copyright (C) 2003-8
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 
 #include <errno.h>
 
-const char * os_openbsd_cpp_cvsid = "$Id: os_openbsd.cpp 4321 2016-05-10 13:43:10Z chrfranke $"
+const char * os_openbsd_cpp_cvsid = "$Id: os_openbsd.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   OS_OPENBSD_H_CVSID;
 
 enum warnings {
index 358627ffaa0be2c9ef66a52f82b3d72eab856ccf..d7aa7d0a9fb74c80d830df89534e00a12edfcc72 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-8 David Snyder <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-8 David Snyder
  *
- * Derived from os_netbsd.c by Sergey Svishchev <smartmontools-support@lists.sourceforge.net>, Copyright (C) 2003-8 
+ * Derived from os_netbsd.c by Sergey Svishchev, Copyright (C) 2003-8
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
 #ifndef OS_OPENBSD_H_
 #define OS_OPENBSD_H_
 
-#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 /* from NetBSD: atareg.h,v 1.17, by Manuel Bouyer */
 /* Actually fits _perfectly_ into OBSDs wdcreg.h, but... */
index 2846f4a054f850fa940f17da07930cfb239f7d36..16f9b273890e9c81700c4de74b6460abff6fc6e0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-8 Yuri Dario <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-8 Yuri Dario
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  */
 
 // These are needed to define prototypes for the functions defined below
+#include "config.h"
+#include "int64.h"
+
+#include <ctype.h>
 #include <errno.h>
 #include "atacmds.h"
 #include "scsicmds.h"
 #include "os_os2.h"
 
 // Needed by '-V' option (CVS versioning) of smartd/smartctl
-const char *os_XXXX_c_cvsid="$Id: os_os2.cpp 4120 2015-08-27 16:12:21Z samm2 $" \
+const char *os_XXXX_c_cvsid="$Id: os_os2.cpp 4431 2017-08-08 19:38:15Z chrfranke $" \
 ATACMDS_H_CVSID OS_XXXX_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
 
 // global handle to device driver
 static HFILE hDevice;
 
-// Please eliminate the following block: both the two #includes and
-// the 'unsupported()' function.  They are only here to warn
-// unsuspecting users that their Operating System is not supported! If
-// you wish, you can use a similar warning mechanism for any of the
-// functions in this file that you can not (or choose not to)
-// implement.
-
-#include "config.h"
-
-typedef struct _IDEREGS {
-       UCHAR  bFeaturesReg;
-       UCHAR  bSectorCountReg;
-       UCHAR  bSectorNumberReg;
-       UCHAR  bCylLowReg;
-       UCHAR  bCylHighReg;
-       UCHAR  bDriveHeadReg;
-       UCHAR  bCommandReg;
-       UCHAR  bReserved;
-} IDEREGS, *PIDEREGS, *LPIDEREGS;
-
-static void unsupported(int which){
-  static int warninggiven[4];
-
-  if (which<0 || which>3)
-    return;
-
-  if (!warninggiven[which]) {
-    char msg;
-    warninggiven[which]=1;
-
-    switch (which) {
-    case 0:
-      msg="generate a list of devices";
-      break;
-    case 1:
-      msg="interface to Marvell-based SATA controllers";
-      break;
-    case 2:
-      msg="interface to 3ware-based RAID controllers";
-      break;
-    case 3:
-      msg="interface to SCSI devices";
-      break;
-    }
-    pout("Under OS/2, smartmontools can not %s\n");
-  }
-  return;
-}
-
 // print examples for smartctl.  You should modify this function so
 // that the device paths are sensible for your OS, and to eliminate
 // unsupported commands (eg, 3ware controllers).
@@ -93,24 +48,21 @@ void print_smartctl_examples(){
   printf("=================================================== SMARTCTL EXAMPLES =====\n\n");
 #ifdef HAVE_GETOPT_LONG
   printf(
-         "  smartctl -a /dev/hda                       (Prints all SMART information)\n\n"
-         "  smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda\n"
+         "  smartctl -a hd0                       (Prints all SMART information)\n\n"
+         "  smartctl --smart=on --offlineauto=on --saveauto=on hd0\n"
          "                                              (Enables SMART on first disk)\n\n"
-         "  smartctl -t long /dev/hda              (Executes extended disk self-test)\n\n"
-         "  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/hda\n"
+         "  smartctl -t long hd0              (Executes extended disk self-test)\n\n"
+         "  smartctl --attributes --log=selftest --quietmode=errorsonly hd0\n"
          "                                      (Prints Self-Test & Attribute errors)\n"
-         "  smartctl -a --device=3ware,2 /dev/sda\n"
-         "          (Prints all SMART info for 3rd ATA disk on 3ware RAID controller)\n"
          );
 #else
   printf(
-         "  smartctl -a /dev/hda                       (Prints all SMART information)\n"
-         "  smartctl -s on -o on -S on /dev/hda         (Enables SMART on first disk)\n"
-         "  smartctl -t long /dev/hda              (Executes extended disk self-test)\n"
-         "  smartctl -A -l selftest -q errorsonly /dev/hda\n"
+         "  smartctl -a hd0                       (Prints all SMART on first disk with DANIS506)\n"
+         "  smartctl -a ahci0                     (Prints all SMART on first disk with OS2AHCI)\n"
+         "  smartctl -s on -o on -S on hd0         (Enables SMART on first disk)\n"
+         "  smartctl -t long hd0              (Executes extended disk self-test)\n"
+         "  smartctl -A -l selftest -q errorsonly hd0\n"
          "                                      (Prints Self-Test & Attribute errors)\n"
-         "  smartctl -a -d 3ware,2 /dev/sda\n"
-         "          (Prints all SMART info for 3rd ATA disk on 3ware RAID controller)\n"
          );
 #endif
   return;
@@ -127,10 +79,8 @@ int guess_device_type (const char* dev_name) {
 
    //printf( "dev_name %s\n", dev_name);
    dev_name = skipdev(dev_name);
-       if (!strncmp(dev_name, "hd", 2))
+       if (!strncmp(dev_name, "hd", 2) || !strncmp(dev_name, "ahci", 4))
                return CONTROLLER_ATA;
-       if (!strncmp(dev_name, "scsi", 4))
-               return CONTROLLER_SCSI;
   return CONTROLLER_UNKNOWN;
 }
 
@@ -140,9 +90,111 @@ int guess_device_type (const char* dev_name) {
 // other N arrays each contain null-terminated character strings.  In
 // the case N==0, no arrays are allocated because the array of 0
 // pointers has zero length, equivalent to calling malloc(0).
+
 int make_device_names (char*** devlist, const char* name) {
-  unsupported(0);
-  return 0;
+
+  int result;
+  int index;
+  const int max_dev = 32; // scan only first 32 devices
+
+  // SCSI is not supported
+  if (strcmp (name, "ATA") != 0)
+    return 0;
+  
+  // try to open DANIS
+  APIRET rc;
+  ULONG ActionTaken;
+  HFILE danisDev, ahciDev;
+  bool is_danis = 0, is_ahci = 0;
+
+  rc = DosOpen ((const char unsigned *)danisdev, &danisDev, &ActionTaken, 0,  FILE_SYSTEM,
+              OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE |
+              OPEN_FLAGS_NOINHERIT | OPEN_ACCESS_READONLY, NULL);
+  if (!rc)
+    is_danis = 1;
+
+  rc = DosOpen ((const char unsigned *)ahcidev, &ahciDev, &ActionTaken, 0,  FILE_SYSTEM,
+              OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE |
+              OPEN_FLAGS_NOINHERIT | OPEN_ACCESS_READONLY, NULL);
+  if (!rc)
+    is_ahci = 1;
+  // Count the devices.
+  result = 0;
+  
+  DSKSP_CommandParameters Parms;
+  ULONG PLen = 1;
+  ULONG IDLen = 512;
+  struct ata_identify_device Id;
+
+  for(int i = 0; i < max_dev; i++) {
+    if (is_ahci) {
+      Parms.byPhysicalUnit = i;
+      rc = DosDevIOCtl (ahciDev, DSKSP_CAT_GENERIC, DSKSP_GET_INQUIRY_DATA,
+                    (PVOID)&Parms, PLen, &PLen, (PVOID)&Id, IDLen, &IDLen);
+      if (!rc) result++;
+    }
+    if (is_danis) {
+      Parms.byPhysicalUnit = i + 0x80;
+      rc = DosDevIOCtl (danisDev, DSKSP_CAT_GENERIC, DSKSP_GET_INQUIRY_DATA,
+                    (PVOID)&Parms, PLen, &PLen, (PVOID)&Id, IDLen, &IDLen);
+      if (!rc) result++;
+    }
+  }
+  *devlist = (char**)calloc (result, sizeof (char *));
+  if (! *devlist)
+    goto error;
+  index = 0;
+
+  // add devices
+  for(int i = 0; i < max_dev; i++) {
+    if (is_ahci) {
+      Parms.byPhysicalUnit = i;
+      rc = DosDevIOCtl (ahciDev, DSKSP_CAT_GENERIC, DSKSP_GET_INQUIRY_DATA,
+                    (PVOID)&Parms, PLen, &PLen, (PVOID)&Id, IDLen, &IDLen);
+      if (!rc) {
+        asprintf(&(*devlist)[index], "ahci%d", i);
+        if (! (*devlist)[index])
+          goto error;
+        index++;
+      }
+    }
+    if (is_danis) {
+      Parms.byPhysicalUnit = i + 0x80;
+      rc = DosDevIOCtl (danisDev, DSKSP_CAT_GENERIC, DSKSP_GET_INQUIRY_DATA,
+                    (PVOID)&Parms, PLen, &PLen, (PVOID)&Id, IDLen, &IDLen);
+      if (!rc) {
+        asprintf(&(*devlist)[index], "hd%d", i);
+        if (! (*devlist)[index])
+          goto error;
+        index++;
+      }
+    }
+  }
+
+  if (is_danis)
+      DosClose( danisDev);
+
+  if (is_ahci)
+      DosClose( ahciDev);
+
+  return result;
+
+ error:
+  if (*devlist)
+    {
+      for (index = 0; index < result; index++)
+        if ((*devlist)[index])
+          free ((*devlist)[index]);
+      free (*devlist);
+    }
+  if (is_danis)
+      DosClose( danisDev);
+
+  if (is_ahci)
+      DosClose( ahciDev);
+
+  return -1;
 }
 
 // Like open().  Return non-negative integer handle, only used by the
@@ -151,33 +203,50 @@ int make_device_names (char*** devlist, const char* name) {
 // array within this file (see os_freebsd.cpp for an example).  If you
 // can not open the device (permission denied, does not exist, etc)
 // set errno as open() does and return <0.
-int deviceopen(const char *pathname, char *type){
+int deviceopen(const char *pathname, char * /* type */ ){
 
-  int fd;
+  int fd = 0;
   APIRET rc;
   ULONG ActionTaken;
+  char * activedev = NULL;
 
+  pathname = skipdev(pathname);
+  // DANIS506 driver
+  if(strlen(pathname) > strlen(danispref)
+    && strncmp(pathname, danispref, strlen(danispref)) == 0) {
+    fd = strtol(pathname + strlen(danispref), NULL, 10) + 0x80;
+    activedev = (char *)danisdev;
+  }
+  // OS2AHCI driver
+  if(strlen(pathname) > strlen(ahcipref)
+    && strncmp(pathname, ahcipref, strlen(ahcipref)) == 0) {
+    fd = strtol(pathname + strlen(ahcipref), NULL, 10);
+    activedev = (char *)ahcidev;
+  }
+
+  if(!activedev) {
+     pout("Error: please specify hdX or ahciX device name\n");
+     return -1;
+  }
   //printf( "deviceopen pathname %s\n", pathname);
-  rc = DosOpen ("\\DEV\\IBMS506$", &hDevice, &ActionTaken, 0,  FILE_SYSTEM,
+  rc = DosOpen ((const char unsigned *)activedev, &hDevice, &ActionTaken, 0,  FILE_SYSTEM,
               OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE |
               OPEN_FLAGS_NOINHERIT | OPEN_ACCESS_READONLY, NULL);
   if (rc) {
     char errmsg[256];
-    snprintf(errmsg,256,"Smartctl open driver IBMS506$ failed (%d)", rc);
+    snprintf(errmsg,256,"Smartctl open driver %s failed (%lu)", activedev, rc);
     errmsg[255]='\0';
     syserror(errmsg);
     return -1;
   }
 
-  pathname = skipdev(pathname);
-  fd = tolower(pathname[2]) - 'a';
-
   return fd;
 }
 
 // Like close().  Acts only on integer handles returned by
 // deviceopen() above.
-int deviceclose(int fd){
+int deviceclose(int /* fd */){
 
   DosClose( hDevice);
   hDevice = NULL;
@@ -185,43 +254,34 @@ int deviceclose(int fd){
   return 0;
 }
 
-static void print_ide_regs(const IDEREGS * r, int out)
-{
-       pout("%s=0x%02x,%s=0x%02x, SC=0x%02x, NS=0x%02x, CL=0x%02x, CH=0x%02x, SEL=0x%02x\n",
-       (out?"STS":"CMD"), r->bCommandReg, (out?"ERR":" FR"), r->bFeaturesReg,
-       r->bSectorCountReg, r->bSectorNumberReg, r->bCylLowReg, r->bCylHighReg, r->bDriveHeadReg);
-}
-
 //
-// OS/2 direct ioctl interface to IBMS506$
+// OS/2 direct ioctl interface to IBMS506$/OS2AHCI$
 //
-int dani_ioctl( int device, int request, void* arg)
+static int dani_ioctl( int device, void* arg)
 {
    unsigned char* buff = (unsigned char*) arg;
    APIRET rc;
    DSKSP_CommandParameters Parms;
    ULONG PLen = 1;
    ULONG DLen = 512; //sizeof (*buf);
-   UCHAR temp;
    ULONG value = 0;
-   IDEREGS  regs;
 
-   //printf( "device %d, request 0x%x, arg[0] 0x%x, arg[2] 0x%x\n", device, request, buff[0], buff[2]);
+   // printf( "device %d, request 0x%x, arg[0] 0x%x, arg[2] 0x%x\n", device, request, buff[0], buff[2]);
 
    Parms.byPhysicalUnit = device;
    switch( buff[0]) {
-   case WIN_IDENTIFY:
+   case ATA_IDENTIFY_DEVICE:
       rc = DosDevIOCtl (hDevice, DSKSP_CAT_GENERIC, DSKSP_GET_INQUIRY_DATA,
-                    (PVOID)&Parms, PLen, &PLen, (PVOID)arg+4, DLen, &DLen);
+                    (PVOID)&Parms, PLen, &PLen, (UCHAR *)arg+4, DLen, &DLen);
       if (rc != 0)
       {
-          printf ("DANIS506 ATA GET HD Failed (%d,0x%x)\n", rc, rc);
+          printf ("DANIS506 ATA DSKSP_GET_INQUIRY_DATA failed (%lu)\n", rc);
           return -1;
       }
       break;
-   case WIN_SMART:
+   case ATA_SMART_CMD:
       switch( buff[2]) {
-      case SMART_STATUS:
+      case ATA_SMART_STATUS:
          DLen = sizeof(value);
          // OS/2 already checks CL/CH in IBM1S506 code!! see s506rte.c (ddk)
          // value: -1=not supported, 0=ok, 1=failing
@@ -229,94 +289,94 @@ int dani_ioctl( int device, int request, void* arg)
                     (PVOID)&Parms, PLen, &PLen, (PVOID)&value, DLen, &DLen);
          if (rc)
          {
-             printf ("DANIS506 ATA GET SMART_STATUS failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET SMART_STATUS failed (%lu)\n", rc);
              return -1;
          }
          buff[4] = (unsigned char)value;
          break;
-      case SMART_READ_VALUES:
+      case ATA_SMART_READ_VALUES:
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_GET_ATTRIBUTES,
-                    (PVOID)&Parms, PLen, &PLen, (PVOID)arg+4, DLen, &DLen);
+                    (PVOID)&Parms, PLen, &PLen, (UCHAR *)arg+4, DLen, &DLen);
          if (rc)
          {
-             printf ("DANIS506 ATA GET DSKSP_SMART_GET_ATTRIBUTES failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_GET_ATTRIBUTES failed (%lu)\n", rc);
              return -1;
          }
          break;
-      case SMART_READ_THRESHOLDS:
+      case ATA_SMART_READ_THRESHOLDS:
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_GET_THRESHOLDS,
-                    (PVOID)&Parms, PLen, &PLen, (PVOID)arg+4, DLen, &DLen);
+                    (PVOID)&Parms, PLen, &PLen, (UCHAR *)arg+4, DLen, &DLen);
          if (rc)
          {
-             printf ("DANIS506 ATA GET DSKSP_SMART_GET_THRESHOLDS failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_GET_THRESHOLDS failed (%lu)\n", rc);
              return -1;
          }
          break;
-      case SMART_READ_LOG_SECTOR:
+      case ATA_SMART_READ_LOG_SECTOR:
          buff[4] = buff[1]; // copy select field
-         rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_READ_LOG,
-                    (PVOID)&Parms, PLen, &PLen, (PVOID)arg+4, DLen, &DLen);
+         rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_GET_LOG,
+                    (PVOID)&Parms, PLen, &PLen, (UCHAR *)arg+4, DLen, &DLen);
          if (rc)
          {
-             printf ("DANIS506 ATA GET DSKSP_SMART_READ_LOG failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_GET_LOG failed (%lu)\n", rc);
              return -1;
          }
          break;
-      case SMART_ENABLE:
+      case ATA_SMART_ENABLE:
          buff[0] = 1; // enable
          DLen = 1;
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_ONOFF,
                            (PVOID)&Parms, PLen, &PLen, (PVOID)buff, DLen, &DLen);
          if (rc) {
-             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%lu)\n", rc);
              return -1;
          }
          break;
-      case SMART_DISABLE:
+      case ATA_SMART_DISABLE:
          buff[0] = 0; // disable
          DLen = 1;
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_ONOFF,
                            (PVOID)&Parms, PLen, &PLen, (PVOID)buff, DLen, &DLen);
          if (rc) {
-             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%lu)\n", rc);
              return -1;
          }
          break;
 #if 0
-      case SMART_AUTO_OFFLINE:
+      case ATA_SMART_AUTO_OFFLINE:
          buff[0] = buff[3];   // select field
          DLen = 1;
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_AUTO_OFFLINE,
                            (PVOID)&Parms, PLen, &PLen, (PVOID)buff, DLen, &DLen);
          if (rc) {
-             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_ONOFF failed (%lu)\n", rc);
              return -1;
          }
          break;
 #endif
-      case SMART_AUTOSAVE:
+      case ATA_SMART_AUTOSAVE:
          buff[0] = buff[3];   // select field
          DLen = 1;
          rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_AUTOSAVE_ONOFF,
                            (PVOID)&Parms, PLen, &PLen, (PVOID)buff, DLen, &DLen);
          if (rc) {
-             printf ("DANIS506 ATA DSKSP_SMART_AUTOSAVE_ONOFF failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA DSKSP_SMART_AUTOSAVE_ONOFF failed (%lu)\n", rc);
              return -1;
          }
          break;
-      case SMART_IMMEDIATE_OFFLINE:
+      case ATA_SMART_IMMEDIATE_OFFLINE:
          buff[0] = buff[1];   // select field
          DLen = 1;
-         rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_EOLI,
+         rc = DosDevIOCtl (hDevice, DSKSP_CAT_SMART, DSKSP_SMART_EXEC_OFFLINE,
                            (PVOID)&Parms, PLen, &PLen, (PVOID)buff, DLen, &DLen);
          if (rc) {
-             printf ("DANIS506 ATA GET DSKSP_SMART_EXEC_OFFLINE failed (%d,0x%x)\n", rc, rc);
+             printf ("DANIS506 ATA GET DSKSP_SMART_EXEC_OFFLINE failed (%lu)\n", rc);
              return -1;
          }
          break;
 
       default:
-         fprintf( stderr, "device %d, request 0x%x, arg[0] 0x%x, arg[2] 0x%x\n", device, request, buff[0], buff[2]);
+         fprintf( stderr, "device %d, arg[0] 0x%x, arg[2] 0x%x\n", device, buff[0], buff[2]);
          fprintf( stderr, "unknown ioctl\n");
          return -1;
          break;
@@ -450,52 +510,14 @@ int ata_command_interface(int device, smart_command_set command, int select, cha
     return -1;
   }
 
-#if 0
-  // This command uses the HDIO_DRIVE_TASKFILE ioctl(). This is the
-  // only ioctl() that can be used to WRITE data to the disk.
-  if (command==WRITE_LOG) {
-    unsigned char task[sizeof(ide_task_request_t)+512];
-    ide_task_request_t *reqtask=(ide_task_request_t *) task;
-    task_struct_t      *taskfile=(task_struct_t *) reqtask->io_ports;
-    int retval;
-
-    memset(task,      0, sizeof(task));
-
-    taskfile->data           = 0;
-    taskfile->feature        = ATA_SMART_WRITE_LOG_SECTOR;
-    taskfile->sector_count   = 1;
-    taskfile->sector_number  = select;
-    taskfile->low_cylinder   = 0x4f;
-    taskfile->high_cylinder  = 0xc2;
-    taskfile->device_head    = 0;
-    taskfile->command        = ATA_SMART_CMD;
-
-    reqtask->data_phase      = TASKFILE_OUT;
-    reqtask->req_cmd         = IDE_DRIVE_TASK_OUT;
-    reqtask->out_size        = 512;
-    reqtask->in_size         = 0;
-
-    // copy user data into the task request structure
-    memcpy(task+sizeof(ide_task_request_t), data, 512);
-
-    if ((retval=dani_ioctl(device, HDIO_DRIVE_TASKFILE, task))) {
-      if (retval==-EINVAL)
-       pout("Kernel lacks HDIO_DRIVE_TASKFILE support; compile kernel with CONFIG_IDE_TASKFILE_IO set\n");
-      return -1;
-    }
-    return 0;
-  }
-#endif // 0
-
-  // We are now doing the HDIO_DRIVE_CMD type ioctl.
-  if ((dani_ioctl(device, HDIO_DRIVE_CMD, buff)))
+  // We are now calling ioctl wrapper to the driver.
+  // TODO: use PASSTHRU in case of OS2AHCI driver
+  if ((dani_ioctl(device, buff)))
     return -1;
 
   // There are two different types of ioctls().  The HDIO_DRIVE_TASK
   // one is this:
   if (command==STATUS_CHECK){
-    int retval;
-
     // Cyl low and Cyl high unchanged means "Good SMART status"
     if (buff[4]==0)
       return 0;
@@ -522,8 +544,8 @@ int ata_command_interface(int device, smart_command_set command, int select, cha
   return 0;
 }
 
-// Interface to SCSI devices.  See os_linux.c
-int do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) {
-  unsupported(3);
+// Interface to SCSI devices. N/A under OS/2
+int do_scsi_cmnd_io(int /* fd */, struct scsi_cmnd_io * /* iop */, int /* report */) {
+  pout("SCSI interface is not implemented\n");
   return -ENOSYS;
 }
index 6a7b1ff78ea7e8d10da1d002319eaa547aa9a19f..6ed52c69284720b79e040c029de5a4a9687b3554 100644 (file)
--- a/os_os2.h
+++ b/os_os2.h
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-8 Yuri Dario <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-8 Yuri Dario
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #ifndef OS_OS2_H_
 #define OS_OS2_H_
 
-#define OS_XXXX_H_CVSID "$Id: os_os2.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_XXXX_H_CVSID "$Id: os_os2.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Additional material should start here.  Note: to keep the '-V' CVS
 // reporting option working as intended, you should only #include
 #define INCL_DOS
 #include <os2.h>
 
-#include "os_os2\hdreg.h"
 #include "os_linux.h"
 
 #pragma pack(1)
 
+/* IOCTL definitions from s506oem.h (primarily required for SMART calls) */
 #define DSKSP_CAT_SMART             0x80  /* SMART IOCTL category */
 #define DSKSP_SMART_ONOFF           0x20  /* turn SMART on or off */
 #define DSKSP_SMART_AUTOSAVE_ONOFF  0x21  /* turn SMART autosave on or off */
 #define DSKSP_SMART_GETSTATUS       0x23  /* get SMART status (pass/fail) */
 #define DSKSP_SMART_GET_ATTRIBUTES  0x24  /* get SMART attributes table */
 #define DSKSP_SMART_GET_THRESHOLDS  0x25  /* get SMART thresholds table */
-#define DSKSP_SMART_READ_LOG        0x26  
-#define DSKSP_SMART_WRITE_LOG       0x27  
-#define DSKSP_SMART_READ_LOG_EXT    0x28  
-#define DSKSP_SMART_WRITE_LOG_EXT   0x29  
-#define DSKSP_SMART_EOLI            0x30  /* EXECUTE OFF-LINE IMMEDIATE */
+#define DSKSP_SMART_GET_LOG         0x26  /* get SMART log        table */
+#define DSKSP_SMART_AUTO_OFFLINE    0x27  /* set SMART offline autosave timer */
+#define DSKSP_SMART_EXEC_OFFLINE 0x28 /* execute SMART immediate offline */
 
 #define SMART_CMD_ON      1   /* on  value for related SMART functions */
 #define SMART_CMD_OFF     0   /* off value for related SMART functions */
@@ -67,4 +65,9 @@ struct SMART_ParamExt {
   ULONG      reserved;        // reserved. must be set to 0
 };
 
+const char * danisdev="\\DEV\\IBMS506$"; // DANIS506
+const char * danispref="hd";
+const char * ahcidev="\\DEV\\OS2AHCI$";  // OS2AHCI
+const char * ahcipref="ahci";
+
 #endif /* OS_GENERIC_H_ */
diff --git a/os_os2/configure.os2 b/os_os2/configure.os2
deleted file mode 100644 (file)
index 121b22c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh
-CFLAGS="-s -Zomf -O3 -march=pentium -mcpu=pentium3" \
-CXXFLAGS="-s -Zomf -O3 -march=pentium -mcpu=pentium3" \
-LDFLAGS="-s -Zmap -Zhigh-mem -Zomf -Zexe -Zstack 0x100" \
-LIBS=" -lsyslog -lsocket" \
-LN_CP_F="cp.exe" \
-RANLIB="echo" \
-AR="emxomfar" \
-./configure --prefix=/usr/local/smartmontools
diff --git a/os_os2/hdreg.h b/os_os2/hdreg.h
deleted file mode 100644 (file)
index 65c4ed1..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-#ifndef _LINUX_HDREG_H
-#define _LINUX_HDREG_H
-
-/*
- * This file contains some defines for the AT-hd-controller.
- * Various sources.  
- */
-
-#define HD_IRQ 14              /* the standard disk interrupt */
-
-/* ide.c has its own port definitions in "ide.h" */
-
-/* Hd controller regs. Ref: IBM AT Bios-listing */
-#define HD_DATA                0x1f0   /* _CTL when writing */
-#define HD_ERROR       0x1f1   /* see err-bits */
-#define HD_NSECTOR     0x1f2   /* nr of sectors to read/write */
-#define HD_SECTOR      0x1f3   /* starting sector */
-#define HD_LCYL                0x1f4   /* starting cylinder */
-#define HD_HCYL                0x1f5   /* high byte of starting cyl */
-#define HD_CURRENT     0x1f6   /* 101dhhhh , d=drive, hhhh=head */
-#define HD_STATUS      0x1f7   /* see status-bits */
-#define HD_FEATURE HD_ERROR    /* same io address, read=error, write=feature */
-#define HD_PRECOMP HD_FEATURE  /* obsolete use of this port - predates IDE */
-#define HD_COMMAND HD_STATUS   /* same io address, read=status, write=cmd */
-
-#define HD_CMD         0x3f6   /* used for resets */
-#define HD_ALTSTATUS   0x3f6   /* same as HD_STATUS but doesn't clear irq */
-
-/* remainder is shared between hd.c, ide.c, ide-cd.c, and the hdparm utility */
-
-/* Bits of HD_STATUS */
-#define ERR_STAT       0x01
-#define INDEX_STAT     0x02
-#define ECC_STAT       0x04    /* Corrected error */
-#define DRQ_STAT       0x08
-#define SEEK_STAT      0x10
-#define WRERR_STAT     0x20
-#define READY_STAT     0x40
-#define BUSY_STAT      0x80
-
-/* Values for HD_COMMAND */
-#define WIN_RESTORE            0x10
-#define WIN_READ               0x20
-#define WIN_WRITE              0x30
-#define WIN_WRITE_VERIFY       0x3C
-#define WIN_VERIFY             0x40
-#define WIN_FORMAT             0x50
-#define WIN_INIT               0x60
-#define WIN_SEEK               0x70
-#define WIN_DIAGNOSE           0x90
-#define WIN_SPECIFY            0x91    /* set drive geometry translation */
-#define WIN_IDLEIMMEDIATE      0xE1    /* force drive to become "ready" */
-#define WIN_SETIDLE1           0xE3
-#define WIN_SETIDLE2           0x97
-
-#define WIN_STANDBYNOW1                0xE0
-#define WIN_STANDBYNOW2                0x94
-#define WIN_SLEEPNOW1          0xE6
-#define WIN_SLEEPNOW2          0x99
-#define WIN_CHECKPOWERMODE1    0xE5
-#define WIN_CHECKPOWERMODE2    0x98
-
-#define WIN_DOORLOCK           0xDE    /* lock door on removable drives */
-#define WIN_DOORUNLOCK         0xDF    /* unlock door on removable drives */
-
-#define WIN_MULTREAD           0xC4    /* read sectors using multiple mode */
-#define WIN_MULTWRITE          0xC5    /* write sectors using multiple mode */
-#define WIN_SETMULT            0xC6    /* enable/disable multiple mode */
-#define WIN_IDENTIFY           0xEC    /* ask drive to identify itself */
-#define WIN_IDENTIFY_DMA       0xEE    /* same as WIN_IDENTIFY, but DMA */
-#define WIN_SETFEATURES                0xEF    /* set special drive features */
-#define WIN_READDMA            0xC8    /* read sectors using DMA transfers */
-#define WIN_WRITEDMA           0xCA    /* write sectors using DMA transfers */
-
-#define WIN_QUEUED_SERVICE     0xA2    /* */
-#define WIN_READDMA_QUEUED     0xC7    /* read sectors using Queued DMA transfers */
-#define WIN_WRITEDMA_QUEUED    0xCC    /* write sectors using Queued DMA transfers */
-
-#define WIN_READ_BUFFER                0xE4    /* force read only 1 sector */
-#define WIN_WRITE_BUFFER       0xE8    /* force write only 1 sector */
-
-#define WIN_SMART              0xB0    /* self-monitoring and reporting */
-
-/* Additional drive command codes used by ATAPI devices. */
-#define WIN_PIDENTIFY          0xA1    /* identify ATAPI device        */
-#define WIN_SRST               0x08    /* ATAPI soft reset command */
-#define WIN_PACKETCMD          0xA0    /* Send a packet command. */
-
-#define DISABLE_SEAGATE                0xFB
-#define EXABYTE_ENABLE_NEST    0xF0
-
-/* WIN_SMART sub-commands */
-
-#define SMART_READ_VALUES      0xd0
-#define SMART_READ_THRESHOLDS  0xd1
-#define SMART_AUTOSAVE         0xd2
-#define SMART_SAVE             0xd3
-#define SMART_IMMEDIATE_OFFLINE        0xd4
-#define SMART_READ_LOG_SECTOR  0xd5
-#define SMART_WRITE_LOG_SECTOR 0xd6
-#define SMART_ENABLE           0xd8
-#define SMART_DISABLE          0xd9
-#define SMART_STATUS           0xda
-#define SMART_AUTO_OFFLINE     0xdb
-
-/* WIN_SETFEATURES sub-commands */
-
-#define SETFEATURES_EN_WCACHE  0x02    /* Enable write cache */
-#define SETFEATURES_XFER       0x03    /* Set transfer mode */
-#      define XFER_UDMA_7      0x47    /* 0100|0111 */
-#      define XFER_UDMA_6      0x46    /* 0100|0110 */
-#      define XFER_UDMA_5      0x45    /* 0100|0101 */
-#      define XFER_UDMA_4      0x44    /* 0100|0100 */
-#      define XFER_UDMA_3      0x43    /* 0100|0011 */
-#      define XFER_UDMA_2      0x42    /* 0100|0010 */
-#      define XFER_UDMA_1      0x41    /* 0100|0001 */
-#      define XFER_UDMA_0      0x40    /* 0100|0000 */
-#      define XFER_MW_DMA_2    0x22    /* 0010|0010 */
-#      define XFER_MW_DMA_1    0x21    /* 0010|0001 */
-#      define XFER_MW_DMA_0    0x20    /* 0010|0000 */
-#      define XFER_SW_DMA_2    0x12    /* 0001|0010 */
-#      define XFER_SW_DMA_1    0x11    /* 0001|0001 */
-#      define XFER_SW_DMA_0    0x10    /* 0001|0000 */
-#      define XFER_PIO_4       0x0C    /* 0000|1100 */
-#      define XFER_PIO_3       0x0B    /* 0000|1011 */
-#      define XFER_PIO_2       0x0A    /* 0000|1010 */
-#      define XFER_PIO_1       0x09    /* 0000|1001 */
-#      define XFER_PIO_0       0x08    /* 0000|1000 */
-#      define XFER_PIO_SLOW    0x00    /* 0000|0000 */
-#define SETFEATURES_DIS_DEFECT 0x04    /* Disable Defect Management */
-#define SETFEATURES_EN_APM     0x05    /* Enable advanced power management */
-#define SETFEATURES_DIS_MSN    0x31    /* Disable Media Status Notification */
-#define SETFEATURES_DIS_RLA    0x55    /* Disable read look-ahead feature */
-#define SETFEATURES_EN_RI      0x5D    /* Enable release interrupt */
-#define SETFEATURES_EN_SI      0x5E    /* Enable SERVICE interrupt */
-#define SETFEATURES_DIS_RPOD   0x66    /* Disable reverting to power on defaults */
-#define SETFEATURES_DIS_WCACHE 0x82    /* Disable write cache */
-#define SETFEATURES_EN_DEFECT  0x84    /* Enable Defect Management */
-#define SETFEATURES_DIS_APM    0x85    /* Disable advanced power management */
-#define SETFEATURES_EN_MSN     0x95    /* Enable Media Status Notification */
-#define SETFEATURES_EN_RLA     0xAA    /* Enable read look-ahead feature */
-#define SETFEATURES_PREFETCH   0xAB    /* Sets drive prefetch value */
-#define SETFEATURES_EN_RPOD    0xCC    /* Enable reverting to power on defaults */
-#define SETFEATURES_DIS_RI     0xDD    /* Disable release interrupt */
-#define SETFEATURES_DIS_SI     0xDE    /* Disable SERVICE interrupt */
-
-/* WIN_SECURITY sub-commands */
-
-#define SECURITY_SET_PASSWORD          0xBA    /* 0xF1 */
-#define SECURITY_UNLOCK                        0xBB    /* 0xF2 */
-#define SECURITY_ERASE_PREPARE         0xBC    /* 0xF3 */
-#define SECURITY_ERASE_UNIT            0xBD    /* 0xF4 */
-#define SECURITY_FREEZE_LOCK           0xBE    /* 0xF5 */
-#define SECURITY_DISABLE_PASSWORD      0xBF    /* 0xF6 */
-
-/* Bits for HD_ERROR */
-#define MARK_ERR       0x01    /* Bad address mark */
-#define TRK0_ERR       0x02    /* couldn't find track 0 */
-#define ABRT_ERR       0x04    /* Command aborted */
-#define MCR_ERR                0x08    /* media change request */
-#define ID_ERR         0x10    /* ID field not found */
-#define ECC_ERR                0x40    /* Uncorrectable ECC error */
-#define        BBD_ERR         0x80    /* pre-EIDE meaning:  block marked bad */
-#define        ICRC_ERR        0x80    /* new meaning:  CRC error during transfer */
-
-struct hd_geometry {
-      unsigned char heads;
-      unsigned char sectors;
-      unsigned short cylinders;
-      unsigned long start;
-};
-
-/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
-#define HDIO_GETGEO            0x0301  /* get device geometry */
-#define HDIO_GET_UNMASKINTR    0x0302  /* get current unmask setting */
-#define HDIO_GET_MULTCOUNT     0x0304  /* get current IDE blockmode setting */
-#define HDIO_OBSOLETE_IDENTITY 0x0307  /* OBSOLETE, DO NOT USE: returns 142 bytes */
-#define HDIO_GET_KEEPSETTINGS  0x0308  /* get keep-settings-on-reset flag */
-#define HDIO_GET_32BIT         0x0309  /* get current io_32bit setting */
-#define HDIO_GET_NOWERR                0x030a  /* get ignore-write-error flag */
-#define HDIO_GET_DMA           0x030b  /* get use-dma flag */
-#define HDIO_GET_NICE          0x030c  /* get nice flags */
-#define HDIO_GET_IDENTITY      0x030d  /* get IDE identification info */
-
-#define HDIO_DRIVE_RESET       0x031c  /* execute a device reset */
-#define HDIO_TRISTATE_HWIF     0x031d  /* execute a channel tristate */
-#ifndef __EMX__
-#define HDIO_DRIVE_TASK                0x031e  /* execute task and special drive command */
-#endif
-#define HDIO_DRIVE_CMD         0x031f  /* execute a special drive command */
-
-#define HDIO_DRIVE_CMD_AEB     HDIO_DRIVE_TASK
-
-/* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
-#define HDIO_SET_MULTCOUNT     0x0321  /* change IDE blockmode */
-#define HDIO_SET_UNMASKINTR    0x0322  /* permit other irqs during I/O */
-#define HDIO_SET_KEEPSETTINGS  0x0323  /* keep ioctl settings on reset */
-#define HDIO_SET_32BIT         0x0324  /* change io_32bit flags */
-#define HDIO_SET_NOWERR                0x0325  /* change ignore-write-error flag */
-#define HDIO_SET_DMA           0x0326  /* change use-dma flag */
-#define HDIO_SET_PIO_MODE      0x0327  /* reconfig interface to new speed */
-#define HDIO_SCAN_HWIF         0x0328  /* register and (re)scan interface */
-#define HDIO_SET_NICE          0x0329  /* set nice flags */
-#define HDIO_UNREGISTER_HWIF   0x032a  /* unregister interface */
-
-/* BIG GEOMETRY */
-struct hd_big_geometry {
-       unsigned char heads;
-       unsigned char sectors;
-       unsigned int cylinders;
-       unsigned long start;
-};
-
-/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
-#define HDIO_GETGEO_BIG                0x0330  /* */
-#define HDIO_GETGEO_BIG_RAW    0x0331  /* */
-
-#define __NEW_HD_DRIVE_ID
-/* structure returned by HDIO_GET_IDENTITY, as per ANSI ATA2 rev.2f spec */
-struct hd_driveid {
-       unsigned short  config;         /* lots of obsolete bit flags */
-       unsigned short  cyls;           /* "physical" cyls */
-       unsigned short  reserved2;      /* reserved (word 2) */
-       unsigned short  heads;          /* "physical" heads */
-       unsigned short  track_bytes;    /* unformatted bytes per track */
-       unsigned short  sector_bytes;   /* unformatted bytes per sector */
-       unsigned short  sectors;        /* "physical" sectors per track */
-       unsigned short  vendor0;        /* vendor unique */
-       unsigned short  vendor1;        /* vendor unique */
-       unsigned short  vendor2;        /* vendor unique */
-       unsigned char   serial_no[20];  /* 0 = not_specified */
-       unsigned short  buf_type;
-       unsigned short  buf_size;       /* 512 byte increments; 0 = not_specified */
-       unsigned short  ecc_bytes;      /* for r/w long cmds; 0 = not_specified */
-       unsigned char   fw_rev[8];      /* 0 = not_specified */
-       unsigned char   model[40];      /* 0 = not_specified */
-       unsigned char   max_multsect;   /* 0=not_implemented */
-       unsigned char   vendor3;        /* vendor unique */
-       unsigned short  dword_io;       /* 0=not_implemented; 1=implemented */
-       unsigned char   vendor4;        /* vendor unique */
-       unsigned char   capability;     /* bits 0:DMA 1:LBA 2:IORDYsw 3:IORDYsup*/
-       unsigned short  reserved50;     /* reserved (word 50) */
-       unsigned char   vendor5;        /* vendor unique */
-       unsigned char   tPIO;           /* 0=slow, 1=medium, 2=fast */
-       unsigned char   vendor6;        /* vendor unique */
-       unsigned char   tDMA;           /* 0=slow, 1=medium, 2=fast */
-       unsigned short  field_valid;    /* bits 0:cur_ok 1:eide_ok */
-       unsigned short  cur_cyls;       /* logical cylinders */
-       unsigned short  cur_heads;      /* logical heads */
-       unsigned short  cur_sectors;    /* logical sectors per track */
-       unsigned short  cur_capacity0;  /* logical total sectors on drive */
-       unsigned short  cur_capacity1;  /*  (2 words, misaligned int)     */
-       unsigned char   multsect;       /* current multiple sector count */
-       unsigned char   multsect_valid; /* when (bit0==1) multsect is ok */
-       unsigned int    lba_capacity;   /* total number of sectors */
-       unsigned short  dma_1word;      /* single-word dma info */
-       unsigned short  dma_mword;      /* multiple-word dma info */
-       unsigned short  eide_pio_modes; /* bits 0:mode3 1:mode4 */
-       unsigned short  eide_dma_min;   /* min mword dma cycle time (ns) */
-       unsigned short  eide_dma_time;  /* recommended mword dma cycle time (ns) */
-       unsigned short  eide_pio;       /* min cycle time (ns), no IORDY  */
-       unsigned short  eide_pio_iordy; /* min cycle time (ns), with IORDY */
-       unsigned short  words69_70[2];  /* reserved words 69-70 */
-       /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
-       unsigned short  words71_74[4];  /* reserved words 71-74 */
-       unsigned short  queue_depth;    /*  */
-       unsigned short  words76_79[4];  /* reserved words 76-79 */
-       unsigned short  major_rev_num;  /*  */
-       unsigned short  minor_rev_num;  /*  */
-       unsigned short  command_set_1;  /* bits 0:Smart 1:Security 2:Removable 3:PM */
-       unsigned short  command_set_2;  /* bits 14:Smart Enabled 13:0 zero */
-       unsigned short  cfsse;          /* command set-feature supported extensions */
-       unsigned short  cfs_enable_1;   /* command set-feature enabled */
-       unsigned short  cfs_enable_2;   /* command set-feature enabled */
-       unsigned short  csf_default;    /* command set-feature default */
-       unsigned short  dma_ultra;      /*  */
-       unsigned short  word89;         /* reserved (word 89) */
-       unsigned short  word90;         /* reserved (word 90) */
-       unsigned short  CurAPMvalues;   /* current APM values */
-       unsigned short  word92;         /* reserved (word 92) */
-       unsigned short  hw_config;      /* hardware config */
-       unsigned short  words94_125[32];/* reserved words 94-125 */
-       unsigned short  last_lun;       /* reserved (word 126) */
-       unsigned short  word127;        /* reserved (word 127) */
-       unsigned short  dlf;            /* device lock function
-                                        * 15:9 reserved
-                                        * 8    security level 1:max 0:high
-                                        * 7:6  reserved
-                                        * 5    enhanced erase
-                                        * 4    expire
-                                        * 3    frozen
-                                        * 2    locked
-                                        * 1    en/disabled
-                                        * 0    capability
-                                        */
-       unsigned short  csfo;           /* current set features options
-                                        * 15:4 reserved
-                                        * 3    auto reassign
-                                        * 2    reverting
-                                        * 1    read-look-ahead
-                                        * 0    write cache
-                                        */
-       unsigned short  words130_155[26];/* reserved vendor words 130-155 */
-       unsigned short  word156;
-       unsigned short  words157_159[3];/* reserved vendor words 157-159 */
-       unsigned short  words160_255[95];/* reserved words 160-255 */
-};
-
-/*
- * IDE "nice" flags. These are used on a per drive basis to determine
- * when to be nice and give more bandwidth to the other devices which
- * share the same IDE bus.
- */
-#define IDE_NICE_DSC_OVERLAP   (0)     /* per the DSC overlap protocol */
-#define IDE_NICE_ATAPI_OVERLAP (1)     /* not supported yet */
-#define IDE_NICE_0             (2)     /* when sure that it won't affect us */
-#define IDE_NICE_1             (3)     /* when probably won't affect us much */
-#define IDE_NICE_2             (4)     /* when we know it's on our expense */
-
-#ifdef __KERNEL__
-/*
- * These routines are used for kernel command line parameters from main.c:
- */
-#include <linux/config.h>
-
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-int ide_register(int io_port, int ctl_port, int irq);
-void ide_unregister(unsigned int);
-#endif /* CONFIG_BLK_DEV_IDE || CONFIG_BLK_DEV_IDE_MODULE */
-
-#endif  /* __KERNEL__ */
-
-#endif /* _LINUX_HDREG_H */
index f6d4697f2089e9c0631d654356231851a781e8a4..189b8563c773287eb50e59b7567a735579e013a8 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) Joerg Hering       <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2003-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) Joerg Hering
+ * Copyright (C) 2003-8 Bruce Allen
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
  */
 #ifndef OS_QNXNTO_H_
 #define OS_QNXNTO_H_
-#define OS_QNXNTO_H_CVSID "$Id: os_qnxnto.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_QNXNTO_H_CVSID "$Id: os_qnxnto.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Additional material should start here.  Note: to keep the '-V' CVS
 // reporting option working as intended, you should only #include
index 3d8d1bbe5e82abc973e1a69237d3df88ae0612ee..79c2c3e33c05b13103079a2e67749d2814c47b0c 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2003-8 SAWADA Keiji <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2003-8 Casper Dik <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2003-8 SAWADA Keiji
+ * Copyright (C) 2003-8 Casper Dik
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 #ifndef OS_SOLARIS_H_
 #define OS_SOLARIS_H_
 
-#define OS_SOLARIS_H_CVSID "$Id: os_solaris.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define OS_SOLARIS_H_CVSID "$Id: os_solaris.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Additional material should start here.  Note: to keep the '-V' CVS
 // reporting option working as intended, you should only #include
index b10e9215081d4c774787d5e29e08a1fd1a5b3aa4..bce23f11cecd46df182605230fc062065a4a5093 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-16 Christian Franke
+ * Copyright (C) 2004-17 Christian Franke
  *
  * Original AACRaid code:
  *  Copyright (C) 2015    Nidhi Malhotra <nidhi.malhotra@pmcs.com>
 #define strnicmp strncasecmp
 #endif
 
-const char * os_win32_cpp_cvsid = "$Id: os_win32.cpp 4293 2016-04-14 19:33:05Z chrfranke $";
+const char * os_win32_cpp_cvsid = "$Id: os_win32.cpp 4559 2017-10-22 16:17:50Z chrfranke $";
 
 /////////////////////////////////////////////////////////////////////////////
 // Windows I/O-controls, some declarations are missing in the include files
@@ -276,6 +276,45 @@ ASSERT_SIZEOF(STORAGE_DEVICE_DESCRIPTOR, 36+1+3);
 ASSERT_SIZEOF(STORAGE_PROPERTY_QUERY, 8+1+3);
 
 
+// IOCTL_STORAGE_QUERY_PROPERTY: Windows 10 enhancements
+
+namespace win10 {
+
+  // enum STORAGE_PROPERTY_ID: new values
+  const STORAGE_PROPERTY_ID StorageAdapterProtocolSpecificProperty = (STORAGE_PROPERTY_ID)49;
+  const STORAGE_PROPERTY_ID StorageDeviceProtocolSpecificProperty = (STORAGE_PROPERTY_ID)50;
+
+  typedef enum _STORAGE_PROTOCOL_TYPE {
+    ProtocolTypeUnknown = 0,
+    ProtocolTypeScsi,
+    ProtocolTypeAta,
+    ProtocolTypeNvme,
+    ProtocolTypeSd
+  } STORAGE_PROTOCOL_TYPE;
+
+  typedef enum _STORAGE_PROTOCOL_NVME_DATA_TYPE {
+    NVMeDataTypeUnknown = 0,
+    NVMeDataTypeIdentify,
+    NVMeDataTypeLogPage,
+    NVMeDataTypeFeature
+  } STORAGE_PROTOCOL_NVME_DATA_TYPE;
+
+  typedef struct _STORAGE_PROTOCOL_SPECIFIC_DATA {
+    STORAGE_PROTOCOL_TYPE ProtocolType;
+    ULONG DataType;
+    ULONG ProtocolDataRequestValue;
+    ULONG ProtocolDataRequestSubValue;
+    ULONG ProtocolDataOffset;
+    ULONG ProtocolDataLength;
+    ULONG FixedProtocolReturnData;
+    ULONG Reserved[3];
+  } STORAGE_PROTOCOL_SPECIFIC_DATA;
+
+  ASSERT_SIZEOF(STORAGE_PROTOCOL_SPECIFIC_DATA, 40);
+
+} // namespace win10
+
+
 // IOCTL_STORAGE_PREDICT_FAILURE
 
 ASSERT_CONST(IOCTL_STORAGE_PREDICT_FAILURE, 0x002d1100);
@@ -1958,6 +1997,8 @@ class csmi_device
 : virtual public /*extends*/ smart_device
 {
 public:
+  enum { max_number_of_ports = 32 };
+
   /// Get bitmask of used ports
   unsigned get_ports_used();
 
@@ -1966,8 +2007,10 @@ protected:
     : smart_device(never_called)
     { memset(&m_phy_ent, 0, sizeof(m_phy_ent)); }
 
-  /// Get phy info
-  bool get_phy_info(CSMI_SAS_PHY_INFO & phy_info);
+  typedef signed char port_2_index_map[max_number_of_ports];
+
+  /// Get phy info and port mapping, return #ports or -1 on error
+  int get_phy_info(CSMI_SAS_PHY_INFO & phy_info, port_2_index_map & p2i);
 
   /// Select physical drive
   bool select_port(int port);
@@ -1987,13 +2030,18 @@ private:
 
 /////////////////////////////////////////////////////////////////////////////
 
-bool csmi_device::get_phy_info(CSMI_SAS_PHY_INFO & phy_info)
+int csmi_device::get_phy_info(CSMI_SAS_PHY_INFO & phy_info, port_2_index_map & p2i)
 {
+  // max_number_of_ports must match CSMI_SAS_PHY_INFO.Phy[] array size
+  typedef char ASSERT_phy_info_size[
+    (int)(sizeof(phy_info.Phy) / sizeof(phy_info.Phy[0])) == max_number_of_ports ? 1 : -1]
+    ATTR_UNUSED;
+
   // Get driver info to check CSMI support
   CSMI_SAS_DRIVER_INFO_BUFFER driver_info_buf;
   memset(&driver_info_buf, 0, sizeof(driver_info_buf));
   if (!csmi_ioctl(CC_CSMI_SAS_GET_DRIVER_INFO, &driver_info_buf.IoctlHeader, sizeof(driver_info_buf)))
-    return false;
+    return -1;
 
   if (scsi_debugmode > 1) {
     const CSMI_SAS_DRIVER_INFO & driver_info = driver_info_buf.Information;
@@ -2007,26 +2055,78 @@ bool csmi_device::get_phy_info(CSMI_SAS_PHY_INFO & phy_info)
   CSMI_SAS_PHY_INFO_BUFFER phy_info_buf;
   memset(&phy_info_buf, 0, sizeof(phy_info_buf));
   if (!csmi_ioctl(CC_CSMI_SAS_GET_PHY_INFO, &phy_info_buf.IoctlHeader, sizeof(phy_info_buf)))
-    return false;
+    return -1;
 
   phy_info = phy_info_buf.Information;
 
-  const int max_number_of_phys = sizeof(phy_info.Phy) / sizeof(phy_info.Phy[0]);
-  if (phy_info.bNumberOfPhys > max_number_of_phys)
-    return set_err(EIO, "CSMI_SAS_PHY_INFO: Bogus NumberOfPhys=%d", phy_info.bNumberOfPhys);
+  if (phy_info.bNumberOfPhys > max_number_of_ports) {
+    set_err(EIO, "CSMI_SAS_PHY_INFO: Bogus NumberOfPhys=%d", phy_info.bNumberOfPhys);
+    return -1;
+  }
+
+  // Create port -> index map
+  //                                 IRST Release
+  // Phy[i].Value               9.x   10.4   14.8   15.2
+  // ---------------------------------------------------
+  // bPortIdentifier           0xff   0xff   port   0x00
+  // Identify.bPhyIdentifier   port   port   port   port
+  // Attached.bPhyIdentifier   0x00   0x00   0x00   port
+  // Empty ports in Phy[]?     no     ?      yes    yes
+
+  int number_of_ports;
+  for (int mode = 0; ; mode++) {
+     for (int i = 0; i < max_number_of_ports; i++)
+       p2i[i] = -1;
+
+     number_of_ports = 0;
+     bool unique = true;
+     for (int i = 0; i < max_number_of_ports; i++) {
+        const CSMI_SAS_PHY_ENTITY & pe = phy_info.Phy[i];
+        if (pe.Identify.bDeviceType == CSMI_SAS_NO_DEVICE_ATTACHED)
+          continue;
+
+        // Use a bPhyIdentifier or the bPortIdentifier if unique,
+        // otherwise use table index
+        int port;
+        switch (mode) {
+          case 0:  port = pe.Attached.bPhyIdentifier; break;
+          case 1:  port = pe.Identify.bPhyIdentifier; break;
+          case 2:  port = pe.bPortIdentifier; break;
+          default: port = i; break;
+        }
+        if (!(port < max_number_of_ports && p2i[port] == -1)) {
+          unique = false;
+          break;
+        }
+
+        p2i[port] = i;
+        if (number_of_ports <= port)
+          number_of_ports = port + 1;
+     }
+
+     if (unique || mode > 2)
+       break;
+  }
 
   if (scsi_debugmode > 1) {
     pout("CSMI_SAS_PHY_INFO: NumberOfPhys=%d\n", phy_info.bNumberOfPhys);
-    for (int i = 0; i < max_number_of_phys; i++) {
+    for (int i = 0; i < max_number_of_ports; i++) {
       const CSMI_SAS_PHY_ENTITY & pe = phy_info.Phy[i];
       const CSMI_SAS_IDENTIFY & id = pe.Identify, & at = pe.Attached;
       if (id.bDeviceType == CSMI_SAS_NO_DEVICE_ATTACHED)
         continue;
 
-      pout("Phy[%d] Port:   0x%02x\n", i, pe.bPortIdentifier);
+      int port = -1;
+      for (int p = 0; p < max_number_of_ports && port < 0; p++) {
+        if (p2i[p] == i)
+          port = p;
+      }
+
+      pout("Phy[%d] Port:   %d\n", i, port);
       pout("  Type:        0x%02x, 0x%02x\n", id.bDeviceType, at.bDeviceType);
       pout("  InitProto:   0x%02x, 0x%02x\n", id.bInitiatorPortProtocol, at.bInitiatorPortProtocol);
       pout("  TargetProto: 0x%02x, 0x%02x\n", id.bTargetPortProtocol, at.bTargetPortProtocol);
+      pout("  PortIdent:   0x%02x\n", pe.bPortIdentifier);
       pout("  PhyIdent:    0x%02x, 0x%02x\n", id.bPhyIdentifier, at.bPhyIdentifier);
       const unsigned char * b = id.bSASAddress;
       pout("  SASAddress:  %02x %02x %02x %02x %02x %02x %02x %02x, ",
@@ -2037,20 +2137,23 @@ bool csmi_device::get_phy_info(CSMI_SAS_PHY_INFO & phy_info)
     }
   }
 
-  return true;
+  return number_of_ports;
 }
 
 unsigned csmi_device::get_ports_used()
 {
   CSMI_SAS_PHY_INFO phy_info;
-  if (!get_phy_info(phy_info))
+  port_2_index_map p2i;
+  int number_of_ports = get_phy_info(phy_info, p2i);
+  if (number_of_ports < 0)
     return 0;
 
   unsigned ports_used = 0;
-  for (unsigned i = 0; i < sizeof(phy_info.Phy) / sizeof(phy_info.Phy[0]); i++) {
-    const CSMI_SAS_PHY_ENTITY & pe = phy_info.Phy[i];
-    if (pe.Identify.bDeviceType == CSMI_SAS_NO_DEVICE_ATTACHED)
+  for (int p = 0; p < max_number_of_ports; p++) {
+    int i = p2i[p];
+    if (i < 0)
       continue;
+    const CSMI_SAS_PHY_ENTITY & pe = phy_info.Phy[i];
     if (pe.Attached.bDeviceType == CSMI_SAS_NO_DEVICE_ATTACHED)
       continue;
     switch (pe.Attached.bTargetPortProtocol) {
@@ -2061,55 +2164,30 @@ unsigned csmi_device::get_ports_used()
         continue;
     }
 
-    if (pe.bPortIdentifier == 0xff)
-      // Older (<= 9.*) Intel RST driver
-      ports_used |= (1 << i);
-    else
-      ports_used |= (1 << pe.bPortIdentifier);
+    ports_used |= (1 << p);
   }
 
   return ports_used;
 }
 
-
 bool csmi_device::select_port(int port)
 {
+  if (!(0 <= port && port < max_number_of_ports))
+    return set_err(EINVAL, "Invalid port number %d", port);
+
   CSMI_SAS_PHY_INFO phy_info;
-  if (!get_phy_info(phy_info))
+  port_2_index_map p2i;
+  int number_of_ports = get_phy_info(phy_info, p2i);
+  if (number_of_ports < 0)
     return false;
 
-  // Find port
-  int max_port = -1, port_index = -1;
-  for (unsigned i = 0; i < sizeof(phy_info.Phy) / sizeof(phy_info.Phy[0]); i++) {
-    const CSMI_SAS_PHY_ENTITY & pe = phy_info.Phy[i];
-    if (pe.Identify.bDeviceType == CSMI_SAS_NO_DEVICE_ATTACHED)
-      continue;
-
-    if (pe.bPortIdentifier == 0xff) {
-      // Older (<= 9.*) Intel RST driver
-      max_port = phy_info.bNumberOfPhys - 1;
-      if (i >= phy_info.bNumberOfPhys)
-        break;
-      if ((int)i != port)
-        continue;
-    }
-    else {
-      if (pe.bPortIdentifier > max_port)
-        max_port = pe.bPortIdentifier;
-      if (pe.bPortIdentifier != port)
-        continue;
-    }
-
-    port_index = i;
-    break;
-  }
-
+  int port_index = p2i[port];
   if (port_index < 0) {
-    if (port <= max_port)
+    if (port < number_of_ports)
       return set_err(ENOENT, "Port %d is disabled", port);
     else
       return set_err(ENOENT, "Port %d does not exist (#ports: %d)", port,
-        max_port + 1);
+        number_of_ports);
   }
 
   const CSMI_SAS_PHY_ENTITY & phy_ent = phy_info.Phy[port_index];
@@ -2155,7 +2233,7 @@ bool csmi_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
     ata_device::supports_output_regs |
     ata_device::supports_multi_sector |
     ata_device::supports_48bit,
-    "CMSI")
+    "CSMI")
   )
     return false;
 
@@ -3422,7 +3500,7 @@ bool win_aacraid_device::scsi_pass_through(struct scsi_cmnd_io *iop)
       }
     else
       j += snprintf(&buff[j], (sz > j ? (sz - j) : 0), "]\n");
-      pout("buff %s\n",buff);
+    pout("buff %s\n",buff);
   }
 
   char ioBuffer[1000];
@@ -3674,7 +3752,7 @@ bool win_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & o
 
   // Set NVMe command
   pthru->SrbIoCtrl.HeaderLength = sizeof(SRB_IO_CONTROL);
-  memcpy(pthru->SrbIoCtrl.Signature, NVME_SIG_STR, sizeof(NVME_SIG_STR));
+  memcpy(pthru->SrbIoCtrl.Signature, NVME_SIG_STR, sizeof(NVME_SIG_STR)-1);
   pthru->SrbIoCtrl.Timeout = 60;
   pthru->SrbIoCtrl.ControlCode = NVME_PASS_THROUGH_SRB_IO_CODE;
   pthru->SrbIoCtrl.ReturnCode = 0;
@@ -3721,6 +3799,169 @@ bool win_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & o
 }
 
 
+/////////////////////////////////////////////////////////////////////////////
+// win10_nvme_device
+
+class win10_nvme_device
+: public /*implements*/ nvme_device,
+  public /*extends*/ win_smart_device
+{
+public:
+  win10_nvme_device(smart_interface * intf, const char * dev_name,
+    const char * req_type, unsigned nsid);
+
+  virtual bool open();
+
+  virtual bool nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out);
+
+private:
+  bool open(int phydrive);
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+win10_nvme_device::win10_nvme_device(smart_interface * intf, const char * dev_name,
+  const char * req_type, unsigned nsid)
+: smart_device(intf, dev_name, "nvme", req_type),
+  nvme_device(nsid)
+{
+}
+
+bool win10_nvme_device::open()
+{
+  // TODO: Use common /dev/ parsing functions
+  const char * name = skipdev(get_dev_name()); int len = strlen(name);
+  // sd[a-z]([a-z])? => Physical drive 0-701
+  char drive[2 + 1] = ""; int n = -1;
+  if (sscanf(name, "sd%2[a-z]%n", drive, &n) == 1 && n == len)
+    return open(sdxy_to_phydrive(drive));
+
+  // pdN => Physical drive N
+  int phydrive = -1; n = -1;
+  if (sscanf(name, "pd%d%n", &phydrive, &n) == 1 && phydrive >= 0 && n == len)
+    return open(phydrive);
+
+  return set_err(EINVAL);
+}
+
+bool win10_nvme_device::open(int phydrive)
+{
+  // TODO: Use common open function for all devices using "\\.\PhysicalDriveN"
+  char devpath[64];
+  snprintf(devpath, sizeof(devpath) - 1, "\\\\.\\PhysicalDrive%d", phydrive);
+
+  // No GENERIC_READ/WRITE access required, this works without admin rights
+  HANDLE h = CreateFileA(devpath, 0, FILE_SHARE_READ | FILE_SHARE_WRITE,
+    (SECURITY_ATTRIBUTES *)0, OPEN_EXISTING, 0, (HANDLE)0);
+
+  if (h == INVALID_HANDLE_VALUE) {
+    long err = GetLastError();
+    if (nvme_debugmode > 1)
+      pout("  %s: Open failed, Error=%ld\n", devpath, err);
+    if (err == ERROR_FILE_NOT_FOUND)
+      set_err(ENOENT, "%s: not found", devpath);
+    else if (err == ERROR_ACCESS_DENIED)
+      set_err(EACCES, "%s: access denied", devpath);
+    else
+      set_err(EIO, "%s: Error=%ld", devpath, err);
+    return false;
+  }
+
+  if (nvme_debugmode > 1)
+    pout("  %s: successfully opened\n", devpath);
+
+  set_fh(h);
+
+  // Use broadcast namespace if no NSID specified
+  // TODO: Get NSID of current device
+  if (!get_nsid())
+    set_nsid(0xffffffff);
+  return true;
+}
+
+struct STORAGE_PROTOCOL_SPECIFIC_QUERY_WITH_BUFFER
+{
+  struct { // STORAGE_PROPERTY_QUERY without AdditionalsParameters[1]
+    STORAGE_PROPERTY_ID PropertyId;
+    STORAGE_QUERY_TYPE QueryType;
+  } PropertyQuery;
+  win10::STORAGE_PROTOCOL_SPECIFIC_DATA ProtocolSpecific;
+  BYTE DataBuffer[1];
+};
+
+bool win10_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & out)
+{
+  // Create buffer with appropriate size
+  raw_buffer spsq_raw_buf(offsetof(STORAGE_PROTOCOL_SPECIFIC_QUERY_WITH_BUFFER, DataBuffer) + in.size);
+  STORAGE_PROTOCOL_SPECIFIC_QUERY_WITH_BUFFER * spsq =
+    reinterpret_cast<STORAGE_PROTOCOL_SPECIFIC_QUERY_WITH_BUFFER *>(spsq_raw_buf.data());
+
+  // Set NVMe specifc STORAGE_PROPERTY_QUERY
+  spsq->PropertyQuery.QueryType = PropertyStandardQuery;
+  spsq->ProtocolSpecific.ProtocolType = win10::ProtocolTypeNvme;
+
+  switch (in.opcode) {
+    case smartmontools::nvme_admin_identify:
+      if (!in.nsid) // Identify controller
+        spsq->PropertyQuery.PropertyId = win10::StorageAdapterProtocolSpecificProperty;
+      else
+        spsq->PropertyQuery.PropertyId = win10::StorageDeviceProtocolSpecificProperty;
+      spsq->ProtocolSpecific.DataType = win10::NVMeDataTypeIdentify;
+      spsq->ProtocolSpecific.ProtocolDataRequestValue = in.cdw10;
+      break;
+    case smartmontools::nvme_admin_get_log_page:
+      spsq->PropertyQuery.PropertyId = win10::StorageDeviceProtocolSpecificProperty;
+      spsq->ProtocolSpecific.DataType = win10::NVMeDataTypeLogPage;
+      spsq->ProtocolSpecific.ProtocolDataRequestValue = in.cdw10 & 0xff; // LID only ?
+      break;
+    // TODO: nvme_admin_get_features
+    default:
+      return set_err(ENOSYS, "NVMe admin command 0x%02x not supported", in.opcode);
+  }
+
+  spsq->ProtocolSpecific.ProtocolDataRequestSubValue = in.nsid; // ?
+  spsq->ProtocolSpecific.ProtocolDataOffset = sizeof(spsq->ProtocolSpecific);
+  spsq->ProtocolSpecific.ProtocolDataLength = in.size;
+
+  if (in.direction() & nvme_cmd_in::data_out)
+    memcpy(spsq->DataBuffer, in.buffer, in.size);
+
+  if (nvme_debugmode > 1)
+    pout("  [STORAGE_QUERY_PROPERTY: Id=%u, Type=%u, Value=0x%08x, SubVal=0x%08x]\n",
+         (unsigned)spsq->PropertyQuery.PropertyId,
+         (unsigned)spsq->ProtocolSpecific.DataType,
+         (unsigned)spsq->ProtocolSpecific.ProtocolDataRequestValue,
+         (unsigned)spsq->ProtocolSpecific.ProtocolDataRequestSubValue);
+
+  // Call IOCTL_STORAGE_QUERY_PROPERTY
+  DWORD num_out = 0;
+  long err = 0;
+  if (!DeviceIoControl(get_fh(), IOCTL_STORAGE_QUERY_PROPERTY,
+        spsq, spsq_raw_buf.size(), spsq, spsq_raw_buf.size(),
+        &num_out, (OVERLAPPED*)0)) {
+    err = GetLastError();
+  }
+
+  if (nvme_debugmode > 1)
+    pout("  [STORAGE_QUERY_PROPERTY: ReturnData=0x%08x, Reserved[3]={0x%x, 0x%x, 0x%x}]\n",
+    (unsigned)spsq->ProtocolSpecific.FixedProtocolReturnData,
+      (unsigned)spsq->ProtocolSpecific.Reserved[0],
+      (unsigned)spsq->ProtocolSpecific.Reserved[1],
+      (unsigned)spsq->ProtocolSpecific.Reserved[2]);
+
+  // NVMe status is checked by IOCTL
+  if (err)
+    return set_err(EIO, "IOCTL_STORAGE_QUERY_PROPERTY(NVMe) failed, Error=%ld", err);
+
+  if (in.direction() & nvme_cmd_in::data_in)
+    memcpy(in.buffer, spsq->DataBuffer, in.size);
+
+  out.result = spsq->ProtocolSpecific.FixedProtocolReturnData; // Completion DW0 ?
+  return true;
+}
+
+
 /////////////////////////////////////////////////////////////////////////////
 // win_smart_interface
 // Platform specific interface
@@ -3806,20 +4047,40 @@ std::string win_smart_interface::get_os_version_str()
   }
 
   const char * w = 0;
+  unsigned build = 0;
   if (   vi.dwPlatformId == VER_PLATFORM_WIN32_NT
       && vi.dwMajorVersion <= 0xf && vi.dwMinorVersion <= 0xf) {
-    bool ws = (vi.wProductType <= VER_NT_WORKSTATION);
-    switch (vi.dwMajorVersion << 4 | vi.dwMinorVersion) {
-      case 0x50: w =       "2000";              break;
-      case 0x51: w =       "xp";                break;
-      case 0x52: w = (!GetSystemMetrics(89/*SM_SERVERR2*/)
-                         ? "2003"  : "2003r2"); break;
-      case 0x60: w = (ws ? "vista" : "2008"  ); break;
-      case 0x61: w = (ws ? "win7"  : "2008r2"); break;
-      case 0x62: w = (ws ? "win8"  : "2012"  ); break;
-      case 0x63: w = (ws ? "win8.1": "2012r2"); break;
-      case 0x64: w = (ws ? "w10tp" : "w10tps"); break; //  6.4 = Win 10 Technical Preview
-      case 0xa0: w = (ws ? "win10" : "2016"  ); break; // 10.0 = Win 10 : Win Server 2016 (TP only?)
+    switch (  (vi.dwMajorVersion << 4 | vi.dwMinorVersion) << 1
+            | (vi.wProductType > VER_NT_WORKSTATION ? 1 : 0)   ) {
+      case 0x50<<1    :
+      case 0x50<<1 | 1: w = "2000";     break;
+      case 0x51<<1    : w = "xp";       break;
+      case 0x52<<1    : w = "xp64";     break;
+      case 0x52<<1 | 1: w = (!GetSystemMetrics(89/*SM_SERVERR2*/)
+                          ? "2003"
+                          : "2003r2");  break;
+      case 0x60<<1    : w = "vista";    break;
+      case 0x60<<1 | 1: w = "2008";     break;
+      case 0x61<<1    : w = "win7";     break;
+      case 0x61<<1 | 1: w = "2008r2";   break;
+      case 0x62<<1    : w = "win8";     break;
+      case 0x62<<1 | 1: w = "2012";     break;
+      case 0x63<<1    : w = "win8.1";   break;
+      case 0x63<<1 | 1: w = "2012r2";   break;
+      case 0xa0<<1    :
+        switch (vi.dwBuildNumber) {
+          case 10240:   w = "w10-1507"; break;
+          case 10586:   w = "w10-1511"; break;
+          case 14393:   w = "w10-1607"; break;
+          case 15063:   w = "w10-1703"; break;
+          case 16299:   w = "w10-1709"; break;
+          default:      w = "w10";  build = vi.dwBuildNumber; break;
+        } break;
+      case 0xa0<<1 | 1:
+        switch (vi.dwBuildNumber) {
+          case 14393:   w = "2016-1607"; break;
+          default:      w = "2016"; build = vi.dwBuildNumber; break;
+        } break;
     }
   }
 
@@ -3833,6 +4094,8 @@ std::string win_smart_interface::get_os_version_str()
     snprintf(vptr, vlen, "-%s%u.%u%s",
       (vi.dwPlatformId==VER_PLATFORM_WIN32_NT ? "nt" : "??"),
       (unsigned)vi.dwMajorVersion, (unsigned)vi.dwMinorVersion, w64);
+  else if (build)
+    snprintf(vptr, vlen, "-%s%s-b%u", w, w64, build);
   else if (vi.wServicePackMinor)
     snprintf(vptr, vlen, "-%s%s-sp%u.%u", w, w64, vi.wServicePackMajor, vi.wServicePackMinor);
   else if (vi.wServicePackMajor)
@@ -3885,7 +4148,9 @@ scsi_device * win_smart_interface::get_scsi_device(const char * name, const char
 nvme_device * win_smart_interface::get_nvme_device(const char * name, const char * type,
   unsigned nsid)
 {
-  return new win_nvme_device(this, name, type, nsid);
+  if (str_starts_with(skipdev(name), "nvme"))
+    return new win_nvme_device(this, name, type, nsid);
+  return new win10_nvme_device(this, name, type, nsid);
 }
 
 
@@ -3991,7 +4256,7 @@ std::string win_smart_interface::get_valid_custom_dev_types_str()
 
 
 // Return value for device detection functions
-enum win_dev_type { DEV_UNKNOWN = 0, DEV_ATA, DEV_SCSI, DEV_SAT, DEV_USB };
+enum win_dev_type { DEV_UNKNOWN = 0, DEV_ATA, DEV_SCSI, DEV_SAT, DEV_USB, DEV_NVME };
 
 // Return true if ATA drive behind a SAT layer
 static bool is_sat(const STORAGE_DEVICE_DESCRIPTOR_DATA * data)
@@ -4061,6 +4326,9 @@ static win_dev_type get_controller_type(HANDLE hdevice, bool admin, GETVERSIONIN
     case BusTypeUsb:
       return DEV_USB;
 
+    case 0x11: // BusTypeNVMe?
+      return DEV_NVME;
+
     default:
       return DEV_UNKNOWN;
   }
@@ -4188,6 +4456,9 @@ smart_device * win_smart_interface::autodetect_smart_device(const char * name)
   if (type == DEV_USB)
     return get_usb_device(name, phydrive, logdrive);
 
+  if (type == DEV_NVME)
+    return new win10_nvme_device(this, name, "", 0 /* use default nsid */);
+
   return 0;
 }
 
@@ -4251,7 +4522,7 @@ bool win_smart_interface::scan_smart_devices(smart_device_list & devlist,
 
   char name[20];
 
-  if (ata || scsi || sat || usb) {
+  if (ata || scsi || sat || usb || nvme) {
     // Scan up to 128 drives and 2 3ware controllers
     const int max_raid = 2;
     bool raid_seen[max_raid] = {false, false};
@@ -4319,6 +4590,13 @@ bool win_smart_interface::scan_smart_devices(smart_device_list & devlist,
             dev = new win_scsi_device(this, name, "");
           break;
 
+        case DEV_NVME:
+          // STORAGE_QUERY_PROPERTY returned NVMe
+          if (!nvme)
+            continue;
+          dev = new win10_nvme_device(this, name, "", 0 /* use default nsid */);
+          break;
+
         default:
           // Unknown type
           continue;
index c4cce584adfeec01bdd0a62c037da0c2970d4677..799ee45c41d295454fa5740427ddfd9f4a8bbb87 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-14 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 
 #include "daemon_win32.h"
 
-const char * daemon_win32_cpp_cvsid = "$Id: daemon_win32.cpp 4120 2015-08-27 16:12:21Z samm2 $"
+const char * daemon_win32_cpp_cvsid = "$Id: daemon_win32.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   DAEMON_WIN32_H_CVSID;
 
 #include <stdio.h>
index e87d0025dc46d68d637826200f33df6f90f7f167..813225189af38eba6fa6a6e08ad3b879785ddb80 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-12 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #ifndef DAEMON_WIN32_H
 #define DAEMON_WIN32_H
 
-#define DAEMON_WIN32_H_CVSID "$Id: daemon_win32.h 4120 2015-08-27 16:12:21Z samm2 $"
+#define DAEMON_WIN32_H_CVSID "$Id: daemon_win32.h 4431 2017-08-08 19:38:15Z chrfranke $"
 
 #include <signal.h>
 
index 78ce0145279047fdb7198798eaca9a128d878f23..19a0a1c6fa7b0de5b58d6317084d42e139e50908 100644 (file)
@@ -3,7 +3,7 @@
 ;
 ; Home page of code is: http://www.smartmontools.org
 ;
-; Copyright (C) 2006-15 Christian Franke
+; Copyright (C) 2006-17 Christian Franke
 ;
 ; This program is free software; you can redistribute it and/or modify
 ; it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
 ; You should have received a copy of the GNU General Public License
 ; (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 ;
-; $Id: installer.nsi 4174 2015-11-22 16:19:29Z chrfranke $
+; $Id: installer.nsi 4575 2017-10-29 16:06:18Z chrfranke $
 ;
 
 
@@ -153,6 +153,8 @@ SectionGroup "!Program files"
       MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Replace existing configuration file$\n$INSTDIR\bin\smartd.conf ?" /SD IDNO IDYES 0 IDNO +2
         File "${INPDIR}\doc\smartd.conf"
 
+    File "${INPDIR}\bin\smartd_mailer.ps1"
+    File "${INPDIR}\bin\smartd_mailer.conf.sample.ps1"
     File "${INPDIR}\bin\smartd_warning.cmd"
     !insertmacro FileExe "bin\wtssendmsg.exe" ""
 
@@ -208,12 +210,15 @@ Section "!Documentation" DOC_SECTION
   File "${INPDIR}\doc\checksums??.txt"
 !endif
   File "${INPDIR}\doc\smartctl.8.html"
-  File "${INPDIR}\doc\smartctl.8.txt"
+  File "${INPDIR}\doc\smartctl.8.pdf"
+  Delete "$INSTDIR\doc\smartctl.8.txt" ; TODO: Remove after smartmontools 6.6
   File "${INPDIR}\doc\smartd.8.html"
-  File "${INPDIR}\doc\smartd.8.txt"
+  File "${INPDIR}\doc\smartd.8.pdf"
+  Delete "$INSTDIR\doc\smartd.8.txt" ; TODO: Remove after smartmontools 6.6
   File "${INPDIR}\doc\smartd.conf"
   File "${INPDIR}\doc\smartd.conf.5.html"
-  File "${INPDIR}\doc\smartd.conf.5.txt"
+  File "${INPDIR}\doc\smartd.conf.5.pdf"
+  Delete "$INSTDIR\doc\smartd.conf.5.txt" ; TODO: Remove after smartmontools 6.6
 
 SectionEnd
 
@@ -240,8 +245,8 @@ Section "Uninstaller" UNINST_SECTION
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "UninstallString" '"$INSTDIR\uninst-smartmontools.exe"'
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "Publisher"     "smartmontools.org"
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "URLInfoAbout"  "https://www.smartmontools.org/"
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "HelpLink"      "http://sourceforge.net/projects/smartmontools/support"
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "URLUpdateInfo" "http://builds.smartmontools.org/"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "HelpLink"      "https://www.smartmontools.org/wiki/Help"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "URLUpdateInfo" "https://builds.smartmontools.org/"
   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "NoModify" 1
   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\smartmontools" "NoRepair" 1
   WriteUninstaller "uninst-smartmontools.exe"
@@ -302,9 +307,11 @@ Section "Start Menu Shortcuts" MENU_SECTION
     !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Daemon stop.lnk"                        "$INSTDIR\bin\runcmdu.exe" "smartd stop"
     !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Do all tests once (-q onecheck).lnk"    "$INSTDIR\bin\runcmdu.exe" "smartd -q onecheck"
     !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Debug mode (-d).lnk"                    "$INSTDIR\bin\runcmdu.exe" "smartd -d"
-    !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (edit).lnk" "$EDITOR" "$INSTDIR\bin\smartd.conf"
-    CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (view).lnk"                   "$EDITOR" "$INSTDIR\bin\smartd.conf"
-    CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.log (view).lnk"                    "$EDITOR" "$INSTDIR\bin\smartd.log"
+    !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (edit).lnk" "$EDITOR" '"$INSTDIR\bin\smartd.conf"'
+    CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (view).lnk"                   "$EDITOR" '"$INSTDIR\bin\smartd.conf"'
+    CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.log (view).lnk"                    "$EDITOR" '"$INSTDIR\bin\smartd.log"'
+    CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd_mailer.conf.sample.ps1 (view).lnk" "$EDITOR" '"$INSTDIR\bin\smartd_mailer.conf.sample.ps1"'
+    !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd_mailer.conf.ps1 (create, edit).lnk" "$EDITOR" '"$INSTDIR\bin\smartd_mailer.conf.ps1"'
 
     ; smartd service
     !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, eventlog, 30min.lnk"   "$INSTDIR\bin\runcmdu.exe" "smartd install"
@@ -322,13 +329,13 @@ Section "Start Menu Shortcuts" MENU_SECTION
     CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartctl manual page (html).lnk"    "$INSTDIR\doc\smartctl.8.html"
     CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd manual page (html).lnk"      "$INSTDIR\doc\smartd.8.html"
     CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd.conf manual page (html).lnk" "$INSTDIR\doc\smartd.conf.5.html"
-    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartctl manual page (txt).lnk"     "$INSTDIR\doc\smartctl.8.txt"
-    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd manual page (txt).lnk"       "$INSTDIR\doc\smartd.8.txt"
-    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd.conf manual page (txt).lnk"  "$INSTDIR\doc\smartd.conf.5.txt"
-    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd.conf sample.lnk" "$EDITOR" "$INSTDIR\doc\smartd.conf"
+    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartctl manual page (pdf).lnk"     "$INSTDIR\doc\smartctl.8.pdf"
+    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd manual page (pdf).lnk"       "$INSTDIR\doc\smartd.8.pdf"
+    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd.conf manual page (pdf).lnk"  "$INSTDIR\doc\smartd.conf.5.pdf"
+    CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\smartd.conf sample.lnk" "$EDITOR" '"$INSTDIR\doc\smartd.conf"'
     ${If} ${FileExists} "$INSTDIR\bin\drivedb.h"
-        CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb.h (view).lnk" "$EDITOR" "$INSTDIR\bin\drivedb.h"
-        !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb-add.h (create, edit).lnk" "$EDITOR" "$INSTDIR\bin\drivedb-add.h"
+      CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb.h (view).lnk" "$EDITOR" '"$INSTDIR\bin\drivedb.h"'
+      !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb-add.h (create, edit).lnk" "$EDITOR" '"$INSTDIR\bin\drivedb-add.h"'
     ${EndIf}
     CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\ChangeLog.lnk" "$INSTDIR\doc\ChangeLog.txt"
     CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\COPYING.lnk"   "$INSTDIR\doc\COPYING.txt"
@@ -337,7 +344,7 @@ Section "Start Menu Shortcuts" MENU_SECTION
 
   ; Homepage
   CreateShortCut "$SMPROGRAMS\smartmontools\smartmontools Home Page.lnk" "https://www.smartmontools.org/"
-  CreateShortCut "$SMPROGRAMS\smartmontools\smartmontools Daily Builds.lnk" "http://builds.smartmontools.org/"
+  CreateShortCut "$SMPROGRAMS\smartmontools\smartmontools Daily Builds.lnk" "https://builds.smartmontools.org/"
 
   ; drivedb.h update
   ${If} ${FileExists} "$INSTDIR\bin\update-smart-drivedb.exe"
@@ -438,19 +445,24 @@ Section "Uninstall"
       Delete "$INSTDIR\bin\drivedb-add.h"
   ${EndIf}
 
+  ; Remove smartd_mailer.conf.ps1 file ?
+  ${If} ${FileExists} "$INSTDIR\bin\smartd_mailer.conf.ps1"
+    MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete mailer configuration file$\n$INSTDIR\bin\smartd_mailer.conf.ps1 ?" /SD IDNO IDYES 0 IDNO +2
+      Delete "$INSTDIR\bin\smartd_mailer.conf.ps1"
+  ${EndIf}
+
   ; Remove files
   Delete "$INSTDIR\bin\smartctl.exe"
   Delete "$INSTDIR\bin\smartctl-nc.exe"
   Delete "$INSTDIR\bin\smartd.exe"
+  Delete "$INSTDIR\bin\smartd_mailer.ps1"
+  Delete "$INSTDIR\bin\smartd_mailer.conf.sample.ps1"
   Delete "$INSTDIR\bin\smartd_warning.cmd" ; TODO: Check for modifications?
   Delete "$INSTDIR\bin\drivedb.h"
   Delete "$INSTDIR\bin\drivedb.h.error"
   Delete "$INSTDIR\bin\drivedb.h.lastcheck"
   Delete "$INSTDIR\bin\drivedb.h.old"
   Delete "$INSTDIR\bin\update-smart-drivedb.exe"
-  Delete "$INSTDIR\bin\smartctl-run.bat"
-  Delete "$INSTDIR\bin\smartd-run.bat"
-  Delete "$INSTDIR\bin\net-run.bat"
   Delete "$INSTDIR\bin\runcmda.exe"
   Delete "$INSTDIR\bin\runcmda.exe.manifest" ; TODO: Remove after smartmontools 6.5
   Delete "$INSTDIR\bin\runcmdu.exe"
@@ -466,12 +478,15 @@ Section "Uninstall"
   Delete "$INSTDIR\doc\TODO.txt"
   Delete "$INSTDIR\doc\checksums*.txt"
   Delete "$INSTDIR\doc\smartctl.8.html"
-  Delete "$INSTDIR\doc\smartctl.8.txt"
+  Delete "$INSTDIR\doc\smartctl.8.pdf"
+  Delete "$INSTDIR\doc\smartctl.8.txt" ; TODO: Remove after smartmontools 6.6
   Delete "$INSTDIR\doc\smartd.8.html"
-  Delete "$INSTDIR\doc\smartd.8.txt"
+  Delete "$INSTDIR\doc\smartd.8.pdf"
+  Delete "$INSTDIR\doc\smartd.8.txt"  ; TODO: Remove after smartmontools 6.6
   Delete "$INSTDIR\doc\smartd.conf"
   Delete "$INSTDIR\doc\smartd.conf.5.html"
-  Delete "$INSTDIR\doc\smartd.conf.5.txt"
+  Delete "$INSTDIR\doc\smartd.conf.5.pdf"
+  Delete "$INSTDIR\doc\smartd.conf.5.txt" ; TODO: Remove after smartmontools 6.6
   Delete "$INSTDIR\uninst-smartmontools.exe"
 
   ; Remove shortcuts
index 2a26cda31b1971982d9e04669456fc0c7d907b65..fe190f5d65f6d949f692c8647fabf10fb3a9acb5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2011 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2011 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
  *
  */
 
-char svnid[] = "$Id: runcmd.c 4120 2015-08-27 16:12:21Z samm2 $";
+char svnid[] = "$Id: runcmd.c 4431 2017-08-08 19:38:15Z chrfranke $";
 
 #include <stdio.h>
 #include <windows.h>
diff --git a/os_win32/smartctl_res.rc.in b/os_win32/smartctl_res.rc.in
deleted file mode 100644 (file)
index b2068e6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// os_win32/smartctl_res.rc.in
-//
-// $Id: smartctl_res.rc.in 3878 2014-03-03 18:45:21Z chrfranke $
-//
-
-1 VERSIONINFO
-    FILEVERSION @BINARY_VERSION@
-    PRODUCTVERSION @BINARY_VERSION@
-    FILEFLAGSMASK 0x0
-    FILEFLAGS 0x0
-    FILEOS 0x4 // VOS__WINDOWS32
-    FILETYPE 0x1 // VFT_APP
-    FILESUBTYPE 0x0
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "04090000"
-        BEGIN
-            VALUE "CompanyName", "www.smartmontools.org"
-            VALUE "FileDescription", "Control and Monitor Utility for SMART Disks"
-            VALUE "FileVersion", "@TEXT_VERSION@"
-            VALUE "InternalName", "smartctl"
-            VALUE "LegalCopyright", "(C) 2002-@YY@, Bruce Allen, Christian Franke, www.smartmontools.org"
-            VALUE "OriginalFilename", "smartctl.exe"
-            VALUE "ProductName", "smartmontools"
-            VALUE "ProductVersion", "@TEXT_VERSION@"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x0409, 0x0000
-    END
-END
diff --git a/os_win32/smartd_mailer.conf.sample.ps1 b/os_win32/smartd_mailer.conf.sample.ps1
new file mode 100644 (file)
index 0000000..b82c9a3
--- /dev/null
@@ -0,0 +1,31 @@
+# Sample file for smartd_mailer.conf.ps1
+#
+# Home page of code is: http://www.smartmontools.org
+# $Id: smartd_mailer.conf.sample.ps1 4338 2016-09-07 19:31:28Z chrfranke $
+
+# SMTP Server
+$smtpServer = "smtp.domain.local"
+
+# Optional settings [default values in square brackets]
+
+# Sender address ["smartd daemon <root@$hostname>"]
+#$from = "Administrator <root@domain.local>"
+
+# SMTP Port [25]
+#$port = 587
+
+# Use STARTTLS [$false]
+#$useSsl = $true
+
+# SMTP user name []
+#$username = "USER"
+
+# Plain text SMTP password []
+#$password = "PASSWORD"
+
+# Encrypted SMTP password []
+# (embedded newlines, tabs and spaces are ignored)
+#$passwordEnc = "
+#  0123456789abcdef...
+#  ...
+#"
diff --git a/os_win32/smartd_mailer.ps1 b/os_win32/smartd_mailer.ps1
new file mode 100644 (file)
index 0000000..a3cba24
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# smartd mailer script
+#
+# Home page of code is: http://www.smartmontools.org
+#
+# Copyright (C) 2016 Christian Franke
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# You should have received a copy of the GNU General Public License
+# (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id: smartd_mailer.ps1 4338 2016-09-07 19:31:28Z chrfranke $
+#
+
+$ErrorActionPreference = "Stop"
+
+# Parse command line and check environment
+$dryrun = $false
+if (($args.Count -eq 1) -and ($args[0] -eq "--dryrun")) {
+  $dryrun = $true
+}
+
+$toCsv = $env:SMARTD_ADDRCSV
+$subject = $env:SMARTD_SUBJECT
+$file = $env:SMARTD_FULLMSGFILE
+
+if (!((($args.Count -eq 0) -or $dryrun) -and $toCsv -and $subject -and $file)) {
+  echo `
+"smartd mailer script
+
+Usage:
+set SMARTD_ADDRCSV='Comma separated mail addresses'
+set SMARTD_SUBJECT='Mail Subject'
+set SMARTD_FULLMSGFILE='X:\PATH\TO\Message.txt'
+
+.\$($MyInvocation.MyCommand.Name) [--dryrun]
+"
+  exit 1
+}
+
+# Set default sender address
+if ($env:COMPUTERNAME -match '^[-_A-Za-z0-9]+$') {
+  $hostname = $env:COMPUTERNAME.ToLower()
+} else {
+  $hostname = "unknown"
+}
+if ($env:USERDNSDOMAIN -match '^[-._A-Za-z0-9]+$') {
+  $hostname += ".$($env:USERDNSDOMAIN.ToLower())"
+} elseif (     ($env:USERDOMAIN -match '^[-_A-Za-z0-9]+$') `
+          -and ($env:USERDOMAIN -ne $env:COMPUTERNAME)    ) {
+  $hostname += ".$($env:USERDOMAIN.ToLower()).local"
+} else {
+  $hostname += ".local"
+}
+
+$from = "smartd daemon <root@$hostname>"
+
+# Read configuration
+. .\smartd_mailer.conf.ps1
+
+# Create parameters
+$to = $toCsv.Split(",")
+$body = Get-Content -Path $file | Out-String
+
+$parm = @{
+  SmtpServer = $smtpServer; From = $from; To = $to
+  Subject = $subject; Body = $body
+}
+if ($port) {
+  $parm += @{ Port = $port }
+}
+if ($useSsl) {
+  $parm += @{ useSsl = $true }
+}
+
+if ($username -and ($password -or $passwordEnc)) {
+  if (!$passwordEnc) {
+    $secureString = ConvertTo-SecureString -String $password -AsPlainText -Force
+  } else {
+    $passwordEnc = $passwordEnc -replace '[\r\n\t ]',''
+    $secureString = ConvertTo-SecureString -String $passwordEnc
+  }
+  $credential = New-Object -Typename System.Management.Automation.PSCredential -Argumentlist $username,$secureString
+  $parm += @{ Credential = $credential }
+}
+
+# Send mail
+if ($dryrun) {
+  echo "Send-MailMessage" @parm
+} else {
+  Send-MailMessage @parm
+}
diff --git a/os_win32/smartd_res.rc.in b/os_win32/smartd_res.rc.in
deleted file mode 100644 (file)
index 07529b7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// os_win32/smartd_res.rc.in
-//
-// $Id: smartd_res.rc.in 3878 2014-03-03 18:45:21Z chrfranke $
-//
-
-1 VERSIONINFO
-    FILEVERSION @BINARY_VERSION@
-    PRODUCTVERSION @BINARY_VERSION@
-    FILEFLAGSMASK 0x0
-    FILEFLAGS 0x0
-    FILEOS 0x4 // VOS__WINDOWS32
-    FILETYPE 0x1 // VFT_APP
-    FILESUBTYPE 0x0
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "04090000"
-        BEGIN
-            VALUE "CompanyName", "www.smartmontools.org"
-            VALUE "FileDescription", "SMART Disk Monitoring Daemon"
-            VALUE "FileVersion", "@TEXT_VERSION@"
-            VALUE "InternalName", "smartd"
-            VALUE "LegalCopyright", "(C) 2002-@YY@, Bruce Allen, Christian Franke, www.smartmontools.org"
-            VALUE "OriginalFilename", "smartd.exe"
-            VALUE "ProductName", "smartmontools"
-            VALUE "ProductVersion", "@TEXT_VERSION@"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x0409, 0x0000
-    END
-END
-
-// eventlog MESSAGETABLE for syslog() emulation
-#include "syslogevt.rc"
index 3a7b0997066b54dae587cdadf9c4abfc6df42473..9b2d178fce1f2511ab5f9855da3fea9168b5b5c9 100644 (file)
@@ -2,7 +2,9 @@
 ::
 :: smartd warning script
 ::
-:: Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+:: Home page of code is: http://www.smartmontools.org
+::
+:: Copyright (C) 2012-17 Christian Franke
 ::
 :: This program is free software; you can redistribute it and/or modify
 :: it under the terms of the GNU General Public License as published by
 :: You should have received a copy of the GNU General Public License
 :: (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 ::
-:: $Id: smartd_warning.cmd 3816 2013-06-09 16:16:11Z chrfranke $
+:: $Id: smartd_warning.cmd 4569 2017-10-25 20:13:11Z chrfranke $
 ::
 
+verify other 2>nul
+setlocal enableextensions enabledelayedexpansion
+if errorlevel 1 goto UNSUPPORTED
 set err=
 
+:: Change to script directory (not necessary if run from smartd service)
+cd /d %~dp0
+if errorlevel 1 goto ERROR
+
 :: Parse options
 set dryrun=
 if "%1" == "--dryrun" (
-  set dryrun=t
+  set dryrun=--dryrun
   shift
 )
+if not "!dryrun!" == "" echo cd /d !cd!
 
 if not "%1" == "" (
   echo smartd warning message script
   echo.
   echo Usage:
   echo set SMARTD_MAILER='Path to external script, empty for "blat"'
-  echo set SMARTD_ADDRESS='Space separated mail adresses, empty if none'
+  echo set SMARTD_ADDRESS='Space separated mail addresses, empty if none'
   echo set SMARTD_MESSAGE='Error Message'
   echo set SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
   echo set SMARTD_TFIRST='Date of first message sent, empty if none'
@@ -42,118 +52,157 @@ if not "%1" == "" (
   echo :: set SMARTD_DEVICETYPE='Device type from -d directive, "auto" if none'
 
   echo smartd_warning.cmd [--dryrun]
-  goto EOF
+  goto ERROR
 )
 
-if "%SMARTD_ADDRESS%%SMARTD_MAILER%" == "" (
+if "!SMARTD_ADDRESS!!SMARTD_MAILER!" == "" (
   echo smartd_warning.cmd: SMARTD_ADDRESS or SMARTD_MAILER must be set
-  goto EOF
+  goto ERROR
 )
 
 :: USERDNSDOMAIN may be unset if running as service
-if "%USERDNSDOMAIN%" == "" (
-  for /f "delims== tokens=2 usebackq" %%d in (`WMIC PATH Win32_Computersystem WHERE "PartOfDomain=TRUE" GET Domain /VALUE 2^>nul ^| find "Domain=" 2^>nul`) do set USERDNSDOMAIN=%%~d
+if "!USERDNSDOMAIN!" == "" (
+  for /f "delims== tokens=2 usebackq" %%d in (`wmic PATH Win32_Computersystem WHERE "PartOfDomain=TRUE" GET Domain /VALUE ^<nul 2^>nul`) do set USERDNSDOMAIN=%%~d
 )
+:: Remove possible trailing \r appended by above command (requires %...%)
+set USERDNSDOMAIN=%USERDNSDOMAIN%
 
 :: Format subject
-set SMARTD_SUBJECT=SMART error (%SMARTD_FAILTYPE%) detected on host: %COMPUTERNAME%
+set SMARTD_SUBJECT=SMART error (!SMARTD_FAILTYPE!) detected on host: !COMPUTERNAME!
 
 :: Temp file for message
-if not "%TMP%" == "" set SMARTD_FULLMSGFILE=%TMP%\smartd_warning-%RANDOM%.txt
-if     "%TMP%" == "" set SMARTD_FULLMSGFILE=smartd_warning-%RANDOM%.txt
+if not "!TMP!" == "" set SMARTD_FULLMSGFILE=!TMP!\smartd_warning-!RANDOM!.txt
+if     "!TMP!" == "" set SMARTD_FULLMSGFILE=smartd_warning-!RANDOM!.txt
 
 :: Format message
 (
   echo This message was generated by the smartd service running on:
   echo.
-  echo.   host name:  %COMPUTERNAME%
-  if not "%USERDNSDOMAIN%" == "" echo.   DNS domain: %USERDNSDOMAIN%
-  if     "%USERDNSDOMAIN%" == "" echo.   DNS domain: [Empty]
-  if not "%USERDOMAIN%"    == "" echo.   Win domain: %USERDOMAIN%
+  echo.   host name:  !COMPUTERNAME!
+  if not "!USERDNSDOMAIN!" == "" echo.   DNS domain: !USERDNSDOMAIN!
+  if     "!USERDNSDOMAIN!" == "" echo.   DNS domain: [Empty]
+  if not "!USERDOMAIN!"    == "" echo.   Win domain: !USERDOMAIN!
   echo.
   echo The following warning/error was logged by the smartd service:
   echo.
-  :: SMARTD_MESSAGE and SMARTD_DEVICEINFO may contain parentheses
-  for %%m in ("%SMARTD_MESSAGE%") do echo.%%~m
+  if not "!SMARTD_MESSAGE!" == "" echo !SMARTD_MESSAGE!
+  if     "!SMARTD_MESSAGE!" == "" echo [SMARTD_MESSAGE]
   echo.
   echo Device info:
-  for %%m in ("%SMARTD_DEVICEINFO%") do echo.%%~m
-  set m=
+  if not "!SMARTD_DEVICEINFO!" == "" echo !SMARTD_DEVICEINFO!
+  if     "!SMARTD_DEVICEINFO!" == "" echo [SMARTD_DEVICEINFO]
   echo.
   echo For details see the event log or log file of smartd.
-  if not "%SMARTD_FAILTYPE%" == "EmailTest" (
+  if not "!SMARTD_FAILTYPE!" == "EmailTest" (
     echo.
     echo You can also use the smartctl utility for further investigation.
-    if not "%SMARTD_PREVCNT%" == "0" echo The original message about this issue was sent at %SMARTD_TFIRST%
-    if "%SMARTD_NEXTDAYS%" == "" (
+    if not "!SMARTD_PREVCNT!" == "0" echo The original message about this issue was sent at !SMARTD_TFIRST!
+    if "!SMARTD_NEXTDAYS!" == "" (
       echo No additional messages about this problem will be sent.
-    ) else ( if "%SMARTD_NEXTDAYS%" == "1" (
+    ) else ( if "!SMARTD_NEXTDAYS!" == "1" (
       echo Another message will be sent in 24 hours if the problem persists.
     ) else (
-      echo Another message will be sent in %SMARTD_NEXTDAYS% days if the problem persists.
+      echo Another message will be sent in !SMARTD_NEXTDAYS! days if the problem persists.
     ))
   )
-) > "%SMARTD_FULLMSGFILE%"
+) > "!SMARTD_FULLMSGFILE!"
+if errorlevel 1 goto ERROR
 
-if not "%dryrun%" == "" (
-  echo %SMARTD_FULLMSGFILE%:
-  type "%SMARTD_FULLMSGFILE%"
+if not "!dryrun!" == "" (
+  echo !SMARTD_FULLMSGFILE!:
+  type "!SMARTD_FULLMSGFILE!"
   echo --EOF--
 )
 
 :: Check first address
 set first=
-for /F "tokens=1*" %%a in ("%SMARTD_ADDRESS%") do (set first=%%a)
+for /f "tokens=1*" %%a in ("!SMARTD_ADDRESS!") do (set first=%%a)
 set wtssend=
-if "%first%" == "console"   set wtssend=-c
-if "%first%" == "active"    set wtssend=-a
-if "%first%" == "connected" set wtssend=-s
-set first=
+if "!first!" == "console"   set wtssend=-c
+if "!first!" == "active"    set wtssend=-a
+if "!first!" == "connected" set wtssend=-s
 
-if not "%wtssend%" == "" (
+if not "!wtssend!" == "" (
   :: Show Message box(es) via WTSSendMessage()
-  if not "%dryrun%" == "" (
-    echo call wtssendmsg %wtssend% "%SMARTD_SUBJECT%" - ^< "%SMARTD_FULLMSGFILE%"
+  if not "!dryrun!" == "" (
+    echo call .\wtssendmsg !wtssend! "!SMARTD_SUBJECT!" - ^< "!SMARTD_FULLMSGFILE!"
   ) else (
-    call wtssendmsg %wtssend% "%SMARTD_SUBJECT%" - < "%SMARTD_FULLMSGFILE%"
+    call .\wtssendmsg !wtssend! "!SMARTD_SUBJECT!" - < "!SMARTD_FULLMSGFILE!"
     if errorlevel 1 set err=t
   )
   :: Remove first address
-  for /F "tokens=1*" %%a in ("%SMARTD_ADDRESS%") do (set SMARTD_ADDRESS=%%b)
+  for /f "tokens=1*" %%a in ("!SMARTD_ADDRESS!") do (set SMARTD_ADDRESS=%%b)
 )
-set wtssend=
 
 :: Make comma separated address list
 set SMARTD_ADDRCSV=
-if not "%SMARTD_ADDRESS%" == "" set SMARTD_ADDRCSV=%SMARTD_ADDRESS: =,%
+if not "!SMARTD_ADDRESS!" == "" set SMARTD_ADDRCSV=!SMARTD_ADDRESS: =,!
 
-:: Use blat mailer by default
-if not "%SMARTD_ADDRESS%" == "" if "%SMARTD_MAILER%" == "" set SMARTD_MAILER=blat
+:: Default mailer is smartd_mailer.ps1 (if configured) or blat.exe
+if not "!SMARTD_ADDRESS!" == "" if "!SMARTD_MAILER!" == "" (
+  if not exist smartd_mailer.conf.ps1 set SMARTD_MAILER=blat
+)
+
+:: Get mailer extension
+set ext=
+for /f "delims=" %%f in ("!SMARTD_MAILER!") do (set ext=%%~xf)
 
 :: Send mail or run command
-if not "%SMARTD_ADDRCSV%" == "" (
+if "!ext!" == ".ps1" (
 
-  :: Send mail
-  if not "%dryrun%" == "" (
-    echo call "%SMARTD_MAILER%" - -q -subject "%SMARTD_SUBJECT%" -to "%SMARTD_ADDRCSV%" ^< "%SMARTD_FULLMSGFILE%"
+  :: Run PowerShell script
+  if not "!dryrun!" == "" (
+    set esc=^^
+    echo PowerShell -NoProfile -ExecutionPolicy Bypass -Command !esc!^& '!SMARTD_MAILER!' ^<nul
   ) else (
-    call "%SMARTD_MAILER%" - -q -subject "%SMARTD_SUBJECT%" -to "%SMARTD_ADDRCSV%" < "%SMARTD_FULLMSGFILE%"
+    PowerShell -NoProfile -ExecutionPolicy Bypass -Command ^& '!SMARTD_MAILER!' <nul
+    if errorlevel 1 set err=t
+  )
+
+) else ( if not "!SMARTD_ADDRCSV!" == "" (
+
+  :: Send mail
+  if "!SMARTD_MAILER!" == "" (
+
+    :: Use smartd_mailer.ps1
+    if not "!dryrun!" == "" (
+      echo PowerShell -NoProfile -ExecutionPolicy Bypass -Command .\smartd_mailer.ps1 ^<nul
+      echo ==========
+    )
+    PowerShell -NoProfile -ExecutionPolicy Bypass -Command .\smartd_mailer.ps1 !dryrun! <nul
     if errorlevel 1 set err=t
+    if not "!dryrun!" == "" echo ==========
+
+  ) else (
+
+    :: Use blat mailer or compatible
+    if not "!dryrun!" == "" (
+      echo call "!SMARTD_MAILER!" - -q -subject "!SMARTD_SUBJECT!" -to "!SMARTD_ADDRCSV!" ^< "!SMARTD_FULLMSGFILE!"
+    ) else (
+      call "!SMARTD_MAILER!" - -q -subject "!SMARTD_SUBJECT!" -to "!SMARTD_ADDRCSV!" < "!SMARTD_FULLMSGFILE!"
+      if errorlevel 1 set err=t
+    )
+
   )
 
-) else ( if not "%SMARTD_MAILER%" == "" (
+) else ( if not "!SMARTD_MAILER!" == "" (
 
   :: Run command
-  if not "%dryrun%" == "" (
-    echo call "%SMARTD_MAILER%" ^<nul
+  if not "!dryrun!" == "" (
+    echo call "!SMARTD_MAILER!" ^<nul
   ) else (
-    call "%SMARTD_MAILER%" <nul
+    call "!SMARTD_MAILER!" <nul
     if errorlevel 1 set err=t
   )
 
-))
+)))
+
+del "!SMARTD_FULLMSGFILE!" >nul 2>nul
 
-del "%SMARTD_FULLMSGFILE%" >nul 2>nul
+if not "!err!" == "" goto ERROR
+endlocal
+exit /b 0
 
-:EOF
-if not "%err%" == "" goto ERROR 2>nul
+:ERROR
+endlocal
+exit /b 1
index 4d839997bae2bed6bc1bda19b562f2167f513ff5..449f802ecbb9b6496640aea2a8e88c294651ea6d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2004-8 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2004-8 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 #ifndef SYSLOG_H
 #define SYSLOG_H
 
-#define SYSLOG_H_CVSID "$Id: syslog.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define SYSLOG_H_CVSID "$Id: syslog.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 #include <stdarg.h>
 
index 8c34ef6e113c80a60cfca5d4cc191a772a0cb365..44347e21ce76cde9a0817efe14a3ea8814036e4e 100644 (file)
@@ -3,7 +3,7 @@
 ; *
 ; * Home page of code is: http://www.smartmontools.org
 ; *
-; * Copyright (C) 2004-10 Christian Franke <smartmontools-support@lists.sourceforge.net>
+; * Copyright (C) 2004-10 Christian Franke
 ; *
 ; * This program is free software; you can redistribute it and/or modify
 ; * it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 ; *
 ; */
 ;
-;// $Id: syslogevt.mc 4120 2015-08-27 16:12:21Z samm2 $
+;// $Id: syslogevt.mc 4431 2017-08-08 19:38:15Z chrfranke $
 ;
 ;// Use message compiler "mc" or "windmc" to generate
 ;//   syslogevt.rc, syslogevt.h, msg00001.bin
index 7b8295a876c622866ec4dfdec57ae5ed6b04509c..145b055f8d140357e42a765771f83305b3d10e14 100644 (file)
@@ -3,7 +3,7 @@
 ;
 ; Home page of code is: http://www.smartmontools.org
 ;
-; Copyright (C) 2011-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+; Copyright (C) 2011-13 Christian Franke
 ;
 ; This program is free software; you can redistribute it and/or modify
 ; it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
 ; You should have received a copy of the GNU General Public License
 ; (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 ;
-; $Id: update-smart-drivedb.nsi 4120 2015-08-27 16:12:21Z samm2 $
+; $Id: update-smart-drivedb.nsi 4431 2017-08-08 19:38:15Z chrfranke $
 ;
 
 
diff --git a/os_win32/vc10/runcmd.vcxproj b/os_win32/vc10/runcmd.vcxproj
deleted file mode 100644 (file)
index 36a294e..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{11A4B619-D97B-499F-AF17-CF9F80BF70E8}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>runcmd</RootNamespace>
-    <ProjectName>runcmd</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <TargetName>$(ProjectName)u</TargetName>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-    <IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <TargetName>$(ProjectName)u</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\runcmd.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/vc10/smartctl.vcxproj b/os_win32/vc10/smartctl.vcxproj
deleted file mode 100644 (file)
index c4be9f1..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{3AFEDCDD-D289-4543-A91D-EFBA6C710247}</ProjectGuid>
-    <RootNamespace>smartctl</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <ProjectName>smartctl</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;__func__=__FUNCTION__;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <DisableSpecificWarnings>4250</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>.;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;__func__=__FUNCTION__;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4250</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\ataidentify.cpp" />
-    <ClCompile Include="..\..\dev_areca.cpp" />
-    <ClCompile Include="..\..\nvmecmds.cpp" />
-    <ClCompile Include="..\..\nvmeprint.cpp" />
-    <ClCompile Include="..\daemon_win32.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\syslog_win32.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\wmiquery.cpp" />
-    <ClCompile Include="..\..\regex\regcomp.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex.c" />
-    <ClCompile Include="..\..\regex\regex_internal.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regexec.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt.c" />
-    <ClCompile Include="..\..\getopt\getopt1.c" />
-    <ClCompile Include="..\..\atacmdnames.cpp" />
-    <ClCompile Include="..\..\atacmds.cpp" />
-    <ClCompile Include="..\..\ataprint.cpp" />
-    <ClCompile Include="..\..\cciss.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
-    <ClCompile Include="..\..\dev_interface.cpp" />
-    <ClCompile Include="..\..\dev_legacy.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\knowndrives.cpp" />
-    <ClCompile Include="..\..\os_darwin.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_freebsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_generic.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_linux.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_netbsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_openbsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_os2.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_qnxnto.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_solaris.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_win32.cpp" />
-    <ClCompile Include="..\..\scsiata.cpp" />
-    <ClCompile Include="..\..\scsicmds.cpp" />
-    <ClCompile Include="..\..\scsiprint.cpp" />
-    <ClCompile Include="..\..\smartctl.cpp" />
-    <ClCompile Include="..\..\smartd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\utility.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\aacraid.h" />
-    <ClInclude Include="..\..\ataidentify.h" />
-    <ClInclude Include="..\..\dev_areca.h" />
-    <ClInclude Include="..\..\nvmecmds.h" />
-    <ClInclude Include="..\..\nvmeprint.h" />
-    <ClInclude Include="config.h" />
-    <ClInclude Include="svnversion.h" />
-    <CustomBuildStep Include="..\daemon_win32.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\syslog.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\wbemcli_small.h" />
-    <ClInclude Include="..\wmiquery.h" />
-    <ClInclude Include="..\..\regex\regex.h" />
-    <ClInclude Include="..\..\regex\regex_internal.h" />
-    <ClInclude Include="..\..\getopt\getopt.h" />
-    <ClInclude Include="..\..\atacmdnames.h" />
-    <ClInclude Include="..\..\atacmds.h" />
-    <ClInclude Include="..\..\ataprint.h" />
-    <CustomBuildStep Include="..\..\cciss.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\..\cissio_freebsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClInclude>
-    <ClInclude Include="..\..\csmisas.h" />
-    <ClInclude Include="..\..\dev_ata_cmd_set.h" />
-    <ClInclude Include="..\..\dev_interface.h" />
-    <ClInclude Include="..\..\dev_tunnelled.h" />
-    <ClInclude Include="..\..\drivedb.h" />
-    <ClInclude Include="..\..\int64.h" />
-    <ClInclude Include="..\..\knowndrives.h" />
-    <CustomBuildStep Include="..\..\megaraid.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_darwin.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_freebsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_generic.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_linux.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_netbsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_openbsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_os2.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_qnxnto.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_solaris.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\..\scsicmds.h" />
-    <ClInclude Include="..\..\scsiprint.h" />
-    <ClInclude Include="..\..\smartctl.h" />
-    <ClInclude Include="..\..\utility.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\smartd_warning.sh.in" />
-    <None Include="..\installer.nsi" />
-    <None Include="..\smartctl_res.rc.in" />
-    <None Include="..\smartd_res.rc.in" />
-    <None Include="..\smartd_warning.cmd" />
-    <None Include="..\syslogevt.mc" />
-    <None Include="..\update-smart-drivedb.nsi" />
-    <None Include="..\..\AUTHORS" />
-    <None Include="..\..\autogen.sh" />
-    <None Include="..\..\ChangeLog" />
-    <None Include="..\..\config.h.in" />
-    <None Include="..\..\configure.ac" />
-    <None Include="..\..\do_release" />
-    <None Include="..\..\Doxyfile" />
-    <None Include="..\..\INSTALL" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="..\..\NEWS" />
-    <None Include="..\..\README" />
-    <None Include="..\..\smartctl.8.in" />
-    <None Include="..\..\smartd.8.in" />
-    <None Include="..\..\smartd.conf.5.in" />
-    <None Include="..\..\smartd.initd.in" />
-    <None Include="..\..\TODO" />
-    <None Include="..\..\update-smart-drivedb.in" />
-    <None Include="..\..\WARNINGS" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="smartctl_res.rc" />
-    <ResourceCompile Include="smartd_res.rc">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ResourceCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/vc10/smartctl.vcxproj.filters b/os_win32/vc10/smartctl.vcxproj.filters
deleted file mode 100644 (file)
index 1033b07..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="os_win32">
-      <UniqueIdentifier>{9321e988-dd03-496d-9933-7c8b235a46bf}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="regex">
-      <UniqueIdentifier>{bfbfd4ea-fae3-45ec-9cfb-c5424218c47c}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="getopt">
-      <UniqueIdentifier>{8ff0bf5f-c96e-45c3-bcb4-7450cecfa0d4}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\daemon_win32.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\syslog_win32.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\wmiquery.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regcomp.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex_internal.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regexec.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt.c">
-      <Filter>getopt</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt1.c">
-      <Filter>getopt</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\atacmdnames.cpp" />
-    <ClCompile Include="..\..\atacmds.cpp" />
-    <ClCompile Include="..\..\ataprint.cpp" />
-    <ClCompile Include="..\..\cciss.cpp" />
-    <ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
-    <ClCompile Include="..\..\dev_interface.cpp" />
-    <ClCompile Include="..\..\dev_legacy.cpp" />
-    <ClCompile Include="..\..\knowndrives.cpp" />
-    <ClCompile Include="..\..\os_darwin.cpp" />
-    <ClCompile Include="..\..\os_freebsd.cpp" />
-    <ClCompile Include="..\..\os_generic.cpp" />
-    <ClCompile Include="..\..\os_linux.cpp" />
-    <ClCompile Include="..\..\os_netbsd.cpp" />
-    <ClCompile Include="..\..\os_openbsd.cpp" />
-    <ClCompile Include="..\..\os_os2.cpp" />
-    <ClCompile Include="..\..\os_qnxnto.cpp" />
-    <ClCompile Include="..\..\os_solaris.cpp" />
-    <ClCompile Include="..\..\os_win32.cpp" />
-    <ClCompile Include="..\..\scsiata.cpp" />
-    <ClCompile Include="..\..\scsicmds.cpp" />
-    <ClCompile Include="..\..\scsiprint.cpp" />
-    <ClCompile Include="..\..\smartctl.cpp" />
-    <ClCompile Include="..\..\smartd.cpp" />
-    <ClCompile Include="..\..\utility.cpp" />
-    <ClCompile Include="..\..\ataidentify.cpp" />
-    <ClCompile Include="..\..\dev_areca.cpp" />
-    <ClCompile Include="..\..\nvmecmds.cpp" />
-    <ClCompile Include="..\..\nvmeprint.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\wbemcli_small.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\wmiquery.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\regex\regex.h">
-      <Filter>regex</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\regex\regex_internal.h">
-      <Filter>regex</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\getopt\getopt.h">
-      <Filter>getopt</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\aacraid.h" />
-    <ClInclude Include="..\..\atacmdnames.h" />
-    <ClInclude Include="..\..\atacmds.h" />
-    <ClInclude Include="..\..\ataprint.h" />
-    <ClInclude Include="..\..\cissio_freebsd.h" />
-    <ClInclude Include="..\..\csmisas.h" />
-    <ClInclude Include="..\..\dev_ata_cmd_set.h" />
-    <ClInclude Include="..\..\dev_interface.h" />
-    <ClInclude Include="..\..\dev_tunnelled.h" />
-    <ClInclude Include="..\..\drivedb.h" />
-    <ClInclude Include="..\..\int64.h" />
-    <ClInclude Include="..\..\knowndrives.h" />
-    <ClInclude Include="..\..\scsicmds.h" />
-    <ClInclude Include="..\..\scsiprint.h" />
-    <ClInclude Include="..\..\smartctl.h" />
-    <ClInclude Include="..\..\utility.h" />
-    <ClInclude Include="..\..\ataidentify.h" />
-    <ClInclude Include="..\..\dev_areca.h" />
-    <ClInclude Include="config.h" />
-    <ClInclude Include="svnversion.h" />
-    <ClInclude Include="..\..\nvmecmds.h" />
-    <ClInclude Include="..\..\nvmeprint.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\installer.nsi">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\update-smart-drivedb.nsi">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\..\AUTHORS" />
-    <None Include="..\..\autogen.sh" />
-    <None Include="..\..\ChangeLog" />
-    <None Include="..\..\config.h.in" />
-    <None Include="..\..\configure.ac" />
-    <None Include="..\..\do_release" />
-    <None Include="..\..\Doxyfile" />
-    <None Include="..\..\INSTALL" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="..\..\NEWS" />
-    <None Include="..\..\README" />
-    <None Include="..\..\smartctl.8.in" />
-    <None Include="..\..\smartd.8.in" />
-    <None Include="..\..\smartd.conf.5.in" />
-    <None Include="..\..\smartd.initd.in" />
-    <None Include="..\..\TODO" />
-    <None Include="..\..\update-smart-drivedb.in" />
-    <None Include="..\..\WARNINGS" />
-    <None Include="..\smartd_warning.cmd">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\..\smartd_warning.sh.in" />
-    <None Include="..\smartctl_res.rc.in">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\smartd_res.rc.in">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\syslogevt.mc">
-      <Filter>os_win32</Filter>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuildStep Include="..\daemon_win32.h">
-      <Filter>os_win32</Filter>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\syslog.h">
-      <Filter>os_win32</Filter>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\cciss.h" />
-    <CustomBuildStep Include="..\..\megaraid.h" />
-    <CustomBuildStep Include="..\..\os_darwin.h" />
-    <CustomBuildStep Include="..\..\os_freebsd.h" />
-    <CustomBuildStep Include="..\..\os_generic.h" />
-    <CustomBuildStep Include="..\..\os_linux.h" />
-    <CustomBuildStep Include="..\..\os_netbsd.h" />
-    <CustomBuildStep Include="..\..\os_openbsd.h" />
-    <CustomBuildStep Include="..\..\os_os2.h" />
-    <CustomBuildStep Include="..\..\os_qnxnto.h" />
-    <CustomBuildStep Include="..\..\os_solaris.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="smartctl_res.rc">
-      <Filter>os_win32</Filter>
-    </ResourceCompile>
-    <ResourceCompile Include="smartd_res.rc">
-      <Filter>os_win32</Filter>
-    </ResourceCompile>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/vc10/smartd.vcxproj b/os_win32/vc10/smartd.vcxproj
deleted file mode 100644 (file)
index 2129a8b..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}</ProjectGuid>
-    <RootNamespace>smartd</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <ProjectName>smartd</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;..;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <DisableSpecificWarnings>4250</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <AdditionalIncludeDirectories>.;..;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4250</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\ataidentify.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\dev_areca.cpp" />
-    <ClCompile Include="..\..\nvmecmds.cpp" />
-    <ClCompile Include="..\..\nvmeprint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\daemon_win32.cpp" />
-    <ClCompile Include="..\syslog_win32.cpp" />
-    <ClCompile Include="..\wmiquery.cpp" />
-    <ClCompile Include="..\..\regex\regcomp.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex.c" />
-    <ClCompile Include="..\..\regex\regex_internal.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regexec.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt.c" />
-    <ClCompile Include="..\..\getopt\getopt1.c" />
-    <ClCompile Include="..\..\atacmdnames.cpp" />
-    <ClCompile Include="..\..\atacmds.cpp" />
-    <ClCompile Include="..\..\ataprint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\cciss.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
-    <ClCompile Include="..\..\dev_interface.cpp" />
-    <ClCompile Include="..\..\dev_legacy.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\knowndrives.cpp" />
-    <ClCompile Include="..\..\os_darwin.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_freebsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_generic.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_linux.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_netbsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_openbsd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_os2.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_qnxnto.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_solaris.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\os_win32.cpp" />
-    <ClCompile Include="..\..\scsiata.cpp" />
-    <ClCompile Include="..\..\scsicmds.cpp" />
-    <ClCompile Include="..\..\scsiprint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\smartctl.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\..\smartd.cpp" />
-    <ClCompile Include="..\..\utility.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\aacraid.h" />
-    <ClInclude Include="..\..\ataidentify.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClInclude>
-    <ClInclude Include="..\..\dev_areca.h" />
-    <ClInclude Include="..\..\nvmecmds.h" />
-    <ClInclude Include="..\..\nvmeprint.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClInclude>
-    <ClInclude Include="..\daemon_win32.h" />
-    <ClInclude Include="..\syslog.h" />
-    <ClInclude Include="..\wbemcli_small.h" />
-    <ClInclude Include="..\wmiquery.h" />
-    <ClInclude Include="..\..\regex\regex.h" />
-    <ClInclude Include="..\..\regex\regex_internal.h" />
-    <ClInclude Include="..\..\getopt\getopt.h" />
-    <ClInclude Include="..\..\atacmdnames.h" />
-    <ClInclude Include="..\..\atacmds.h" />
-    <ClInclude Include="config.h" />
-    <ClInclude Include="svnversion.h" />
-    <CustomBuildStep Include="..\..\ataprint.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\cciss.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\..\cissio_freebsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClInclude>
-    <ClInclude Include="..\..\csmisas.h" />
-    <ClInclude Include="..\..\dev_ata_cmd_set.h" />
-    <ClInclude Include="..\..\dev_interface.h" />
-    <ClInclude Include="..\..\dev_tunnelled.h" />
-    <ClInclude Include="..\..\drivedb.h" />
-    <ClInclude Include="..\..\int64.h" />
-    <ClInclude Include="..\..\knowndrives.h" />
-    <CustomBuildStep Include="..\..\megaraid.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_darwin.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_freebsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_generic.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_linux.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_netbsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_openbsd.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_os2.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_qnxnto.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\os_solaris.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\..\scsicmds.h" />
-    <CustomBuildStep Include="..\..\scsiprint.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <CustomBuildStep Include="..\..\smartctl.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </CustomBuildStep>
-    <ClInclude Include="..\..\utility.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\smartd_warning.sh.in" />
-    <None Include="..\installer.nsi" />
-    <None Include="..\smartctl_res.rc.in" />
-    <None Include="..\smartd_res.rc.in" />
-    <None Include="..\smartd_warning.cmd" />
-    <CustomBuild Include="..\syslogevt.mc">
-      <FileType>Document</FileType>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Command>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Message>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Command>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Message>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
-    </CustomBuild>
-    <None Include="..\update-smart-drivedb.nsi" />
-    <None Include="..\..\AUTHORS" />
-    <None Include="..\..\autogen.sh" />
-    <None Include="..\..\ChangeLog" />
-    <None Include="..\..\config.h.in" />
-    <None Include="..\..\configure.ac" />
-    <None Include="..\..\do_release" />
-    <None Include="..\..\Doxyfile" />
-    <None Include="..\..\INSTALL" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="..\..\NEWS" />
-    <None Include="..\..\README" />
-    <None Include="..\..\smartctl.8.in" />
-    <None Include="..\..\smartd.8.in" />
-    <None Include="..\..\smartd.conf.5.in" />
-    <None Include="..\..\smartd.initd.in" />
-    <None Include="..\..\TODO" />
-    <None Include="..\..\update-smart-drivedb.in" />
-    <None Include="..\..\WARNINGS" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="smartctl_res.rc">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ResourceCompile>
-    <ResourceCompile Include="smartd_res.rc">
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)</AdditionalIncludeDirectories>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/vc10/smartd.vcxproj.filters b/os_win32/vc10/smartd.vcxproj.filters
deleted file mode 100644 (file)
index 9efd8b2..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="os_win32">
-      <UniqueIdentifier>{44bb110e-4d44-4d5e-8186-354210a8d3ba}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="regex">
-      <UniqueIdentifier>{fd3bb1d5-a72e-4f92-84a3-6eac97975ec7}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="getopt">
-      <UniqueIdentifier>{1d1b67d5-219f-4e86-a5ff-9d94f1f751f9}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\daemon_win32.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\syslog_win32.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\wmiquery.cpp">
-      <Filter>os_win32</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regcomp.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regex_internal.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\regex\regexec.c">
-      <Filter>regex</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt.c">
-      <Filter>getopt</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\getopt\getopt1.c">
-      <Filter>getopt</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\atacmdnames.cpp" />
-    <ClCompile Include="..\..\atacmds.cpp" />
-    <ClCompile Include="..\..\ataprint.cpp" />
-    <ClCompile Include="..\..\cciss.cpp" />
-    <ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
-    <ClCompile Include="..\..\dev_interface.cpp" />
-    <ClCompile Include="..\..\dev_legacy.cpp" />
-    <ClCompile Include="..\..\knowndrives.cpp" />
-    <ClCompile Include="..\..\os_darwin.cpp" />
-    <ClCompile Include="..\..\os_freebsd.cpp" />
-    <ClCompile Include="..\..\os_generic.cpp" />
-    <ClCompile Include="..\..\os_linux.cpp" />
-    <ClCompile Include="..\..\os_netbsd.cpp" />
-    <ClCompile Include="..\..\os_openbsd.cpp" />
-    <ClCompile Include="..\..\os_os2.cpp" />
-    <ClCompile Include="..\..\os_qnxnto.cpp" />
-    <ClCompile Include="..\..\os_solaris.cpp" />
-    <ClCompile Include="..\..\os_win32.cpp" />
-    <ClCompile Include="..\..\scsiata.cpp" />
-    <ClCompile Include="..\..\scsicmds.cpp" />
-    <ClCompile Include="..\..\scsiprint.cpp" />
-    <ClCompile Include="..\..\smartctl.cpp" />
-    <ClCompile Include="..\..\smartd.cpp" />
-    <ClCompile Include="..\..\utility.cpp" />
-    <ClCompile Include="..\..\ataidentify.cpp" />
-    <ClCompile Include="..\..\dev_areca.cpp" />
-    <ClCompile Include="..\..\nvmecmds.cpp" />
-    <ClCompile Include="..\..\nvmeprint.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\daemon_win32.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\syslog.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\wbemcli_small.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\wmiquery.h">
-      <Filter>os_win32</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\regex\regex.h">
-      <Filter>regex</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\regex\regex_internal.h">
-      <Filter>regex</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\getopt\getopt.h">
-      <Filter>getopt</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\aacraid.h" />
-    <ClInclude Include="..\..\atacmdnames.h" />
-    <ClInclude Include="..\..\atacmds.h" />
-    <ClInclude Include="..\..\cissio_freebsd.h" />
-    <ClInclude Include="..\..\csmisas.h" />
-    <ClInclude Include="..\..\dev_ata_cmd_set.h" />
-    <ClInclude Include="..\..\dev_interface.h" />
-    <ClInclude Include="..\..\dev_tunnelled.h" />
-    <ClInclude Include="..\..\drivedb.h" />
-    <ClInclude Include="..\..\int64.h" />
-    <ClInclude Include="..\..\knowndrives.h" />
-    <ClInclude Include="..\..\scsicmds.h" />
-    <ClInclude Include="..\..\utility.h" />
-    <ClInclude Include="..\..\ataidentify.h" />
-    <ClInclude Include="..\..\dev_areca.h" />
-    <ClInclude Include="config.h" />
-    <ClInclude Include="svnversion.h" />
-    <ClInclude Include="..\..\nvmecmds.h" />
-    <ClInclude Include="..\..\nvmeprint.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\installer.nsi">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\update-smart-drivedb.nsi">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\..\AUTHORS" />
-    <None Include="..\..\autogen.sh" />
-    <None Include="..\..\ChangeLog" />
-    <None Include="..\..\config.h.in" />
-    <None Include="..\..\configure.ac" />
-    <None Include="..\..\do_release" />
-    <None Include="..\..\Doxyfile" />
-    <None Include="..\..\INSTALL" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="..\..\NEWS" />
-    <None Include="..\..\README" />
-    <None Include="..\..\smartctl.8.in" />
-    <None Include="..\..\smartd.8.in" />
-    <None Include="..\..\smartd.conf.5.in" />
-    <None Include="..\..\smartd.initd.in" />
-    <None Include="..\..\TODO" />
-    <None Include="..\..\update-smart-drivedb.in" />
-    <None Include="..\..\WARNINGS" />
-    <None Include="..\smartd_warning.cmd">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\..\smartd_warning.sh.in" />
-    <None Include="..\smartctl_res.rc.in">
-      <Filter>os_win32</Filter>
-    </None>
-    <None Include="..\smartd_res.rc.in">
-      <Filter>os_win32</Filter>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuildStep Include="..\..\ataprint.h" />
-    <CustomBuildStep Include="..\..\cciss.h" />
-    <CustomBuildStep Include="..\..\megaraid.h" />
-    <CustomBuildStep Include="..\..\os_darwin.h" />
-    <CustomBuildStep Include="..\..\os_freebsd.h" />
-    <CustomBuildStep Include="..\..\os_generic.h" />
-    <CustomBuildStep Include="..\..\os_linux.h" />
-    <CustomBuildStep Include="..\..\os_netbsd.h" />
-    <CustomBuildStep Include="..\..\os_openbsd.h" />
-    <CustomBuildStep Include="..\..\os_os2.h" />
-    <CustomBuildStep Include="..\..\os_qnxnto.h" />
-    <CustomBuildStep Include="..\..\os_solaris.h" />
-    <CustomBuildStep Include="..\..\scsiprint.h" />
-    <CustomBuildStep Include="..\..\smartctl.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="smartctl_res.rc">
-      <Filter>os_win32</Filter>
-    </ResourceCompile>
-    <ResourceCompile Include="smartd_res.rc">
-      <Filter>os_win32</Filter>
-    </ResourceCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="..\syslogevt.mc">
-      <Filter>os_win32</Filter>
-    </CustomBuild>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/vc10/smartmontools.sln b/os_win32/vc10/smartmontools.sln
deleted file mode 100644 (file)
index c6530b4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartctl", "smartctl.vcxproj", "{3AFEDCDD-D289-4543-A91D-EFBA6C710247}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartd", "smartd.vcxproj", "{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runcmd", "runcmd.vcxproj", "{11A4B619-D97B-499F-AF17-CF9F80BF70E8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wtssendmsg", "wtssendmsg.vcxproj", "{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Release|Win32 = Release|Win32
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {3AFEDCDD-D289-4543-A91D-EFBA6C710247}.Debug|Win32.ActiveCfg = Debug|Win32
-               {3AFEDCDD-D289-4543-A91D-EFBA6C710247}.Debug|Win32.Build.0 = Debug|Win32
-               {3AFEDCDD-D289-4543-A91D-EFBA6C710247}.Release|Win32.ActiveCfg = Release|Win32
-               {3AFEDCDD-D289-4543-A91D-EFBA6C710247}.Release|Win32.Build.0 = Release|Win32
-               {C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Debug|Win32.ActiveCfg = Debug|Win32
-               {C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Debug|Win32.Build.0 = Debug|Win32
-               {C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Release|Win32.ActiveCfg = Release|Win32
-               {C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Release|Win32.Build.0 = Release|Win32
-               {11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Debug|Win32.ActiveCfg = Debug|Win32
-               {11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Debug|Win32.Build.0 = Debug|Win32
-               {11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Release|Win32.ActiveCfg = Release|Win32
-               {11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Release|Win32.Build.0 = Release|Win32
-               {0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Debug|Win32.ActiveCfg = Debug|Win32
-               {0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Debug|Win32.Build.0 = Debug|Win32
-               {0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Release|Win32.ActiveCfg = Release|Win32
-               {0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Release|Win32.Build.0 = Release|Win32
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/os_win32/vc10/wtssendmsg.vcxproj b/os_win32/vc10/wtssendmsg.vcxproj
deleted file mode 100644 (file)
index 92e143a..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\wtssendmsg.c" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>wtssendmsg</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-    <IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_DEBUG;_CRT_NONSTDC_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>wtsapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>NDEBUG;_CRT_NONSTDC_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>wtsapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/os_win32/versioninfo.rc.in b/os_win32/versioninfo.rc.in
new file mode 100644 (file)
index 0000000..99388e9
--- /dev/null
@@ -0,0 +1,34 @@
+//
+// os_win32/versioninfo.rc.in
+//
+// $Id: versioninfo.rc.in 4519 2017-10-08 15:41:54Z chrfranke $
+//
+
+1 VERSIONINFO
+    FILEVERSION @BINARY_VERSION@
+    PRODUCTVERSION @BINARY_VERSION@
+    FILEFLAGSMASK 0x0
+    FILEFLAGS 0x0
+    FILEOS 0x4 // VOS__WINDOWS32
+    FILETYPE 0x1 // VFT_APP
+    FILESUBTYPE 0x0
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "04090000"
+        BEGIN
+            VALUE "CompanyName", "www.smartmontools.org"
+            VALUE "FileDescription", "@DESC@"
+            VALUE "FileVersion", "@TEXT_VERSION@"
+            VALUE "InternalName", "@NAME@"
+            VALUE "LegalCopyright", "(C) 2002-@YY@, Bruce Allen, Christian Franke, www.smartmontools.org"
+            VALUE "OriginalFilename", "@NAME@.exe"
+            VALUE "ProductName", "smartmontools"
+            VALUE "ProductVersion", "@TEXT_VERSION@"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0409, 0x0000
+    END
+END
index 861ae4acc37805d2a94a13298fdc7d8c70c1d9c9..5ced75b4f4878e7ef6bc3fc7fa12d4ce550edda5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2011-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2011-13 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-const char * wmiquery_cpp_cvsid = "$Id: wmiquery.cpp 4120 2015-08-27 16:12:21Z samm2 $"
+const char * wmiquery_cpp_cvsid = "$Id: wmiquery.cpp 4431 2017-08-08 19:38:15Z chrfranke $"
   WMIQUERY_H_CVSID;
 
 
index dca7fb7c74773a0f9a3ef6ace4e6bed33d8de189..2977f1a66c09d0126db377f7d01ae6adfd1d2dff 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2012 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #define WINVER 0x0500
 #define _WIN32_WINNT WINVER
 
-char svnid[] = "$Id: wtssendmsg.c 4120 2015-08-27 16:12:21Z samm2 $";
+char svnid[] = "$Id: wtssendmsg.c 4431 2017-08-08 19:38:15Z chrfranke $";
 
 #include <stdio.h>
 #include <string.h>
@@ -30,7 +30,7 @@ char svnid[] = "$Id: wtssendmsg.c 4120 2015-08-27 16:12:21Z samm2 $";
 
 static int usage()
 {
-  printf("wtssendmsg $Revision: 4120 $ - Display a message box on client desktops\n"
+  printf("wtssendmsg $Revision: 4431 $ - Display a message box on client desktops\n"
          "Copyright (C) 2012 Christian Franke, smartmontools.org\n\n"
          "Usage: wtssendmsg [-cas] [-v] [\"Caption\"] \"Message\"|-\n"
          "       wtssendmsg -v\n\n"
index 26a9290c4d0a32e718ed34a8eecc73cb0440b948..abc5f02c3a51faea7328298999dff7d3107b7153 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2006-15 Douglas Gilbert <dgilbert@interlog.com>
- * Copyright (C) 2009-16 Christian Franke
+ * Copyright (C) 2009-17 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@
 #include "dev_ata_cmd_set.h" // ata_device_with_command_set
 #include "dev_tunnelled.h" // tunnelled_device<>
 
-const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 4276 2016-04-02 19:13:39Z chrfranke $";
+const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 4386 2017-01-28 16:35:06Z chrfranke $";
 
 /* This is a slightly stretched SCSI sense "descriptor" format header.
    The addition is to allow the 0x70 and 0x71 response codes. The idea
@@ -247,14 +247,14 @@ sat_device::~sat_device() throw()
 
 bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
 {
-  if (!ata_cmd_is_supported(in,
-    ata_device::supports_data_out |
-    ata_device::supports_output_regs |
-    ata_device::supports_multi_sector |
-    ata_device::supports_48bit,
-    "SAT")
-  )
-    return false;
+    if (!ata_cmd_is_supported(in,
+      ata_device::supports_data_out |
+      ata_device::supports_output_regs |
+      ata_device::supports_multi_sector |
+      ata_device::supports_48bit,
+      "SAT")
+    )
+      return false;
 
     struct scsi_cmnd_io io_hdr;
     struct scsi_sense_disect sinfo;
@@ -1170,7 +1170,6 @@ bool usbjmicron_device::get_registers(unsigned short addr,
   io_hdr.dxfer_len = size;
   io_hdr.dxferp = buf;
   io_hdr.cmnd = cdb;
-  io_hdr.cmnd_len = sizeof(cdb);
   io_hdr.cmnd_len = (!m_prolific ? 12 : 14);
 
   scsi_device * scsidev = get_tunnel_dev();
index eb4fb1dd1847e215261106bfb4c088d5ba597c3c..9d0439469006fc4826583f72af7bd7102c3c2aa6 100644 (file)
@@ -47,7 +47,7 @@
 #include "dev_interface.h"
 #include "utility.h"
 
-const char *scsicmds_c_cvsid="$Id: scsicmds.cpp 4243 2016-03-20 18:29:36Z chrfranke $"
+const char *scsicmds_c_cvsid="$Id: scsicmds.cpp 4414 2017-03-27 21:00:46Z chrfranke $"
   SCSICMDS_H_CVSID;
 
 // Print SCSI debug messages?
@@ -1453,7 +1453,7 @@ scsiSetExceptionControlAndWarning(scsi_device * device, int enabled,
             if (iecp->gotChangeable &&
                 (iecp->raw_chg[offset + 2] & DEXCPT_ENABLE))
                 rout[offset + 2] |= DEXCPT_ENABLE;
-                rout[offset + 2] &= TEST_DISABLE;/* clear TEST bit for spec */
+            rout[offset + 2] &= TEST_DISABLE; /* clear TEST bit for spec */
         }
     }
     if (10 == iecp->modese_len)
@@ -1493,7 +1493,6 @@ scsiCheckIE(scsi_device * device, int hasIELogPage, int hasTempLogPage,
     UINT8 tBuf[252];
     struct scsi_sense_disect sense_info;
     int err;
-    int temperatureSet = 0;
     UINT8 currTemp, trTemp;
 
     *asc = 0;
@@ -1534,7 +1533,7 @@ scsiCheckIE(scsi_device * device, int hasIELogPage, int hasTempLogPage,
     }
     *asc = sense_info.asc;
     *ascq = sense_info.ascq;
-    if ((! temperatureSet) && hasTempLogPage) {
+    if (hasTempLogPage) {
         if (0 == scsiGetTemp(device, &currTemp, &trTemp)) {
             *currenttemp = currTemp;
             *triptemp = trTemp;
index 65402fac56a06fec3fa81612a6a289fd8f8291fa..bbb9f8af19aadfc0e937a140c1c44ed361ff3c45 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef SCSICMDS_H_
 #define SCSICMDS_H_
 
-#define SCSICMDS_H_CVSID "$Id: scsicmds.h 4152 2015-10-17 16:08:21Z chrfranke $\n"
+#define SCSICMDS_H_CVSID "$Id: scsicmds.h 4557 2017-10-19 19:17:29Z samm2 $\n"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -304,8 +304,9 @@ Documentation, see http://www.storage.ibm.com/techsup/hddtech/prodspecs.htm */
 
 
 /* SCSI command timeout values (units are seconds) */
-#define SCSI_TIMEOUT_DEFAULT    20  // should be longer than the spin up time
-                                    // of a disk in standby mode.
+#define SCSI_TIMEOUT_DEFAULT    60  // should be longer than the spin up time
+                                    // of a disk in JBOD.
+
 #define SCSI_TIMEOUT_SELF_TEST  (5 * 60 * 60)   /* allow max 5 hours for */
                                             /* extended foreground self test */
 
index 42e43e65a4c4148871926c728ba6b3e2349abd2c..9416f23ad128bd1eec8a291ed1f24ec5ec883260 100644 (file)
@@ -40,7 +40,7 @@
 
 #define GBUF_SIZE 65535
 
-const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 4292 2016-04-12 23:06:59Z dpgilbert $"
+const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 4415 2017-03-27 21:14:53Z chrfranke $"
                                  SCSIPRINT_H_CVSID;
 
 
@@ -1205,7 +1205,6 @@ show_sas_port_param(unsigned char * ucp, int param_len)
 {
     int j, m, n, nphys, t, sz, spld_len;
     unsigned char * vcp;
-    uint64_t ull;
     char s[64];
 
     sz = sizeof(s);
@@ -1293,14 +1292,17 @@ show_sas_port_param(unsigned char * ucp, int param_len)
                !! (vcp[6] & 8), !! (vcp[6] & 4), !! (vcp[6] & 2));
         pout("    attached target port: ssp=%d stp=%d smp=%d\n",
                !! (vcp[7] & 8), !! (vcp[7] & 4), !! (vcp[7] & 2));
-        for (n = 0, ull = vcp[8]; n < 8; ++n) {
-            ull <<= 8; ull |= vcp[8 + n];
-        }
-        pout("    SAS address = 0x%" PRIx64 "\n", ull);
-        for (n = 0, ull = vcp[16]; n < 8; ++n) {
-            ull <<= 8; ull |= vcp[16 + n];
+        if (!dont_print_serial_number) {
+            uint64_t ull;
+            for (n = 0, ull = vcp[8]; n < 8; ++n) {
+                ull <<= 8; ull |= vcp[8 + n];
+            }
+            pout("    SAS address = 0x%" PRIx64 "\n", ull);
+            for (n = 0, ull = vcp[16]; n < 8; ++n) {
+                ull <<= 8; ull |= vcp[16 + n];
+            }
+            pout("    attached SAS address = 0x%" PRIx64 "\n", ull);
         }
-        pout("    attached SAS address = 0x%" PRIx64 "\n", ull);
         pout("    attached phy identifier = %d\n", vcp[24]);
         unsigned int ui;
         ui = (vcp[32] << 24) | (vcp[33] << 16) | (vcp[34] << 8) | vcp[35];
@@ -1942,13 +1944,13 @@ scsiPrintMain(scsi_device * device, const scsi_print_options & options)
     if (options.smart_enable) {
         if (scsiSmartEnable(device))
             failuretest(MANDATORY_CMD, returnval |= FAILSMART);
-            any_output = true;
+        any_output = true;
     }
 
     if (options.smart_disable) {
         if (scsiSmartDisable(device))
             failuretest(MANDATORY_CMD,returnval |= FAILSMART);
-            any_output = true;
+        any_output = true;
     }
 
     if (options.smart_auto_save_enable) {
index 29632ada9daa7df63359d708948bee26f0cf68a3..cae657c3cbb272b584aa8a291a15d95ea62b03ae 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-9 Bruce Allen
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * Additional SCSI work:
@@ -29,7 +29,7 @@
 #ifndef SCSI_PRINT_H_
 #define SCSI_PRINT_H_
 
-#define SCSIPRINT_H_CVSID "$Id: scsiprint.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define SCSIPRINT_H_CVSID "$Id: scsiprint.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Options for scsiPrintMain
 struct scsi_print_options
index 943b6221d7b045730947d156903af031a0285a34..b6cd2946a797fcdfee01ae3d8aaf4dedea819a20 100644 (file)
@@ -1,8 +1,8 @@
 .ig
 Copyright (C) 2002-10 Bruce Allen
-Copyright (C) 2004-16 Christian Franke
+Copyright (C) 2004-17 Christian Franke
 
-$Id: smartctl.8.in 4311 2016-04-27 21:03:01Z chrfranke $
+$Id: smartctl.8.in 4588 2017-11-04 15:15:32Z chrfranke $
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -18,13 +18,30 @@ Research Center), Jack Baskin School of Engineering, University of
 California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 
 ..
+.\" Macros borrowed from pages generated with Pod::Man
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp 0.4v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
 .TH SMARTCTL 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartctl\fP \- Control and Monitor Utility for SMART Disks
-
+.Sp
 .SH SYNOPSIS
 .B smartctl [options] device
-
+.Sp
 .SH DESCRIPTION
 .\" %IF NOT OS ALL
 .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
@@ -41,23 +58,25 @@ self-tests.
 This version of \fBsmartctl\fP is compatible with
 ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards
 (see \fBREFERENCES\fP below).
-
+.PP
 \fBsmartctl\fP also provides support for polling TapeAlert messages
 from SCSI tape drives and changers.
-
+.PP
 The user must specify the device to be controlled or interrogated as
-the final argument to \fBsmartctl\fP. The command set used by the device
-is often derived from the device path but may need help with the \'\-d\'
+the final argument to \fBsmartctl\fP.  The command set used by the device
+is often derived from the device path but may need help with the \*(Aq\-d\*(Aq
 option (for more information see the section on "ATA, SCSI command sets
-and SAT" below). Device paths are as follows:
+and SAT" below).
+Device paths are as follows:
 .\" %IF OS Linux
 .IP \fBLINUX\fP: 9
 Use the forms \fB"/dev/sd[a\-z]"\fP for ATA/SATA and SCSI/SAS devices.
 For SCSI Tape Drives and Changers with TapeAlert support use the
 devices \fB"/dev/nst*"\fP and \fB"/dev/sg*"\fP.  For disks behind
 3ware controllers you may need \fB"/dev/sd[a\-z]"\fP or
-\fB"/dev/twe[0\-9]"\fP, \fB"/dev/twa[0\-9]"\fP or \fB"/dev/twl[0\-9]"\fP: see details
-below. For disks behind HighPoint RocketRAID controllers you may need
+\fB"/dev/twe[0\-9]"\fP, \fB"/dev/twa[0\-9]"\fP or \fB"/dev/twl[0\-9]"\fP:
+see details below.
+For disks behind HighPoint RocketRAID controllers you may need
 \fB"/dev/sd[a\-z]"\fP.  For disks behind Areca SATA RAID controllers,
 you need \fB"/dev/sg[2\-9]"\fP (note that smartmontools interacts with
 the Areca controllers via a SCSI generic device which is different
@@ -65,19 +84,28 @@ than the SCSI device used for reading and writing data)!  For HP Smart
 Array RAID controllers, there are three currently supported drivers: cciss,
 hpsa, and hpahcisr.  For disks accessed via the cciss driver the device nodes
 are of the form \fB"/dev/cciss/c[0\-9]d0"\fP.  For disks accessed via
-the hpahcisr and hpsa drivers, the device nodes you need are \fB"/dev/sg[0\-9]*"\fP.
-("lsscsi \-g" is helpful in determining which scsi generic device node corresponds
-to which device.)  Use the nodes corresponding to the RAID controllers,
-not the nodes corresponding to logical drives.  See the \fB\-d\fP option below, as well.
+the hpahcisr and hpsa drivers, the device nodes you need are
+\fB"/dev/sg[0\-9]*"\fP.
+("lsscsi \-g" is helpful in determining which scsi generic device node
+corresponds to which device.)
+Use the nodes corresponding to the RAID controllers, not the nodes
+corresponding to logical drives.
+See the \fB\-d\fP option below, as well.
 Use the forms \fB"/dev/nvme[0\-9]"\fP (broadcast namespace) or
 \fB"/dev/nvme[0\-9]n[1\-9]"\fP (specific namespace 1\-9) for NVMe devices.
 .\" %ENDIF OS Linux
 .\" %IF OS Darwin
 .IP \fBDARWIN\fP: 9
-Use the forms \fB/dev/disk[0\-9]\fP or equivalently \fBdisk[0\-9]\fP or equivalently
-\fB/dev/rdisk[0\-9]\fP.  Long forms are also available: please use \'\-h\' to see some
-examples. Note that there is currently no Darwin SCSI support.
-
+Use the forms \fB/dev/disk[0\-9]\fP or equivalently \fBdisk[0\-9]\fP or
+equivalently \fB/dev/rdisk[0\-9]\fP.
+Long forms are also available: please use \*(Aq\-h\*(Aq to see some examples.
+.Sp
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+There is NVMe support based on the undocumented SMART API in OSX. Currently only
+SMART and Controller information pages are supported.
+.Sp
+Note that Darwin SCSI support is not yet implemented.
+.Sp
 Use the OS X SAT SMART Driver to access SMART data on SAT capable USB and
 Firewire devices (see INSTALL file).
 .\" %ENDIF OS Darwin
@@ -86,15 +114,15 @@ Firewire devices (see INSTALL file).
 Use the forms \fB"/dev/ad[0\-9]+"\fP for IDE/ATA
 devices and \fB"/dev/da[0\-9]+"\fP or \fB"/dev/pass[0\-9]+"\fP for SCSI devices.
 For SATA devices on AHCI bus use \fB"/dev/ada[0\-9]+"\fP format.  For HP Smart
-Array RAID controllers, use \fB"/dev/ciss[0\-9]"\fP (and see the \fB-d\fP option,
-below).
+Array RAID controllers, use \fB"/dev/ciss[0\-9]"\fP (and see the \fB\-d\fP
+option, below).
 .\" %ENDIF OS FreeBSD
 .\" %IF OS NetBSD OpenBSD
 .IP \fBNETBSD/OPENBSD\fP: 9
 Use the form \fB"/dev/wd[0\-9]+c"\fP for IDE/ATA
 devices.  For SCSI disk and tape devices, use the device names
-\fB"/dev/sd[0\-9]+c"\fP and \fB"/dev/st[0\-9]+c"\fP respectively.  
-Be sure to specify the correct "whole disk" partition letter for 
+\fB"/dev/sd[0\-9]+c"\fP and \fB"/dev/st[0\-9]+c"\fP respectively.
+Be sure to specify the correct "whole disk" partition letter for
 your architecture.
 .\" %ENDIF OS NetBSD OpenBSD
 .\" %IF OS Solaris
@@ -110,64 +138,72 @@ Use \fB"/dev/sd[a\-z][a\-z]"\fP for "\\\\.\\PhysicalDrive[26\-...]".
 These disks can also be referred to as \fB"/dev/pd[0\-255]"\fP for
 "\\\\.\\PhysicalDrive[0\-255]".
 ATA disks can also be referred to as \fB"/dev/hd[a\-z]"\fP for
-"\\\\.\\PhysicalDrive[0\-25]". 
+"\\\\.\\PhysicalDrive[0\-25]".
 Use one the forms \fB"/dev/tape[0\-255]"\fP, \fB"/dev/st[0\-255]"\fP,
 or \fB"/dev/nst[0\-255]"\fP for SCSI tape drives "\\\\.\\Tape[0\-255]".
-
+.Sp
 Alternatively, drive letters \fB"X:"\fP or \fB"X:\\"\fP may be used to
-specify the (\'basic\') disk behind a mounted partition.  This does
-not work with \'dynamic\' disks.
-
+specify the (\*(Aqbasic\*(Aq) disk behind a mounted partition.  This does
+not work with \*(Aqdynamic\*(Aq disks.
+.Sp
 For disks behind 3ware 9000 controllers use \fB"/dev/sd[a\-z],N"\fP where
-N specifies the disk number (3ware \'port\') behind the controller
-providing the logical drive (\'unit\') specified by \fB"/dev/sd[a\-z]"\fP.
+N specifies the disk number (3ware \*(Aqport\*(Aq) behind the controller
+providing the logical drive (\*(Aqunit\*(Aq) specified by
+\fB"/dev/sd[a\-z]"\fP.
 Alternatively, use \fB"/dev/tw_cli/cx/py"\fP for controller x, port y
-to run the \'tw_cli\' tool and parse the output. This provides limited
-monitoring (\'\-i\', \'\-c\', \'\-A\' below) if SMART support is missing
-in the driver. Use \fB"/dev/tw_cli/stdin"\fP or \fB"/dev/tw_cli/clip"\fP
+to run the \*(Aqtw_cli\*(Aq tool and parse the output.  This provides limited
+monitoring (\*(Aq\-i\*(Aq, \*(Aq\-c\*(Aq, \*(Aq\-A\*(Aq below) if SMART
+support is missing in the driver.
+Use \fB"/dev/tw_cli/stdin"\fP or \fB"/dev/tw_cli/clip"\fP
 to parse CLI or 3DM output from standard input or clipboard.
-The option \'\-d 3ware,N\' is not necessary on Windows.
-
+The option \*(Aq\-d 3ware,N\*(Aq is not necessary on Windows.
+.Sp
 For disks behind an Intel ICHxR controller with RST driver use
 \fB"/dev/csmi[0\-9],N"\fP where N specifies the port behind the logical
 scsi controller "\\\\.\\Scsi[0\-9]:".
-
+.Sp
 For SATA or SAS disks behind an Areca controller use
-\fB"/dev/arcmsr[0\-9]"\fP, see \'\-d areca,N[/E]\' below.
-
+\fB"/dev/arcmsr[0\-9]"\fP, see \*(Aq\-d areca,N[/E]\*(Aq below.
+.Sp
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 Use the forms \fB"/dev/nvme[0\-9]"\fP (broadcast namespace) or
 \fB"/dev/nvme[0\-9]n[1\-9]"\fP (specific namespace 1\-9) for first,
 second, ..., NVMe device.
 Alternatively use the forms \fB"/dev/nvmes[0\-9][n[1\-9]]"\fP for NVMe devices
 behind the logical scsi controller "\\\\.\\Scsi[0\-9]:".
-
+Both forms require a NVMe driver which supports NVME_PASS_THROUGH_IOCTL.
+.Sp
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+Use the forms \fB"/dev/sd[...]"\fP or \fB"/dev/pd[...]"\fP (see above)
+for NVMe devices behind Windows 10 NVMe driver (stornvme.sys).
+.Sp
 The prefix \fB"/dev/"\fP is optional.
 .\" %ENDIF OS Windows Cygwin
 .\" %IF OS OS2
 .IP \fBOS/2,eComStation\fP: 9
-Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
+Use the form \fB"/dev/hd[a\-z]"\fP for ATA/SATA devices using DANIS506 driver.
+.Sp
+Use the form \fB"/dev/ahci[a\-z]"\fP for ATA/SATA devices using OS2AHCI driver.
 .\" %ENDIF OS OS2
 .PP
-if \'\-\' is specified as the device path, \fBsmartctl\fP reads and
+if \*(Aq\-\*(Aq is specified as the device path, \fBsmartctl\fP reads and
 interprets it's own debug output from standard input.
-See \'\-r ataioctl\' below for details.
+See \*(Aq\-r ataioctl\*(Aq below for details.
+.PP
+\fBsmartctl\fP guesses the device type if possible.
+If necessary, the \*(Aq\-d\*(Aq option can be used to override this guess.
 .PP
-Based on the device path, \fBsmartctl\fP will guess the device type
-(ATA or SCSI).  If necessary, the \'\-d\' option can be used to override
-this guess
-
 Note that the printed output of \fBsmartctl\fP displays most numerical
 values in base 10 (decimal), but some values are displayed in base 16
 (hexadecimal).  To distinguish them, the base 16 values are always
-displayed with a leading \fB"0x"\fP, for example: "0xff". This man
-page follows the same convention.
-
+displayed with a leading \fB"0x"\fP, for example: "0xff".
+This man page follows the same convention.
+.Sp
 .SH OPTIONS
 The options are grouped below into several categories.  \fBsmartctl\fP
 will execute the corresponding commands in the order: INFORMATION,
 ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
-
+.Sp
 .TP
 .B SHOW INFORMATION OPTIONS:
 .TP
@@ -177,81 +213,81 @@ Prints a usage message to STDOUT and exits.
 .B \-V, \-\-version, \-\-copyright, \-\-license
 Prints version, copyright, license, home page and SVN revision
 information for your copy of \fBsmartctl\fP to STDOUT and then exits.
-Please include this information if you are reporting bugs or problems.
 .TP
 .B \-i, \-\-info
 Prints the device model number, serial number, firmware version, and
 ATA Standard version/revision information.  Says if the device
 supports SMART, and if so, whether SMART support is currently enabled
 or disabled.  If the device supports Logical Block Address mode (LBA
-mode) print current user drive capacity in bytes. (If drive is has a
+mode) print current user drive capacity in bytes.  (If drive is has a
 user protected area reserved, or is "clipped", this may be smaller
 than the potential maximum drive capacity.)  Indicates if the drive is
-in the smartmontools database (see \'\-v\' options below).  If so, the
-drive model family may also be printed. If \'\-n\' (see below) is
-specified, the power mode of the drive is printed.
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
-[NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+in the smartmontools database (see \*(Aq\-v\*(Aq options below).  If so, the
+drive model family may also be printed.
+If \*(Aq\-n\*(Aq (see below) is specified, the power mode of the drive is
+printed.
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
+[NVMe]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 For NVMe devices the information is obtained from the Identify Controller
 and the Identify Namespace data structure.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-\-identify[=[w][nvb]]
 [ATA only] Prints an annotated table of the IDENTIFY DEVICE data.
 By default, only valid words (words not equal to 0x0000 or 0xffff)
 and nonzero bits and bit fields are printed.
 This can be changed by the optional argument which consists of one or
-two characters from the set \'wnvb\'.
-The character \'w\' enables printing of all 256 words. The character
-\'n\' suppresses printing of bits, \'v\' enables printing of all bits
-from valid words, \'b\' enables printing of all bits.
-For example \'\-\-identify=n\' (valid words, no bits) produces the
-shortest output and \'\-\-identify=wb\' (all words, all bits) produces
+two characters from the set \*(Aqwnvb\*(Aq.
+The character \*(Aqw\*(Aq enables printing of all 256 words.  The character
+\*(Aqn\*(Aq suppresses printing of bits, \*(Aqv\*(Aq enables printing of all
+bits from valid words, \*(Aqb\*(Aq enables printing of all bits.
+For example \*(Aq\-\-identify=n\*(Aq (valid words, no bits) produces the
+shortest output and \*(Aq\-\-identify=wb\*(Aq (all words, all bits) produces
 the longest output.
 .TP
 .B \-a, \-\-all
 Prints all SMART information about the disk, or TapeAlert information
 about the tape drive or changer.  For ATA devices this is equivalent
 to
-.nf
-\'\-H \-i \-c \-A \-l error \-l selftest \-l selective\'
-.fi
+.br
+\*(Aq\-H \-i \-c \-A \-l error \-l selftest \-l selective\*(Aq
+.br
 and for SCSI, this is equivalent to
-.nf
-\'\-H \-i \-A \-l error \-l selftest\'.
-.fi
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.br
+\*(Aq\-H \-i \-A \-l error \-l selftest\*(Aq.
+.br
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 For NVMe, this is equivalent to
-.nf
-\'\-H \-i \-c \-A \-l error'.
-.fi
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.br
+\*(Aq\-H \-i \-c \-A \-l error\*(Aq.
+.br
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 Note that for ATA disks this does \fBnot\fP enable the non-SMART options
 and the SMART options which require support for 48-bit ATA commands.
 .TP
 .B \-x, \-\-xall
-Prints all SMART and non-SMART information about the device. For ATA
-devices this is equivalent to
-.nf
-\'\-H \-i \-g all \-c \-A \-f brief \-l xerror,error \-l xselftest,selftest
-\-l selective \-l directory \-l scttemp \-l scterc \-l devstat \-l sataphy\'.
-.fi
+Prints all SMART and non-SMART information about the device.
+For ATA devices this is equivalent to
+.br
+\*(Aq\-H \-i \-g all \-g wcreorder \-c \-A \-f brief \-l xerror,error
+\-l xselftest,selftest \-l selective \-l directory \-l scttemp \-l scterc
+\-l devstat \-l sataphy\*(Aq.
+.br
 and for SCSI, this is equivalent to
-.nf
-\'\-H \-i \-A \-l error \-l selftest \-l background \-l sasphy\'.
-.fi
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.br
+\*(Aq\-H \-i \-g all \-A \-l error \-l selftest \-l background \-l sasphy\*(Aq.
+.br
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 For NVMe, this is equivalent to
-.nf
-\'\-H \-i \-c \-A \-l error'.
-.fi
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.br
+\*(Aq\-H \-i \-c \-A \-l error\*(Aq.
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-\-scan
 Scans for devices and prints each device name, device type and protocol
-([ATA] or [SCSI]) info.  May be used in conjunction with \'\-d TYPE\'
+([ATA] or [SCSI]) info.  May be used in conjunction with \*(Aq\-d TYPE\*(Aq
 to restrict the scan to a specific TYPE.  See also info about platform
 specific device scan and the \fBDEVICESCAN\fP directive on
 \fBsmartd\fP(8) man page.
@@ -259,188 +295,184 @@ specific device scan and the \fBDEVICESCAN\fP directive on
 .B \-\-scan\-open
 Same as \-\-scan, but also tries to open each device before printing
 device info.  The device open may change the device type due
-to autodetection (see also \'\-d test\').
-
+to autodetection (see also \*(Aq\-d test\*(Aq).
+.Sp
 This option can be used to create a draft \fBsmartd.conf\fP file.
-All options after \'\-\-\' are appended to each output line.
+All options after \*(Aq\-\-\*(Aq are appended to each output line.
 For example:
-.nf
+.Vb 1
 smartctl \-\-scan\-open \-\- \-a \-W 4,45,50 \-m admin@work > smartd.conf
-.fi
-
+.Ve
+.Sp
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
-Multiple \'\-d TYPE\' options may be specified with \'\-\-scan[\-open]\'
-to combine the scan results of more than one TYPE.
+Multiple \*(Aq\-d TYPE\*(Aq options may be specified with
+\*(Aq\-\-scan[\-open]\*(Aq to combine the scan results of more than one TYPE.
 .TP
 .B \-g NAME, \-\-get=NAME
-Get non-SMART device settings.  See \'\-s, \-\-set\' below for further info.
-
+Get non-SMART device settings.  See \*(Aq\-s, \-\-set\*(Aq below for further
+info.
+.Sp
 .TP
 .B RUN-TIME BEHAVIOR OPTIONS:
 .TP
 .B \-q TYPE, \-\-quietmode=TYPE
-Specifies that \fBsmartctl\fP should run in one of the two quiet modes
+Specifies that \fBsmartctl\fP should run in one of the quiet modes
 described here.  The valid arguments to this option are:
-
+.Sp
 .I errorsonly
-\- only print: For the \'\-l error\' option, if nonzero, the number
+\- only print: For the \*(Aq\-l error\*(Aq option, if nonzero, the number
 of errors recorded in the SMART error log and the power-on time when
-they occurred; For the \'\-l selftest\' option, errors recorded in the device
-self-test log; For the \'\-H\' option, SMART "disk failing" status or device
-Attributes (pre-failure or usage) which failed either now or in the
-past; For the \'\-A\' option, device Attributes (pre-failure or usage)
-which failed either now or in the past.
-
+they occurred; For the \*(Aq\-l selftest\*(Aq option, errors recorded in
+the device self-test log; For the \*(Aq\-H\*(Aq option, SMART "disk failing"
+status or device Attributes (pre-failure or usage) which failed either now
+or in the past; For the \*(Aq\-A\*(Aq option, device Attributes (pre-failure
+or usage) which failed either now or in the past.
+.Sp
 .I silent
 \- print no output.  The only way to learn about what was found is to
 use the exit status of \fBsmartctl\fP (see EXIT STATUS below).
-
+.Sp
 .I noserial
 \- Do not print the serial number of the device.
 .TP
 .B \-d TYPE, \-\-device=TYPE
 Specifies the type of the device.
 The valid arguments to this option are:
-
+.Sp
 .I auto
 \- attempt to guess the device type from the device name or from
 controller type info provided by the operating system or from
 a matching USB ID entry in the drive database.
 This is the default.
-
+.Sp
 .I test
-\- prints the guessed type, then opens the device and prints the
+\- prints the guessed TYPE, then opens the device and prints the
 (possibly changed) TYPE name and then exists without performing
 any further commands.
-
+.Sp
 .I ata
 \- the device type is ATA.  This prevents
 \fBsmartctl\fP
 from issuing SCSI commands to an ATA device.
-
+.Sp
 .\" %IF NOT OS Darwin
 .I scsi
 \- the device type is SCSI.  This prevents
 \fBsmartctl\fP
 from issuing ATA commands to a SCSI device.
-
+.Sp
 .\" %ENDIF NOT OS Darwin
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I nvme[,NSID]
-\- [FreeBSD, Linux, Windows and Cygwin only]
-[NEW EXPERIMENTAL SMARTCTL FEATURE]
+\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
 the device type is NVM Express (NVMe).
 The optional parameter NSID specifies the namespace id (in hex) passed
 to the driver.
 Use 0xffffffff for the broadcast namespace id.
 The default for NSID is the namespace id addressed by the device name.
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .\" %IF NOT OS Darwin
 .I sat[,auto][,N]
 \- the device type is SCSI to ATA Translation (SAT).
-This is for ATA disks that have a SCSI to ATA Translation (SAT) Layer
-(SATL) between the disk and the operating system.
+This is for ATA disks that have a SCSI to ATA Translation Layer (SATL)
+between the disk and the operating system.
 SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
 the other 16 bytes long.  The default is the 16 byte variant which can be
-overridden with either \'\-d sat,12\' or \'\-d sat,16\'.
-
-If \'\-d sat,auto\' is specified, device type SAT (for ATA/SATA disks) is
-only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA     ").
+overridden with either \*(Aq\-d sat,12\*(Aq or \*(Aq\-d sat,16\*(Aq.
+.Sp
+If \*(Aq\-d sat,auto\*(Aq is specified, device type SAT (for ATA/SATA disks)
+is only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA     ").
 Otherwise device type SCSI (for SCSI/SAS disks) is used.
-
+.Sp
 .I usbcypress
 \- this device type is for ATA disks that are behind a Cypress USB to PATA
 bridge.  This will use the ATACB proprietary scsi pass through command.
 The default SCSI operation code is 0x24, but although it can be overridden
-with \'\-d usbcypress,0xN\', where N is the scsi operation code,
+with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code,
 you're running the risk of damage to the device or filesystems on it.
-
+.Sp
 .I usbjmicron[,p][,x][,PORT]
 \- this device type is for SATA disks that are behind a JMicron USB to
-PATA/SATA bridge.  The 48-bit ATA commands (required e.g. for \'\-l xerror\',
-see below) do not work with all of these bridges and are therefore disabled by
-default.  These commands can be enabled by \'\-d usbjmicron,x\'.
-If two disks are connected to a bridge with two ports, an error message is printed
-if no PORT is specified.
-The port can be specified by \'\-d usbjmicron[,x],PORT\' where PORT is 0
+PATA/SATA bridge.
+The 48-bit ATA commands (required e.g.\& for \*(Aq\-l xerror\*(Aq, see below)
+do not work with all of these bridges and are therefore disabled by default.
+These commands can be enabled by \*(Aq\-d usbjmicron,x\*(Aq.
+If two disks are connected to a bridge with two ports, an error message is
+printed if no PORT is specified.
+The port can be specified by \*(Aq\-d usbjmicron[,x],PORT\*(Aq where PORT is 0
 (master) or 1 (slave).  This is not necessary if the device uses a port
 multiplier to connect multiple disks to one port.  The disks appear under
 separate /dev/ice names then.
-CAUTION: Specifying \',x\' for a device which does not support it results
+CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results
 in I/O errors and may disconnect the drive.  The same applies if the specified
 PORT does not exist or is not connected to a disk.
-
+.Sp
 The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
-command similar to JMicron and work with \'\-d usbjmicron,0\'.
+command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq.
 Newer Prolific firmware requires a modified command which can be selected by
-\'\-d usbjmicron,p\'.
+\*(Aq\-d usbjmicron,p\*(Aq.
 Note that this does not yet support the SMART status command.
-
+.Sp
 .I usbprolific
-\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
-this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775
-USB to SATA bridge.
-
+\- this device type is for SATA disks that are behind a Prolific
+PL2571/2771/2773/2775 USB to SATA bridge.
+.Sp
 .I usbsunplus
 \- this device type is for SATA disks that are behind a SunplusIT USB to SATA
 bridge.
-
+.Sp
 .\" %ENDIF NOT OS Darwin
 .\" %IF OS Linux
 .I marvell
 \- [Linux only] interact with SATA disks behind Marvell chip-set
 controllers (using the Marvell rather than libata driver).
-
+.Sp
 .I megaraid,N
 \- [Linux only] the device consists of one or more SCSI/SAS disks connected
 to a MegaRAID controller.  The non-negative integer N (in the range of 0 to
 127 inclusive) denotes which disk on the controller is monitored.
 Use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d megaraid,2 /dev/sda\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d megaraid,0 /dev/sdb\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d megaraid,0 /dev/bus/0\fP
-.fi
+.br
 This interface will also work for Dell PERC controllers.
 It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus
 number.
-
+.Sp
 The following entry in /proc/devices must exist:
 .br
 For PERC2/3/4 controllers: \fBmegadevN\fP
 .br
 For PERC5/6 controllers: \fBmegaraid_sas_ioctlN\fP
-
+.Sp
 .\" %ENDIF OS Linux
 .\" %IF OS Linux Windows Cygwin
 .I aacraid,H,L,ID
-\- [Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTCTL FEATURE]
-the device consists of one or more SCSI/SAS disks connected to an AacRaid controller.
+\- [Linux, Windows and Cygwin only] the device consists of one or more
+SCSI/SAS disks connected to an AacRaid controller.
 The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
 on the controller is monitored.
 Use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d aacraid,0,0,2 /dev/sda\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d aacraid,1,0,4 /dev/sdb\fP
-.fi
-
+.Sp
 .\" %ENDIF OS Linux Windows Cygwin
 .\" %IF OS Linux
 On Linux, the following entry in /proc/devices must exist: \fBaac\fP.
 Character device nodes /dev/aacH (H=Host number) are created if required.
-
+.Sp
 .\" %ENDIF OS Linux
 .\" %IF OS Windows Cygwin
-On Windows, the device name parameter /dev/sdX is ignored if \'-d aacraid\'
-is specified.
-
+On Windows, the device name parameter /dev/sdX is ignored if
+\*(Aq\-d aacraid\*(Aq is specified.
+.Sp
 .\" %ENDIF OS Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I 3ware,N
@@ -449,122 +481,72 @@ connected to a 3ware RAID controller.  The non-negative integer N
 (in the range from 0 to 127 inclusive) denotes which disk on the controller
 is monitored.
 Use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d 3ware,2 /dev/sda\fP  [Linux only]
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d 3ware,0 /dev/twe0\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d 3ware,1 /dev/twa0\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d 3ware,1 /dev/twl0\fP [Linux only]
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d 3ware,1 /dev/tws0\fP [FreeBSD only]
-.fi
-The first two forms, which refer to devices /dev/sda\-z and /dev/twe0\-15,
-may be used with 3ware series 6000, 7000, and 8000 series controllers
-that use the 3x-xxxx driver.
-\fBNote that the /dev/sda\-z form is deprecated\fP starting with
-the Linux 2.6 kernel series and may not be supported by the Linux
-kernel in the near future.  The final form, which refers to devices
-/dev/twa0\-15, must be used with 3ware 9000 series controllers, which
-use the 3w\-9xxx driver.
-
-The devices /dev/twl0\-15 [Linux] or /dev/tws0\-15 [FreeBSD] must be used with the 3ware/LSI 9750 series
-controllers which use the 3w-sas driver.
-
+.br
+The first two forms, which refer to devices /dev/sda\-z (deprecated)
+and /dev/twe0\-15, may be used with 3ware series 6000, 7000, and 8000
+series controllers that use the 3x-xxxx driver.
+The devices /dev/twa0\-15, must be used with 3ware 9000 series controllers,
+which use the 3w\-9xxx driver.
+The devices /dev/twl0\-15 [Linux] or /dev/tws0\-15 [FreeBSD] must be used
+with the 3ware/LSI 9750 series controllers which use the 3w-sas driver.
+.Sp
 Note that if the special character device nodes /dev/tw[ls]?, /dev/twa?
 and /dev/twe? do not exist, or exist with the incorrect major or minor
-numbers, smartctl will recreate them on the fly.  Typically /dev/twa0
-refers to the first 9000-series controller, /dev/twa1 refers to the
-second 9000 series controller, and so on.  The /dev/twl0 devices refers
-to the first 9750 series controller, /dev/twl1 resfers to the second
-9750 series controller, and so on.  Likewise /dev/twe0 refers to
-the first 6/7/8000-series controller, /dev/twe1 refers to the second
-6/7/8000 series controller, and so on.
-
-Note that for the 6/7/8000 controllers, \fBany\fP of the physical
-disks can be queried or examined using \fBany\fP of the 3ware's SCSI
-logical device /dev/sd?  entries.  Thus, if logical device /dev/sda is
-made up of two physical disks (3ware ports zero and one) and logical
-device /dev/sdb is made up of two other physical disks (3ware ports
-two and three) then you can examine the SMART data on \fBany\fP of the
-four physical disks using \fBeither\fP SCSI device /dev/sda \fBor\fP
-/dev/sdb.  If you need to know which logical SCSI device a particular
-physical disk (3ware port) is associated with, use the dmesg or SYSLOG
-output to show which SCSI ID corresponds to a particular 3ware unit,
-and then use the 3ware CLI or 3dm tool to determine which ports
-(physical disks) correspond to particular 3ware units.
-
-If the value of N corresponds to a port that does \fBnot\fP exist on
-the 3ware controller, or to a port that does not physically have a
-disk attached to it, the behavior of \fBsmartctl\fP depends upon the
-specific controller model, firmware, Linux kernel and platform.  In
-some cases you will get a warning message that the device does not
-exist.  In other cases you will be presented with \'void\' data for a
-non-existent device.
-
-Note that if the /dev/sd? addressing form is used, then older 3w-xxxx
-drivers do not pass the "Enable Autosave"
-(\'\fB\-S on\fP\') and "Enable Automatic Offline" (\'\fB\-o on\fP\')
-commands to the disk, and produce these types of harmless syslog error
-messages instead: "\fB3w-xxxx: tw_ioctl(): Passthru size (123392) too
-big\fP".  This can be fixed by upgrading to version 1.02.00.037 or
-later of the 3w-xxxx driver, or by applying a patch to older
-versions.  Alternatively, use the character device /dev/twe0\-15 interface.
-
-The selective self-test functions (\'\-t select,A\-B\') are only supported
-using the character device interface /dev/twl0\-15, /dev/tws0\-15, /dev/twa0\-15 and /dev/twe0\-15.
-The necessary WRITE LOG commands can not be passed through the SCSI
-interface.
-
+numbers, smartctl will recreate them on the fly.
+.Sp
 .\" %ENDIF OS FreeBSD Linux
 .\" %IF OS FreeBSD Linux Windows Cygwin
 .I areca,N
-\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or more SATA disks
-connected to an Areca SATA RAID controller.  The positive integer N (in the range
-from 1 to 24 inclusive) denotes which disk on the controller is monitored.
+\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or
+more SATA disks connected to an Areca SATA RAID controller.
+The positive integer N (in the range from 1 to 24 inclusive) denotes which
+disk on the controller is monitored.
 .\" %ENDIF OS FreeBSD Linux Windows Cygwin
 .\" %IF OS Linux
 On Linux use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d areca,2 /dev/sg2\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d areca,3 /dev/sg3\fP
-.fi
+.br
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
 On FreeBSD use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d areca,2 /dev/arcmsr1\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d areca,3 /dev/arcmsr2\fP
-.fi
+.br
 .\" %ENDIF OS FreeBSD
 .\" %IF OS Windows Cygwin
 On Windows and Cygwin use syntax such as:
-.nf
+.br
 \fBsmartctl \-a \-d areca,2 /dev/arcmsr0\fP
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d areca,3 /dev/arcmsr1\fP
-.fi
+.br
 .\" %ENDIF OS Windows Cygwin
 .\" %IF OS FreeBSD Linux Windows Cygwin
-The first line above addresses the second disk on the first Areca RAID controller.
+The first line above addresses the second disk on the first Areca RAID
+controller.
 The second line addresses the third disk on the second Areca RAID
-controller.  
+controller.
 .\" %ENDIF OS FreeBSD Linux Windows Cygwin
 .\" %IF OS Linux
 To help identify the correct device on Linux, use the command:
-.nf
+.br
 \fBcat /proc/scsi/sg/device_hdr /proc/scsi/sg/devices\fP
-.fi
+.br
 to show the SCSI generic devices (one per line, starting with
 /dev/sg0).  The correct SCSI generic devices to address for
 smartmontools are the ones with the type field equal to 3.  If the
@@ -572,43 +554,41 @@ incorrect device is addressed, please read the warning/error messages
 carefully.  They should provide hints about what devices to use.
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD Linux Windows Cygwin
-
+.Sp
 Important: the Areca controller must have firmware version 1.46 or
 later.  Lower-numbered firmware versions will give (harmless) SCSI
 error messages and no SMART information.
-
+.Sp
 .I areca,N/E
 \- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one
 or more SATA or SAS disks connected to an Areca SAS RAID controller.
 The integer N (range 1 to 128) denotes the channel (slot) and E (range
 1 to 8) denotes the enclosure.
 Important: This requires Areca SAS controller firmware version 1.51 or later.
-
+.Sp
 .\" %ENDIF OS FreeBSD Linux Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I cciss,N
-\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or SATA disks
-connected to a cciss RAID controller.  The non-negative integer N (in the range
-from 0 to 15 inclusive) denotes which disk on the controller is monitored.
-
+\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or
+SATA disks connected to a cciss RAID controller.
+The non-negative integer N (in the range from 0 to 15 inclusive) denotes
+which disk on the controller is monitored.
+.Sp
 To look at disks behind HP Smart Array controllers, use syntax
 such as:
 .\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.nf
+.br
 \fBsmartctl \-a \-d cciss,0 /dev/cciss/c0d0\fP    (cciss driver under Linux)
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d cciss,0 /dev/sg2\fP    (hpsa or hpahcisr drivers under Linux)
-.fi
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.nf
+.br
 \fBsmartctl \-a \-d cciss,0 /dev/ciss0\fP    (under FreeBSD)
-.fi
 .\" %ENDIF OS FreeBSD
 .\" %IF OS FreeBSD Linux
-
+.Sp
 .I hpt,L/M/N
 \- [FreeBSD and Linux only] the device consists of one or more ATA disks
 connected to a HighPoint RocketRAID controller.  The integer L is the
@@ -620,55 +600,68 @@ of the HighPoint RocketRAID controller.
 Use syntax such as:
 .\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.nf
+.br
 \fBsmartctl \-a \-d hpt,1/3 /dev/sda\fP    (under Linux)
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d hpt,1/2/3 /dev/sda\fP    (under Linux)
-.fi
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.nf
+.br
 \fBsmartctl \-a \-d hpt,1/3 /dev/hptrr\fP    (under FreeBSD)
-.fi
-.nf
+.br
 \fBsmartctl \-a \-d hpt,1/2/3 /dev/hptrr\fP    (under FreeBSD)
-.fi
 .\" %ENDIF OS FreeBSD
 .\" %IF OS FreeBSD Linux
+.br
 Note that the /dev/sda\-z form should be the device node which stands for
 the disks derived from the HighPoint RocketRAID controllers under Linux and
 under FreeBSD, it is the character device which the driver registered (eg,
 /dev/hptrr, /dev/hptmv6).
 .\" %ENDIF OS FreeBSD Linux
+.Sp
+.I intelliprop,N[+TYPE]
+\- [NEW EXPERIMENTAL SMARTCTL FEATURE] the device consists of multiple ATA
+disks connected to an Intelliprop controller.
+The integer N is the port number from 0 to 3 of the ATA drive to be targeted.
+The TYPE can be ata(default), sat, or a USB controller listed above.
+Note: if a type of ATA does not work, try a type of sat.
+Use syntax such as:
+.br
+\fBsmartctl \-a \-d intelliprop,1 /dev/sda\fP    (under Linux)
+.br
+\fBsmartctl \-a \-d intelliprop,1+sat /dev/sda\fP    (under Linux)
+.br
+\fBWARNING: The disks are selected by write commands to the ATA Device
+Vendor Specific Log at address 0xc0.
+Using this option with other devices may have undesirable side effects.\fP
 .TP
 .B \-T TYPE, \-\-tolerance=TYPE
 [ATA only] Specifies how tolerant \fBsmartctl\fP should be of ATA and SMART
-command failures. 
-
+command failures.
+.Sp
 The behavior of \fBsmartctl\fP depends upon whether the command is
-"\fBoptional\fP" or "\fBmandatory\fP". Here "\fBmandatory\fP" means
+"\fBoptional\fP" or "\fBmandatory\fP".  Here "\fBmandatory\fP" means
 "required by the ATA Specification if the device implements
 the SMART command set" and "\fBoptional\fP" means "not required by the
 ATA Specification even if the device implements the SMART
 command set."  The "\fBmandatory\fP" ATA and SMART commands are: (1)
 ATA IDENTIFY DEVICE, (2) SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE, (3)
 SMART ENABLE/DISABLE, and (4) SMART RETURN STATUS.
-
+.Sp
 The valid arguments to this option are:
-
+.Sp
 .I normal
 \- exit on failure of any \fBmandatory\fP SMART command, and ignore
 all failures of \fBoptional\fP SMART commands.  This is the default.
 Note that on some devices, issuing unimplemented optional SMART
-commands doesn\'t cause an error.  This can result in misleading
+commands doesn't cause an error.  This can result in misleading
 \fBsmartctl\fP messages such as "Feature X not implemented", followed
 shortly by "Feature X: enabled".  In most such cases, contrary to the
 final message, Feature X is \fBnot\fP enabled.
-
+.Sp
 .I conservative
 \- exit on failure of any \fBoptional\fP SMART command.
-
+.Sp
 .I permissive
 \- ignore failure(s) of \fBmandatory\fP SMART commands.  This option
 may be given more than once.  Each additional use of this option will
@@ -676,9 +669,9 @@ cause one more additional failure to be ignored.  Note that the use of
 this option can lead to messages like "Feature X not supported",
 followed shortly by "Feature X enable failed".  In a few
 such cases, contrary to the final message, Feature X \fBis\fP enabled.
-
+.Sp
 .I verypermissive
-\- equivalent to giving a large number of \'\-T permissive\' options:
+\- equivalent to giving a large number of \*(Aq\-T permissive\*(Aq options:
 ignore failures of \fBany number\fP of \fBmandatory\fP SMART commands.
 Please see the note above.
 .TP
@@ -687,16 +680,16 @@ Please see the note above.
 error is detected in the: (1) Device Identity Structure, (2) SMART
 Self-Test Log Structure, (3) SMART Attribute Value Structure, (4) SMART
 Attribute Threshold Structure, or (5) ATA Error Log Structure.
-
+.Sp
 The valid arguments to this option are:
-
+.Sp
 .I warn
 \- report the incorrect checksum but carry on in spite of it.  This is the
 default.
-
+.Sp
 .I exit
 \- exit \fBsmartctl\fP.
-
+.Sp
 .I ignore
 \- continue silently without issuing a warning.
 .TP
@@ -709,224 +702,243 @@ When used just once, it shows a record of the ioctl() transactions
 with the device.  When used more than once, the detail of these
 ioctl() transactions are reported in greater detail.  The valid
 arguments to this option are:
-
+.Sp
 .I ioctl
 \- report all ioctl() transactions.
-
+.Sp
 .I ataioctl
 \- report only ioctl() transactions with ATA devices.
-
+.Sp
 .I scsiioctl
-\- report only ioctl() transactions with SCSI devices. Invoking this once
-shows the SCSI commands in hex and the corresponding status. Invoking
-it a second time adds a hex listing of the first 64 bytes of data send to, 
-or received from the device.
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+\- report only ioctl() transactions with SCSI devices.
+Invoking this once shows the SCSI commands in hex and the corresponding status.
+Invoking it a second time adds a hex listing of the first 64 bytes of data
+send to, or received from the device.
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I nvmeioctl
-\- [FreeBSD, Linux, Windows and Cygwin only]
-[NEW EXPERIMENTAL SMARTCTL FEATURE]
+\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
 report only ioctl() transactions with NVMe devices.
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 Any argument may include a positive integer to specify the level of detail
 that should be reported.  The argument should be followed by a comma then
-the integer with no spaces.  For example, 
+the integer with no spaces.  For example,
 .I ataioctl,2
-The default
-level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are equivalent.
-
-For testing purposes, the output of \'\-r ataioctl,2\' can later be parsed
-by \fBsmartctl\fP itself if \'\-\' is used as device path argument.
+The default level is 1, so \*(Aq\-r ataioctl,1\*(Aq and \*(Aq\-r ataioctl\*(Aq
+are equivalent.
+.Sp
+For testing purposes, the output of \*(Aq\-r ataioctl,2\*(Aq can later be parsed
+by \fBsmartctl\fP itself if \*(Aq\-\*(Aq is used as device path argument.
 The ATA command input parameters, sector data and return values are
 reconstructed from the debug report read from stdin.
 Then \fBsmartctl\fP internally simulates an ATA device with the same
-behaviour. This is does not work for SCSI devices yet.
+behaviour.
+This is does not work for SCSI devices yet.
 .TP
-.B \-n POWERMODE, \-\-nocheck=POWERMODE
+.B \-n POWERMODE[,STATUS], \-\-nocheck=POWERMODE[,STATUS]
 [ATA only] Specifies if \fBsmartctl\fP should exit before performing any
-checks when the device is in a low-power mode. It may be used to prevent
-a disk from being spun-up by \fBsmartctl\fP. The power mode is ignored by
-default.  A nonzero exit status is returned if the device is in one of the
-specified low-power modes (see EXIT STATUS below).
-
+checks when the device is in a low-power mode.
+It may be used to prevent a disk from being spun-up by \fBsmartctl\fP.
+The power mode is ignored by default.
+.Sp
 Note: If this option is used it may also be necessary to specify the device
-type with the \'\-d\' option.  Otherwise the device may spin up due to
+type with the \*(Aq\-d\*(Aq option.  Otherwise the device may spin up due to
 commands issued during device type autodetection.
-
+.Sp
+By default, exit status 2 is returned if the device is in one of the
+specified low-power modes.
+This status is also returned if the device open or identification failed
+(see EXIT STATUS below).
+.Sp
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+The optional STATUS parameter allows to override this default.
+STATUS is an integer in the range from 0 to 255 inclusive.
+For example use \*(Aq\-n standby,0\*(Aq to return success if a device is in
+SLEEP or STANDBY mode.
+Use \*(Aq\-n standby,3\*(Aq to return a unique exit status in this case.
+.Sp
 The valid arguments to this option are:
-
+.Sp
 .I never
-\- check the device always, but print the power mode if \'\-i\' is
+\- check the device always, but print the power mode if \*(Aq\-i\*(Aq is
 specified.
-
-.I sleep
+.Sp
+.I sleep[,STATUS]
 \- check the device unless it is in SLEEP mode.
-
-.I standby
+.Sp
+.I standby[,STATUS]
 \- check the device unless it is in SLEEP or STANDBY mode.  In
 these modes most disks are not spinning, so if you want to prevent
 a disk from spinning up, this is probably what you want.
-
-.I idle
+.Sp
+.I idle[,STATUS]
 \- check the device unless it is in SLEEP, STANDBY or IDLE mode.
 In the IDLE state, most disks are still spinning, so this is probably
 not what you want.
-
+.Sp
 .TP
 .B SMART FEATURE ENABLE/DISABLE COMMANDS:
 .IP
-.B Note: 
+.B Note:
 if multiple options are used to both enable and disable a
-feature, then 
+feature, then
 .B both
 the enable and disable commands will be issued.  The enable command
 will always be issued
 .B before
 the corresponding disable command.
 .TP
-.B \-s VALUE, \-\-smart=VALUE 
+.B \-s VALUE, \-\-smart=VALUE
 Enables or disables SMART on device.  The valid arguments to
-this option are \fIon\fP and \fIoff\fP.  Note that the command \'\-s on\'
-(perhaps used with with the \'\-o on\' and \'\-S on\' options) should be
-placed in a start-up script for your machine, for example in rc.local or
-rc.sysinit. In principle the SMART feature settings are preserved over
-power-cycling, but it doesn\'t hurt to be sure. It is not necessary (or
-useful) to enable SMART to see the TapeAlert messages.
+this option are \fIon\fP and \fIoff\fP.
+.Sp
+[ATA]
+Note that the ATA commands SMART ENABLE/DISABLE OPERATIONS were declared obsolete
+in ATA ACS-4 Revision 10 (Nov 2015).
+.Sp
+[SCSI tape drive or changer]
+It is not necessary (or useful) to enable SMART to see the TapeAlert messages.
 .TP
 .B \-o VALUE, \-\-offlineauto=VALUE
 [ATA only] Enables or disables SMART automatic offline test, which scans the
-drive every four hours for disk defects. This command can be given during
-normal system operation.  The valid arguments to this option are \fIon\fP
-and \fIoff\fP.
-
+drive every four hours for disk defects.
+This command can be given during normal system operation.
+The valid arguments to this option are \fIon\fP and \fIoff\fP.
+.Sp
 Note that the SMART automatic offline test command is listed as
 "Obsolete" in every version of the ATA and ATA/ATAPI Specifications.
 It was originally part of the SFF-8035i Revision 2.0 specification,
 but was never part of any ATA specification.  However it is
 implemented and used by many vendors.
 You can tell if automatic offline testing is supported by seeing if
-this command enables and disables it, as indicated by the \'Auto
-Offline Data Collection\' part of the SMART capabilities report
-(displayed with \'\-c\').
-
+this command enables and disables it, as indicated by the \*(AqAuto
+Offline Data Collection\*(Aq part of the SMART capabilities report
+(displayed with \*(Aq\-c\*(Aq).
+.Sp
 SMART provides \fBthree\fP basic categories of testing.  The
 \fBfirst\fP category, called "online" testing, has no effect on the
-performance of the device.  It is turned on by the \'\-s on\' option.
-
-The \fBsecond\fP category of testing is called "offline" testing. This
-type of test can, in principle, degrade the device performance.  The
-\'\-o on\' option causes this offline testing to be carried out,
+performance of the device.  It is turned on by the \*(Aq\-s on\*(Aq option.
+.Sp
+The \fBsecond\fP category of testing is called "offline" testing.
+This type of test can, in principle, degrade the device performance.
+The \*(Aq\-o on\*(Aq option causes this offline testing to be carried out,
 automatically, on a regular scheduled basis.  Normally, the disk will
 suspend offline testing while disk accesses are taking place, and then
 automatically resume it when the disk would otherwise be idle, so in
 practice it has little effect.  Note that a one-time offline test can
 also be carried out immediately upon receipt of a user command.  See
-the \'\-t offline\' option below, which causes a one-time offline test
+the \*(Aq\-t offline\*(Aq option below, which causes a one-time offline test
 to be carried out immediately.
-
+.Sp
 The choice (made by the SFF-8035i and ATA specification authors) of
 the word \fItesting\fP for these first two categories is unfortunate,
 and often leads to confusion.  In fact these first two categories of
 online and offline testing could have been more accurately described
 as online and offline \fBdata collection\fP.
-
+.Sp
 The results of this automatic or immediate offline testing (data
 collection) are reflected in the values of the SMART Attributes.
 Thus, if problems or errors are detected, the values of these
 Attributes will go below their failure thresholds; some types of
-errors may also appear in the SMART error log. These are visible with
-the \'\-A\' and \'\-l error\' options respectively.
-
+errors may also appear in the SMART error log.
+These are visible with the \*(Aq\-A\*(Aq and \*(Aq\-l error\*(Aq options
+respectively.
+.Sp
 Some SMART attribute values are updated only during off-line data
 collection activities; the rest are updated during normal operation of
 the device or during both normal operation and off-line testing.  The
-Attribute value table produced by the \'\-A\' option indicates this in
+Attribute value table produced by the \*(Aq\-A\*(Aq option indicates this in
 the UPDATED column.  Attributes of the first type are labeled
 "Offline" and Attributes of the second type are labeled "Always".
-
+.Sp
 The \fBthird\fP category of testing (and the \fIonly\fP category for
-which the word \'testing\' is really an appropriate choice) is "self"
+which the word \*(Aqtesting\*(Aq is really an appropriate choice) is "self"
 testing.  This third type of test is only performed (immediately) when
-a command to run it is issued.  The \'\-t\' and \'\-X\' options can be
-used to carry out and abort such self-tests; please see below for
-further details.
-
+a command to run it is issued.
+The \*(Aq\-t\*(Aq and \*(Aq\-X\*(Aq options can be used to carry out and
+abort such self-tests; please see below for further details.
+.Sp
 Any errors detected in the self testing will be shown in the
-SMART self-test log, which can be examined using the \'\-l selftest\'
+SMART self-test log, which can be examined using the \*(Aq\-l selftest\*(Aq
 option.
-
+.Sp
 \fBNote:\fP in this manual page, the word \fB"Test"\fP is used in
-connection with the second category just described, e.g. for the
+connection with the second category just described, e.g.\& for the
 "offline" testing.  The words \fB"Self-test"\fP are used in
 connection with the third category.
 .TP
 .B \-S VALUE, \-\-saveauto=VALUE
 [ATA] Enables or disables SMART autosave of device vendor-specific
-Attributes. The valid arguments to this option are \fIon\fP
+Attributes.  The valid arguments to this option are \fIon\fP
 and \fIoff\fP.  Note that this feature is preserved across disk power
 cycles, so you should only need to issue it once.
-
+.Sp
 The ATA standard does not specify a method to check whether SMART
-autosave is enabled. Unlike SCSI (below), smartctl is unable to print
-a warning if autosave is disabled.
-
+autosave is enabled.
+Unlike SCSI (below), smartctl is unable to print a warning if autosave is
+disabled.
+.Sp
+Note that the ATA commands SMART ENABLE/DISABLE AUTOSAVE were declared
+obsolete in ATA ACS-4 Revision 10 (Nov 2015).
+.Sp
 [SCSI] For SCSI devices this toggles the value of the Global Logging
-Target Save Disabled (GLTSD) bit in the Control Mode Page. Some disk
-manufacturers set this bit by default. This prevents error counters,
+Target Save Disabled (GLTSD) bit in the Control Mode Page.  Some disk
+manufacturers set this bit by default.  This prevents error counters,
 power-up hours and other useful data from being placed in non-volatile
 storage, so these values may be reset to zero the next time the device
-is power-cycled.  If the GLTSD bit is set then \'smartctl \-a\' will
-issue a warning. Use \fIon\fP to clear the GLTSD bit and thus enable
-saving counters to non-volatile storage. For extreme streaming-video
+is power-cycled.  If the GLTSD bit is set then \*(Aqsmartctl \-a\*(Aq will
+issue a warning.  Use \fIon\fP to clear the GLTSD bit and thus enable
+saving counters to non-volatile storage.  For extreme streaming-video
 type applications you might consider using \fIoff\fP to set the GLTSD
 bit.
 .TP
 .B \-g NAME, \-\-get=NAME, \-s NAME[,VALUE], \-\-set=NAME[,VALUE]
 Gets/sets non-SMART device settings.
-Note that the \'\-\-set\' option shares its short option \'\-s\' with
-\'\-\-smart\'.  Valid arguments are:
-
+Note that the \*(Aq\-\-set\*(Aq option shares its short option \*(Aq\-s\*(Aq
+with \*(Aq\-\-smart\*(Aq.
+Valid arguments are:
+.Sp
 .I all
-\- Gets all values. This is equivalent to
-.nf
-\'-g aam -g apm -g lookahead -g security -g wcache\'
-.fi
-
+\- Gets all values.
+This is equivalent to
+.br
+\*(Aq\-g aam \-g apm \-g lookahead \-g security \-g wcache \-g rcache \-g dsn\*(Aq
+.Sp
 .I aam[,N|off]
 \- [ATA only] Gets/sets the Automatic Acoustic Management (AAM) feature
 (if supported).  A value of 128 sets the most quiet (slowest) mode and 254
-the fastest (loudest) mode, \'off\' disables AAM.  Devices may support
+the fastest (loudest) mode, \*(Aqoff\*(Aq disables AAM.  Devices may support
 intermediate levels.  Values below 128 are defined as vendor specific (0)
 or retired (1 to 127).  Note that the AAM feature was declared obsolete in
 ATA ACS-2 Revision 4a (Dec 2010).
-
+.Sp
 .I apm[,N|off]
 \- [ATA only] Gets/sets the Advanced Power Management (APM) feature on
 device (if supported).  If a value between 1 and 254 is provided, it will
-attempt to enable APM and set the specified value, \'off\' disables APM.
+attempt to enable APM and set the specified value, \*(Aqoff\*(Aq disables APM.
 Note the actual behavior depends on the drive, for example some drives disable
 APM if their value is set above 128.  Values below 128 are supposed to allow
 drive spindown, values 128 and above adjust only head-parking frequency,
 although the actual behavior defined is also vendor-specific.
-
+.Sp
 .I lookahead[,on|off]
 \- [ATA only] Gets/sets the read look-ahead feature (if supported).
 Read look-ahead is usually enabled by default.
-
+.Sp
 .I security
 \- [ATA only] Gets the status of ATA Security feature (if supported).
 If ATA Security is enabled an ATA user password is set.  The drive will be
 locked on next reset then.
-
+.Sp
 .I security-freeze
 \- [ATA only] Sets ATA Security feature to frozen mode.  This prevents that
 the drive accepts any security commands until next reset.  Note that the
 frozen mode may already be set by BIOS or OS.
-
+.Sp
 .I standby,[N|off]
 \- [ATA only] Sets the standby (spindown) timer and places the drive in the
-IDLE mode.  A value of 0 or \'off\' disables the standby timer.
+IDLE mode.  A value of 0 or \*(Aqoff\*(Aq disables the standby timer.
 Values from 1 to 240 specify timeouts from 5 seconds to 20 minutes in 5
 second increments.  Values from 241 to 251 specify timeouts from 30 minutes
 to 330 minutes in 30 minute increments.  Value 252 specifies 21 minutes.
@@ -934,74 +946,103 @@ Value 253 specifies a vendor specific time between 8 and 12 hours.  Value
 255 specifies 21 minutes and 15 seconds.  Some drives may use a vendor
 specific interpretation for the values.  Note that there is no get option
 because ATA standards do not specify a method to read the standby timer.
-
+.br
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+If \*(Aq\-s standby,now\*(Aq is also specified, the drive is immediately placed
+in the STANDBY mode without temporarily placing it in the IDLE mode.
+Note that ATA standards do not specify a command to set the standby timer
+without affecting the power mode.
+.Sp
 .I standby,now
-\- [ATA only] Places the drive in the STANDBY mode.  This usually spins down
-the drive.  The setting of the standby timer is not affected.
-
+\- [ATA only] Places the drive in the STANDBY mode.
+This usually spins down the drive.
+The setting of the standby timer is not affected unless
+\*(Aq\-s standby,[N|off]\*(Aq is also specified.
+.Sp
 .I wcache[,on|off]
 \- [ATA] Gets/sets the volatile write cache feature (if supported).
 The write cache is usually enabled by default.
-
+.Sp
 .I wcache[,on|off]
-\- [SCSI] Gets/sets the \'Write Cache Enable\' (WCE) bit (if supported).
+\- [SCSI] Gets/sets the \*(AqWrite Cache Enable\*(Aq (WCE) bit (if supported).
 The write cache is usually enabled by default.
-
-.I wcreorder[,on|off]
+.Sp
+.I wcache-sct[,ata|on|off[,p]]
+\- [ATA only]
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+Gets/sets the write cache feature through SCT Feature Control (if supported).
+The state of write cache in SCT Feature Control could be "Controlled by ATA",
+"Force Enabled", or "Force Disabled".
+SCT Feature control overwrites the setting by ATA Set Features command
+(wcache[,on|off] option).
+If SCT Feature Control sets write cache as "Force Enabled" or "Force Disabled",
+the setting of wcache[,on|off] is ignored by the drive.
+SCT Feature Control usually sets write cache as "Controlled by ATA" by default.
+If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
+.Sp
+.I wcreorder[,on|off[,p]]
 \- [ATA only] Gets/sets Write Cache Reordering.
-If it is disabled (off), disk write scheduling is executed on a 
-first-in-first-out (FIFO) basis. If Write Cache Reordering is enabled (on),
-then disk write scheduling may be reordered by the drive. If write cache is
+If it is disabled (off), disk write scheduling is executed on a
+first-in-first-out (FIFO) basis.  If Write Cache Reordering is enabled (on),
+then disk write scheduling may be reordered by the drive.  If write cache is
 disabled, the current Write Cache Reordering state is remembered but has
 no effect on non-cached writes, which are always written in the order received.
 The state of Write Cache Reordering has no effect on either NCQ or LCQ queued
 commands.
-
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
+.Sp
 .I rcache[,on|off]
-\- [SCSI only] Gets/sets the \'Read Cache Disable\' (RCE) bit.
-\'Off\' value disables read cache (if supported).
+\- [SCSI only] Gets/sets the \*(AqRead Cache Disable\*(Aq (RCE) bit.
+\*(AqOff\*(Aq value disables read cache (if supported).
 The read cache is usually enabled by default.
-
+.Sp
+.I dsn[,on|off]
+\- [ATA only]
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+Gets/sets the DSN feature (if supported).
+The dsn is usually disabled by default.
+.Sp
 .TP
 .B SMART READ AND DISPLAY DATA OPTIONS:
 .TP
 .B \-H, \-\-health
 Prints the health status of the device or pending TapeAlert messages.
-
+.Sp
 If the device reports failing health status, this means
 .B either
-that the device has already failed, 
-.B or 
+that the device has already failed,
+.B or
 that it is predicting its own failure within the next 24 hours.  If
-this happens, use the \'\-a\' option to get more information, and
+this happens, use the \*(Aq\-a\*(Aq option to get more information, and
 .B get your data off the disk and to someplace safe as soon as you can.
-
+.Sp
 [ATA] Health status is obtained by checking the (boolean) result returned
 by the SMART RETURN STATUS command.
 The return value of this ATA command may be unknown due to limitations or
-bugs in some layer (e.g. RAID controller or USB bridge firmware) between
+bugs in some layer (e.g.\& RAID controller or USB bridge firmware) between
 disk and operating system.
 In this case, \fBsmartctl\fP prints a warning and checks whether any
 Prefailure SMART Attribute value is less than or equal to its threshold
-(see \'\-A\' below).
-
+(see \*(Aq\-A\*(Aq below).
+.Sp
 [SCSI] Health status is obtained by checking the Additional Sense Code
 (ASC) and Additional Sense Code Qualifier (ASCQ) from Informal Exceptions
 (IE) log page (if supported) and/or from SCSI sense data.
-
+.Sp
 [SCSI tape drive or changer] TapeAlert status is obtained by reading the
 TapeAlert log page.
 Please note that the TapeAlert log page flags are cleared for the initiator
 when the page is read.
 This means that each alert condition is reported only once by \fBsmartctl\fP
 for each initiator for each activation of the condition.
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
-[NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
+[NVMe]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 NVMe status is obtained by reading the "Critical Warning" byte from
 the SMART/Health Information log.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-c, \-\-capabilities
 [ATA] Prints only the generic SMART capabilities.  These
@@ -1010,29 +1051,20 @@ respond to some of the different SMART commands.  For example it
 shows if the device logs errors, if it supports offline surface
 scanning, and so on.  If the device can carry out self-tests, this
 option also shows the estimated time required to run those tests.
-
-Note that the time required to run the Self-tests (listed in minutes)
-are fixed.  However the time required to run the Immediate Offline
-Test (listed in seconds) is variable.  This means that if you issue a
-command to perform an Immediate Offline test with the \'\-t offline\' option,
-then the time may jump to a larger value and then count down as the
-Immediate Offline Test is carried out.  Please see REFERENCES below
-for further information about the the flags and capabilities described
-by this option.
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
-[NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
+[NVMe]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 Prints various NVMe device capabilities obtained from the Identify Controller
 and the Identify Namespace data structure.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-A, \-\-attributes
 [ATA] Prints only the vendor specific SMART Attributes.  The Attributes
-are numbered from 1 to 253 and have specific names and ID numbers. For
-example Attribute 12 is "power cycle count": how many times has the
+are numbered from 1 to 253 and have specific names and ID numbers.
+For example Attribute 12 is "power cycle count": how many times has the
 disk been powered up.
-
+.Sp
 Each Attribute has a "Raw" value, printed under the heading
 "RAW_VALUE", and a "Normalized" value printed under the heading
 "VALUE".  [Note: \fBsmartctl\fP prints these values in base-10.]  In
@@ -1044,31 +1076,31 @@ value to a "Normalized" value in the range from 1 to 254.  Please keep
 in mind that \fBsmartctl\fP only reports the different Attribute
 types, values, and thresholds as read from the device.  It does
 \fBnot\fP carry out the conversion between "Raw" and "Normalized"
-values: this is done by the disk\'s firmware.
-
+values: this is done by the disk's firmware.
+.Sp
 The conversion from Raw value to a quantity with physical units is
-not specified by the SMART standard. In most cases, the values printed
+not specified by the SMART standard.  In most cases, the values printed
 by \fBsmartctl\fP are sensible.  For example the temperature Attribute
 generally has its raw value equal to the temperature in Celsius.
 However in some cases vendors use unusual conventions.  For example
 the Hitachi disk on my laptop reports its power-on hours in minutes,
-not hours. Some IBM disks track three temperatures rather than one, in
+not hours.  Some IBM disks track three temperatures rather than one, in
 their raw values.  And so on.
-
+.Sp
 Each Attribute also has a Threshold value (whose range is 0 to 255)
 which is printed under the heading "THRESH".  If the Normalized value
 is \fBless than or equal to\fP the Threshold value, then the Attribute
 is said to have failed.  If the Attribute is a pre-failure Attribute,
 then disk failure is imminent.
-
+.Sp
 Each Attribute also has a "Worst" value shown under the heading
 "WORST".  This is the smallest (closest to failure) value that the
 disk has recorded at any time during its lifetime when SMART was
 enabled.  [Note however that some vendors firmware may actually
 \fBincrease\fP the "Worst" value for some "rate-type" Attributes.]
-
+.Sp
 The Attribute table printed out by \fBsmartctl\fP also shows the
-"TYPE" of the Attribute. Attributes are one of two possible types:
+"TYPE" of the Attribute.  Attributes are one of two possible types:
 Pre-failure or Old age.  Pre-failure Attributes are ones which, if
 less than or equal to their threshold values, indicate pending disk
 failure.  Old age, or usage Attributes, are ones which indicate
@@ -1076,27 +1108,27 @@ end-of-product life from old-age or normal aging and wearout, if
 the Attribute value is less than or equal to the threshold.  \fBPlease
 note\fP: the fact that an Attribute is of type 'Pre-fail' does
 \fBnot\fP mean that your disk is about to fail!  It only has this
-meaning if the Attribute\'s current Normalized value is less than or
+meaning if the Attribute's current Normalized value is less than or
 equal to the threshold value.
-
-If the Attribute\'s current Normalized value is less than or equal to
+.Sp
+If the Attribute's current Normalized value is less than or equal to
 the threshold value, then the "WHEN_FAILED" column will display
-"FAILING_NOW". If not, but the worst recorded value is less than or
+"FAILING_NOW".  If not, but the worst recorded value is less than or
 equal to the threshold value, then this column will display
 "In_the_past".  If the "WHEN_FAILED" column has no entry (indicated by
-a dash: \'\-\') then this Attribute is OK now (not failing) and has
+a dash: \*(Aq\-\*(Aq) then this Attribute is OK now (not failing) and has
 also never failed in the past.
-
+.Sp
 The table column labeled "UPDATED" shows if the SMART Attribute values
 are updated during both normal operation and off-line testing, or
 only during offline testing.  The former are labeled "Always" and the
 latter are labeled "Offline".
-
+.Sp
 So to summarize: the Raw Attribute values are the ones that might have
 a real physical interpretation, such as "Temperature Celsius",
 "Hours", or "Start-Stop Cycles".  Each manufacturer converts these,
-using their detailed knowledge of the disk\'s operations and failure
-modes, to Normalized Attribute values in the range 1\-254.  The
+using their detailed knowledge of the disk's operations and failure
+modes, to Normalized Attribute values in the range 1\(en254.  The
 current and worst (lowest measured) of these Normalized Attribute
 values are stored on the disk, along with a Threshold value that the
 manufacturer has determined will indicate that the disk is going to
@@ -1104,64 +1136,66 @@ fail, or that it has exceeded its design age or aging limit.
 \fBsmartctl\fP does \fBnot\fP calculate any of the Attribute values,
 thresholds, or types, it merely reports them from the SMART data on
 the device.
-
+.Sp
 Note that starting with ATA/ATAPI-4, revision 4, the meaning of these
 Attribute fields has been made entirely vendor-specific.  However most
 newer ATA/SATA disks seem to respect their meaning, so we have retained
 the option of printing the Attribute values.
-
+.Sp
 Solid-state drives use different meanings for some of the attributes.
 In this case the attribute name printed by smartctl is incorrect unless
 the drive is already in the smartmontools drive database.
-
+.Sp
+Note that the ATA command SMART READ DATA was declared obsolete in
+ATA ACS-4 Revision 10 (Nov 2015).
+.Sp
 [SCSI] For SCSI devices the "attributes" are obtained from the temperature
-and start-stop cycle counter log pages. Certain vendor specific
-attributes are listed if recognised. The attributes are output in a
-relatively free format (compared with ATA disk attributes).
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
-[NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+and start-stop cycle counter log pages.
+Certain vendor specific attributes are listed if recognised.
+The attributes are output in a relatively free format (compared with ATA
+disk attributes).
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
+[NVMe]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 For NVMe devices the attributes are obtained from the SMART/Health
 Information log.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-f FORMAT, \-\-format=FORMAT
 [ATA only] Selects the output format of the attributes:
-
+.Sp
 .I old
-\- Old smartctl format. This is the default unless the \'\-x\' option is
-specified.
-
+\- Old smartctl format.
+This is the default unless the \*(Aq\-x\*(Aq option is specified.
+.Sp
 .I brief
 \- New format which fits into 80 colums (except in some rare cases).
 This format also decodes four additional attribute flags.
-This is the default if the '\-x\' option is specified.
-
+This is the default if the \*(Aq'\-x\*(Aq option is specified.
+.Sp
 .I hex,id
 \- Print all attribute IDs as hexadecimal numbers.
-
+.Sp
 .I hex,val
 \- Print all normalized values as hexadecimal numbers.
-
+.Sp
 .I hex
-\- Same as \'\-f hex,id \-f hex,val\'.
+\- Same as \*(Aq\-f hex,id \-f hex,val\*(Aq.
 .TP
 .B \-l TYPE, \-\-log=TYPE
-Prints either the SMART Error Log, the SMART Self-Test Log, the SMART
-Selective Self-Test Log [ATA only], the Log Directory [ATA only], or
-the Background Scan Results Log [SCSI only].
+Prints various device logs.
 The valid arguments to this option are:
-
+.Sp
 .I error
 \- [ATA] prints the Summary SMART error log.  SMART disks maintain a log
-of the most recent five non-trivial errors. For each of these errors, the
+of the most recent five non-trivial errors.  For each of these errors, the
 disk power-on lifetime at which the error occurred is recorded, as is
 the device status (idle, standby, etc) at the time of the error.  For
 some common types of errors, the Error Register (ER) and Status
-Register (SR) values are decoded and printed as text. The meanings of these
-are:
-.nf
+Register (SR) values are decoded and printed as text.
+The meanings of these are:
+.Vb 5
    \fBABRT\fP:  Command \fBAB\fPo\fBRT\fPed
    \fBAMNF\fP:  \fBA\fPddress \fBM\fPark \fBN\fPot \fBF\fPound
    \fBCCTO\fP:  \fBC\fPommand \fBC\fPompletion \fBT\fPimed \fBO\fPut
@@ -1176,10 +1210,10 @@ are:
    \fBTK0NF\fP: \fBT\fPrac\fBK 0 N\fPot \fBF\fPound
    \fBUNC\fP:   \fBUNC\fPorrectable Error in Data
    \fBWP\fP:    Media is \fBW\fPrite \fBP\fProtected
-.fi
+.Ve
 In addition, up to the last five commands that preceded the error are
 listed, along with a timestamp measured from the start of the
-corresponding power cycle. This is displayed in the form
+corresponding power cycle.  This is displayed in the form
 Dd+HH:MM:SS.msec where D is the number of days, HH is hours, MM is
 minutes, SS is seconds and msec is milliseconds.  [Note: this time
 stamp wraps after 2^32 milliseconds, or 49 days 17 hours 2 minutes and
@@ -1194,7 +1228,7 @@ used to indicate that a command was retired in the ATA-\fIN\fP
 specification.  Some commands are not defined in any version of the
 ATA specification but are in common use nonetheless; these are marked
 \fB[NS]\fP, meaning non-standard.
-
+.Sp
 The ATA Specification (ATA ACS-2 Revision 7, Section A.7.1) says:
 \fB"Error log data structures shall include, but are not limited to,
 Uncorrectable errors, ID Not Found errors for which the LBA requested was
@@ -1208,81 +1242,80 @@ Checking and Correction (ECC) codes are inconsistent.  In effect, this
 means that the data can not be read.
 .br
 \fBIDNF\fP (\fBID N\fPot \fBF\fPound): user-accessible address could
-not be found. For READ LOG type commands, \fBIDNF\fP can also indicate
+not be found.  For READ LOG type commands, \fBIDNF\fP can also indicate
 that a device data log structure checksum was incorrect.
-
+.Sp
 If the command that caused the error was a READ or WRITE command, then
 the Logical Block Address (LBA) at which the error occurred will be
 printed in base 10 and base 16.  The LBA is a linear address, which
 counts 512-byte sectors on the disk, starting from zero.  (Because of
 the limitations of the SMART error log, if the LBA is greater than
 0xfffffff, then either no error log entry will be made, or the error
-log entry will have an incorrect LBA. This may happen for drives with
-a capacity greater than 128 GiB or 137 GB.) On Linux systems the
+log entry will have an incorrect LBA.  This may happen for drives with
+a capacity greater than 128 GiB or 137 GB.)  On Linux systems the
 smartmontools web page has instructions about how to convert the LBA
 address to the name of the disk file containing the erroneous disk
 sector.
-
+.Sp
 Please note that some manufacturers \fBignore\fP the ATA
 specifications, and make entries in the error log if the device
 receives a command which is not implemented or is not valid.
-
+.Sp
 .I error
 \- [SCSI] prints the error counter log pages for reads, write and verifies.
 The verify row is only output if it has an element other than zero.
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I error[,NUM]
-\- [NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+\- [NVMe]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 prints the NVMe Error Information log.
 Only the 16 most recent log entries are printed by default.
 This number can be changed by the optional parameter NUM.
 The maximum number of log entries is vendor specific
 (in the range from 1 to 256 inclusive).
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I xerror[,NUM][,error]
 \- [ATA only] prints the Extended Comprehensive SMART error log
 (General Purpose Log address 0x03).  Unlike the Summary SMART error
-log (see \'\-l error\' above), it provides sufficient space to log
+log (see \*(Aq\-l error\*(Aq above), it provides sufficient space to log
 the contents of the 48-bit LBA register set introduced with ATA-6.
 It also supports logs with more than one sector.  Each sector holds
-up to 4 log entries. The actual number of log sectors is vendor
-specific.
-
+up to 4 log entries.
+The actual number of log sectors is vendor specific.
+.Sp
 Only the 8 most recent error log entries are printed by default.
 This number can be changed by the optional parameter NUM.
-
-If ',error' is appended and the Extended Comprehensive SMART error
+.Sp
+If \*(Aq,error\*(Aq is appended and the Extended Comprehensive SMART error
 log is not supported, the Summary SMART self-test log is printed.
-
+.Sp
 Please note that recent drives may report errors only in the Extended
 Comprehensive SMART error log.  The Summary SMART error log may be reported
 as supported but is always empty then.
-
+.Sp
 .I selftest
 \- [ATA] prints the SMART self-test log.  The disk maintains a self-test
 log showing the results of the self tests, which can be run using the
-\'\-t\' option described below.  For each of the most recent
+\*(Aq\-t\*(Aq option described below.  For each of the most recent
 twenty-one self-tests, the log shows the type of test (short or
 extended, off-line or captive) and the final status of the test.  If
 the test did not complete successfully, then the percentage of the
 test remaining is shown.  The time at which the test took place,
-measured in hours of disk lifetime, is also printed. [Note: this time
+measured in hours of disk lifetime, is also printed.  [Note: this time
 stamp wraps after 2^16 hours, or 2730 days and 16 hours, or about 7.5
-years.] If any errors were detected, the Logical Block Address (LBA)
-of the first error is printed in decimal notation.  On Linux systems the
-smartmontools web page has instructions about how to convert this LBA
-address to the name of the disk file containing the erroneous block.
-
+years.]
+If any errors were detected, the Logical Block Address (LBA)
+of the first error is printed in decimal notation.
+.Sp
 .I selftest
 \- [SCSI] the self-test log for a SCSI device has a slightly different
 format than for an ATA device.  For each of the most recent twenty
 self-tests, it shows the type of test and the status (final or in
-progress) of the test. SCSI standards use the terms "foreground" and
-"background" (rather than ATA\'s corresponding "captive" and
-"off-line") and "short" and "long" (rather than ATA\'s corresponding
+progress) of the test.  SCSI standards use the terms "foreground" and
+"background" (rather than ATA's corresponding "captive" and
+"off-line") and "short" and "long" (rather than ATA's corresponding
 "short" and "extended") to describe the type of the test.  The printed
 segment number is only relevant when a test fails in the third or
 later test segment.  It identifies the test that failed and consists
@@ -1290,29 +1323,27 @@ of either the number of the segment that failed during the test, or
 the number of the test that failed and the number of the segment in
 which the test was run, using a vendor-specific method of putting both
 numbers into a single byte.  The Logical Block Address (LBA) of the
-first error is printed in hexadecimal notation.  On Linux systems the
-smartmontools web page has instructions about how to convert this LBA
-address to the name of the disk file containing the erroneous block.
+first error is printed in hexadecimal notation.
 If provided, the SCSI Sense Key (SK), Additional Sense Code (ASC) and
-Additional Sense Code Qualifier (ASQ) are also printed. The self tests
-can be run using the \'\-t\' option described below (using the ATA
+Additional Sense Code Qualifier (ASCQ) are also printed.  The self tests
+can be run using the \*(Aq\-t\*(Aq option described below (using the ATA
 test terminology).
-
+.Sp
 .I xselftest[,NUM][,selftest]
 \- [ATA only] prints the Extended SMART self-test log (General Purpose
-Log address 0x07). Unlike the SMART self-test log (see \'\-l selftest\'
+Log address 0x07).  Unlike the SMART self-test log (see \*(Aq\-l selftest\*(Aq
 above), it supports 48-bit LBA and logs with more than one sector.
-Each sector holds up to 19 log entries. The actual number of log sectors
-is vendor specific.
-
-Only the 25 most recent log entries are printed by default. This number
-can be changed by the optional parameter NUM.
-
-If ',selftest' is appended and the Extended SMART self-test log is not
+Each sector holds up to 19 log entries.
+The actual number of log sectors is vendor specific.
+.Sp
+Only the 25 most recent log entries are printed by default.
+This number can be changed by the optional parameter NUM.
+.Sp
+If \*(Aq,selftest\*(Aq is appended and the Extended SMART self-test log is not
 supported, the old SMART self-test log is printed.
-
+.Sp
 .I selective
-\- [ATA only] Please see the \'\-t select\' option below for a
+\- [ATA only] Please see the \*(Aq\-t select\*(Aq option below for a
 description of selective self-tests.  The selective self-test log
 shows the start/end Logical Block Addresses (LBA) of each of the five
 test spans, and their current test status.  If the span is being
@@ -1320,10 +1351,10 @@ tested or the remainder of the disk is being read-scanned, the
 current 65536-sector block of LBAs being tested is also displayed.
 The selective self-test log also shows if a read-scan of the
 remainder of the disk will be carried out after the selective
-self-test has completed (see \'\-t afterselect\' option) and the time
+self-test has completed (see \*(Aq\-t afterselect\*(Aq option) and the time
 delay before restarting this read-scan if it is interrupted (see
-\'\-t pending\' option).
-
+\*(Aq\-t pending\*(Aq option).
+.Sp
 .I directory[,gs]
 \- [ATA only] if the device supports the General Purpose Logging feature
 set (ATA-6 and above) then this prints the Log Directory (the log at
@@ -1337,101 +1368,114 @@ and
 arguments to this option.
 If your version of smartctl supports 48-bit ATA commands, both the
 General Purpose Log (GPL) and SMART Log (SL) directories are printed in
-one combined table. The output can be restricted to the GPL directory or
-SL directory by \'\-l directory,q\' or \'\-l directory,s\' respectively.
-
+one combined table.  The output can be restricted to the GPL directory or
+SL directory by \*(Aq\-l directory,q\*(Aq or \*(Aq\-l directory,s\*(Aq
+respectively.
+.Sp
 .I background
 \- [SCSI only] the background scan results log outputs information derived
 from Background Media Scans (BMS) done after power up and/or periodically
-(e.g. every 24 hours) on recent SCSI disks. If supported, the BMS status
+(e.g.\& every 24 hours) on recent SCSI disks.  If supported, the BMS status
 is output first, indicating whether a background scan is currently
 underway (and if so a progress percentage), the amount of time the disk
-has been powered up and the number of scans already completed. Then there
-is a header and a line for each background scan "event". These will
-typically be either recovered or unrecoverable errors. That latter group
-may need some attention. There is a description of the background scan
-mechanism in section 4.18 of SBC-3 revision 6 (see www.t10.org ).
-
+has been powered up and the number of scans already completed.
+Then there is a header and a line for each background scan "event".
+These will typically be either recovered or unrecoverable errors.
+That latter group may need some attention.
+There is a description of the background scan mechanism in section 4.18 of
+SBC-3 revision 6 (see www.t10.org ).
+.Sp
 .I scttemp, scttempsts, scttemphist
 \- [ATA only] prints the disk temperature information provided by the
 SMART Command Transport (SCT) commands.
-The option \'scttempsts\' prints current temperature and temperature
-ranges returned by the SCT Status command, \'scttemphist\' prints
+The option \*(Aqscttempsts\*(Aq prints current temperature and temperature
+ranges returned by the SCT Status command, \*(Aqscttemphist\*(Aq prints
 temperature limits and the temperature history table returned by
-the SCT Data Table command, and \'scttemp\' prints both.
+the SCT Data Table command, and \*(Aqscttemp\*(Aq prints both.
 The temperature values are preserved across power cycles.
 The logging interval can be configured with the
-\'\-l scttempint,N[,p]\' option, see below.
+\*(Aq\-l scttempint,N[,p]\*(Aq option, see below.
 The SCT commands were introduced in ATA8-ACS and were also
 supported by many ATA-7 disks.
-
+.Sp
 .I scttempint,N[,p]
 \- [ATA only] clears the SCT temperature history table and sets the
 time interval for temperature logging to N minutes.
-If \',p\' is specified, the setting is preserved across power cycles.
+If \*(Aq,p\*(Aq is specified, the setting is preserved across power cycles.
 Otherwise, the setting is volatile and will be reverted to the last
 non-volatile setting by the next hard reset.  The default interval
 is vendor specific, typical values are 1, 2, or 5 minutes.
-
+.Sp
 .I scterc[,READTIME,WRITETIME]
 \- [ATA only] prints values and descriptions of the SCT Error Recovery
-Control settings. These are equivalent to TLER (as used by Western
-Digital), CCTL (as used by Samsung and Hitachi/HGST) and ERC (as used by
-Seagate). READTIME and WRITETIME arguments (deciseconds) set the
-specified values. Values of 0 disable the feature, other values less
-than 65 are probably not supported. For RAID configurations, this is
-typically set to 70,70 deciseconds.
-
+Control settings.
+These are equivalent to TLER (as used by Western Digital), CCTL (as used
+by Samsung and Hitachi/HGST) and ERC (as used by Seagate).
+READTIME and WRITETIME arguments (deciseconds) set the specified values.
+Values of 0 disable the feature, other values less than 65 are probably not
+supported.
+For RAID configurations, this is typically set to 70,70 deciseconds.
+.Sp
 .I devstat[,PAGE]
 \- [ATA only] prints values and descriptions of the ATA Device Statistics
 log pages (General Purpose Log address 0x04).  If no PAGE number is specified,
 entries from all supported pages are printed.  If PAGE 0 is specified,
 the list of supported pages is printed.  Device Statistics was
 introduced in ACS-2 and is only supported by some recent devices.
-
+.Sp
+.I defects[,NUM]
+\- [ATA only]
+[NEW EXPERIMENTAL SMARTCTL FEATURE]
+prints LBA and hours values from the ATA Pending Defects log
+(General Purpose Log address 0x0c).
+Only the 31 entries from first log page are printed by default.
+This number can be changed by the optional parameter NUM.
+The size of the log and the order of the entries are vendor specific.
+The Pending Defects log was introduced in ACS-4 Revision 01 (Mar 2014).
+.Sp
 .I sataphy[,reset]
 \- [SATA only] prints values and descriptions of the SATA Phy Event
-Counters (General Purpose Log address 0x11).  If \'\-l sataphy,reset\'
+Counters (General Purpose Log address 0x11).  If \*(Aq\-l sataphy,reset\*(Aq
 is specified, all counters are reset after reading the values.
 This also works for SATA devices with Packet interface like CD/DVD
 drives.
-
+.Sp
 .I sasphy[,reset]
 \- [SAS (SCSI) only] prints values and descriptions of the SAS (SSP)
-Protocol Specific log page (log page 0x18).  If \'\-l sasphy,reset\'
+Protocol Specific log page (log page 0x18).  If \*(Aq\-l sasphy,reset\*(Aq
 is specified, all counters are reset after reading the values.
-
+.Sp
 .I gplog,ADDR[,FIRST[\-LAST|+SIZE]]
 \- [ATA only] prints a hex dump of any log accessible via General
 Purpose Logging (GPL) feature.  The log address ADDR is the hex address
-listed in the log directory (see \'\-l directory\' above).
+listed in the log directory (see \*(Aq\-l directory\*(Aq above).
 The range of log sectors (pages) can be specified by decimal values
 FIRST\-LAST or FIRST+SIZE.  FIRST defaults to 0, SIZE defaults to 1.
-LAST can be set to \'max\' to specify the last page of the log.
-
+LAST can be set to \*(Aqmax\*(Aq to specify the last page of the log.
+.Sp
 .I smartlog,ADDR[,FIRST[\-LAST|+SIZE]]
 \- [ATA only] prints a hex dump of any log accessible via SMART Read
-Log command.  See \'\-l gplog,...\' above for parameter syntax.
-
+Log command.  See \*(Aq\-l gplog,...\*(Aq above for parameter syntax.
+.Sp
 For example, all these commands:
-.nf
-  smartctl \-l gplog,0x80,10-15 /dev/sda
+.Vb 3
+  smartctl \-l gplog,0x80,10\-15 /dev/sda
   smartctl \-l gplog,0x80,10+6 /dev/sda
-  smartctl \-l smartlog,0x80,10-15 /dev/sda
-.fi
-print pages 10-15 of log 0x80 (first host vendor specific log).
-
-The hex dump format is compatible with the \'xxd \-r\' command.
+  smartctl \-l smartlog,0x80,10\-15 /dev/sda
+.Ve
+print pages 10\(en15 of log 0x80 (first host vendor specific log).
+.Sp
+The hex dump format is compatible with the \*(Aqxxd \-r\*(Aq command.
 This command:
-.nf
-  smartctl \-l gplog,0x11 /dev/sda | grep ^0 | xxd -r >log.bin
-.fi
+.Vb 1
+  smartctl \-l gplog,0x11 /dev/sda | grep ^0 | xxd \-r >log.bin
+.Ve
 writes a binary representation of the one sector log 0x11
 (SATA Phy Event Counters) to file log.bin.
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I nvmelog,PAGE,SIZE
-\- [NVMe only] [FreeBSD, Linux, Windows and Cygwin only]
+\- [NVMe only]
 [NEW EXPERIMENTAL SMARTCTL FEATURE]
 prints a hex dump of the first SIZE bytes from the NVMe log with
 identifier PAGE.
@@ -1439,205 +1483,208 @@ PAGE is a hexadecimal number in the range from 0x1 to 0xff.
 SIZE is a hexadecimal number in the range from 0x4 to 0x4000 (16 KiB).
 \fBWARNING: Do not specify the identifier of an unknown log page.
 Reading a log page may have undesirable side effects.\fP
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I ssd
 \- [ATA] prints the Solid State Device Statistics log page.
-This has the same effect as \'\-l devstat,7\', see above.
-
+This has the same effect as \*(Aq\-l devstat,7\*(Aq, see above.
+.Sp
 .I ssd
 \- [SCSI] prints the Solid State Media percentage used endurance
-indicator. A value of 0 indicates as new condition while 100
+indicator.  A value of 0 indicates as new condition while 100
 indicates the device is at the end of its lifetime as projected by the
-manufacturer. The value may reach 255.
+manufacturer.
+The value may reach 255.
 .TP
-.B \-v ID,FORMAT[:BYTEORDER][,NAME], \-\-vendorattribute=ID,FORMAT[:BYTEORDER][,NAME]
+.B \-v ID,FORMAT[:BYTEORDER][,NAME], \-\-vendorattribute=ID,FORMAT...
 [ATA only] Sets a vendor-specific raw value print FORMAT, an optional
 BYTEORDER and an optional NAME for Attribute ID.
 This option may be used multiple times.
-
-The Attribute ID can be in the range 1 to 255. If \'N\' is specified as
-ID, the settings for all Attributes are changed.
-
+.Sp
+The Attribute ID can be in the range 1 to 255.
+If \*(AqN\*(Aq is specified as ID, the settings for all Attributes are changed.
+.Sp
 The optional BYTEORDER consists of 1 to 8 characters from the
-set \'012345rvwz\'. The characters \'0\' to \'5\' select the byte 0
-to 5 from the 48-bit raw value, \'r\' selects the reserved byte of
-the attribute data block, \'v\' selects the normalized value, \'w\'
-selects the worst value and \'z\' inserts a zero byte.
-The default BYTEORDER is \'543210\' for all 48-bit formats, \'r543210\'
-for the 54-bit formats, and \'543210wv\' for the 64-bit formats.
-For example, \'\-v 5,raw48:012345\' prints the raw value of
+set \*(Aq012345rvwz\*(Aq.
+The characters \*(Aq0\*(Aq to \*(Aq5\*(Aq select the byte 0 to 5 from the
+48-bit raw value, \*(Aqr\*(Aq selects the reserved byte of the attribute
+data block, \*(Aqv\*(Aq selects the normalized value, \*(Aqw\*(Aq selects
+the worst value and \*(Aqz\*(Aq inserts a zero byte.
+The default BYTEORDER is \*(Aq543210\*(Aq for all 48-bit formats,
+\*(Aqr543210\*(Aq for the 54-bit formats, and \*(Aq543210wv\*(Aq for the
+64-bit formats.
+For example, \*(Aq\-v 5,raw48:012345\*(Aq prints the raw value of
 attribute 5 with big endian instead of little endian
 byte ordering.
-
+.Sp
 The NAME is a string of letters, digits and underscore.  Its length should
-not exceed 23 characters.  The \'\-P showall\' option reports an error if
-this is the case.
-
+not exceed 23 characters.
+The \*(Aq\-P showall\*(Aq option reports an error if this is the case.
+.Sp
 .I \-v help
 \- Prints (to STDOUT) a list of all valid arguments to this option,
 then exits.
-
+.Sp
 Valid arguments for FORMAT are:
-
+.Sp
 .I raw8
 \- Print the Raw value as six 8-bit unsigned base-10 integers.
 This may be useful for decoding the meaning of the Raw value.
-
+.Sp
 .I raw16
 \- Print the Raw value as three 16-bit unsigned base-10 integers.
 This may be useful for decoding the meaning of the Raw value.
-
+.Sp
 .I raw48
 \- Print the Raw value as a 48-bit unsigned base-10 integer.
 This is the default for most attributes.
-
+.Sp
 .I hex48
 \- Print the Raw value as a 12 digit hexadecimal number.
 This may be useful for decoding the meaning of the Raw value.
-
+.Sp
 .I raw56
 \- Print the Raw value as a 54-bit unsigned base-10 integer.
 This includes the reserved byte which follows the 48-bit raw value.
-
+.Sp
 .I hex56
 \- Print the Raw value as a 14 digit hexadecimal number.
 This includes the reserved byte which follows the 48-bit raw value.
-
+.Sp
 .I raw64
 \- Print the Raw value as a 64-bit unsigned base-10 integer.
 This includes two bytes from the normalized and worst attribute value.
 This raw format is used by some SSD devices with Indilinx controller.
-
+.Sp
 .I hex64
 \- Print the Raw value as a 16 digit hexadecimal number.
 This includes two bytes from the normalized and worst attribute value.
 This raw format is used by some SSD devices with Indilinx controller.
-
+.Sp
 .I min2hour
 \- Raw Attribute is power-on time in minutes.  Its raw value
 will be displayed in the form "Xh+Ym".  Here X is hours, and Y is
-minutes in the range 0\-59 inclusive.  Y is always printed with two
+minutes in the range 0\(en59 inclusive.  Y is always printed with two
 digits, for example "06" or "31" or "00".
-
+.Sp
 .I sec2hour
 \- Raw Attribute is power-on time in seconds.  Its raw value
 will be displayed in the form "Xh+Ym+Zs".  Here X is hours, Y is
-minutes in the range 0\-59 inclusive, and Z is seconds in the range
-0\-59 inclusive.  Y and Z are always printed with two digits, for
+minutes in the range 0\(en59 inclusive, and Z is seconds in the range
+0\(en59 inclusive.  Y and Z are always printed with two digits, for
 example "06" or "31" or "00".
-
+.Sp
 .I halfmin2hour
 \- Raw Attribute is power-on time, measured in units of 30
 seconds.  This format is used by some Samsung disks.  Its raw value
 will be displayed in the form "Xh+Ym".  Here X is hours, and Y is
-minutes in the range 0\-59 inclusive.  Y is always printed with two
+minutes in the range 0\(en59 inclusive.  Y is always printed with two
 digits, for example "06" or "31" or "00".
-
+.Sp
 .I msec24hour32
 \- Raw Attribute is power-on time measured in 32-bit hours and 24-bit
 milliseconds since last hour update.  It will be displayed in the form
 "Xh+Ym+Z.Ms".  Here X is hours, Y is minutes, Z is seconds and M is
 milliseconds.
-
+.Sp
 .I tempminmax
 \- Raw Attribute is the disk temperature in Celsius.  Info about
 Min/Max temperature is printed if available.  This is the default
 for Attributes 190 and 194.  The recording interval (lifetime,
 last power cycle, last soft reset) of the min/max values is device
 specific.
-
+.Sp
 .I temp10x
 \- Raw Attribute is ten times the disk temperature in Celsius.
-
+.Sp
 .I raw16(raw16)
 \- Print the raw attribute as a 16-bit value and two optional
 16-bit values if these words are nonzero.  This is the default
 for Attributes 5 and 196.
-
+.Sp
 .I raw16(avg16)
 \- Raw attribute is spin-up time.  It is printed as a 16-bit value
 and an optional "Average" 16-bit value if the word is nonzero.
 This is the default for Attribute 3.
-
+.Sp
 .I raw24(raw8)
 \- Print the raw attribute as a 24-bit value and three optional
 8-bit values if these bytes are nonzero.  This is the default
 for Attribute 9.
-
+.Sp
 .I raw24/raw24
-\- Raw Attribute contains two 24-bit values. The first is the
+\- Raw Attribute contains two 24-bit values.  The first is the
 number of load cycles.  The second is the number of unload cycles.
 The difference between these two values is the number of times that
 the drive was unexpectedly powered off (also called an emergency
-unload). As a rule of thumb, the mechanical stress created by one
+unload).  As a rule of thumb, the mechanical stress created by one
 emergency unload is equivalent to that created by one hundred normal
 unloads.
-
+.Sp
 .I raw24/raw32
 \- Raw attribute is an error rate which consists of a 24-bit error
 count and a 32-bit total count.
-
-The following old arguments to \'\-v\' are also still valid:
-
+.Sp
+The following old arguments to \*(Aq\-v\*(Aq are also still valid:
+.Sp
 .I 9,minutes
 \- same as:
 .I 9,min2hour,Power_On_Minutes.
-
+.Sp
 .I 9,seconds
 \- same as:
 .I 9,sec2hour,Power_On_Seconds.
-
+.Sp
 .I 9,halfminutes
 \- same as:
 .I 9,halfmin2hour,Power_On_Half_Minutes.
-
+.Sp
 .I 9,temp
 \- same as:
 .I 9,tempminmax,Temperature_Celsius.
-
+.Sp
 .I 192,emergencyretractcyclect
 \- same as:
 .I 192,raw48,Emerg_Retract_Cycle_Ct
-
+.Sp
 .I 193,loadunload
 \- same as:
 .I 193,raw24/raw24.
-
+.Sp
 .I 194,10xCelsius
 \- same as:
 .I 194,temp10x,Temperature_Celsius_x10.
-
+.Sp
 .I 194,unknown
 \- same as:
 .I 194,raw48,Unknown_Attribute.
-
+.Sp
 .I 197,increasing
 \- same as:
 .I 197,raw48,Total_Pending_Sectors.
 Also means that Attribute number 197 (Current Pending Sector Count)
 is not reset if uncorrectable sectors are reallocated
 (see \fBsmartd.conf\fP(5) man page).
-
+.Sp
 .I 198,increasing
 \- same as:
 .I 198,raw48,Total_Offl_Uncorrectabl.
 Also means that Attribute number 198 (Offline Uncorrectable Sector Count)
 is not reset if uncorrectable sectors are reallocated
 (see \fBsmartd.conf\fP(5) man page).
-
+.Sp
 .I 198,offlinescanuncsectorct
 \- same as:
 .I 198,raw48,Offline_Scan_UNC_SectCt.
-
+.Sp
 .I 200,writeerrorcount
 \- same as:
 .I 200,raw48,Write_Error_Count.
-
+.Sp
 .I 201,detectedtacount
 \- same as:
 .I 201,raw48,Detected_TA_Count.
-
+.Sp
 .I 220,temp
 \- same as:
 .I 220,tempminmax,Temperature_Celsius.
@@ -1646,18 +1693,18 @@ is not reset if uncorrectable sectors are reallocated
 [ATA only] Modifies the behavior of \fBsmartctl\fP to compensate for some
 known and understood device firmware or driver bug.  This option may be used
 multiple times.  The valid arguments are:
-
+.Sp
 .I none
 \- Assume that the device firmware obeys the ATA specifications.  This
-is the default, unless the device has presets for \'\-F\' in the
+is the default, unless the device has presets for \*(Aq\-F\*(Aq in the
 drive database.  Using this option on the command line will override any
 preset values.
-
+.Sp
 .I nologdir
 \- Suppresses read attempts of SMART or GP Log Directory.
 Support for all standard logs is assumed without an actual check.
 Some Intel SSDs may freeze if log address 0 is read.
-
+.Sp
 .I samsung
 \- In some Samsung disks (example: model SV4012H Firmware Version:
 RM100-08) some of the two- and four-byte quantities in the SMART data
@@ -1667,36 +1714,37 @@ in byte-reversed order.  Some signs that your disk needs this option
 are (1) no self-test log printed, even though you have run self-tests;
 (2) very large numbers of ATA errors reported in the ATA error log;
 (3) strange and impossible values for the ATA error log timestamps.
-
+.Sp
 .I samsung2
 \- In some Samsung disks the number of ATA errors reported is byte swapped.
 Enabling this option tells \fBsmartctl\fP to evaluate this quantity in
-byte-reversed order. An indication that your Samsung disk needs this
+byte-reversed order.  An indication that your Samsung disk needs this
 option is that the self-test log is printed correctly, but there are a
 very large number of errors in the SMART error log.  This is because
 the error count is byte swapped.  Thus a disk with five errors
 (0x0005) will appear to have 20480 errors (0x5000).
-
+.Sp
 .I samsung3
 \- Some Samsung disks (at least SP2514N with Firmware VF100-37) report
 a self-test still in progress with 0% remaining when the test was already
-completed. Enabling this option modifies the output of the self-test
-execution status (see options \'\-c\' or \'\-a\' above) accordingly.
-
+completed.  Enabling this option modifies the output of the self-test
+execution status (see options \*(Aq\-c\*(Aq or \*(Aq\-a\*(Aq above)
+accordingly.
+.Sp
 .I xerrorlba
 \- Fixes LBA byte ordering in Extended Comprehensive SMART error log.
 Some disks use little endian byte ordering instead of ATA register
 ordering to specifiy the LBA addresses in the log entries.
-
+.Sp
 .I swapid
 \- Fixes byte swapped ATA identify strings (device name, serial number,
 firmware version) returned by some buggy device drivers.
 .TP
 .B \-P TYPE, \-\-presets=TYPE
 [ATA only] Specifies whether \fBsmartctl\fP should use any preset options
-that are available for this drive. By default, if the drive is recognized
+that are available for this drive.  By default, if the drive is recognized
 in the \fBsmartmontools\fP database, then the presets are used.
-
+.Sp
 The argument
 .I show
 will show any preset options for your drive and the argument
@@ -1708,60 +1756,61 @@ to get \fBsmartctl\fP to display correct values) then please contact
 the \fBsmartmontools\fP developers so that this information can be
 added to the \fBsmartmontools\fP database.  Contact information is at the
 end of this man page.
-
+.Sp
 The valid arguments to this option are:
-
+.Sp
 .I use
 \- if a drive is recognized, then use the stored presets for it.  This
-is the default. Note that presets will NOT override additional
-Attribute interpretation (\'\-v N,something\') command-line options or
-explicit \'\-F\' command-line options..
-
+is the default.  Note that presets will NOT override additional
+Attribute interpretation (\*(Aq\-v N,something\*(Aq) command-line options or
+explicit \*(Aq\-F\*(Aq command-line options..
+.Sp
 .I ignore
 \- do not use presets.
-
+.Sp
 .I show
 \- show if the drive is recognized in the database, and if so, its
 presets, then exit.
-
+.Sp
 .I showall
 \- list all recognized drives, and the presets that are set for them,
 then exit.  This also checks the drive database regular expressions
 and settings for syntax errors.
-
-The \'\-P showall\' option takes up to two optional arguments to
-match a specific drive type and firmware version. The command:
-.nf
+.Sp
+The \*(Aq\-P showall\*(Aq option takes up to two optional arguments to
+match a specific drive type and firmware version.
+The command:
+.Vb 1
   smartctl \-P showall
-.fi
+.Ve
 lists all entries, the command:
-.nf
-  smartctl \-P showall \'MODEL\'
-.fi
+.Vb 1
+  smartctl \-P showall \*(AqMODEL\*(Aq
+.Ve
 lists all entries matching MODEL, and the command:
-.nf
-  smartctl \-P showall \'MODEL\' \'FIRMWARE\'
-.fi
+.Vb 1
+  smartctl \-P showall \*(AqMODEL\*(Aq \*(AqFIRMWARE\*(Aq
+.Ve
 lists all entries for this MODEL and a specific FIRMWARE version.
 .TP
 .B \-B [+]FILE, \-\-drivedb=[+]FILE
 [ATA only] Read the drive database from FILE.  The new database replaces
-the built in database by default.  If \'+\' is specified, then the new
+the built in database by default.  If \*(Aq+\*(Aq is specified, then the new
 entries prepend the built in entries.
-
+.Sp
 Optional entries are read from the file
 .\" %IF NOT OS Windows
 \fB/usr/local/etc/smart_drivedb.h\fP
 .\" %ENDIF NOT OS Windows
 .\" %IF OS ALL
- (Windows: \fBEXEDIR/drivedb-add.h\fP)
+(Windows: \fBEXEDIR/drivedb-add.h\fP)
 .\" %ENDIF OS ALL
 .\" %IF OS Windows
 .\"! \fBEXEDIR/drivedb-add.h\fP.
 .\" %ENDIF OS Windows
 .\" %IF ENABLE_DRIVEDB
 if this option is not specified.
-
+.Sp
 If
 .\" %IF NOT OS Windows
 \fB/usr/local/share/smartmontools/drivedb.h\fP
@@ -1774,7 +1823,7 @@ If
 .\" %ENDIF OS Windows
 is present, the contents of this file is used instead of the built in table.
 .\" %IF ENABLE_UPDATE_SMART_DRIVEDB
-
+.Sp
 Run
 .\" %IF NOT OS Windows
 \fB/usr/local/sbin/update-smart-drivedb\fP
@@ -1788,12 +1837,13 @@ Run
 to update this file from the smartmontools SVN repository.
 .\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
 .\" %ENDIF ENABLE_DRIVEDB
-
+.Sp
 The database files use the same C/C++ syntax that is used to initialize
-the built in database array. C/C++ style comments are allowed.
+the built in database array.
+C/C++ style comments are allowed.
 Example:
-
-.nf
+.Sp
+.Vb 8
   /* Full entry: */
   {
     "Model family",    // Info about model family/series.
@@ -1819,13 +1869,13 @@ Example:
     "\-d sat"           // String with device type option.
   },
   /* ... */
-.fi
-
+.Ve
+.Sp
 .TP
 .B SMART RUN/ABORT OFFLINE TEST AND self-test OPTIONS:
 .TP
 .B \-t TEST, \-\-test=TEST
-Executes TEST immediately.  The \'\-C\' option can be used in
+Executes TEST immediately.  The \*(Aq\-C\*(Aq option can be used in
 conjunction with this option to run the short or long (and also for
 ATA devices, selective or conveyance) self-tests in captive mode
 (known as "foreground mode" for SCSI devices).  Note that only one
@@ -1833,324 +1883,324 @@ test type can be run at a time, so only one test type should be
 specified per command line.  Note also that if a computer is shutdown
 or power cycled during a self-test, no harm should result.  The
 self-test will either be aborted or will resume automatically.
-
-All \'\-t TEST\' commands can be given during normal system operation
-unless captive mode (\'\-C\' option) is used.
+.Sp
+All \*(Aq\-t TEST\*(Aq commands can be given during normal system operation
+unless captive mode (\*(Aq\-C\*(Aq option) is used.
 A running self-test can, however, degrade performance of the drive.
 Frequent I/O requests from the operating system increase the duration
 of a test.  These impacts may vary from device to device.
-
+.Sp
 If a test failure occurs then the device may discontinue the testing
 and report the result immediately.
-
+.Sp
+[ATA]
+Note that the ATA command SMART EXECUTE OFF-LINE IMMEDIATE (the command to
+start a test) was declared obsolete in ATA ACS-4 Revision 10 (Nov 2015).
+.Sp
 The valid arguments to this option are:
-
+.Sp
 .I offline
 \- [ATA] runs SMART Immediate Offline Test.  This immediately
 starts the test described above.  This command can be given during
 normal system operation.  The effects of this test are visible only in
 that it updates the SMART Attribute values, and if errors are
-found they will appear in the SMART error log, visible with the \'\-l error\'
-option.
-
-If the \'\-c\' option to \fBsmartctl\fP shows that the device has the
+found they will appear in the SMART error log, visible with the
+\*(Aq\-l error\*(Aq option.
+.Sp
+If the \*(Aq\-c\*(Aq option to \fBsmartctl\fP shows that the device has the
 "Suspend Offline collection upon new command" capability then you can
-track the progress of the Immediate Offline test using the \'\-c\'
-option to \fBsmartctl\fP.  If the \'\-c\' option show that the device
+track the progress of the Immediate Offline test using the \*(Aq\-c\*(Aq
+option to \fBsmartctl\fP.  If the \*(Aq\-c\*(Aq option show that the device
 has the "Abort Offline collection upon new command" capability then
 most commands will abort the Immediate Offline Test, so you should not
-try to track the progress of the test with \'\-c\', as it will abort
+try to track the progress of the test with \*(Aq\-c\*(Aq, as it will abort
 the test.
-
+.Sp
 .I offline
-\- [SCSI] runs the default self test in foreground. No entry is placed
-in the self test log.
-
+\- [SCSI] runs the default self test in foreground.
+No entry is placed in the self test log.
+.Sp
 .I short
 \- [ATA] runs SMART Short Self Test (usually under ten minutes).
 This command can be given during normal system operation (unless run in
-captive mode \- see the \'\-C\' option below).  This is a
+captive mode \- see the \*(Aq\-C\*(Aq option below).  This is a
 test in a different category than the immediate or automatic offline
 tests.  The "Self" tests check the electrical and mechanical
 performance as well as the read performance of the disk.  Their
 results are reported in the Self Test Error Log, readable with
-the \'\-l selftest\' option.  Note that on some disks the progress of the
-self-test can be monitored by watching this log during the self-test; with other disks
-use the \'\-c\' option to monitor progress.
-
+the \*(Aq\-l selftest\*(Aq option.  Note that on some disks the progress of
+the self-test can be monitored by watching this log during the self-test;
+with other disks use the \*(Aq\-c\*(Aq option to monitor progress.
+.Sp
 .I short
 \- [SCSI] runs the "Background short" self-test.
-
+.Sp
 .I long
-\- [ATA] runs SMART Extended Self Test (tens of minutes). This is a
-longer and more thorough version of the Short Self Test described
+\- [ATA] runs SMART Extended Self Test (tens of minutes to several hours).
+This is a longer and more thorough version of the Short Self Test described
 above.  Note that this command can be given during normal
-system operation (unless run in captive mode \- see the \'\-C\' option below).
-
+system operation (unless run in captive mode \- see the \*(Aq\-C\*(Aq option
+below).
+.Sp
 .I long
 \- [SCSI] runs the "Background long" self-test.
-
+.Sp
 .I conveyance
 \- [ATA only] runs a SMART Conveyance Self Test (minutes).  This
 self-test routine is intended to identify damage incurred during
-transporting of the device. This self-test routine should take on the
+transporting of the device.  This self-test routine should take on the
 order of minutes to complete.  Note that this command can be given
 during normal system operation (unless run in captive mode \- see the
-\'\-C\' option below).
-
+\*(Aq\-C\*(Aq option below).
+.Sp
 .I select,N\-M, select,N+SIZE
 \- [ATA only] runs a SMART Selective Self Test, to test a \fBrange\fP
 of disk Logical Block Addresses (LBAs), rather than the entire disk.
 Each range of LBAs that is checked is called a "span" and is specified
 by a starting LBA (N) and an ending LBA (M) with N less than or equal
-to M. The range can also be specified as N+SIZE. A span at the end of
-a disk can be specified by N\-\fBmax\fP.
-
+to M.
+The range can also be specified as N+SIZE.
+A span at the end of a disk can be specified by N\-\fBmax\fP.
+.Sp
 For example the commands:
-.nf
+.Vb 2
   smartctl \-t select,10\-20 /dev/sda
   smartctl \-t select,10+11 /dev/sda
-.fi
+.Ve
 both runs a self test on one span consisting of LBAs ten to twenty
-(inclusive). The command:
-.nf
+(inclusive).
+The command:
+.Vb 1
   smartctl \-t select,100000000\-max /dev/sda
-.fi
+.Ve
 run a self test from LBA 100000000 up to the end of the disk.
-The \'\-t\' option can be given up to five times, to test
+The \*(Aq\-t\*(Aq option can be given up to five times, to test
 up to five spans.  For example the command:
-.nf
+.Vb 1
   smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/sda
-.fi
+.Ve
 runs a self test on two spans.  The first span consists of 101 LBAs
 and the second span consists of 1001 LBAs.  Note that the spans can
 overlap partially or completely, for example:
-.nf
+.Vb 1
   smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/sda
-.fi
+.Ve
 The results of the selective self-test can be obtained (both during
 and after the test) by printing the SMART self-test log, using the
-\'\-l selftest\' option to smartctl.
-
+\*(Aq\-l selftest\*(Aq option to smartctl.
+.Sp
 Selective self tests are particularly useful as disk capacities
 increase: an extended self test (smartctl \-t long) can take several
 hours.  Selective self-tests are helpful if (based on SYSLOG error
 messages, previous failed self-tests, or SMART error log entries) you
 suspect that a disk is having problems at a particular range of
 Logical Block Addresses (LBAs).
-
+.Sp
 Selective self-tests can be run during normal system operation (unless
-done in captive mode \- see the \'\-C\' option below).
-
+done in captive mode \- see the \*(Aq\-C\*(Aq option below).
+.Sp
 The following variants of the selective self-test command use spans based
 on the ranges from past tests already stored on the disk:
-
+.Sp
 .I select,redo[+SIZE]
 \- [ATA only] redo the last SMART Selective Self Test using the same LBA
-range. The starting LBA is identical to the LBA used by last test, same
-for ending LBA unless a new span size is specified by optional +SIZE
-argument.
-
+range.
+The starting LBA is identical to the LBA used by last test, same for ending
+LBA unless a new span size is specified by optional +SIZE argument.
+.Sp
 For example the commands:
-.nf
+.Vb 3
   smartctl \-t select,10\-20 /dev/sda
   smartctl \-t select,redo /dev/sda
   smartctl \-t select,redo+20 /dev/sda
-.fi
+.Ve
 have the same effect as:
-.nf
+.Vb 3
   smartctl \-t select,10\-20 /dev/sda
   smartctl \-t select,10\-20 /dev/sda
   smartctl \-t select,10\-29 /dev/sda
-.fi
-
+.Ve
+.Sp
 .I select,next[+SIZE]
 \- [ATA only] runs a SMART Selective Self Test on the LBA range which
-follows the range of the last test. The starting LBA is set to (ending
-LBA +1) of the last test. A new span size may be specified by the
-optional +SIZE argument.
-
+follows the range of the last test.
+The starting LBA is set to (ending LBA +1) of the last test.
+A new span size may be specified by the optional +SIZE argument.
+.Sp
 For example the commands:
-.nf
+.Vb 3
   smartctl \-t select,0\-999 /dev/sda
   smartctl \-t select,next /dev/sda
   smartctl \-t select,next+2000 /dev/sda
-.fi
+.Ve
 have the same effect as:
-.nf
+.Vb 3
   smartctl \-t select,0\-999 /dev/sda
   smartctl \-t select,1000\-1999 /dev/sda
   smartctl \-t select,2000\-3999 /dev/sda
-.fi
-
+.Ve
+.Sp
 If the last test ended at the last LBA of the disk, the new range starts
-at LBA 0. The span size of the last span of a disk is adjusted such that
+at LBA 0.  The span size of the last span of a disk is adjusted such that
 the total number of spans to check the full disk will not be changed
-by future uses of \'\-t select,next\'.
-
+by future uses of \*(Aq\-t select,next\*(Aq.
+.Sp
 .I select,cont[+SIZE]
-\- [ATA only] performs a \'redo\' (above) if the self test status reports
-that the last test was aborted by the host. Otherwise it run the \'next\'
-(above) test.
-
+\- [ATA only] performs a \*(Aqredo\*(Aq (above) if the self test status
+reports that the last test was aborted by the host.
+Otherwise it run the \*(Aqnext\*(Aq (above) test.
+.Sp
 .I afterselect,on
 \- [ATA only] perform an offline read scan after a Selective self-test
-has completed. This option must be used together with one or more of
-the \fIselect,N\-M\fP options above. If the LBAs that have been
+has completed.  This option must be used together with one or more of
+the \fIselect,N\-M\fP options above.  If the LBAs that have been
 specified in the Selective self-test pass the test with no errors
 found, then read scan the \fBremainder\fP of the disk.  If the device
 is powered-cycled while this read scan is in progress, the read scan
 will be automatically resumed after a time specified by the pending
 timer (see below).  The value of this option is preserved between
 selective self-tests.
-
+.Sp
 .I afterselect,off
 \- [ATA only] do not read scan the remainder of the disk after a
 Selective self-test has completed.  This option must be use together
 with one or more of the \fIselect,N\-M\fP options above.  The value of this
 option is preserved between selective self-tests.
-
-.I pending,N 
+.Sp
+.I pending,N
 \- [ATA only] set the pending offline read scan timer to N minutes.
 Here N is an integer in the range from 0 to 65535 inclusive.  If the
 device is powered off during a read scan after a Selective self-test,
 then resume the test automatically N minutes after power-up.  This
 option must be use together with one or more of the \fIselect,N\-M\fP
-options above. The value of this option is preserved between selective
-self-tests.
-
+options above.
+The value of this option is preserved between selective self-tests.
+.Sp
 .I vendor,N
 \- [ATA only] issues the ATA command SMART EXECUTE OFF-LINE IMMEDIATE
-with subcommand N in LBA LOW register. The subcommand is specified as
-a hex value in the range 0x00 to 0xff.  Subcommands 0x40-0x7e and
-0x90-0xff are reserved for vendor specific use, see table 61 of
+with subcommand N in LBA LOW register.  The subcommand is specified as
+a hex value in the range 0x00 to 0xff.  Subcommands 0x40\(en0x7e and
+0x90\(en0xff are reserved for vendor specific use, see table 61 of
 T13/1699-D Revision 6a (ATA8-ACS).  Note that the subcommands
-0x00-0x04,0x7f,0x81-0x84 are supported by other smartctl options
-(e.g. 0x01: \'\-t short\', 0x7f: \'\-X\', 0x82: \'\-C \-t long\').
-
+0x00\(en0x04, 0x7f, 0x81\(en0x84 are supported by other smartctl options
+(e.g.\& 0x01: \*(Aq\-t short\*(Aq, 0x7f: \*(Aq\-X\*(Aq, 0x82:
+\*(Aq\-C \-t long\*(Aq).
+.Sp
 \fBWARNING: Only run subcommands documented by the vendor of the
 device.\fP
-
+.Sp
 Example for some Intel SSDs only:
-The subcommand 0x40 (\'\-t vendor,0x40\') clears the timed workload
+The subcommand 0x40 (\*(Aq\-t vendor,0x40\*(Aq) clears the timed workload
 related SMART attributes (226, 227, 228).  Note that the raw values of
 these attributes are held at 65535 (0xffff) until the workload timer
 reaches 60 minutes.
-
+.Sp
 .I force
 \- start new self-test even if another test is already running.
 By default a running self-test will not be interrupted to begin another
 test.
 .TP
 .B \-C, \-\-captive
-[ATA] Runs self-tests in captive mode.  This has no effect with \'\-t
-offline\' or if the \'\-t\' option is not used.
-
+[ATA] Runs self-tests in captive mode.  This has no effect with \*(Aq\-t
+offline\*(Aq or if the \*(Aq\-t\*(Aq option is not used.
+.Sp
 \fBWARNING: Tests run in captive mode may busy out the drive for the
 length of the test.  Only run captive tests on drives without any
 mounted partitions!\fP
-
+.Sp
 [SCSI] Runs the self-test in "Foreground" mode.
 .TP
 .B \-X, \-\-abort
 Aborts non-captive SMART Self Tests.  Note that this
 command will abort the Offline Immediate Test routine only if your
 disk has the "Abort Offline collection upon new command" capability.
-
+.Sp
 .SH ATA, SCSI command sets and SAT
 In the past there has been a clear distinction between storage devices
-that used the ATA and SCSI command sets. This distinction was often
-reflected in their device naming and hardware. Now various SCSI
-transports (e.g. SAS, FC and iSCSI) can interconnect to both SCSI
-disks (e.g. FC and SAS) and ATA disks (especially SATA). USB and
+that used the ATA and SCSI command sets.  This distinction was often
+reflected in their device naming and hardware.  Now various SCSI
+transports (e.g.\& SAS, FC and iSCSI) can interconnect to both SCSI
+disks (e.g.\& FC and SAS) and ATA disks (especially SATA).  USB and
 IEEE 1394 storage devices use the SCSI command set externally but
-almost always contain ATA or SATA disks (or flash). The storage
+almost always contain ATA or SATA disks (or flash).  The storage
 subsystems in some operating systems have started to remove the
 distinction between ATA and SCSI in their device naming policies.
 .PP
 99% of operations that an OS performs on a disk involve the SCSI INQUIRY,
-READ CAPACITY, READ and WRITE commands, or their ATA equivalents. Since
+READ CAPACITY, READ and WRITE commands, or their ATA equivalents.  Since
 the SCSI commands are slightly more general than their ATA equivalents,
 many OSes are generating SCSI commands (mainly READ and WRITE) and
 letting a lower level translate them to their ATA equivalents as the
-need arises. An important note here is that "lower level" may be in
+need arises.  An important note here is that "lower level" may be in
 external equipment and hence outside the control of an OS.
 .PP
 SCSI to ATA Translation (SAT) is a standard (ANSI INCITS 431-2007) that
-specifies how this translation is done. For the other 1% of operations
-that an OS performs on a disk, SAT provides two options. First is an
-optional ATA PASS-THROUGH SCSI command (there are two variants). The
-second is a translation from the closest SCSI command. Most current
-interest is in the "pass-through" option.
+specifies how this translation is done.  For the other 1% of operations
+that an OS performs on a disk, SAT provides two options.  First is an
+optional ATA PASS-THROUGH SCSI command (there are two variants).
+The second is a translation from the closest SCSI command.
+Most current interest is in the "pass-through" option.
 .PP
 The relevance to smartmontools (and hence smartctl) is that its
-interactions with disks fall solidly into the "1%" category. So even
+interactions with disks fall solidly into the "1%" category.  So even
 if the OS can happily treat (and name) a disk as "SCSI", smartmontools
 needs to detect the native command set and act accordingly.
 As more storage manufacturers (including external SATA drives) comply
 with SAT, smartmontools is able to automatically distinguish the native
-command set of the device. In some cases the '\-d sat' option is needed
-on the command line.
+command set of the device.
+In some cases the \*(Aq\-d sat\*(Aq option is needed on the command line.
 .PP
 There are also virtual disks which typically have no useful information
-to convey to smartmontools, but could conceivably in the future. An
-example of a virtual disk is the OS's view of a RAID 1 box. There are
-most likely two SATA disks inside a RAID 1 box. Addressing those SATA
-disks from a distant OS is a challenge for smartmontools. Another
+to convey to smartmontools, but could conceivably in the future.  An
+example of a virtual disk is the OS's view of a RAID 1 box.  There are
+most likely two SATA disks inside a RAID 1 box.  Addressing those SATA
+disks from a distant OS is a challenge for smartmontools.  Another
 approach is running a tool like smartmontools inside the RAID 1 box (e.g.
 a Network Attached Storage (NAS) box) and fetching the logs via a
-browser. 
-
+browser.
+.Sp
 .SH EXAMPLES
-.nf
 .B smartctl \-a /dev/sda
-.fi
-Print a large amount of SMART information for drive /dev/sda .
+.br
+Print a large amount of SMART information for drive /dev/sda.
 .PP
-.nf
 .B smartctl \-s off /dev/sdd
-.fi
-Disable SMART monitoring and data log collection on drive /dev/sdd .
+.br
+Disable SMART monitoring and data log collection on drive /dev/sdd.
 .PP
-.nf
 .B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/sda
-.fi
+.br
 Enable SMART on drive /dev/sda, enable automatic offline
 testing every four hours, and enable autosaving of
-SMART Attributes.  This is a good start-up line for your system\'s
+SMART Attributes.  This is a good start-up line for your system's
 init files.  You can issue this command on a running system.
 .PP
-.nf
 .B smartctl \-t long /dev/sdc
-.fi
+.br
 Begin an extended self-test of drive /dev/sdc.  You can issue this
 command on a running system.  The results can be seen in the self-test
-log visible with the \'\-l selftest\' option after it has completed.
+log visible with the \*(Aq\-l selftest\*(Aq option after it has completed.
 .PP
-.nf
 .B smartctl \-s on \-t offline /dev/sda
-.fi
+.br
 Enable SMART on the disk, and begin an immediate offline test of
 drive /dev/sda.  You can issue this command on a running system.  The
 results are only used to update the SMART Attributes, visible
-with the \'\-A\' option.  If any device errors occur, they are logged to
-the SMART error log, which can be seen with the \'\-l error\' option.
+with the \*(Aq\-A\*(Aq option.  If any device errors occur, they are logged to
+the SMART error log, which can be seen with the \*(Aq\-l error\*(Aq option.
 .PP
-.nf
 .B smartctl \-A \-v 9,minutes /dev/sda
-.fi
+.br
 Shows the vendor Attributes, when the disk stores its power-on time
 internally in minutes rather than hours.
 .PP
-.nf
 .B smartctl \-q errorsonly \-H \-l selftest /dev/sda
-.fi
+.br
 Produces output only if the device returns failing SMART status,
 or if some of the logged self-tests ended with errors.
 .PP
-.nf
 .B smartctl \-q silent \-a /dev/sda
-.fi
+.br
 Examine all SMART data for device /dev/sda, but produce no
 printed output.  You must use the exit status (the
 .B $?
@@ -2158,71 +2208,42 @@ shell variable) to learn if any Attributes are out of bound, if the
 SMART status is failing, if there are errors recorded in the
 self-test log, or if there are errors recorded in the disk error log.
 .PP
-.nf
-.B smartctl \-a \-d 3ware,0 /dev/sda
-.fi
-Examine all SMART data for the first ATA disk connected to a 3ware
-RAID controller card.
-.PP
-.nf
-.B smartctl \-a \-d 3ware,0 /dev/twe0
-.fi
-Examine all SMART data for the first ATA disk connected to a 3ware
-RAID 6000/7000/8000 controller card.
-.PP
-.nf
-.B smartctl \-a \-d 3ware,0 /dev/twa0
-.fi
-Examine all SMART data for the first ATA disk connected to a
-3ware RAID 9000 controller card.
-.PP
-.nf
 .B smartctl \-a \-d 3ware,0 /dev/twl0
-.fi
+.br
 Examine all SMART data for the first SATA (not SAS) disk connected to a
 3ware RAID 9750 controller card.
 .PP
-.nf
-.B smartctl \-t short \-d 3ware,3 /dev/sdb
-.fi
-Start a short self-test on the fourth ATA disk connected to the 3ware RAID
-controller card which is the second SCSI device /dev/sdb.
-.PP
-.nf
 .B smartctl \-t long \-d areca,4 /dev/sg2
-.fi
+.br
 Start a long self-test on the fourth SATA disk connected to an Areca RAID
 controller addressed by /dev/sg2.
 .PP
-.nf
 .B smartctl \-a \-d hpt,1/3 /dev/sda    (under Linux)
+.br
 .B smartctl \-a \-d hpt,1/3 /dev/hptrr    (under FreeBSD)
-.fi
-Examine all SMART data for the (S)ATA disk directly connected to the third channel of the
-first HighPoint RocketRAID controller card.
-.nf
+.br
+Examine all SMART data for the (S)ATA disk directly connected to the third
+channel of the first HighPoint RocketRAID controller card.
 .PP
-.nf
 .B smartctl \-t short \-d hpt,1/1/2 /dev/sda    (under Linux)
+.br
 .B smartctl \-t short \-d hpt,1/1/2 /dev/hptrr    (under FreeBSD)
-.fi
+.br
 Start a short self-test on the (S)ATA disk connected to second pmport on the
 first channel of the first HighPoint RocketRAID controller card.
 .PP
-.nf
 .B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/sda
-.fi
+.br
 Run a selective self-test on LBAs 10 to 100 and 30 to 300.  After the
-these LBAs have been tested, read-scan the remainder of the disk.  If the disk is
-power-cycled during the read-scan, resume the scan 45 minutes after power to the
-device is restored.
+these LBAs have been tested, read-scan the remainder of the disk.
+If the disk is power-cycled during the read-scan, resume the scan 45 minutes
+after power to the device is restored.
 .PP
-.nf
 .B smartctl \-a \-d cciss,0 /dev/cciss/c0d0
-.fi
+.br
 Examine all SMART data for the first SCSI disk connected to a cciss
 RAID controller card.
-
+.Sp
 .SH EXIT STATUS
 The exit statuses of \fBsmartctl\fP are defined by a bitmask.
 If all is well with the disk, the exit status (return value) of
@@ -2237,11 +2258,11 @@ Command line did not parse.
 .TP
 .B Bit 1:
 Device open failed, device did not return an IDENTIFY DEVICE structure,
-or device is in a low-power mode (see \'\-n\' option above).
+or device is in a low-power mode (see \*(Aq\-n\*(Aq option above).
 .TP
 .B Bit 2:
 Some SMART or other ATA command to the disk failed, or there was a checksum
-error in a SMART data structure (see \'\-b\' option above).
+error in a SMART data structure (see \*(Aq\-b\*(Aq option above).
 .TP
 .B Bit 3:
 SMART status check returned "DISK FAILING".
@@ -2252,7 +2273,7 @@ We found prefail Attributes <= threshold.
 .B Bit 5:
 SMART status check returned "DISK OK" but we found that some (usage
 or prefail) Attributes have been <= threshold at some time in the
-past. 
+past.
 .TP
 .B Bit 6:
 The device error log contains records of errors.
@@ -2265,9 +2286,9 @@ self-test are ignored.
 To test within the shell for whether or not the different bits are
 turned on or off, you can use the following type of construction
 (which should work with any POSIX compatible shell):
-.nf
+.br
 .B smartstat=$(($? & 8))
-.fi
+.br
 This looks at only at bit 3 of the exit status
 .B $?
 (since 8=2^3).  The shell variable
@@ -2275,14 +2296,14 @@ $smartstat will be nonzero if SMART status check returned "disk
 failing" and zero otherwise.
 .PP
 This shell script prints all status bits:
-.nf
+.Vb 5
 val=$?; mask=1
 for i in 0 1 2 3 4 5 6 7; do
   echo "Bit $i: $(((val & mask) && 1))"
   mask=$((mask << 1))
 done
-.fi
-
+.Ve
+.Sp
 .\" %IF NOT OS Windows
 .SH FILES
 .TP
@@ -2291,12 +2312,12 @@ full path of this executable.
 .\" %IF ENABLE_DRIVEDB
 .TP
 .B /usr/local/share/smartmontools/drivedb.h
-drive database (see \'\-B\' option).
+drive database (see \*(Aq\-B\*(Aq option).
 .\" %ENDIF ENABLE_DRIVEDB
 .TP
 .B /usr/local/etc/smart_drivedb.h
-optional local drive database (see \'\-B\' option).
-
+optional local drive database (see \*(Aq\-B\*(Aq option).
+.Sp
 .\" %ENDIF NOT OS Windows
 .SH AUTHORS
 \fBBruce Allen\fP (project initiator),
@@ -2310,52 +2331,52 @@ optional local drive database (see \'\-B\' option).
 \fBGabriele Pohl\fP (wiki & development team support),
 .br
 \fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
-
+.PP
 Many other individuals have made contributions and corrections,
 see AUTHORS, ChangeLog and repository files.
-
+.PP
 The first smartmontools code was derived from the smartsuite package,
 written by Michael Cornwell and Andre Hedrick.
-
+.Sp
 .SH REPORTING BUGS
 To submit a bug report, create a ticket in smartmontools wiki:
 .br
-<\fBhttp://www.smartmontools.org/\fP>.
+<\fBhttps://www.smartmontools.org/\fP>.
 .br
 Alternatively send the info to the smartmontools support mailing list:
 .br
-<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
-
+<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>.
+.Sp
 .SH SEE ALSO
 \fBsmartd\fP(8).
 .\" %IF ENABLE_UPDATE_SMART_DRIVEDB
 .br
 \fBupdate-smart-drivedb\fP(8).
 .\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
-
+.Sp
 .SH REFERENCES
 Please see the following web site for more info:
-\fBhttp://www.smartmontools.org/\fP
-
+<\fBhttps://www.smartmontools.org/\fP>
+.PP
 An introductory article about smartmontools is \fIMonitoring Hard
 Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
-pages 74-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
-online.
-
+pages 74\(en77.
+See <\fBhttps://www.linuxjournal.com/article/6983\fP>.
+.PP
 If you would like to understand better how SMART works, and what it
 does, a good place to start is with Sections 4.8 and 6.54 of the first
-volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7)
+volume of the \*(AqAT Attachment with Packet Interface-7\*(Aq (ATA/ATAPI-7)
 specification Revision 4b.  This documents the SMART functionality which the
 \fBsmartmontools\fP utilities provide access to.
-
+.PP
 The functioning of SMART was originally defined by the SFF-8035i
 revision 2 and the SFF-8055i revision 1.4 specifications.  These are
 publications of the Small Form Factors (SFF) Committee.
-
+.PP
 Links to these and other documents may be found on the Links page of the
-\fBsmartmontools\fP Wiki at \fBhttp://www.smartmontools.org/wiki/Links\fP .
-
+\fBsmartmontools\fP Wiki at <\fBhttps://www.smartmontools.org/wiki/Links\fP>.
+.Sp
 .SH PACKAGE VERSION
 CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
 .br
-$Id: smartctl.8.in 4311 2016-04-27 21:03:01Z chrfranke $
+$Id: smartctl.8.in 4588 2017-11-04 15:15:32Z chrfranke $
index 3c2e40569486cf097411416947cd4c8f03f258a9..4bf5c5c92c4a7e260f0f78912138897b0509889b 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-11 Bruce Allen
- * Copyright (C) 2008-16 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -52,7 +52,7 @@
 #include "smartctl.h"
 #include "utility.h"
 
-const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 4311 2016-04-27 21:03:01Z chrfranke $"
+const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 4585 2017-11-04 13:41:03Z chrfranke $"
   CONFIG_H_CVSID SMARTCTL_H_CVSID;
 
 // Globals to control printing
@@ -87,7 +87,8 @@ static void Usage()
 "  --identify[=[w][nvb]]\n"
 "         Show words and bits from IDENTIFY DEVICE data                (ATA)\n\n"
 "  -g NAME, --get=NAME\n"
-"        Get device setting: all, aam, apm, lookahead, security, wcache, rcache, wcreorder\n\n"
+"        Get device setting: all, aam, apm, dsn, lookahead, security,\n"
+"        wcache, rcache, wcreorder, wcache-sct\n\n"
 "  -a, --all\n"
 "         Show all SMART information for device\n\n"
 "  -x, --xall\n"
@@ -102,14 +103,15 @@ static void Usage()
 "  -q TYPE, --quietmode=TYPE                                           (ATA)\n"
 "         Set smartctl quiet mode to one of: errorsonly, silent, noserial\n\n"
 "  -d TYPE, --device=TYPE\n"
-"         Specify device type to one of: %s\n\n"
+"         Specify device type to one of:\n"
+"         %s\n\n" // TODO: fold this string
 "  -T TYPE, --tolerance=TYPE                                           (ATA)\n"
 "         Tolerance: normal, conservative, permissive, verypermissive\n\n"
 "  -b TYPE, --badsum=TYPE                                              (ATA)\n"
 "         Set action on bad checksum to one of: warn, exit, ignore\n\n"
 "  -r TYPE, --report=TYPE\n"
 "         Report transactions (see man page)\n\n"
-"  -n MODE, --nocheck=MODE                                             (ATA)\n"
+"  -n MODE[,STATUS], --nocheck=MODE[,STATUS]                           (ATA)\n"
 "         No check if: never, sleep, standby, idle (see man page)\n\n",
   getvalidarglist('d').c_str()); // TODO: Use this function also for other options ?
   printf(
@@ -122,8 +124,9 @@ static void Usage()
 "        Enable/disable Attribute autosave on device (on/off)\n\n"
 "  -s NAME[,VALUE], --set=NAME[,VALUE]\n"
 "        Enable/disable/change device setting: aam,[N|off], apm,[N|off],\n"
-"        lookahead,[on|off], security-freeze, standby,[N|off|now],\n"
-"        wcache,[on|off], rcache,[on|off], wcreorder,[on|off]\n\n"
+"        dsn,[on|off], lookahead,[on|off], security-freeze,\n"
+"        standby,[N|off|now], wcache,[on|off], rcache,[on|off],\n"
+"        wcreorder,[on|off[,p]], wcache-sct,[ata|on|off[,p]]\n\n"
   );
   printf(
 "======================================= READ AND DISPLAY DATA OPTIONS =====\n\n"
@@ -137,12 +140,10 @@ static void Usage()
 "        Set output format for attributes: old, brief, hex[,id|val]\n\n"
 "  -l TYPE, --log=TYPE\n"
 "        Show device log. TYPE: error, selftest, selective, directory[,g|s],\n"
-"                               xerror[,N][,error], xselftest[,N][,selftest],\n"
-"                               background, sasphy[,reset], sataphy[,reset],\n"
-"                               scttemp[sts,hist], scttempint,N[,p],\n"
-"                               scterc[,N,M], devstat[,N], ssd,\n"
-"                               gplog,N[,RANGE], smartlog,N[,RANGE],\n"
-"                               nvmelog,N,SIZE\n\n"
+"        xerror[,N][,error], xselftest[,N][,selftest], background,\n"
+"        sasphy[,reset], sataphy[,reset], scttemp[sts,hist],\n"
+"        scttempint,N[,p], scterc[,N,M], devstat[,N], defects[,N], ssd,\n"
+"        gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE\n\n"
 "  -v N,OPTION , --vendorattribute=N,OPTION                            (ATA)\n"
 "        Set display OPTION for vendor Attribute N (see man page)\n\n"
 "  -F TYPE, --firmwarebug=TYPE                                         (ATA)\n"
@@ -195,6 +196,8 @@ static std::string getvalidarglist(int opt)
     return "normal, conservative, permissive, verypermissive";
   case 'b':
     return "warn, exit, ignore";
+  case 'B':
+    return "[+]<FILE_NAME>";
   case 'r':
     return "ioctl[,N], ataioctl[,N], scsiioctl[,N], nvmeioctl[,N]";
   case opt_smart:
@@ -206,7 +209,7 @@ static std::string getvalidarglist(int opt)
            "xerror[,N][,error], xselftest[,N][,selftest], "
            "background, sasphy[,reset], sataphy[,reset], "
            "scttemp[sts,hist], scttempint,N[,p], "
-           "scterc[,N,M], devstat[,N], ssd, "
+           "scterc[,N,M], devstat[,N], defects[,N], ssd, "
            "gplog,N[,RANGE], smartlog,N[,RANGE], "
            "nvmelog,N,SIZE";
   case 'P':
@@ -217,14 +220,15 @@ static std::string getvalidarglist(int opt)
   case 'F':
     return std::string(get_valid_firmwarebug_args()) + ", swapid";
   case 'n':
-    return "never, sleep, standby, idle";
+    return "never, sleep[,STATUS], standby[,STATUS], idle[,STATUS]";
   case 'f':
     return "old, brief, hex[,id|val]";
   case 'g':
-    return "aam, apm, lookahead, security, wcache, rcache, wcreorder";
+    return "aam, apm, dsn, lookahead, security, wcache, rcache, wcreorder, wcache-sct";
   case opt_set:
-    return "aam,[N|off], apm,[N|off], lookahead,[on|off], security-freeze, "
-           "standby,[N|off|now], wcache,[on|off], rcache,[on|off], wcreorder,[on|off]";
+    return "aam,[N|off], apm,[N|off], dsn,[on|off], lookahead,[on|off], security-freeze, "
+           "standby,[N|off|now], wcache,[on|off], rcache,[on|off], wcreorder,[on|off[,p]], "
+           "wcache-sct,[ata|on|off[,p]]";
   case 's':
     return getvalidarglist(opt_smart)+", "+getvalidarglist(opt_set);
   case opt_identify:
@@ -526,6 +530,17 @@ static const char * parse_options(int argc, char** argv,
               badarg = true;
         }
 
+      } else if (str_starts_with(optarg, "defects")) {
+        int n1 = -1, n2 = -1, len = strlen(optarg);
+        unsigned val = ~0;
+        sscanf(optarg, "defects%n,%u%n", &n1, &val, &n2);
+        if (n1 == len)
+          ataopts.pending_defects_log = 31; // Entries of first page
+        else if (n2 == len && val <= 0xffff * 32 - 1)
+          ataopts.pending_defects_log = val;
+        else
+          badarg = true;
+
       } else if (!strncmp(optarg, "xerror", sizeof("xerror")-1)) {
         int n1 = -1, n2 = -1, len = strlen(optarg);
         unsigned val = 8;
@@ -662,11 +677,14 @@ static const char * parse_options(int argc, char** argv,
       ataopts.sct_erc_get = true;
       ataopts.sct_wcache_reorder_get = true;
       ataopts.devstat_all_pages = true;
+      // ataopts.pending_defects_log = 31; // TODO: Add if no longer EXPERIMENTAL
+      ataopts.pending_defects_info = true; // TODO: Remove then
       ataopts.sataphy = true;
       ataopts.get_set_used = true;
       ataopts.get_aam = ataopts.get_apm = true;
       ataopts.get_security = true;
       ataopts.get_lookahead = ataopts.get_wcache = true;
+      ataopts.get_dsn = true;
       scsiopts.get_rcd = scsiopts.get_wce = true;
       scsiopts.smart_background_log = true;
       scsiopts.smart_ss_media_log = true;
@@ -798,16 +816,25 @@ static const char * parse_options(int argc, char** argv,
       break;
     case 'n':
       // skip disk check if in low-power mode
-      if (!strcmp(optarg, "never"))
+      if (!strcmp(optarg, "never")) {
         ataopts.powermode = 1; // do not skip, but print mode
-      else if (!strcmp(optarg, "sleep"))
-        ataopts.powermode = 2;
-      else if (!strcmp(optarg, "standby"))
-        ataopts.powermode = 3;
-      else if (!strcmp(optarg, "idle"))
-        ataopts.powermode = 4;
-      else
-        badarg = true;
+      }
+      else {
+        int n1 = -1, n2 = -1, len = strlen(optarg);
+        char s[7+1]; unsigned i = FAILPOWER;
+        sscanf(optarg, "%9[a-z]%n,%u%n", s, &n1, &i, &n2);
+        if (!((n1 == len || n2 == len) && i <= 255))
+          badarg = true;
+        else if (!strcmp(s, "sleep"))
+          ataopts.powermode = 2;
+        else if (!strcmp(s, "standby"))
+          ataopts.powermode = 3;
+        else if (!strcmp(s, "idle"))
+          ataopts.powermode = 4;
+        else
+          badarg = true;
+        ataopts.powerexit = i;
+      }
       break;
     case 'f':
       if (!strcmp(optarg, "old")) {
@@ -856,8 +883,28 @@ static const char * parse_options(int argc, char** argv,
         int n1 = -1, n2 = -1, n3 = -1, len = strlen(optarg);
         if (sscanf(optarg, "%16[^,=]%n%*[,=]%n%u%n", name, &n1, &n2, &val, &n3) >= 1
             && (n1 == len || (!get && n2 > 0))) {
-          bool on  = (n2 > 0 && !strcmp(optarg+n2, "on"));
-          bool off = (n2 > 0 && !strcmp(optarg+n2, "off"));
+          bool on  = false;
+          bool off = false;
+          bool ata = false;
+          bool persistent = false;
+
+          if (n2 > 0) {
+            int len2 = strlen(optarg + n2);
+            char * tmp = strstr(optarg+n2, ",p");
+            // handle ",p" in persistent options like: wcache-sct,[ata|on|off],p
+            if (tmp && (strlen(tmp) == 2)) {
+              persistent = true;
+              len2 = strlen(optarg+n2) - 2;
+
+              // the ,p option only works for set of SCT Feature Control command
+              if (strcmp(name, "wcache-sct") != 0 &&
+                  strcmp(name, "wcreorder") != 0)
+                badarg = true;
+            }
+            on  = !strncmp(optarg+n2, "on", len2);
+            off = !strncmp(optarg+n2, "off", len2);
+            ata = !strncmp(optarg+n2, "ata", len2);
+          }
           if (n3 != len)
             val = ~0U;
 
@@ -865,6 +912,7 @@ static const char * parse_options(int argc, char** argv,
             ataopts.get_aam = ataopts.get_apm = true;
             ataopts.get_security = true;
             ataopts.get_lookahead = ataopts.get_wcache = true;
+            ataopts.get_dsn = true;
             scsiopts.get_rcd = scsiopts.get_wce = true;
           }
           else if (!strcmp(name, "aam")) {
@@ -903,6 +951,7 @@ static const char * parse_options(int argc, char** argv,
               badarg = true;
           }
           else if (!strcmp(name, "wcreorder")) {
+            ataopts.sct_wcache_reorder_set_pers = persistent;
             if (get) {
               ataopts.sct_wcache_reorder_get = true;
             }
@@ -913,6 +962,20 @@ static const char * parse_options(int argc, char** argv,
             else
               badarg = true;
           }
+          else if (!strcmp(name, "wcache-sct")) {
+            ataopts.sct_wcache_sct_set_pers = persistent;
+            if (get) {
+              ataopts.sct_wcache_sct_get = true;
+            }
+            else if (off)
+              ataopts.sct_wcache_sct_set = 3;
+            else if (on)
+              ataopts.sct_wcache_sct_set = 2;
+            else if (ata)
+              ataopts.sct_wcache_sct_set = 1;
+            else
+              badarg = true;
+          }
           else if (!strcmp(name, "rcache")) {
             if (get)
               scsiopts.get_rcd = true;
@@ -958,6 +1021,19 @@ static const char * parse_options(int argc, char** argv,
             else
               badarg = true;
           }
+          else if (!strcmp(name, "dsn")) {
+            if (get) {
+              ataopts.get_dsn = true;
+            }
+            else if (off) {
+              ataopts.set_dsn = -1;
+            }
+            else if (on) {
+              ataopts.set_dsn = 1;
+            }
+            else
+              badarg = true;
+          }
           else
             badarg = true;
         }
@@ -1305,8 +1381,8 @@ static int main_worker(int argc, char **argv)
          dev->get_info_name(), dev->get_dev_type(), get_protocol_info(dev.get()));
 
   if (dev->is_ata() && ataopts.powermode>=2 && dev->is_powered_down()) {
-    pout( "%s: Device is in %s mode, exit(%d)\n", dev->get_info_name(), "STANDBY (OS)", FAILPOWER );
-    return FAILPOWER;
+    pout("Device is in STANDBY (OS) mode, exit(%d)\n", ataopts.powerexit);
+    return ataopts.powerexit;
   }
 
   // Open device
index fee2b66091a5fd77f00c5451ef366485a639fa47..e379c7e8b15de177256fe07698979f9aebfe64cd 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008-10 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-10 Bruce Allen
+ * Copyright (C) 2008-10 Christian Franke
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
 #ifndef SMARTCTL_H_
 #define SMARTCTL_H_
 
-#define SMARTCTL_H_CVSID "$Id: smartctl.h 4120 2015-08-27 16:12:21Z samm2 $\n"
+#define SMARTCTL_H_CVSID "$Id: smartctl.h 4431 2017-08-08 19:38:15Z chrfranke $\n"
 
 // Return codes (bitmask)
 
index 3ea06283bff1246c97adaa5f01cd3ef861922da5..5d5521478a7fa04979cea486b13614cde107821a 100644 (file)
@@ -1,8 +1,8 @@
 .ig
 Copyright (C) 2002-10 Bruce Allen
-Copyright (C) 2004-16 Christian Franke
+Copyright (C) 2004-17 Christian Franke
 
-$Id: smartd.8.in 4299 2016-04-16 19:45:57Z chrfranke $
+$Id: smartd.8.in 4576 2017-10-29 16:41:44Z chrfranke $
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -18,6 +18,23 @@ Research Center), Jack Baskin School of Engineering, University of
 California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 
 ..
+.\" Macros borrowed from pages generated with Pod::Man
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp 0.4v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
 .TH SMARTD 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartd\fP \- SMART Disk Monitoring Daemon
@@ -40,83 +57,85 @@ self-tests.
 This version of \fBsmartd\fP is compatible with
 ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards
 (see \fBREFERENCES\fP below).
-
+.PP
 \fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
-(equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices
+(equivalent to \fBsmartctl \-s on\fP) and polls these and SCSI devices
 every 30 minutes (configurable), logging SMART errors and changes of
 SMART Attributes via the SYSLOG interface.  The default location for
 these SYSLOG notifications and warnings is system-dependent
 (typically \fB/var/log/messages\fP or \fB/var/log/syslog\fP).
-To change this default location, please see the \fB\'-l\'\fP
+To change this default location, please see the \*(Aq\-l\*(Aq
 command-line option described below.
-
+.PP
 In addition to logging to a file, \fBsmartd\fP can also be configured
 to send email warnings if problems are detected.  Depending upon the
 type of problem, you may want to run self-tests on the disk, back up
-the disk, replace the disk, or use a manufacturer\'s utility to force
+the disk, replace the disk, or use a manufacturer's utility to force
 reallocation of bad or unreadable disk sectors.  If disk problems are
 detected, please see the \fBsmartctl\fP manual page and the
 \fBsmartmontools\fP web page/FAQ for further guidance.
-
+.PP
 If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
 check the status of the disks, and then return to polling the disks
-every 30 minutes. See the \fB\'\-i\'\fP option below for additional
-details.
-
+every 30 minutes.
+See the \*(Aq\-i\*(Aq option below for additional details.
+.PP
 \fBsmartd\fP can be configured at start-up using the configuration
 file \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
 If the configuration file is subsequently modified, \fBsmartd\fP
 can be told to re-read the configuration file by sending it a
 \fBHUP\fP signal, for example with the command:
 .br
-\fBkillall -HUP smartd\fP.
+\fBkillall \-HUP smartd\fP.
 .br
 .\" %IF OS Windows
 (Windows: See NOTES below.)
 .\" %ENDIF OS Windows
-
+.PP
 On startup, if \fBsmartd\fP finds a syntax error in the configuration
-file, it will print an error message and then exit. However if
+file, it will print an error message and then exit.  However if
 \fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
 to re-read the configuration file, and then find a syntax error in
 this file, it will print an error message and then continue, ignoring
 the contents of the (faulty) configuration file, as if the \fBHUP\fP
 signal had never been received.
-
+.PP
 When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
 (normally generated from a shell with CONTROL-C) is treated in the
 same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
-configuration file. To exit \fBsmartd\fP use CONTROL-\e
+configuration file.
+To exit \fBsmartd\fP use CONTROL-\e.
 .\" %IF OS Windows
 (Windows: CONTROL-Break).
 .\" %ENDIF OS Windows
-
+.PP
 On startup, in the absence of the configuration file
 \fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
 devices that support SMART.  The scanning is done as follows:
 .\" %IF OS Linux
 .IP \fBLINUX:\fP 9
-Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
-devices, and \fB"/dev/sd[a-z]"\fP, \fB"/dev/sd[a-c][a-z]"\fP
+Examine all entries \fB"/dev/hd[a\-t]"\fP for IDE/ATA
+devices, and \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP
 for ATA/SATA or SCSI/SAS devices.
 Disks behind RAID controllers are not included.
-
+.Sp
 [NEW EXPERIMENTAL SMARTD FEATURE]
-If directive \'\-d nvme\'
+If directive \*(Aq\-d nvme\*(Aq
 .\" %IF ENABLE_NVME_DEVICESCAN
-or no \'\-d\' directive
+or no \*(Aq\-d\*(Aq directive
 .\" %ENDIF ENABLE_NVME_DEVICESCAN
-is specified, examine all entries \fB"/dev/nvme[0-99]"\fP for NVMe devices.
+is specified, examine all entries \fB"/dev/nvme[0\-99]"\fP for NVMe devices.
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
 .IP \fBFREEBSD:\fP 9
-Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems.
+Authoritative list of disk devices is obtained from SCSI (CAM) and ATA
+subsystems.
 Disks behind RAID controllers are not included.
 .\" %ENDIF OS FreeBSD
 .\" %IF OS NetBSD OpenBSD
 .IP \fBNETBSD/OPENBSD:\fP 9
-Authoritative list of disk devices is obtained from sysctl 
-\'hw.disknames\'.
+Authoritative list of disk devices is obtained from sysctl
+\*(Aqhw.disknames\*(Aq.
 .\" %ENDIF OS NetBSD OpenBSD
 .\" %IF OS Solaris
 .IP \fBSOLARIS:\fP 9
@@ -132,98 +151,107 @@ The IOService plane is scanned for ATA block storage devices.
 Examine all entries \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP
 and \fB"/dev/sdd[a\-x]"\fP ("\\\\.\\PhysicalDrive[0\-127]") for
 IDE/(S)ATA and SCSI disk devices.
-
+.Sp
 If a 3ware 9000 controller is installed, examine all entries
-\fB"/dev/sdX,N"\fP for the first logical drive (\'unit\'
-\fB"/dev/sdX"\fP) and all physical disks (\'ports\' \fB",N"\fP)
-detected behind this controller. Same for a second controller if present.
-
-If directive \'\-d csmi\' or no \'\-d\' directive is specified,
+\fB"/dev/sdX,N"\fP for the first logical drive (\*(Aqunit\*(Aq
+\fB"/dev/sdX"\fP) and all physical disks (\*(Aqports\*(Aq \fB",N"\fP)
+detected behind this controller.
+Same for a second controller if present.
+.Sp
+If directive \*(Aq\-d csmi\*(Aq or no \*(Aq\-d\*(Aq directive is specified,
 examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind an Intel
 ICHxR controller with RST driver.
-
+.Sp
 Disks behind Areca RAID controllers are not included.
-
+.Sp
 [NEW EXPERIMENTAL SMARTD FEATURE]
-If directive \'\-d nvme\'
+If directive \*(Aq\-d nvme\*(Aq
 .\" %IF ENABLE_NVME_DEVICESCAN
-or no \'\-d\' directive
+or no \*(Aq\-d\*(Aq directive
 .\" %ENDIF ENABLE_NVME_DEVICESCAN
-is specified, examine all entries \fB"/dev/nvme[0-9]"\fP for NVMe devices.
+is specified, examine all entries \fB"/dev/sd[...]"\fP (see above)
+and all entries \fB"/dev/nvme[0\-9]"\fP for NVMe devices.
 .\" %ENDIF OS Windows Cygwin
 .PP
 \fBsmartd\fP then monitors
-for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
+for \fIall\fP possible SMART errors (corresponding to the \*(Aq\-a\*(Aq
 Directive in the configuration file; see the \fBsmartd.conf\fP(5) man page).
-
+.Sp
 .SH OPTIONS
 .TP
 .B \-A PREFIX, \-\-attributelog=PREFIX
 Writes \fBsmartd\fP attribute information (normalized and raw
-attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.csv\'.  At each
-check cycle attributes are logged as a line of semicolon separated triplets
-of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
-For SCSI devices error counters and temperature recorded in the form "counter-name;counter-value;"
+attribute values) to files \*(AqPREFIX\*(Aq\*(AqMODEL\-SERIAL.ata.csv\*(Aq
+or \*(AqPREFIX\*(Aq\*(AqVENDOR\-MODEL\-SERIAL.scsi.csv\*(Aq.
+At each check cycle attributes are logged as a line of semicolon separated
+triplets of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
+For SCSI devices error counters and temperature recorded in the form
+"counter-name;counter-value;".
 Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC).
-
+.Sp
 .\" %IF ENABLE_ATTRIBUTELOG
 If this option is not specified, attribute information is written to files
-\'/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\'.
+\*(Aq/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\*(Aq.
 To disable attribute log files, specify this option with an empty string
-argument: \'-A ""\'.
+argument: \*(Aq\-A ""\*(Aq.
 .\" %ENDIF ENABLE_ATTRIBUTELOG
 MODEL and SERIAL are build from drive identify information, invalid
 characters are replaced by underline.
-
-If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
-files \'MODEL\-SERIAL.ata.csv\' are created in directory \'/path/dir\'.
-If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/attrlog\-\'),
-then files 'nameMODEL\-SERIAL.ata.csv' are created in directory '/path/'.
+.Sp
+If the PREFIX has the form \*(Aq/path/dir/\*(Aq (e.g.\&
+\*(Aq/var/lib/smartd/\*(Aq), then files \*(AqMODEL\-SERIAL.ata.csv\*(Aq are
+created in directory \*(Aq/path/dir\*(Aq.
+If the PREFIX has the form \*(Aq/path/name\*(Aq (e.g.\&
+\*(Aq/var/lib/misc/attrlog\-\*(Aq),
+then files \*(AqnameMODEL\-SERIAL.ata.csv\*(Aq are created in directory
+\*(Aq/path/\*(Aq.
 The path must be absolute, except if debug mode is enabled.
 .TP
 .B \-B [+]FILE, \-\-drivedb=[+]FILE
 [ATA only] Read the drive database from FILE.  The new database replaces
-the built in database by default.  If \'+\' is specified, then the new entries
-prepend the built in entries.
+the built in database by default.  If \*(Aq+\*(Aq is specified, then the new
+entries prepend the built in entries.
 Please see the \fBsmartctl\fP(8) man page for further details.
 .TP
 .B \-c FILE, \-\-configfile=FILE
 Read \fBsmartd\fP configuration Directives from FILE, instead of from
-the default location \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP).
+the default location \fB/usr/local/etc/smartd.conf\fP
+(Windows: \fBEXEDIR/smartd.conf\fP).
 If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error
-message and exit with nonzero status.  Thus, \'\-c /usr/local/etc/smartd.conf\'
-can be used to verify the existence of the default configuration file.
-
-By using \'\-\' for FILE, the configuration is read from standard
-input. This is useful for commands like:
-.nf
+message and exit with nonzero status.
+Thus, \*(Aq\-c /usr/local/etc/smartd.conf\*(Aq can be used to verify the
+existence of the default configuration file.
+.Sp
+By using \*(Aq\-\*(Aq for FILE, the configuration is read from standard input.
+This is useful for commands like:
+.br
 .B echo /dev/sdb \-m user@home \-M test | smartd \-c \- \-q onecheck
-.fi
+.br
 to perform quick and simple checks without a configuration file.
 .\" %IF ENABLE_CAPABILITIES
 .TP
 .B \-C, \-\-capabilities
 [Linux only] Use libcap-ng to drop unneeded Linux process \fBcapabilities\fP(7).
 The following capabilities are kept: CAP_SYS_ADMIN, CAP_SYS_RAWIO, CAP_MKNOD.
-
+.Sp
 Warning: Mail notification does not work when used.
 .\" %ENDIF ENABLE_CAPABILITIES
 .TP
 .B \-d, \-\-debug
-Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
+Runs \fBsmartd\fP in "debug" mode.  In this mode, it displays status
 information to STDOUT rather than logging it to SYSLOG and does not
 \fBfork\fP(2) into the background and detach from the controlling
 terminal.  In this mode, \fBsmartd\fP also prints more verbose
 information about what it is doing than when operating in "daemon"
-mode. In this mode, the \fBINT\fP signal (normally generated from a
+mode.  In this mode, the \fBINT\fP signal (normally generated from a
 terminal with CONTROL-C) makes \fBsmartd\fP reload its configuration
 file.  Please use CONTROL-\e to exit
 .\" %IF OS Windows
 (Windows: CONTROL-Break).
-
+.Sp
 [Windows only] The "debug" mode can be toggled by the command
-\fBsmartd sigusr2\fP. A new console for debug output is opened when
-debug mode is enabled.
+\fBsmartd sigusr2\fP.
+A new console for debug output is opened when debug mode is enabled.
 .\" %ENDIF OS Windows
 .TP
 .B \-D, \-\-showdirectives
@@ -239,19 +267,19 @@ Prints usage message to STDOUT and exits.
 Sets the interval between disk checks to \fIN\fP seconds, where
 \fIN\fP is a decimal integer.  The minimum allowed value is ten and
 the maximum is the largest positive integer that can be represented on
-your system (often 2^31-1).  The default is 1800 seconds.
-
+your system (often 2^31\-1).  The default is 1800 seconds.
+.Sp
 Note that the superuser can make \fBsmartd\fP check the status of the
 disks at any time by sending it the \fBSIGUSR1\fP signal, for example
 with the command:
-.nf
-.B kill -SIGUSR1 <pid>
-.fi
+.br
+.B kill \-SIGUSR1 <pid>
+.br
 where \fB<pid>\fP is the process id number of \fBsmartd\fP.  One may
 also use:
-.nf
-.B killall -USR1 smartd
-.fi
+.br
+.B killall \-USR1 smartd
+.br
 for the same purpose.
 .br
 .\" %IF OS Windows
@@ -264,46 +292,46 @@ Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
 or \fIdaemon\fP [default].  If this command-line option is not used,
 then by default messages from \fBsmartd\fP are logged to the facility
 \fIdaemon\fP.
-
+.Sp
 If you would like to have \fBsmartd\fP messages logged somewhere other
-than the default location, include (for example) \'\-l local3\' in its
+than the default location, include (for example) \*(Aq\-l local3\*(Aq in its
 start up argument list.
 Tell the syslog daemon to log all messages from facility \fBlocal3\fP
-to (for example) \'/var/log/smartd.log\'.
-
+to (for example) \*(Aq/var/log/smartd.log\*(Aq.
+.Sp
 For more detailed information, please refer to the man pages for
 the local syslog daemon, typically \fBsyslogd\fP(8), \fBsyslog-ng\fP(8)
 or \fBrsyslogd\fP(8).
 .\" %IF OS Cygwin
-
-Cygwin: If no \fBsyslogd\fP is running, the \'\-l\' option has no effect.
+.Sp
+Cygwin: If no \fBsyslogd\fP is running, the \*(Aq\-l\*(Aq option has no effect.
 In this case, all \fBsyslog\fP messages are written to Windows event log.
 .\" %ENDIF OS Cygwin
 .\" %IF OS Windows
-
+.Sp
 Windows: Some \fBsyslog\fP functionality is implemented
-internally in \fBsmartd\fP as follows: If no \'\-l\' option
-(or \'\-l daemon\') is specified, messages are written to Windows
+internally in \fBsmartd\fP as follows: If no \*(Aq\-l\*(Aq option
+(or \*(Aq\-l daemon\*(Aq) is specified, messages are written to Windows
 event log or to file \fB./smartd.log\fP if event log is not available
-(access denied). By specifying other values of FACILITY,
-log output is redirected as follows:
-\'\-l local0\' to file \fB./smartd.log\fP,
-\'\-l local1\' to standard output (redirect with \'>\' to any file),
-\'\-l local2\' to standard error,
-\'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP.
+(access denied).
+By specifying other values of FACILITY, log output is redirected as follows:
+\*(Aq\-l local0\*(Aq to file \fB./smartd.log\fP,
+\*(Aq\-l local1\*(Aq to standard output (redirect with \*(Aq>\*(Aq to any file),
+\*(Aq\-l local2\*(Aq to standard error,
+\*(Aq\-l local[3\-7]\*(Aq: to file \fB./smartd[1\-5].log\fP.
 .\" %ENDIF OS Windows
 .TP
 .B \-n, \-\-no\-fork
 Do not fork into background; this is useful when executed from modern
 init methods like initng, minit, supervise or systemd.
 .\" %IF OS Cygwin
-
+.Sp
 On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv,
 see NOTES below.
 .\" %ENDIF OS Cygwin
 .\" %IF OS Windows
-
-On Windows, this option is not available, use \'\-\-service\' instead.
+.Sp
+On Windows, this option is not available, use \*(Aq\-\-service\*(Aq instead.
 .\" %ENDIF OS Windows
 .TP
 .B \-p NAME, \-\-pidfile=NAME
@@ -317,55 +345,55 @@ pidfile is removed.
 .B \-q WHEN, \-\-quit=WHEN
 Specifies when, if ever, \fBsmartd\fP should exit.  The valid
 arguments are to this option are:
-
+.Sp
 .I nodev
 \- Exit if there are no devices to monitor, or if any errors are found
 at startup in the configuration file.  This is the default.
-
+.Sp
 .I errors
 \- Exit if there are no devices to monitor, or if any errors are found
 in the configuration file /usr/local/etc/smartd.conf at startup or whenever it
 is reloaded.
-
+.Sp
 .I nodevstartup
 \- Exit if there are no devices to monitor at startup.  But continue
 to run if no devices are found whenever the configuration file is
 reloaded.
-
+.Sp
 .I never
 \- Only exit if a fatal error occurs (no remaining system memory,
-invalid command line arguments). In this mode, even if there are no
+invalid command line arguments).  In this mode, even if there are no
 devices to monitor, or if the configuration file
 \fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
 waiting to load a configuration file listing valid devices.
-
+.Sp
 .I onecheck
 \- Start \fBsmartd\fP in debug mode, then register devices, then check
-device\'s SMART status once, and then exit with zero exit status if all
+device's SMART status once, and then exit with zero exit status if all
 of these steps worked correctly.
-
-This last option is intended for \'distribution-writers\' who want to
+.Sp
+This last option is intended for \*(Aqdistribution-writers\*(Aq who want to
 create automated scripts to determine whether or not to automatically
 start up \fBsmartd\fP after installing smartmontools.  After starting
-\fBsmartd\fP with this command-line option, the distribution\'s install
+\fBsmartd\fP with this command-line option, the distribution's install
 scripts should wait a reasonable length of time (say ten seconds).  If
 \fBsmartd\fP has not exited with zero status by that time, the script
 should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
 \fBsmartd\fP will not operate correctly on the host.  Conversely, if
 \fBsmartd\fP exits with zero status, then it is safe to run
-\fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
+\fBsmartd\fP in normal daemon mode.  If \fBsmartd\fP is unable to
 monitor any devices or encounters other problems then it will return
 with non-zero exit status.
-
+.Sp
 .I showtests
 \- Start \fBsmartd\fP in debug mode, then register devices, then write
 a list of future scheduled self tests to stdout, and then exit with zero
 exit status if all of these steps worked correctly.
 Device's SMART status is not checked.
-
-This option is intended to test whether the '\-s REGEX' directives in
-smartd.conf will have the desired effect. The output lists the next test
-schedules, limited to 5 tests per type and device. This is followed by a
+.Sp
+This option is intended to test whether the \*(Aq\-s REGEX\*(Aq directives in
+smartd.conf will have the desired effect.  The output lists the next test
+schedules, limited to 5 tests per type and device.  This is followed by a
 summary of all tests of each device within the next 90 days.
 .TP
 .B \-r TYPE, \-\-report=TYPE
@@ -381,57 +409,62 @@ When used just once, it shows a record of the ioctl() transactions
 with the device.  When used more than once, the detail of these ioctl()
 transactions are reported in greater detail.  The valid arguments to
 this option are:
-
+.Sp
 .I ioctl
 \- report all ioctl() transactions.
-
+.Sp
 .I ataioctl
 \- report only ioctl() transactions with ATA devices.
-
+.Sp
 .I scsiioctl
 \- report only ioctl() transactions with SCSI devices.
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I nvmeioctl
-\- [FreeBSD, Linux, Windows and Cygwin only]
-[NEW EXPERIMENTAL SMARTD FEATURE]
+\- [NEW EXPERIMENTAL SMARTD FEATURE]
 report only ioctl() transactions with NVMe devices.
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 Any argument may include a positive integer to specify the level of
 detail that should be reported.  The argument should be followed by a
 comma then the integer with no spaces.  For example, \fIataioctl,2\fP
-The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
-equivalent.
+The default level is 1, so \*(Aq\-r ataioctl,1\*(Aq and
+\*(Aq\-r ataioctl\*(Aq are equivalent.
 .TP
 .B \-s PREFIX, \-\-savestates=PREFIX
 Reads/writes \fBsmartd\fP state information from/to files
-\'PREFIX\'\'MODEL\-SERIAL.ata.state\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.state\'. 
+\*(AqPREFIX\*(Aq\*(AqMODEL\-SERIAL.ata.state\*(Aq or
+\*(AqPREFIX\*(Aq\*(AqVENDOR\-MODEL\-SERIAL.scsi.state\*(Aq.
 This preserves SMART attributes, drive min and max temperatures (\-W directive),
 info about last sent warning email
 (\-m directive), and the time of next check of the self-test REGEXP
 (\-s directive) across boot cycles.
-
+.Sp
 .\" %IF ENABLE_SAVESTATES
 If this option is not specified, state information is maintained in files
-\'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\' for ATA devices and
-\'/usr/local/var/lib/smartmontools/smartd.VENDOR\-MODEL\-SERIAL.scsi.state\' for SCSI devices.
+\*(Aq/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\*(Aq
+for ATA devices and
+\*(Aq/usr/local/var/lib/smartmontools/smartd.VENDOR\-MODEL\-SERIAL.scsi.state\*(Aq
+for SCSI devices.
 To disable state files, specify this option with an empty string
-argument: \'\-s ""\'.
+argument: \*(Aq\-s ""\*(Aq.
 .\" %ENDIF ENABLE_SAVESTATES
 MODEL and SERIAL are build from drive identify information, invalid
 characters are replaced by underline.
-
-If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then
-files \'MODEL\-SERIAL.ata.state\' are created in directory \'/path/dir\'.
-If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/smartd\-\'),
-then files 'nameMODEL\-SERIAL.ata.state' are created in directory '/path/'.
+.Sp
+If the PREFIX has the form \*(Aq/path/dir/\*(Aq (e.g.\&
+\*(Aq/var/lib/smartd/\*(Aq), then files \*(AqMODEL\-SERIAL.ata.state\*(Aq are
+created in directory \*(Aq/path/dir\*(Aq.
+If the PREFIX has the form \*(Aq/path/name\*(Aq (e.g.\&
+\*(Aq/var/lib/misc/smartd\-\*(Aq),
+then files \*(AqnameMODEL\-SERIAL.ata.state\*(Aq are created in directory
+\*(Aq/path/\*(Aq.
 The path must be absolute, except if debug mode is enabled.
-
-The state information files are read on smartd startup. The files are
+.Sp
+The state information files are read on smartd startup.  The files are
 always (re)written after reading the configuration file, before rereading
 the configuration file (SIGHUP), before smartd shutdown, and after a check
-forced by SIGUSR1. After a normal check cycle, a file is only rewritten if
+forced by SIGUSR1.  After a normal check cycle, a file is only rewritten if
 an important change (which usually results in a SYSLOG output) occurred.
 .TP
 .B \-w PATH, \-\-warnexec=PATH
@@ -453,205 +486,212 @@ The default script is
 .B \-\-service
 [Windows only] Enables \fBsmartd\fP to run as a Windows service.
 The option must be specified in the service command line as the first
-argument. It should not be used from console.
+argument.
+It should not be used from console.
 See NOTES below for details.
 .\" %ENDIF OS Windows
 .TP
 .B \-V, \-\-version, \-\-license, \-\-copyright
 Prints version, copyright, license, home page and SVN revision
 information for your copy of \fBsmartd\fP to STDOUT and then exits.
-Please include this information if you are reporting bugs or problems.
-
+.Sp
 .SH EXAMPLES
 .B smartd
 .br
-Runs the daemon in forked mode. This is the normal way to run
+Runs the daemon in forked mode.  This is the normal way to run
 \fBsmartd\fP.
 Entries are logged to SYSLOG.
-
-.B smartd -d -i 30
+.Sp
+.B smartd \-d \-i 30
 .br
 Run in foreground (debug) mode, checking the disk status
 every 30 seconds.
-
-.B smartd -q onecheck
+.Sp
+.B smartd \-q onecheck
 .br
 Registers devices, and checks the status of the devices exactly
-once. The exit status (the shell
+once.
+The exit status (the shell
 .B $?
 variable) will be zero if all went well, and nonzero if no devices
 were detected or some other problem was encountered.
-
 .\" %IF ENABLE_INITSCRIPT
+.Sp
 Note that \fBsmartmontools\fP provides a start-up script in
 \fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
 stopping the daemon via the normal init interface.  Using this script,
 you can start \fBsmartd\fP by giving the command:
-.nf
+.br
 .B /usr/local/etc/rc.d/init.d/smartd start
-.fi
+.br
 and stop it by using the command:
-.nf
+.br
 .B /usr/local/etc/rc.d/init.d/smartd stop
-.fi
-
 .\" %ENDIF ENABLE_INITSCRIPT
+.Sp
 .SH CONFIGURATION
 The syntax of the \fBsmartd.conf\fP(5) file is discussed separately.
-
+.Sp
 .SH NOTES
 \fBsmartd\fP
-will make log entries at loglevel 
+will make log entries at loglevel
 .B LOG_INFO
 if the Normalized SMART Attribute values have changed, as reported using the
-.B \'\-t\', \'\-p\',
+.B \*(Aq\-t\*(Aq, \*(Aq\-p\*(Aq,
 or
-.B \'\-u\'
-Directives. For example:
-.nf
-.B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
-.fi
-Note that in this message, the value given is the \'Normalized\' not the \'Raw\' 
-Attribute value (the disk temperature in this case is about 22
-Celsius).  The 
-.B \'-R\'
-and 
-.B \'-r\'
+.B \*(Aq\-u\*(Aq
+Directives.
+For example:
+.br
+.B \*(AqDevice: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\*(Aq
+.br
+Note that in this message, the value given is the \*(AqNormalized\*(Aq not the
+\*(AqRaw\*(Aq Attribute value (the disk temperature in this case is about 22
+Celsius).  The
+.B \*(Aq\-R\*(Aq
+and
+.B \*(Aq\-r\*(Aq
 Directives modify this behavior, so that the information is printed
 with the Raw values as well, for example:
-.nf
-.B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
-.fi
+.br
+.B \*(AqDevice: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\*(Aq
+.br
 Here the Raw values are the actual disk temperatures in Celsius.  The
 way in which the Raw values are printed, and the names under which the
 Attributes are reported, is governed by the various
-.B \'-v Num,Description\'
+.B \*(Aq\-v Num,Description\*(Aq
 Directives described previously.
-
+.PP
 Please see the
 .B smartctl
 manual page for further explanation of the differences between
 Normalized and Raw Attribute values.
-
+.PP
 \fBsmartd\fP
 will make log entries at loglevel
 .B LOG_CRIT
 if a SMART Attribute has failed, for example:
-.nf
-.B \'Device: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
-.fi
+.br
+.B \*(AqDevice: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\*(Aq
+.br
  This loglevel is used for reporting enabled by the
-.B \'\-H\', \-f\', \'\-l\ selftest\',
+.B \*(Aq\-H\*(Aq, \-f\*(Aq, \*(Aq\-l\ selftest\*(Aq,
 and
-.B \'\-l\ error\'
-Directives. Entries reporting failure of SMART Prefailure Attributes
+.B \*(Aq\-l\ error\*(Aq
+Directives.  Entries reporting failure of SMART Prefailure Attributes
 should not be ignored: they mean that the disk is failing.  Use the
 .B smartctl
-utility to investigate. 
-
+utility to investigate.
 .\" %IF OS Solaris
+.PP
 Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
 messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
 Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
 lost.  If you want to use the existing daemon facility to log all
 messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
 from:
-.nf
+.Vb 1
        ...;daemon.notice;...        /var/adm/messages
-.fi
+.Ve
 to read:
-.nf
+.Vb 1
        ...;daemon.info;...          /var/adm/messages
-.fi
+.Ve
 Alternatively, you can use a local facility to log messages: please
-see the \fBsmartd\fP '\-l' command-line option described above.
-
+see the \fBsmartd\fP \*(Aq\-l\*(Aq command-line option described above.
 .\" %ENDIF OS Solaris
 .\" %IF OS Cygwin
+.PP
 The Cygwin Version of \fBsmartd\fP can be run as a service via the
 cygrunsrv tool.
 .\" %IF ENABLE_INITSCRIPT
 The start-up script provides Cygwin-specific commands to install and
 remove the service:
-.nf
+.br
 .B /usr/local/etc/rc.d/init.d/smartd install [options]
+.br
 .B /usr/local/etc/rc.d/init.d/smartd remove
-.fi
+.br
 The service can be started and stopped by the start-up script as usual
 (see \fBEXAMPLES\fP above).
 .\" %ENDIF ENABLE_INITSCRIPT
-
 .\" %ENDIF OS Cygwin
 .\" %IF OS Windows
+.PP
 On Windows, the log messages are written to the event log or to a file.
-See documentation of the '\-l FACILITY' option above for details.
-
+See documentation of the \*(Aq\-l FACILITY\*(Aq option above for details.
+.PP
 On Windows, the following built-in commands can be used to control
 \fBsmartd\fP, if running as a daemon:
-
-\'\fBsmartd status\fP\' \- check status
-
-\'\fBsmartd stop\fP\' \- stop smartd
-
-\'\fBsmartd reload\fP\' \- reread config file
-
-\'\fBsmartd restart\fP\' \- restart smartd
-
-\'\fBsmartd sigusr1\fP\' \- check disks now
-
-\'\fBsmartd sigusr2\fP\' \- toggle debug mode
-
+.PP
+\*(Aq\fBsmartd status\fP\*(Aq \- check status
+.br
+\*(Aq\fBsmartd stop\fP\*(Aq \- stop smartd
+.br
+\*(Aq\fBsmartd reload\fP\*(Aq \- reread config file
+.br
+\*(Aq\fBsmartd restart\fP\*(Aq \- restart smartd
+.br
+\*(Aq\fBsmartd sigusr1\fP\*(Aq \- check disks now
+.br
+\*(Aq\fBsmartd sigusr2\fP\*(Aq \- toggle debug mode
+.PP
 The Windows Version of \fBsmartd\fP has buildin support for services:
-
-\'\fBsmartd install [options]\fP\' installs a service
+.PP
+\*(Aq\fBsmartd install [options]\fP\*(Aq installs a service
 named "smartd" (display name "SmartD Service") using the command line
-\'/INSTALLPATH/smartd.exe \-\-service [options]\'.
+\*(Aq/INSTALLPATH/smartd.exe \-\-service [options]\*(Aq.
 This also installs smartd.exe as a event message file for the Windows
 event viewer.
-
-\'\fBsmartd remove\fP\' can later be used to remove the service and
+.PP
+\*(Aq\fBsmartd remove\fP\*(Aq can later be used to remove the service and
 event message entries from the registry.
-
+.PP
 Upon startup, the smartd service changes the working directory
-to its own installation path. If smartd.conf and blat.exe are stored
-in this directory, no \'-c\' option and \'-M exec\' directive is needed.
-
-The debug mode (\'\-d\', \'\-q onecheck\') does not work if smartd is
-running as service.
-
-The service can be controlled as usual with Windows commands \'net\'
-or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\').
-
-Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between
-disk checks (\'\-i N\') to infinite.
-
-Continuing the paused service (\'\fBnet continue smartd\fP\') resets the
-interval and rereads the configuration file immediately (like \fBSIGHUP\fP):
-
-Continuing a still running service (\'\fBnet continue smartd\fP\' without
-preceding \'\fBnet pause smartd\fP\') does not reread configuration but
+to its own installation path.  If smartd.conf and blat.exe are stored
+in this directory, no \*(Aq\-c\*(Aq option and \*(Aq\-M exec\*(Aq directive
+is needed.
+.PP
+The debug mode (\*(Aq\-d\*(Aq, \*(Aq\-q onecheck\*(Aq) does not work if
+smartd is running as service.
+.PP
+The service can be controlled as usual with Windows commands \*(Aqnet\*(Aq
+or \*(Aqsc\*(Aq (\*(Aq\fBnet start smartd\fP\*(Aq,
+\*(Aq\fBnet stop smartd\fP\*(Aq).
+.PP
+Pausing the service (\*(Aq\fBnet pause smartd\fP\*(Aq) sets the interval
+between disk checks (\*(Aq\-i N\*(Aq) to infinite.
+.PP
+Continuing the paused service (\*(Aq\fBnet continue smartd\fP\*(Aq) resets the
+interval and rereads the configuration file immediately (like \fBSIGHUP\fP).
+The \*(AqPARAMCHANGE\*(Aq service control command (\*(Aq\fBsc control smartd
+paramchange\fP\*(Aq) has the same effect regardless of paused state.
+.PP
+Continuing a still running service (\*(Aq\fBnet continue smartd\fP\*(Aq without
+preceding \*(Aq\fBnet pause smartd\fP\*(Aq) does not reread configuration but
 checks disks immediately (like \fBSIGUSR1\fP).
-
 .\" %ENDIF OS Windows
+.Sp
 .SH LOG TIMESTAMP TIMEZONE
 When \fBsmartd\fP makes log entries, these are time-stamped.  The time
 stamps are in the computer's local time zone, which is generally set
-using either the environment variable \'\fBTZ\fP\' or using a
+using either the environment variable \*(Aq\fBTZ\fP\*(Aq or using a
 time-zone file such as \fB/etc/localtime\fP.  You may wish to change
 the timezone while \fBsmartd\fP is running (for example, if you carry
 a laptop to a new time-zone and don't reboot it).  Due to a bug in the
 \fBtzset\fP(3) function of many unix standard C libraries, the
 time-zone stamps of \fBsmartd\fP might not change.  For some systems,
 \fBsmartd\fP will work around this problem \fIif\fP the time-zone is
-set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
-time-zone is set using the \'\fBTZ\fP\' variable (or a file that it
+set using \fB/etc/localtime\fP.  The work-around \fIfails\fP if the
+time-zone is set using the \*(Aq\fBTZ\fP\*(Aq variable (or a file that it
 points to).
-
+.Sp
 .SH EXIT STATUS
 The exit status (return value) of \fBsmartd\fP can have the following values:
 .TP
 .B 0:
-Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
+Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM
+(or in debug mode, a SIGQUIT).
 .TP
 .B 1:
 Commandline did not parse.
@@ -663,10 +703,11 @@ There was a syntax error in the config file.
 Forking the daemon failed.
 .TP
 .B 4:
-Couldn\'t create PID file.
+Couldn't create PID file.
 .TP
 .B 5:
-Config file does not exist (only returned in conjunction with the \'\-c\' option).
+Config file does not exist (only returned in conjunction with the \*(Aq\-c\*(Aq
+option).
 .TP
 .B 6:
 Config file exists, but cannot be read.
@@ -676,26 +717,26 @@ Config file exists, but cannot be read.
 ran out of memory during startup.
 .TP
 .B 10:
-An inconsistency was found in \fBsmartd\fP\'s internal data
-structures. This should never happen.  It must be due to either a
+An inconsistency was found in \fBsmartd\fP's internal data
+structures.  This should never happen.  It must be due to either a
 coding or compiler bug.  \fIPlease\fP report such failures to
 smartmontools developers, see REPORTING BUGS below.
 .TP
 .B 16:
 A device explicitly listed in
 .B /usr/local/etc/smartd.conf
-can\'t be monitored.
+can't be monitored.
 .TP
 .B 17:
 \fBsmartd\fP
-didn\'t find any devices to monitor.
+didn't find any devices to monitor.
 .TP
 .B 254:
 When in daemon mode,
 \fBsmartd\fP
 received a SIGINT or SIGQUIT.  (Note that in debug mode, SIGINT has
 the same effect as SIGHUP, and makes \fBsmartd\fP reload its
-configuration file. SIGQUIT has the same effect as SIGTERM and causes
+configuration file.  SIGQUIT has the same effect as SIGTERM and causes
 \fBsmartd\fP to exit with zero exit status.
 .TP
 .B 132 and above
@@ -704,7 +745,7 @@ was killed by a signal that is not explicitly listed above.  The exit
 status is then 128 plus the signal number.  For example if
 \fBsmartd\fP
 is killed by SIGKILL (signal 9) then the exit status is 137.
-
+.Sp
 .\" %IF NOT OS Windows
 .SH FILES
 .TP
@@ -715,23 +756,23 @@ full path of this executable.
 configuration file (see \fBsmartd.conf\fP(5) man page).
 .TP
 .B /usr/local/etc/smartd_warning.sh
-script run on warnings (see \'\-M exec\' directive on
-\fBsmartd.conf\fP(5) man page).
+script run on warnings (see \*(Aq\-w\*(Aq option above and \*(Aq\-M exec\*(Aq
+directive on \fBsmartd.conf\fP(5) man page).
 .\" %IF ENABLE_SMARTDPLUGINDIR
 .TP
 .B /usr/local/etc/smartd_warning.d/
-plugin directory for smartd warning script (see \'\-m\' directive on
+plugin directory for smartd warning script (see \*(Aq\-m\*(Aq directive on
 \fBsmartd.conf\fP(5) man page).
 .\" %ENDIF ENABLE_SMARTDPLUGINDIR
 .\" %IF ENABLE_DRIVEDB
 .TP
 .B /usr/local/share/smartmontools/drivedb.h
-drive database (see \'\-B\' option).
+drive database (see \*(Aq\-B\*(Aq option).
 .\" %ENDIF ENABLE_DRIVEDB
 .TP
 .B /usr/local/etc/smart_drivedb.h
-optional local drive database (see \'\-B\' option).
-
+optional local drive database (see \*(Aq\-B\*(Aq option).
+.Sp
 .\" %ENDIF NOT OS Windows
 .SH AUTHORS
 \fBBruce Allen\fP (project initiator),
@@ -745,52 +786,52 @@ optional local drive database (see \'\-B\' option).
 \fBGabriele Pohl\fP (wiki & development team support),
 .br
 \fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
-
+.PP
 Many other individuals have made contributions and corrections,
 see AUTHORS, ChangeLog and repository files.
-
+.PP
 The first smartmontools code was derived from the smartsuite package,
 written by Michael Cornwell and Andre Hedrick.
-
+.Sp
 .SH REPORTING BUGS
 To submit a bug report, create a ticket in smartmontools wiki:
 .br
-<\fBhttp://www.smartmontools.org/\fP>.
+<\fBhttps://www.smartmontools.org/\fP>.
 .br
 Alternatively send the info to the smartmontools support mailing list:
 .br
-<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
-
+<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>.
+.Sp
 .SH SEE ALSO
 \fBsmartd.conf\fP(5), \fBsmartctl\fP(8).
 .\" %IF ENABLE_UPDATE_SMART_DRIVEDB
 .br
 \fBupdate-smart-drivedb\fP(8).
 .\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB
-
+.Sp
 .SH REFERENCES
 Please see the following web site for more info:
-\fBhttp://www.smartmontools.org/\fP
-
+<\fBhttps://www.smartmontools.org/\fP>
+.PP
 An introductory article about smartmontools is \fIMonitoring Hard
 Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
-pages 74-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
-online.
-
+pages 74\(en77.
+See <\fBhttps://www.linuxjournal.com/article/6983\fP>.
+.PP
 If you would like to understand better how SMART works, and what it
 does, a good place to start is with Sections 4.8 and 6.54 of the first
-volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7)
+volume of the \*(AqAT Attachment with Packet Interface-7\*(Aq (ATA/ATAPI-7)
 specification Revision 4b.  This documents the SMART functionality which the
 \fBsmartmontools\fP utilities provide access to.
-
+.PP
 The functioning of SMART was originally defined by the SFF-8035i
 revision 2 and the SFF-8055i revision 1.4 specifications.  These are
 publications of the Small Form Factors (SFF) Committee.
-
+.PP
 Links to these and other documents may be found on the Links page of the
-\fBsmartmontools\fP Wiki at \fBhttp://www.smartmontools.org/wiki/Links\fP .
-
+\fBsmartmontools\fP Wiki at <\fBhttps://www.smartmontools.org/wiki/Links\fP>.
+.Sp
 .SH PACKAGE VERSION
 CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
 .br
-$Id: smartd.8.in 4299 2016-04-16 19:45:57Z chrfranke $
+$Id: smartd.8.in 4576 2017-10-29 16:41:44Z chrfranke $
index 7c38e649a0300a43f65ed720b87b341be9cc1453..0afba1ba46b12b7aac07b260908df6e57e1e80ae 100644 (file)
@@ -1,8 +1,8 @@
 .ig
 Copyright (C) 2002-10 Bruce Allen
-Copyright (C) 2004-16 Christian Franke
+Copyright (C) 2004-17 Christian Franke
 
-$Id: smartd.conf.5.in 4307 2016-04-24 12:37:31Z chrfranke $
+$Id: smartd.conf.5.in 4589 2017-11-04 15:30:54Z chrfranke $
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -18,6 +18,23 @@ Research Center), Jack Baskin School of Engineering, University of
 California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 
 ..
+.\" Macros borrowed from pages generated with Pod::Man
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp 0.4v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
 .TH SMARTD.CONF 5 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP
@@ -30,27 +47,27 @@ California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 .\" %ENDIF NOT OS ALL
 \fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP
 daemon.
-
+.PP
 If the configuration file \fB/usr/local/etc/smartd.conf\fP is present,
-\fBsmartd\fP reads it at startup, before \fBfork\fP(2)ing into the
-background. If \fBsmartd\fP subsequently receives a \fBHUP\fP signal,
+\fBsmartd\fP reads it at startup.
+If \fBsmartd\fP subsequently receives a \fBHUP\fP signal,
 it will then re-read the configuration file.  If \fBsmartd\fP is
 running in debug mode, then an \fBINT\fP signal will also make it
-re-read the configuration file. This signal can be generated by typing
-\fB\<CONTROL-C\>\fP in the terminal window where \fBsmartd\fP is
+re-read the configuration file.  This signal can be generated by typing
+\fB<CONTROL-C>\fP in the terminal window where \fBsmartd\fP is
 running.
-
+.PP
 In the absence of a configuration file
 \fBsmartd\fP will try to open all available devices
 (see \fBsmartd\fP(8) man page).
-A configuration file with a single line \fB\'DEVICESCAN \-a'\fP
+A configuration file with a single line \fB\*(AqDEVICESCAN \-a\*(Aq\fP
 would have the same effect.
-
+.PP
 This can be annoying if you have an ATA or SCSI device that hangs or
 misbehaves when receiving SMART commands.  Even if this causes no
 problems, you may be annoyed by the string of error log messages about devices
-that can\'t be opened.
-
+that can't be opened.
+.PP
 One can avoid this problem, and gain more control over the types of
 events monitored by
 \fBsmartd\fP,
@@ -59,164 +76,167 @@ by using the configuration file
 This file contains a list of devices to monitor, with one device per
 line.  An example file is included with the
 .B smartmontools
-distribution. You will find this sample configuration file in
-\fB/usr/local/share/doc/smartmontools/\fP. For security, the configuration file
-should not be writable by anyone but root. The syntax of the file is as
-follows:
+distribution.  You will find this sample configuration file in
+\fB/usr/local/share/doc/smartmontools/\fP.
+For security, the configuration file should not be writable by anyone
+but root.
+The syntax of the file is as follows:
 .IP \(bu 4
 There should be one device listed per line, although you may have
 lines that are entirely comments or white space.
 .IP \(bu 4
-Any text following a hash sign \'#\' and up to the end of the line is
+Any text following a hash sign \*(Aq#\*(Aq and up to the end of the line is
 taken to be a comment, and ignored.
 .IP \(bu 4
-Lines may be continued by using a backslash \'\e\' as the last
+Lines may be continued by using a backslash \*(Aq\e\*(Aq as the last
 non-whitespace or non-comment item on a line.
 .IP \(bu 4
-Note: a line whose first character is a hash sign \'#\' is treated as
+Note: a line whose first character is a hash sign \*(Aq#\*(Aq is treated as
 a white-space blank line, \fBnot\fP as a non-existent line, and will
 \fBend\fP a continuation line.
 .PP
-
-Here is an example configuration file.  It\'s for illustrative purposes
-only; please don\'t copy it onto your system without reading to the end
+Here is an example configuration file.  It's for illustrative purposes
+only; please don't copy it onto your system without reading to the end
 of the
 .B DIRECTIVES
 Section below!
-
-.nf
-.B ################################################
-.B # This is an example smartd startup config file
-.B # /usr/local/etc/smartd.conf
-.B #
-.B # On the second disk, start a long self-test every
-.B # Sunday between 3 and 4 am.
-.B #
-.B \ \ /dev/sda -a -m admin@example.com,root@localhost
-.B \ \ /dev/sdb -a -I 194 -I 5 -i 12 -s L/../../7/03
-.B #
-.B # Send a TEST warning email to admin on startup.
-.B #
-.B \ \ /dev/sdc -m admin@example.com -M test
-.B #
-.B # Strange device.  It\'s SCSI. Start a scheduled
-.B # long self test between 5 and 6 am Monday/Thursday
-.B \ \ /dev/weird -d scsi -s L/../../(1|4)/05
-.B #
-.B # An ATA disk may appear as a SCSI device to the
-.B # OS. If a SCSI to ATA Translation (SAT) layer
-.B # is between the OS and the device then this can be
-.B # flagged with the '-d sat' option. This situation
-.B # may become common with SATA disks in SAS and FC
-.B # environments.
-.B \ \ /dev/sda -a -d sat
-.B #
+.PP
+.Vb 9
+################################################
+# This is an example smartd startup config file
+# /usr/local/etc/smartd.conf
+#
+# On the second disk, start a long self-test every
+# Sunday between 3 and 4 am.
+#
+/dev/sda \-a \-m admin@example.com,root@localhost
+/dev/sdb \-a \-I 194 \-I 5 \-i 12 \-s L/../../7/03
+#
+# Send a TEST warning email to admin on startup.
+#
+/dev/sdc \-m admin@example.com \-M test
+#
+# Strange device.  It's SCSI.  Start a scheduled
+# long self test between 5 and 6 am Monday/Thursday
+/dev/weird \-d scsi \-s L/../../(1|4)/05
+#
+# An ATA disk may appear as a SCSI device to the
+# OS.  If a SCSI to ATA Translation (SAT) layer
+# is between the OS and the device then this can be
+# flagged with the '\-d sat' option.  This situation
+# may become common with SATA disks in SAS and FC
+# environments.
+/dev/sda \-a \-d sat
 .\" %IF OS Linux
-.B # Three disks connected to a MegaRAID controller
-.B # Start short self-tests daily between 1-2, 2-3, and
-.B # 3-4 am.
-.B \ \ /dev/sda -d megaraid,0 -a -s S/../.././01
-.B \ \ /dev/sda -d megaraid,1 -a -s S/../.././02
-.B \ \ /dev/sda -d megaraid,2 -a -s S/../.././03
-.B \ \ /dev/bus/0 -d megaraid,2 -a -s S/../.././03
-.B #
-.B # Three disks connected to an AacRaid controller
-.B # Start short self-tests daily between 1-2, 2-3, and
-.B # 3-4 am.
-.B \ \ /dev/sda -d aacraid,0,0,66 -a -s S/../.././01
-.B \ \ /dev/sda -d aacraid,0,0,67 -a -s S/../.././02
-.B \ \ /dev/sda -d aacraid,0,0,68 -a -s S/../.././03
-.B #
+#
+# Three disks connected to a MegaRAID controller
+# Start short self\-tests daily between 1\-2, 2\-3, and
+# 3\-4 am.
+/dev/sda \-d megaraid,0 \-a \-s S/../.././01
+/dev/sda \-d megaraid,1 \-a \-s S/../.././02
+/dev/sda \-d megaraid,2 \-a \-s S/../.././03
+/dev/bus/0 \-d megaraid,2 \-a \-s S/../.././03
+#
+# Three disks connected to an AacRaid controller
+# Start short self\-tests daily between 1\-2, 2\-3, and
+# 3\-4 am.
+/dev/sda \-d aacraid,0,0,66 \-a \-s S/../.././01
+/dev/sda \-d aacraid,0,0,67 \-a \-s S/../.././02
+/dev/sda \-d aacraid,0,0,68 \-a \-s S/../.././03
 .\" %ENDIF OS Linux
-.B # Four ATA disks on a 3ware 6/7/8000 controller.
-.B # Start short self-tests daily between midnight and 1am,
-.B # 1-2, 2-3, and 3-4 am.  Starting with the Linux 2.6
-.B # kernel series, /dev/sdX is deprecated in favor of
-.B # /dev/tweN.  For example replace /dev/sdc by /dev/twe0
-.B # and /dev/sdd by /dev/twe1.
-.B \ \ /dev/sdc -d 3ware,0 -a -s S/../.././00
-.B \ \ /dev/sdc -d 3ware,1 -a -s S/../.././01
-.B \ \ /dev/sdd -d 3ware,2 -a -s S/../.././02
-.B \ \ /dev/sdd -d 3ware,3 -a -s S/../.././03
-.B #
-.B # Two ATA disks on a 3ware 9000 controller.
-.B # Start long self-tests Sundays between midnight and
-.B # 1am and 2-3 am
-.B \ \ /dev/twa0 -d 3ware,0 -a -s L/../../7/00
-.B \ \ /dev/twa0 -d 3ware,1 -a -s L/../../7/02
-.B #
-.B # Two SATA (not SAS) disks on a 3ware 9750 controller.
-.B # Start long self-tests Sundays between midnight and
-.B # 1am and 2-3 am
+.\" %IF OS FreeBSD Linux
+#
+# Two SATA (not SAS) disks on a 3ware 9750 controller.
+# Start long self\-tests Sundays between midnight and
+# 1 am and 2\-3 am
+.\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.B \ \ /dev/twl0 -d 3ware,0 -a -s L/../../7/00
-.B \ \ /dev/twl0 -d 3ware,1 -a -s L/../../7/02
+# under Linux
+/dev/twl0 \-d 3ware,0 \-a \-s L/../../7/00
+/dev/twl0 \-d 3ware,1 \-a \-s L/../../7/02
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.B \ \ /dev/tws0 -d 3ware,0 -a -s L/../../7/00
-.B \ \ /dev/tws0 -d 3ware,1 -a -s L/../../7/02
+# under FreeBSD
+/dev/tws0 \-d 3ware,0 \-a \-s L/../../7/00
+/dev/tws0 \-d 3ware,1 \-a \-s L/../../7/02
 .\" %ENDIF OS FreeBSD
-.B #
-.B # Three SATA disks on a HighPoint RocketRAID controller.
-.B # Start short self-tests daily between 1-2, 2-3, and
-.B # 3-4 am.
+.\" %IF OS FreeBSD Linux
+#
+# Three SATA disks on a HighPoint RocketRAID controller.
+# Start short self\-tests daily between 1\-2, 2\-3, and
+# 3\-4 am.
+.\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.B # under Linux
-.B \ \ /dev/sde -d hpt,1/1 -a -s S/../.././01
-.B \ \ /dev/sde -d hpt,1/2 -a -s S/../.././02
-.B \ \ /dev/sde -d hpt,1/3 -a -s S/../.././03
+# under Linux
+/dev/sde \-d hpt,1/1 \-a \-s S/../.././01
+/dev/sde \-d hpt,1/2 \-a \-s S/../.././02
+/dev/sde \-d hpt,1/3 \-a \-s S/../.././03
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.B # under FreeBSD
-.B  /dev/hptrr -d hpt,1/1 -a -s S/../.././01
-.B  /dev/hptrr -d hpt,1/2 -a -s S/../.././02
-.B  /dev/hptrr -d hpt,1/3 -a -s S/../.././03
+# under FreeBSD
+/dev/hptrr \-d hpt,1/1 \-a \-s S/../.././01
+/dev/hptrr \-d hpt,1/2 \-a \-s S/../.././02
+/dev/hptrr \-d hpt,1/3 \-a \-s S/../.././03
 .\" %ENDIF OS FreeBSD
-.B #
-.B # Two SATA disks connected to a HighPoint RocketRAID 
-.B # via a pmport device.  Start long self-tests Sundays
-.B # between midnight and 1am and 2-3 am.
+.\" %IF OS FreeBSD Linux
+#
+# Two SATA disks connected to a HighPoint RocketRAID
+# via a pmport device.  Start long self\-tests Sundays
+# between midnight and 1 am and 2\-3 am.
+.\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.B # under Linux
-.B \ \ /dev/sde -d hpt,1/4/1 -a -s L/../../7/00
-.B \ \ /dev/sde -d hpt,1/4/2 -a -s L/../../7/02
+# under Linux
+/dev/sde \-d hpt,1/4/1 \-a \-s L/../../7/00
+/dev/sde \-d hpt,1/4/2 \-a \-s L/../../7/02
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.B # under FreeBSD
-.B \ \ /dev/hptrr -d hpt,1/4/1 -a -s L/../../7/00
-.B \ \ /dev/hptrr -d hpt,1/4/2 -a -s L/../../7/02
-.B #
+# under FreeBSD
+/dev/hptrr \-d hpt,1/4/1 \-a \-s L/../../7/00
+/dev/hptrr \-d hpt,1/4/2 \-a \-s L/../../7/02
 .\" %ENDIF OS FreeBSD
-.B # Three SATA disks connected to an Areca
-.B # RAID controller. Start long self-tests Sundays
-.B # between midnight and 3 am.
+.\" %IF OS FreeBSD Linux
+#
+# Three SATA disks connected to an Areca
+# RAID controller.  Start long self\-tests Sundays
+# between midnight and 3 am.
+.\" %ENDIF OS FreeBSD Linux
 .\" %IF OS Linux
-.B \ \ /dev/sg2 -d areca,1 -a -s L/../../7/00
-.B \ \ /dev/sg2 -d areca,2 -a -s L/../../7/01
-.B \ \ /dev/sg2 -d areca,3 -a -s L/../../7/02
+# under Linux
+/dev/sg2 \-d areca,1 \-a \-s L/../../7/00
+/dev/sg2 \-d areca,2 \-a \-s L/../../7/01
+/dev/sg2 \-d areca,3 \-a \-s L/../../7/02
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
-.B \ \ /dev/arcmsr0 -d areca,1 -a -s L/../../7/00
-.B \ \ /dev/arcmsr0 -d areca,2 -a -s L/../../7/01
-.B \ \ /dev/arcmsr0 -d areca,3 -a -s L/../../7/02
+# under FreeBSD
+/dev/arcmsr0 \-d areca,1 \-a \-s L/../../7/00
+/dev/arcmsr0 \-d areca,2 \-a \-s L/../../7/01
+/dev/arcmsr0 \-d areca,3 \-a \-s L/../../7/02
 .\" %ENDIF OS FreeBSD
-.B #
-.B # The following line enables monitoring of the 
-.B # ATA Error Log and the Self-Test Error Log.  
-.B # It also tracks changes in both Prefailure
-.B # and Usage Attributes, apart from Attributes
-.B # 9, 194, and 231, and shows  continued lines:
-.B #
-.B \ \ /dev/sdd\ -l\ error\ \e
-.B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
-.B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
-.B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
-.B \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \e\ \ # also temperature
-.B \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
-.B #
-.B ################################################
-.fi
-
+.\" %IF OS Linux
+#
+# Two SATA disks on an Intelliprop controller.
+# Start short self\-tests daily between 1\-2, 2\-3, and
+# 3\-4 am.
+/dev/sde \-d intelliprop,0+sat \-a \-s S/../.././01
+/dev/sde \-d intelliprop,1+sat \-a \-s S/../.././02
+.\" %ENDIF OS Linux
+#
+# The following line enables monitoring of the
+# ATA Error Log and the Self\-Test Error Log.
+# It also tracks changes in both Prefailure
+# and Usage Attributes, apart from Attributes
+# 9, 194, and 231, and shows  continued lines:
+#
+/dev/sdd\ \-l\ error\ \e
+\ \ \ \ \ \-l\ selftest\ \e
+\ \ \ \ \ \-t\ \e\ \ \ \ \ \ \ \ \ # Attributes not tracked:
+\ \ \ \ \ \-I\ 194\ \e\ \ \ \ \ # temperature
+\ \ \ \ \ \-I\ 231\ \e\ \ \ \ \ # also temperature
+\ \ \ \ \ \-I\ 9\ \ \ \ \ \ \ \ \ # power\-on hours
+#
+################################################
+.Ve
+.Sp
 .SH CONFIGURATION FILE DIRECTIVES
 If a non-comment entry in the configuration file is the text string
 .B DEVICESCAN
@@ -228,7 +248,7 @@ scan for devices.
 may optionally be followed by Directives that will apply to all
 devices that are found in the scan.  Please see below for additional
 details.
-
+.PP
 If an entry in the configuration file starts with
 .B DEFAULT
 instead of a device name, then all directives in this entry are set
@@ -236,27 +256,26 @@ as defaults for the next device entries.
 .PP
 This configuration:
 .PP
-.nf
-\ \ DEFAULT -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
+.Vb 7
+\ \ DEFAULT \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com
 \ \ /dev/sda
 \ \ /dev/sdb
 \ \ /dev/sdc
-\ \ DEFAULT -H -m admin@example.com
+\ \ DEFAULT \-H \-m admin@example.com
 \ \ /dev/sdd
-\ \ /dev/sde -d removable
-.fi
+\ \ /dev/sde \-d removable
+.Ve
 .PP
 has the same effect as:
 .PP
-.nf
-\ \ /dev/sda -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
-\ \ /dev/sdb -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
-\ \ /dev/sdc -a -R5! -W 2,40,45 -I 194 -s L/../../7/00 -m admin@example.com
-\ \ /dev/sdd -H -m admin@example.com
-\ \ /dev/sde -d removable -H -m admin@example.com
-.fi
-
-
+.Vb 5
+\ \ /dev/sda \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com
+\ \ /dev/sdb \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com
+\ \ /dev/sdc \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com
+\ \ /dev/sdd \-H \-m admin@example.com
+\ \ /dev/sde \-d removable \-H \-m admin@example.com
+.Ve
+.PP
 The following are the Directives that may appear following the device
 name or
 .B DEVICESCAN
@@ -264,131 +283,133 @@ or
 .B DEFAULT
 on any line of the
 .B /usr/local/etc/smartd.conf
-configuration file. Note that
-.B these are NOT command-line options for 
+configuration file.  Note that
+.B these are NOT command-line options for
 \fBsmartd\fP.
 The Directives below may appear in any order, following the device
-name. 
-
+name.
+.PP
 .B For an ATA device,
 if no Directives appear, then the device will be monitored
-as if the \'\-a\' Directive (monitor all SMART properties) had been given.
-
+as if the \*(Aq\-a\*(Aq Directive (monitor all SMART properties) had been given.
+.PP
 .B If a SCSI disk is listed,
 it will be monitored at the maximum implemented level: roughly
-equivalent to using the \'\-H \-l selftest\' options for an ATA disk.
-So with the exception of \'\-d\', \'\-m\', \'\-l selftest\', \'\-s\', and
-\'\-M\', the Directives below are ignored for SCSI disks.  For SCSI
-disks, the \'\-m\' Directive sends a warning email if the SMART status
-indicates a disk failure or problem, if the SCSI inquiry about disk
+equivalent to using the \*(Aq\-H \-l selftest\*(Aq options for an ATA disk.
+So with the exception of \*(Aq\-d\*(Aq, \*(Aq\-m\*(Aq, \*(Aq\-l selftest\*(Aq,
+\*(Aq\-s\*(Aq, and \*(Aq\-M\*(Aq, the Directives below are ignored for SCSI disks.
+For SCSI disks, the \*(Aq\-m\*(Aq Directive sends a warning email if the SMART
+status indicates a disk failure or problem, if the SCSI inquiry about disk
 status fails, or if new errors appear in the self-test log.
-
+.\" %IF OS FreeBSD Linux
+.PP
 .B If a 3ware controller is used
 then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?,
-/dev/twa?, /dev/twl? or /dev/tws?) must be listed, along with the \'\-d 3ware,N\'
-Directive (see below).  The individual ATA disks hosted by the 3ware
-controller appear to \fBsmartd\fP as normal ATA devices.  Hence all
-the ATA directives can be used for these disks (but see note below).
-
-.\" %IF OS Linux FreeBSD
+/dev/twa?, /dev/twl? or /dev/tws?) must be listed, along with the
+\*(Aq\-d 3ware,N\*(Aq Directive (see below).
+The individual ATA disks hosted by the 3ware controller appear to \fBsmartd\fP
+as normal ATA devices.
+Hence all the ATA directives can be used for these disks (but see note below).
+.PP
 .B If an Areca controller is used
-then the corresponding device (SCSI /dev/sg? on Linux or /dev/arcmsr0 on 
-FreeBSD) must be listed, along with the \'\-d areca,N\' Directive (see below).
+then the corresponding device (SCSI /dev/sg? on Linux or /dev/arcmsr0 on
+FreeBSD) must be listed, along with the \*(Aq\-d areca,N\*(Aq Directive
+(see below).
 The individual SATA disks hosted by the Areca controller appear to \fBsmartd\fP
 as normal ATA devices.  Hence all the ATA directives can be used for
 these disks.  Areca firmware version 1.46 or later which supports
 smartmontools must be used; Please see the \fBsmartctl\fP(8) man page
 for further details.
-.\" %ENDIF OS Linux FreeBSD
+.\" %ENDIF OS FreeBSD Linux
 .TP
 .B \-d TYPE
 Specifies the type of the device.
 The valid arguments to this directive are:
-
+.Sp
 .I auto
 \- attempt to guess the device type from the device name or from
 controller type info provided by the operating system or from
 a matching USB ID entry in the drive database.
 This is the default.
-
+.Sp
 .I ata
 \- the device type is ATA.  This prevents
 \fBsmartd\fP
 from issuing SCSI commands to an ATA device.
-
+.Sp
 .\" %IF NOT OS Darwin
 .I scsi
 \- the device type is SCSI.  This prevents
 \fBsmartd\fP
 from issuing ATA commands to a SCSI device.
-
+.Sp
 .\" %ENDIF NOT OS Darwin
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I nvme[,NSID]
-\- [FreeBSD, Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTD FEATURE]
+\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
 the device type is NVM Express (NVMe).
 The optional parameter NSID specifies the namespace id (in hex) passed
 to the driver.
 Use 0xffffffff for the broadcast namespace id.
 The default for NSID is the namespace id addressed by the device name.
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .\" %IF NOT OS Darwin
 .I sat[,auto][,N]
 \- the device type is SCSI to ATA Translation (SAT).
-This is for ATA disks that have a SCSI to ATA Translation (SAT) Layer
-(SATL) between the disk and the operating system.
+This is for ATA disks that have a SCSI to ATA Translation Layer (SATL)
+between the disk and the operating system.
 SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
 the other 16 bytes long.  The default is the 16 byte variant which can be
-overridden with either \'\-d sat,12\' or \'\-d sat,16\'.
-
-If \'\-d sat,auto\' is specified, device type SAT (for ATA/SATA disks) is
-only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA     ").
+overridden with either \*(Aq\-d sat,12\*(Aq or \*(Aq\-d sat,16\*(Aq.
+.Sp
+If \*(Aq\-d sat,auto\*(Aq is specified, device type SAT (for ATA/SATA disks)
+is only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA     ").
 Otherwise device type SCSI (for SCSI/SAS disks) is used.
-
+.Sp
 .I usbcypress
 \- this device type is for ATA disks that are behind a Cypress USB to PATA
 bridge.  This will use the ATACB proprietary scsi pass through command.
 The default SCSI operation code is 0x24, but although it can be overridden
-with \'\-d usbcypress,0xN\', where N is the scsi operation code,
+with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code,
 you're running the risk of damage to the device or filesystems on it.
-
+.Sp
 .I usbjmicron[,p][,x][,PORT]
 \- this device type is for SATA disks that are behind a JMicron USB to
-PATA/SATA bridge.  The 48-bit ATA commands (required e.g. for \'\-l xerror\',
-see below) do not work with all of these bridges and are therefore disabled by
-default.  These commands can be enabled by \'\-d usbjmicron,x\'.
-If two disks are connected to a bridge with two ports, an error message is printed
-if no PORT is specified.
-The port can be specified by \'\-d usbjmicron[,x],PORT\' where PORT is 0
+PATA/SATA bridge.
+The 48-bit ATA commands (required e.g.\& for \*(Aq\-l xerror\*(Aq, see below)
+do not work with all of these bridges and are therefore disabled by default.
+These commands can be enabled by \*(Aq\-d usbjmicron,x\*(Aq.
+If two disks are connected to a bridge with two ports, an error message is
+printed if no PORT is specified.
+The port can be specified by \*(Aq\-d usbjmicron[,x],PORT\*(Aq where PORT is 0
 (master) or 1 (slave).  This is not necessary if the device uses a port
 multiplier to connect multiple disks to one port.  The disks appear under
 separate /dev/ice names then.
-CAUTION: Specifying \',x\' for a device which does not support it results
+CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results
 in I/O errors and may disconnect the drive.  The same applies if the specified
 PORT does not exist or is not connected to a disk.
-
+.Sp
 The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
-command similar to JMicron and work with \'\-d usbjmicron,0\'.
+command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq.
 Newer Prolific firmware requires a modified command which can be selected by
-\'\-d usbjmicron,p\'.
+\*(Aq\-d usbjmicron,p\*(Aq.
 Note that this does not yet support the SMART status command.
-
+.Sp
 .I usbprolific
-\- [NEW EXPERIMENTAL SMARTD FEATURE]
-this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775
-USB to SATA bridge.
-
+\- this device type is for SATA disks that are behind a Prolific
+PL2571/2771/2773/2775 USB to SATA bridge.
+.Sp
 .I usbsunplus
 \- this device type is for SATA disks that are behind a SunplusIT USB to SATA
 bridge.
-
+.Sp
 .\" %ENDIF NOT OS Darwin
 .\" %IF OS Linux
 .I marvell
 \- [Linux only] interact with SATA disks behind Marvell chip-set
 controllers (using the Marvell rather than libata driver).
-
+.Sp
 .I megaraid,N
 \- [Linux only] the device consists of one or more SCSI/SAS disks connected
 to a MegaRAID controller.  The non-negative integer N (in the range of 0 to
@@ -396,20 +417,21 @@ to a MegaRAID controller.  The non-negative integer N (in the range of 0 to
 This interface will also work for Dell PERC controllers.
 In log files and email messages this disk will be identified as
 megaraid_disk_XXX with XXX in the range from 000 to 127 inclusive.
-It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus 
+It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus
 number.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .\" %ENDIF OS Linux
 .\" %IF OS Linux Windows Cygwin
 .I aacraid,H,L,ID
-\- [Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTD FEATURE]
-the device consists of one or more SCSI/SAS disks connected to an AacRaid controller.
+\- [Linux, Windows and Cygwin only] the device consists of one or more
+SCSI/SAS disks connected to an AacRaid controller.
 The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
 on the controller is monitored.
-In log files and email messages this disk will be identified as aacraid_disk_HH_LL_ID.
+In log files and email messages this disk will be identified as
+aacraid_disk_HH_LL_ID.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .\" %ENDIF OS Linux Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I 3ware,N
@@ -419,40 +441,42 @@ connected to a 3ware RAID controller.  The non-negative integer N
 is monitored.
 In log files and email messages this disk will be identified as 3ware_disk_XXX
 with XXX in the range from 000 to 127 inclusive.
-
+.Sp
 Note that while you may use \fBany\fP of the 3ware SCSI logical devices /dev/tw*
 to address \fBany\fP of the physical disks (3ware ports), error and log
 messages will make the most sense if you always list the 3ware SCSI
 logical device corresponding to the particular physical disks.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .\" %ENDIF OS FreeBSD Linux
 .\" %IF OS FreeBSD Linux Windows Cygwin
 .I areca,N
-\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or more SATA disks
-connected to an Areca SATA RAID controller.  The positive integer N (in the range
-from 1 to 24 inclusive) denotes which disk on the controller is monitored.
-In log files and email messages this disk will be identifed as
+\- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or
+more SATA disks connected to an Areca SATA RAID controller.
+The positive integer N (in the range from 1 to 24 inclusive) denotes which
+disk on the controller is monitored.
+In log files and email messages this disk will be identified as
 areca_disk_XX with XX in the range from 01 to 24 inclusive.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .I areca,N/E
 \- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one
 or more SATA or SAS disks connected to an Areca SAS RAID controller.
 The integer N (range 1 to 128) denotes the channel (slot) and E (range
 1 to 8) denotes the enclosure.
 Important: This requires Areca SAS controller firmware version 1.51 or later.
-
+.Sp
 .\" %ENDIF OS FreeBSD Linux Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I cciss,N
-\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or SATA disks
-connected to a cciss RAID controller.  The non-negative integer N (in the range
-from 0 to 15 inclusive) denotes which disk on the controller is monitored.
+\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or
+SATA disks connected to a cciss RAID controller.
+The non-negative integer N (in the range from 0 to 15 inclusive) denotes
+which disk on the controller is monitored.
 In log files and email messages this disk will be identified as cciss_disk_XX
 with XX in the range from 00 to 15 inclusive.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .I hpt,L/M/N
 \- [FreeBSD and Linux only] the device consists of one or more ATA disks
 connected to a HighPoint RocketRAID controller.  The integer L is the
@@ -465,90 +489,105 @@ In log files and email messages this disk will be identified as
 hpt_X/X/X and X/X/X is the same as L/M/N, note if no N indicated, N set
 to the default value 1.
 Please see the \fBsmartctl\fP(8) man page for further details.
-
+.Sp
 .\" %ENDIF OS FreeBSD Linux
+.I intelliprop,N[+TYPE]
+\- [NEW EXPERIMENTAL SMARTD FEATURE] the device consists of multiple ATA
+disks connected to an Intelliprop controller.
+The integer N is the port number from 0 to 3 of the ATA drive to be targeted.
+Please see the \fBsmartctl\fP(8) man page for further details.
+.Sp
 .I ignore
 \- the device specified by this configuration entry should be ignored.
 This allows to ignore specific devices which are detected by a following
 DEVICESCAN configuration line.
 It may also be used to temporary disable longer multi-line configuration entries.
-This Directive may be used in conjunction with the other \'\-d\' Directives.
-
+This Directive may be used in conjunction with the other \*(Aq\-d\*(Aq
+Directives.
+.Sp
 .I removable
 \- the device or its media is removable.  This indicates to
 \fBsmartd\fP
 that it should continue (instead of exiting, which is the default
 behavior) if the device does not appear to be present when
 \fBsmartd\fP is started.  This Directive may be used in conjunction
-with the other \'\-d\' Directives.
+with the other \*(Aq\-d\*(Aq Directives.
+[NEW EXPERIMENTAL SMARTD FEATURE]
+This directive also suppresses warning emails and repeated log messages
+if the device is removed after startup.
+\fBWARNING: Removing a device and connecting a different one to same interface
+is not supported and may result in bogus warnings until smartd is restarted.\fP
 .TP
 .B \-n POWERMODE[,N][,q]
-[ATA only] This \'nocheck\' Directive is used to prevent a disk from
+[ATA only] This \*(Aqnocheck\*(Aq Directive is used to prevent a disk from
 being spun-up when it is periodically polled by \fBsmartd\fP.
-
-ATA disks have five different power states. In order of increasing
-power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
-and \'ACTIVE\'.  Typically in the OFF, SLEEP, and STANDBY modes the
-disk\'s platters are not spinning. But usually, in response to SMART
-commands issued by \fBsmartd\fP, the disk platters are spun up.  So if
-this option is not used, then a disk which is in a low-power mode may
+.Sp
+ATA disks have five different power states.  In order of increasing
+power consumption they are: \*(AqOFF\*(Aq, \*(AqSLEEP\*(Aq,
+\*(AqSTANDBY\*(Aq, \*(AqIDLE\*(Aq, and \*(AqACTIVE\*(Aq.
+Typically in the OFF, SLEEP, and STANDBY modes the disk's platters are not
+spinning.
+But usually, in response to SMART commands issued by \fBsmartd\fP, the disk
+platters are spun up.
+So if this option is not used, then a disk which is in a low-power mode may
 be spun up and put into a higher-power mode when it is periodically
 polled by \fBsmartd\fP.
-
+.Sp
 Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
 then it won't respond to \fBsmartd\fP commands, and so the disk won't
-be registered as a device for \fBsmartd\fP to monitor. If a disk is in
+be registered as a device for \fBsmartd\fP to monitor.  If a disk is in
 any other low-power mode, then the commands issued by \fBsmartd\fP to
 register the disk will probably cause it to spin-up.
-
-The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
+.Sp
+The \*(Aq\fB\-n\fP\*(Aq (nocheck) Directive specifies if \fBsmartd\fP's
 periodic checks should still be carried out when the device is in a
 low-power mode.  It may be used to prevent a disk from being spun-up
 by periodic \fBsmartd\fP polling.  The allowed values of POWERMODE
 are:
-
+.Sp
 .I never
 \- \fBsmartd\fP will poll (check) the device regardless of its power
-mode. This may cause a disk which is spun-down to be spun-up when
+mode.  This may cause a disk which is spun-down to be spun-up when
 \fBsmartd\fP checks it.  This is the default behavior if the '\-n'
 Directive is not given.
-
+.Sp
 .I sleep
 \- check the device unless it is in SLEEP mode.
-
+.Sp
 .I standby
 \- check the device unless it is in SLEEP or STANDBY mode.  In
 these modes most disks are not spinning, so if you want to prevent
 a laptop disk from spinning up each time that \fBsmartd\fP polls,
 this is probably what you want.
-
+.Sp
 .I idle
 \- check the device unless it is in SLEEP, STANDBY or IDLE mode.
 In the IDLE state, most disks are still spinning, so this is probably
 not what you want.
-
+.Sp
 Maximum number of skipped checks (in a row) can be specified by
-appending positive number \',N\' to POWERMODE (like \'\-n standby,15\').
+appending positive number \*(Aq,N\*(Aq to POWERMODE (like
+\*(Aq\-n standby,15\*(Aq).
 After N checks are skipped in a row, powermode is ignored and the
 check is performed anyway.
-
+.Sp
 When a periodic test is skipped, \fBsmartd\fP normally writes an
-informal log message. The message can be suppressed by appending
-the option \',q\' to POWERMODE (like \'\-n standby,q\').
+informal log message.  The message can be suppressed by appending
+the option \*(Aq,q\*(Aq to POWERMODE (like \*(Aq\-n standby,q\*(Aq).
 This prevents a laptop disk from spinning up due to this message.
-
-Both \',N\' and \',q\' can be specified together.
+.Sp
+Both \*(Aq,N\*(Aq and \*(Aq,q\*(Aq can be specified together.
 .TP
 .B \-T TYPE
 Specifies how tolerant
 \fBsmartd\fP
 should be of SMART command failures.  The valid arguments to this
 Directive are:
-
+.Sp
 .I normal
 \- do not try to monitor the disk if a mandatory SMART command fails, but
 continue if an optional SMART command fails.  This is the default.
-
+.Sp
 .I permissive
 \- try to monitor the disk even if it appears to lack SMART
 capabilities.  This may be required for some old disks (prior to
@@ -561,10 +600,10 @@ were incorporated into the ATA/ATAPI Specifications.
 \fBsmartd\fP
 starts up and has no further effect.  The valid arguments to this
 Directive are \fIon\fP and \fIoff\fP.
-
+.Sp
 The delay between tests is vendor-specific, but is typically four
 hours.
-
+.Sp
 Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA
 Specification.  Please see the
 .B smartctl \-o
@@ -582,105 +621,105 @@ Directive are \fIon\fP and \fIoff\fP.  Also affects SCSI devices.
 STATUS command.
 If this command reports a failing health status, then disk
 failure is predicted in less than 24 hours, and a message at loglevel
-.B \'LOG_CRIT\'
+.B \*(AqLOG_CRIT\*(Aq
 will be logged to syslog.  [Please see the
 .B smartctl \-H
 command-line option.]
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
-[NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
+[NVMe]
 [NEW EXPERIMENTAL SMARTD FEATURE]
 Checks the "Critical Warning" byte from the SMART/Health Information log.
-If any warning bit is set, a message at loglevel \fB\'LOG_CRIT\'\fP
+If any warning bit is set, a message at loglevel \fB\*(AqLOG_CRIT\*(Aq\fP
 will be logged to syslog.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-l TYPE
 Reports increases in the number of errors in one of three SMART logs.  The
 valid arguments to this Directive are:
-
+.Sp
 .I error
 \- [ATA] report if the number of ATA errors reported in the Summary SMART
 error log has increased since the last check.
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I error
-\- [NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+\- [NVMe]
 [NEW EXPERIMENTAL SMARTD FEATURE]
 report if the "Number of Error Information Log Entries" from the
 SMART/Health Information log has increased since the last check.
-
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I xerror
 \- [ATA] report if the number of ATA errors reported in the Extended
 Comprehensive SMART error log has increased since the last check.
-
-If both \'\-l error\' and \'\-l xerror\' are specified, smartd checks
-the maximum of both values.
-
+.Sp
+If both \*(Aq\-l error\*(Aq and \*(Aq\-l xerror\*(Aq are specified, smartd
+checks the maximum of both values.
+.Sp
 [Please see the \fBsmartctl \-l xerror\fP command-line option.]
-
-.\" %IF OS FreeBSD Linux Windows Cygwin
+.Sp
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .I xerror
-\- [NVMe] [FreeBSD, Linux, Windows and Cygwin only]
+\- [NVMe]
 [NEW EXPERIMENTAL SMARTD FEATURE]
-same as \'-l error\'.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
-
+same as \*(Aq\-l error\*(Aq.
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
 .I selftest
 \- report if the number of failed tests reported in the SMART
 Self-Test Log has increased since the last check, or if the timestamp
 associated with the most recent failed test has increased.  Note that
 such errors will \fBonly\fP be logged if you run self-tests on the
 disk (and it fails a test!).  Self-Tests can be run automatically by
-\fBsmartd\fP: please see the \fB\'\-s\'\fP Directive below.
-Self-Tests can also be run manually by using the \fB\'\-t\ short\'\fP
-and \fB\'\-t\ long\'\fP options of \fBsmartctl\fP and the results of
-the testing can be observed using the \fBsmartctl \'\-l\ selftest\'\fP
+\fBsmartd\fP: please see the \*(Aq\-s\*(Aq Directive below.
+Self-Tests can also be run manually by using the \*(Aq\-t short\*(Aq
+and \fB\*(Aq\-t\ long\*(Aq\fP options of \fBsmartctl\fP and the results of
+the testing can be observed using the \fBsmartctl \*(Aq\-l\ selftest\*(Aq\fP
 command-line option.
 [Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line
 options.]
-
+.Sp
 [ATA only] Failed self-tests outdated by a newer successful extended
 self-test are ignored.  The warning email counter is reset if the
 number of failed self tests dropped to 0.  This typically happens when
 an extended self-test is run after all bad sectors have been reallocated.
-
+.Sp
 .I offlinests[,ns]
 \- [ATA only] report if the Offline Data Collection status has changed
 since the last check.  The report will be logged as LOG_CRIT if the new
 status indicates an error.  With some drives the status often changes,
-therefore \'\-l offlinests\' is not enabled by '\-a\' Directive.
+therefore \*(Aq\-l offlinests\*(Aq is not enabled by \*(Aq\-a\*(Aq Directive.
 .\" %IF NOT OS Cygwin Windows
-.\"! Appending \',ns\' (no standby) to this directive is not implemented
+.\"! Appending ',ns' (no standby) to this directive is not implemented
 .\"! on OS_MAN_FILTER.
 .\" %ENDIF NOT OS Cygwin Windows
 .\" %IF OS Cygwin Windows
-
-[Windows and Cygwin only] If \',ns\' (no standby) is appended to this
+.Sp
+[Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this
 directive, smartd disables system auto standby as long as an Offline
-Data Collection is in progress. See \'\-l selfteststs,ns\' below.
+Data Collection is in progress.  See \*(Aq\-l selfteststs,ns\*(Aq below.
 .\" %ENDIF OS Cygwin Windows
-
+.Sp
 .I selfteststs[,ns]
 \- [ATA only] report if the Self-Test execution status has changed
 since the last check.  The report will be logged as LOG_CRIT if the new
 status indicates an error.
 .\" %IF NOT OS Cygwin Windows
-.\"! Appending \',ns\' (no standby) to this directive is not implemented
+.\"! Appending ',ns' (no standby) to this directive is not implemented
 .\"! on OS_MAN_FILTER.
 .\" %ENDIF NOT OS Cygwin Windows
 .\" %IF OS Cygwin Windows
-
-[Windows and Cygwin only] If \',ns\' (no standby) is appended to this
+.Sp
+[Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this
 directive, smartd disables system auto standby as long as a Self-Test
 is in progress.  This prevents that a Self-Test is aborted because the
 OS sets the system to a standby/sleep mode when idle.  Smartd check
-interval (\'\-i\' option) should be shorter than the configured idle
+interval (\*(Aq\-i\*(Aq option) should be shorter than the configured idle
 timeout.  Auto standby is not disabled if the system is running on
 battery.
 .\" %ENDIF OS Cygwin Windows
-
+.Sp
 .I scterc,READTIME,WRITETIME
 \- [ATA only] sets the SCT Error Recovery Control settings to the specified
 values (deciseconds) when \fBsmartd\fP starts up and has no further effect.
@@ -694,49 +733,54 @@ Sets non-SMART device settings when \fBsmartd\fP starts up and has no
 further effect.
 [Please see the \fBsmartctl \-\-set\fP command-line option.]
 Valid arguments are:
-
+.Sp
 .I aam,[N|off]
 \- [ATA only] Sets the Automatic Acoustic Management (AAM) feature.
-
+.Sp
 .I apm,[N|off]
 \- [ATA only] Sets the Advanced Power Management (APM) feature.
-
+.Sp
 .I lookahead,[on|off]
 \- [ATA only] Sets the read look-ahead feature.
-
+.Sp
 .I security-freeze
 \- [ATA only] Sets ATA Security feature to frozen mode.
-
+.Sp
 .I standby,[N|off]
 \- [ATA only] Sets the standby (spindown) timer and places the drive in the
 IDLE mode.
-
+.Sp
 .I wcache,[on|off]
 \- [ATA only] Sets the volatile write cache feature.
+.Sp
+.I dsn,[on|off]
+\- [ATA only]
+[NEW EXPERIMENTAL SMARTD FEATURE]
+Sets the DSN feature.
 .TP
 .B \-s REGEXP
 Run Self-Tests or Offline Immediate Tests, at scheduled times.  A
 Self- or Offline Immediate Test will be run at the end of periodic
 device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP
-match the extended regular expression \fBREGEXP\fP. Here:
+match the extended regular expression \fBREGEXP\fP.  Here:
 .RS 7
 .IP \fBT\fP 4
 is the type of the test.  The values that \fBsmartd\fP will try to
-match (in turn) are: \'L\' for a \fBL\fPong Self-Test, \'S\' for a
-\fBS\fPhort Self-Test, \'C\' for a \fBC\fPonveyance Self-Test (ATA
-only), and \'O\' for an \fBO\fPffline Immediate Test (ATA only).  As
+match (in turn) are: \*(AqL\*(Aq for a \fBL\fPong Self-Test, \*(AqS\*(Aq for a
+\fBS\fPhort Self-Test, \*(AqC\*(Aq for a \fBC\fPonveyance Self-Test (ATA
+only), and \*(AqO\*(Aq for an \fBO\fPffline Immediate Test (ATA only).  As
 soon as a match is found, the test will be started and no additional
 matches will be sought for that device and that polling cycle.
-
-To run scheduled Selective Self-Tests, use \'n\' for \fBn\fPext span,
-\'r\' to \fBr\fPedo last span, or \'c\' to \fBc\fPontinue with next span
-or redo last span based on status of last test.
+.Sp
+To run scheduled Selective Self-Tests, use \*(Aqn\*(Aq for \fBn\fPext span,
+\*(Aqr\*(Aq to \fBr\fPedo last span, or \*(Aqc\*(Aq to \fBc\fPontinue with
+next span or redo last span based on status of last test.
 The LBA range is based on the first span from the last test.
 See the \fBsmartctl \-t select,[next|redo|cont]\fP options for
 further info.
-
-Some disks (e.g. WD) do not preserve the selective self test log accross
-power cycles.  If state persistence (\'\-s\' option) is enabled, the last
+.Sp
+Some disks (e.g.\& WD) do not preserve the selective self test log across
+power cycles.  If state persistence (\*(Aq\-s\*(Aq option) is enabled, the last
 test span is preserved by smartd and used if (and only if) the selective
 self test log is empty.
 .IP \fBMM\fP 4
@@ -744,7 +788,7 @@ is the month of the year, expressed with two decimal digits.  The
 range is from 01 (January) to 12 (December) inclusive.  Do \fBnot\fP
 use a single decimal digit or the match will always fail!
 .IP \fBDD\fP 4
-is the day of the month, expressed with two decimal digits. The
+is the day of the month, expressed with two decimal digits.  The
 range is from 01 to 31 inclusive.  Do \fBnot\fP
 use a single decimal digit or the match will always fail!
 .IP \fBd\fP 4
@@ -752,7 +796,7 @@ is the day of the week, expressed with one decimal digit.  The
 range is from 1 (Monday) to 7 (Sunday) inclusive.
 .IP \fBHH\fP 4
 is the hour of the day, written with two decimal digits, and given in
-hours after midnight.  The range is 00 (midnight to just before 1am)
+hours after midnight.  The range is 00 (midnight to just before 1 am)
 to 23 (11pm to just before midnight) inclusive.  Do \fBnot\fP use a
 single decimal digit or the match will always fail!
 .RE
@@ -761,81 +805,79 @@ single decimal digit or the match will always fail!
 .TP
 .B \&
 Some examples follow.  In reading these, keep in mind that in extended
-regular expressions a dot \fB\'.\'\fP matches any single character, and
-a parenthetical expression such as \fB\'(A|B|C)\'\fP denotes any one of the three possibilities \fBA\fP,
-\fBB\fP, or \fBC\fP.
-
-To schedule a short Self-Test between 2-3am every morning, use:
-.nf
+regular expressions a dot \fB\*(Aq.\*(Aq\fP matches any single character, and
+a parenthetical expression such as \fB\*(Aq(A|B|C)\*(Aq\fP denotes any one
+of the three possibilities \fBA\fP, \fBB\fP, or \fBC\fP.
+.Sp
+To schedule a short Self-Test between 2\(en3 am every morning, use:
+.br
 \fB \-s S/../.././02\fP
-.fi
-To schedule a long Self-Test between 4-5am every Sunday morning, use:
-.nf
+.br
+To schedule a long Self-Test between 4\(en5 am every Sunday morning, use:
+.br
 \fB \-s L/../../7/04\fP
-.fi
-To schedule a long Self-Test between 10-11pm on the first and
+.br
+To schedule a long Self-Test between 10\(en11 pm on the first and
 fifteenth day of each month, use:
-.nf
+.br
 \fB \-s L/../(01|15)/./22\fP
-.fi
-To schedule an Offline Immediate test after every midnight, 6am,
-noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
-Self-Test every Saturday at 3-4am, use:
-.nf
+.br
+To schedule an Offline Immediate test after every midnight, 6 am,
+noon, and 6 pm, plus a Short Self-Test daily at 1\(en2 am and a Long
+Self-Test every Saturday at 3\(en4 am, use:
+.br
 \fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP
-.fi
+.br
 If Long Self-Tests of a large disks take longer than the system uptime,
 a full disk test can be performed by several Selective Self-Tests.
-To setup a full test of a 1TB disk within 20 days (one 50GB span
+To setup a full test of a 1 TB disk within 20 days (one 50 GB span
 each day), run this command once:
 .nf
-  smartctl -t select,0-99999999 /dev/sda
+  smartctl \-t select,0\-99999999 /dev/sda
 .fi
-To run the next test spans on Monday-Friday between 12-13am, run smartd
+To run the next test spans on Monday\(enFriday between 12\(en13 am, run smartd
 with this directive:
-.nf
-\fB \-s n/../../[1-5]/12\fP
-.fi
-
-
+.br
+\fB \-s n/../../[1\-5]/12\fP
+.Sp
 Scheduled tests are run immediately following the regularly-scheduled
 device polling, if the current local date, time, and test type, match
 \fBREGEXP\fP.  By default the regularly-scheduled device polling
 occurs every thirty minutes after starting \fBsmartd\fP.  Take caution
-if you use the \'\-i\' option to make this polling interval more than
+if you use the \*(Aq\-i\*(Aq option to make this polling interval more than
 sixty minutes: the poll times may fail to coincide with any of the
 testing times that you have specified with \fBREGEXP\fP.  In this case
 the test will be run following the next device polling.
-
+.Sp
 Before running an offline or self-test, \fBsmartd\fP checks to be sure
 that a self-test is not already running.  If a self-test \fBis\fP
 already running, then this running self test will \fBnot\fP be
 interrupted to begin another test.
-
+.Sp
 \fBsmartd\fP will not attempt to run \fBany\fP type of test if another
 test was already started or run in the same hour.
-
+.Sp
 To avoid performance problems during system boot, \fBsmartd\fP will
 not attempt to run any scheduled tests following the very first
-device polling (unless \'\-q onecheck\' is specified).
-
+device polling (unless \*(Aq\-q onecheck\*(Aq is specified).
+.Sp
 Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
-You can use these or the '-q showtests' command-line option to verify
+You can use these or the \*(Aq\-q showtests\*(Aq command-line option to verify
 that you constructed \fBREGEXP\fP correctly.  The matching order
 (\fBL\fP before \fBS\fP before \fBC\fP before \fBO\fP) ensures that
 if multiple test types are all scheduled for the same hour, the
 longer test type has precedence.  This is usually the desired behavior.
-
+.Sp
 If the scheduled tests are used in conjunction with state persistence
-(\'\-s\' option), smartd will also try to match the hours since last
-shutdown (or 90 days at most). If any test would have been started
+(\*(Aq\-s\*(Aq option), smartd will also try to match the hours since last
+shutdown (or 90 days at most).  If any test would have been started
 during downtime, the longest (see above) of these tests is run after
 second device polling.
-
-If the \'\-n\' directive is used and any test would have been started
+.Sp
+If the \*(Aq\-n\*(Aq directive is used and any test would have been started
 during disk standby time, the longest of these tests is run when the
 disk is active again.
-
+.Sp
 Unix users: please beware that the rules for extended regular
 expressions [\fBregex\fP(7)] are \fBnot\fP the same as the rules for
 file-name pattern matching by the shell [\fBglob\fP(7)].  \fBsmartd\fP will
@@ -844,115 +886,122 @@ in \fBREGEXP\fP that appear to indicate that you have made this
 mistake.
 .TP
 .B \-m ADD
-Send a warning email to the email address \fBADD\fP if the \'\-H\',
-\'\-l\', \'\-f\', \'\-C\', or \'\-O\' Directives detect a failure or a
-new error, or if a SMART command to the disk fails. This Directive
-only works in conjunction with these other Directives (or with the
-equivalent default \'\-a\' Directive).
-
+Send a warning email to the email address \fBADD\fP if the \*(Aq\-H\*(Aq,
+\*(Aq\-l\*(Aq, \*(Aq\-f\*(Aq, \*(Aq\-C\*(Aq, or \*(Aq\-O\*(Aq Directives
+detect a failure or a new error, or if a SMART command to the disk fails.
+This Directive only works in conjunction with these other Directives
+(or with the equivalent default \*(Aq\-a\*(Aq Directive).
+.Sp
 To prevent your email in-box from getting filled up with warning
-messages, by default only a single warning will be sent for each of
-the enabled alert types, \'\-H\', \'\-l\', \'\-f\', \'\-C\', or
-\'\-O\' even if more than one failure or error is detected or if the
-failure or error persists.  [This behavior can be modified; see the
-\'\-M\' Directive below.]
-
+messages, by default only a single warning and (depending on
+\*(Aq\-s\*(Aq option) daily reminder emails will be sent for each of
+the enabled alert types.
+See the \*(Aq\-M\*(Aq Directive below for details.
+.Sp
 To send email to more than one user, please use the following "comma
 separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP
 (with no spaces).
-
-To test that email is being sent correctly, use the \'\-M test\'
+.Sp
+To test that email is being sent correctly, use the \*(Aq\-M test\*(Aq
 Directive described below to send one test email message on
 \fBsmartd\fP
 startup.
-
+.Sp
 By default, email is sent using the system \fBmail\fP(1) command.
 In order that \fBsmartd\fP find this command (normally /usr/bin/mail) the
 executable must be in the path of the shell or environment from which
 \fBsmartd\fP
 was started.  If you wish to specify an explicit path to the mail
 executable (for example /usr/local/bin/mail) or a custom script to
-run, please use the \'\-M exec\' Directive below.
-
+run, please use the \*(Aq\-M exec\*(Aq Directive below.
+.Sp
 .\" %IF OS Windows
-On Windows, the \'\fBBlat\fP\' mailer
-(\fBhttp://blat.sourceforge.net/\fP) is used by default.
+[Windows only] On Windows, the \*(Aq\fBBlat\fP\*(Aq mailer
+(<\fBhttp://blat.sourceforge.net/\fP>) is used by default.
 This mailer uses a different command line syntax, see
-\'\-M exec\' below.
-
+\*(Aq\-M exec\*(Aq below.
+.Sp
+[NEW EXPERIMENTAL SMARTD FEATURE]
+If the file EXEDIR/smartd_mailer.conf.ps1 is present and \*(Aq\-M exec\*(Aq
+is not specified, the script smartd_mailer.ps1 is used instead.
+This script uses the Send-MailMessage cmdlet to send mail.
+See EXEDIR/smartd_mailer.conf.sample.ps1 for info about the format of
+the configuration file.
+.Sp
 .\" %ENDIF OS Windows
 Note also that there is a special argument
 .B <nomailer>
-which can be given to the \'\-m\' Directive in conjunction with the \'\-M
-exec\' Directive. Please see below for an explanation of its effect.
-
+which can be given to the \*(Aq\-m\*(Aq Directive in conjunction with the
+\*(Aq\-M exec\*(Aq Directive.
+Please see below for an explanation of its effect.
+.Sp
 If the mailer or the shell running it produces any STDERR/STDOUT
 output, then a snippet of that output will be copied to SYSLOG.  The
-remainder of the output is discarded. If problems are encountered in
+remainder of the output is discarded.  If problems are encountered in
 sending mail, this should help you to understand and fix them.  If
 you have mail problems, we recommend running \fBsmartd\fP in debug
-mode with the \'-d\' flag, using the \'-M test\' Directive described
-below.
+mode with the \*(Aq\-d\*(Aq flag, using the \*(Aq\-M test\*(Aq Directive
+described below.
 .\" %IF ENABLE_SMARTDPLUGINDIR
 .\" %IF NOT OS Windows
-
-If a word of the comma separated list has the form \'@plugin\', a custom
+.Sp
+If a word of the comma separated list has the form \*(Aq@plugin\*(Aq, a custom
 script /usr/local/etc/smartd_warning.d/plugin is run and the word is
-removed from the list before sending mail. The string \'plugin\' may be any
-valid name except \'ALL\'.
-If \'@ALL\' is specified, all scripts in /usr/local/etc/smartd_warning.d/*
+removed from the list before sending mail.  The string \*(Aqplugin\*(Aq may
+be any valid name except \*(AqALL\*(Aq.
+If \*(Aq@ALL\*(Aq is specified, all scripts in /usr/local/etc/smartd_warning.d/*
 are run instead.
 This is handled by the script /usr/local/etc/smartd_warning.sh
-(see also \'\-M exec\' below).
+(see also \*(Aq\-M exec\*(Aq below).
 .\" %ENDIF NOT OS Windows
 .\" %ENDIF ENABLE_SMARTDPLUGINDIR
 .\" %IF OS Windows
-
+.Sp
 [Windows only] If one of the following words are used as the first address
 in the comma separated list, warning messages are sent via WTSSendMessage().
 This displays message boxes on the desktops of the selected sessions.
-Address \'\fBconsole\fP\' specifies the console session only,
-\'\fBactive\fP\' specifies the console session and all active remote
-sessions, and \'\fBconnected\fP\' specifies the console session and
+Address \*(Aq\fBconsole\fP\*(Aq specifies the console session only,
+\*(Aq\fBactive\fP\*(Aq specifies the console session and all active remote
+sessions, and \*(Aq\fBconnected\fP\*(Aq specifies the console session and
 all connected (active or waiting for login) remote sessions.
 This is handled by the script EXEDIR/smartd_warning.cmd which runs
-the tool EXEDIR/wtssendmsg.exe (see also \'\-M exec\' below).
+the tool EXEDIR/wtssendmsg.exe (see also \*(Aq\-M exec\*(Aq below).
 .\" %ENDIF OS Windows
 .TP
 .B \-M TYPE
 These Directives modify the behavior of the
 \fBsmartd\fP
-email warnings enabled with the \'\-m\' email Directive described above.
-These \'\-M\' Directives only work in conjunction with the \'\-m\'
+email warnings enabled with the \*(Aq\-m\*(Aq email Directive described above.
+These \*(Aq\-M\*(Aq Directives only work in conjunction with the \*(Aq\-m\*(Aq
 Directive and can not be used without it.
-
+.Sp
 Multiple \-M Directives may be given.  If more than one of the
 following three \-M Directives are given (example: \-M once \-M daily)
 then the final one (in the example, \-M daily) is used.
-
+.Sp
 The valid arguments to the \-M Directive are (one of the following
 three):
-
+.Sp
 .I once
 \- send only one warning email for each type of disk problem detected.  This
-is the default unless state persistence (\'\-s\' option) is enabled.
-
+is the default unless state persistence (\*(Aq\-s\*(Aq option) is enabled.
+.Sp
 .I daily
 \- send additional warning reminder emails, once per day, for each type
 of disk problem detected.  This is the default if state persistence
-(\'\-s\' option) is enabled.
-
+(\*(Aq\-s\*(Aq option) is enabled.
+.Sp
 .I diminishing
 \- send additional warning reminder emails, after a one-day interval,
 then a two-day interval, then a four-day interval, and so on for each
-type of disk problem detected. Each interval is twice as long as the
+type of disk problem detected.  Each interval is twice as long as the
 previous interval.
-
+.Sp
 If a disk problem is no longer detected, the internal email counter is
 reset.  If the problem reappears a new warning email is sent immediately.
-
+.Sp
 In addition, one may add zero or more of the following Directives:
-
+.Sp
 .I test
 \- send a single test email
 immediately upon
@@ -960,61 +1009,58 @@ immediately upon
 startup.  This allows one to verify that email is delivered correctly.
 Note that if this Directive is used,
 \fBsmartd\fP
-will also send the normal email warnings that were enabled with the \'\-m\' Directive,
-in addition to the single test email!
-
+will also send the normal email warnings that were enabled with the
+\*(Aq\-m\*(Aq Directive, in addition to the single test email!
+.Sp
 .I exec PATH
 \- run the executable PATH instead of the default mail command, when
 \fBsmartd\fP
 needs to send email.  PATH must point to an executable binary file or
 script.
 .\" %IF OS Windows
-
+.Sp
 [Windows only] The PATH may contain space characters.
 Then it must be included in double quotes.
 .\" %ENDIF OS Windows
-
+.Sp
 By setting PATH to point to a customized script, you can make
 \fBsmartd\fP perform useful tricks when a disk problem is detected
 (beeping the console, shutting down the machine, broadcasting warnings
-to all logged-in users, etc.)  But please be careful. \fBsmartd\fP
+to all logged-in users, etc.\&)  But please be careful.  \fBsmartd\fP
 will \fBblock\fP until the executable PATH returns, so if your
 executable hangs, then \fBsmartd\fP will also hang.
 .\" %IF NOT OS Windows
 Some sample scripts are included in
 /usr/local/share/doc/smartmontools/examplescripts/.
 .\" %ENDIF NOT OS Windows
-
-The return status of the executable is recorded by \fBsmartd\fP in
-SYSLOG. The executable is not expected to write to STDOUT or
-STDERR.  If it does, then this is interpreted as indicating that
+.Sp
+The exit status of the executable is recorded by \fBsmartd\fP in
+SYSLOG.
+The executable is not expected to write to STDOUT or STDERR.
+If it does, then this is interpreted as indicating that
 something is going wrong with your executable, and a fragment of this
 output is logged to SYSLOG to help you to understand the problem.
 Normally, if you wish to leave some record behind, the executable
 should send mail or write to a file or device.
-
+.Sp
 Before running the executable, \fBsmartd\fP sets a number of
 environment variables.  These environment variables may be used to
-control the executable\'s behavior.  The environment variables
+control the executable's behavior.  The environment variables
 exported by \fBsmartd\fP are:
 .RS 7
 .IP \fBSMARTD_MAILER\fP 4
-is set to the argument of \-M exec, if present or else to \'mail\'
+is set to the argument of \-M exec, if present or else to \*(Aqmail\*(Aq
 (examples: /usr/local/bin/mail, mail).
 .IP \fBSMARTD_DEVICE\fP 4
 is set to the device path (example: /dev/sda).
 .IP \fBSMARTD_DEVICETYPE\fP 4
-is set to the device type specified by \'-d\' directive or
-\'auto\' if none.
+is set to the device type specified by \*(Aq\-d\*(Aq directive or
+\*(Aqauto\*(Aq if none.
 .IP \fBSMARTD_DEVICESTRING\fP 4
-is set to the device description.  For SMARTD_DEVICETYPE of ata or
-scsi, this is the same as SMARTD_DEVICE.  For 3ware RAID controllers,
-the form used is \'/dev/sdc [3ware_disk_01]\'.  For HighPoint
-RocketRAID controller, the form is \'/dev/sdd [hpt_1/1/1]\' under Linux
-or \'/dev/hptrr [hpt_1/1/1]\' under FreeBSD.  For Areca controllers, the
-form is \'/dev/sg2 [areca_disk_09]\' on Linux or  \'/dev/arcmsr0 [areca_disk_09]\' on FreeBSD.  In these cases the device string
-contains a space and is NOT quoted.  So to use $SMARTD_DEVICESTRING in a
-shell script you should probably enclose it in double quotes.
+is set to the device description.
+It starts with SMARTD_DEVICE and may be followed by an optional controller
+identification (example: /dev/sda [SAT]).
+The string may contain a space and is NOT quoted.
 .IP \fBSMARTD_DEVICEINFO\fP 4
 is set to device identify information.  It includes most of the info printed
 by \fBsmartctl \-i\fP but uses a brief single line format.
@@ -1048,11 +1094,12 @@ one or more disk sectors could not be read.
 .br
 \fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
 .br
-\fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log failed.
+\fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log
+failed.
 .br
 \fIFailedOpenDevice\fP: the open() command to the device failed.
 .IP \fBSMARTD_ADDRESS\fP 4
-is determined by the address argument ADD of the \'\-m\' Directive.
+is determined by the address argument ADD of the \*(Aq\-m\*(Aq Directive.
 If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set.
 Otherwise, it is set to the comma-separated-list of email addresses
 given by the argument ADD, with the commas replaced by spaces
@@ -1067,17 +1114,18 @@ SMARTD_ADDRESS.
 .\" %ENDIF OS Windows
 .IP \fBSMARTD_MESSAGE\fP 4
 is set to the one sentence summary warning email message string from
-\fBsmartd\fP. 
-This message string contains space characters and is NOT quoted. So to
+\fBsmartd\fP.
+This message string contains space characters and is NOT quoted.  So to
 use $SMARTD_MESSAGE in a shell script you should probably enclose it in
 double quotes.
 .\" %IF NOT OS Windows
 .IP \fBSMARTD_FULLMESSAGE\fP 4
 is set to the contents of the entire email warning message string from
-\fBsmartd\fP. 
-This message string contains space and return characters and is NOT quoted. So to
-use $SMARTD_FULLMESSAGE in a shell script you should probably enclose it in
-double quotes.
+\fBsmartd\fP.
+This message string contains space and return characters and is NOT
+quoted.
+So to use $SMARTD_FULLMESSAGE in a shell script you should probably
+enclose it in double quotes.
 .\" %ENDIF NOT OS Windows
 .\" %IF OS Windows
 .IP \fBSMARTD_FULLMSGFILE\fP 4
@@ -1088,8 +1136,8 @@ the mailer or command exits.
 .\" %ENDIF OS Windows
 .IP \fBSMARTD_TFIRST\fP 4
 is a text string giving the time and date at which the first problem
-of this type was reported. This text string contains space characters
-and no newlines, and is NOT quoted. For example:
+of this type was reported.  This text string contains space characters
+and no newlines, and is NOT quoted.  For example:
 .br
 Sun Feb  9 14:58:19 2003 CST
 .IP \fBSMARTD_TFIRSTEPOCH\fP 4
@@ -1097,59 +1145,74 @@ is an integer, which is the unix epoch (number of seconds since Jan 1,
 1970) for \fBSMARTD_TFIRST\fP.
 .IP \fBSMARTD_PREVCNT\fP 4
 is an integer specifying the number of previous messages sent.
-It is set to \'0\' for the first message.
+It is set to \*(Aq0\*(Aq for the first message.
 .IP \fBSMARTD_NEXTDAYS\fP 4
 is an integer specifying the number of days until the next message will be sent.
-It it set to empty on \'\-M once\' and set to \'1\' on \'\-M daily\'.
+It it set to empty on \*(Aq\-M once\*(Aq and set to \*(Aq1\*(Aq on
+\*(Aq\-M daily\*(Aq.
 .RE
 .\"  The following two lines are a workaround for a man2html bug.  Please leave them.
 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
 .TP
 .B \&
-If the \'\-m ADD\' Directive is given with a normal address argument,
+If the \*(Aq\-m ADD\*(Aq Directive is given with a normal address argument,
 then the executable pointed to by PATH will be run in a shell with
 STDIN receiving the body of the email message, and with the same
 command-line arguments:
-.nf
--s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
-.fi
-that would normally be provided to \'mail\'.  Examples include:
-.nf
-.B -m user@home -M exec /usr/bin/mail
-.B -m admin@work -M exec /usr/local/bin/mailto
-.B -m root -M exec /Example_1/shell/script/below
-.fi
-
+.Vb 1
+\ \ \-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
+.Ve
+that would normally be provided to \*(Aqmail\*(Aq.  Examples include:
+.br
+.B \-m user@home \-M exec /usr/bin/mail
+.br
+.B \-m admin@work \-M exec /usr/local/bin/mailto
+.br
+.B \-m root \-M exec /Example_1/shell/script/below
+.Sp
 .\" %IF OS Windows
-[Windows only] On Windows, the syntax of the \'\fBBlat\fP\' mailer is
-used:
-.nf
-- -q -subject "%SMARTD_SUBJECT%" -to %SMARTD_ADDRCSV%
-.fi
-
+[Windows only] On Windows, the syntax of the \*(Aq\fBBlat\fP\*(Aq mailer is
+used (except for \*(Aq.ps1\*(Aq scripts):
+.Vb 1
+\ \ \- \-q \-subject "%SMARTD_SUBJECT%" \-to %SMARTD_ADDRCSV%
+.Ve
+.Sp
 .\" %ENDIF OS Windows
-If the \'\-m ADD\' Directive is given with the special address argument
+If the \*(Aq\-m ADD\*(Aq Directive is given with the special address argument
 .B <nomailer>
 then the executable pointed to by PATH is run in a shell with
 .B no
 STDIN and
 .B no
 command-line arguments, for example:
-.nf
-.B -m <nomailer> -M exec /Example_2/shell/script/below
-.fi
+.Vb 1
+\ \ \-m <nomailer> \-M exec /Example_2/shell/script/below
+.Ve
+.Sp
+.\" %IF OS Windows
+[Windows only]
+[NEW EXPERIMENTAL SMARTD FEATURE]
+If a PATH with extension \*(Aq.ps1\*(Aq is specified with \*(Aq\-M exec\*(Aq,
+the script is run as follows with no STDIN, regardless of \*(Aq\-m ADD\*(Aq
+setting:
+.Vb 2
+\ \ PowerShell -NoProfile -ExecutionPolicy Bypass ^
+\ \ \ \ \ \ \ \ \ \ \ \ \ -Command ^& \*(Aq%SMARTD_MAILER%\*(Aq
+.Ve
+.Sp
+.\" %ENDIF OS Windows
 If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP
 assumes that something is going wrong, and a snippet of that output
 will be copied to SYSLOG.  The remainder of the output is then
 discarded.
-
-Some EXAMPLES of scripts that can be used with the \'\-M exec\'
+.Sp
+Some EXAMPLES of scripts that can be used with the \*(Aq\-M exec\*(Aq
 Directive are given below.
 .\" %IF NOT OS Windows
 Some sample scripts are also included in
 /usr/local/share/doc/smartmontools/examplescripts/.
 .\" %ENDIF NOT OS Windows
-
+.Sp
 The executable is run by the script
 .\" %IF NOT OS Windows
 /usr/local/etc/smartd_warning.sh.
@@ -1175,7 +1238,7 @@ SMARTD_SUBJECT and SMARTD_FULLMESSAGE
 are set by the script before running the executable.
 .TP
 .B \-f
-[ATA only] Check for \'failure\' of any Usage Attributes.  If these
+[ATA only] Check for \*(Aqfailure\*(Aq of any Usage Attributes.  If these
 Attributes are less than or equal to the threshold, it does NOT indicate
 imminent disk failure.  It "indicates an advisory condition where the usage
 or age of the device has exceeded its intended design life period."
@@ -1183,28 +1246,29 @@ or age of the device has exceeded its intended design life period."
 .TP
 .B \-p
 [ATA only] Report anytime that a Prefail Attribute has changed
-its value since the last check. [Please see the
+its value since the last check.  [Please see the
 .B smartctl \-A
 command-line option.]
 .TP
 .B \-u
 [ATA only] Report anytime that a Usage Attribute has changed its value
-since the last check. [Please see the
+since the last check.  [Please see the
 .B smartctl \-A
 command-line option.]
 .TP
 .B \-t
-[ATA only] Equivalent to turning on the two previous flags \'\-p\' and \'\-u\'.
+[ATA only] Equivalent to turning on the two previous flags \*(Aq\-p\*(Aq
+and \*(Aq\-u\*(Aq.
 Tracks changes in \fIall\fP device Attributes (both Prefailure and
-Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
+Usage).  [Please see the \fBsmartctl\fP \-A command-line option.]
 .TP
 .B \-i ID
 [ATA only] Ignore device Attribute number \fBID\fP when checking for failure
 of Usage Attributes.  \fBID\fP must be a decimal integer in the range
-from 1 to 255.  This Directive modifies the behavior of the \'\-f\'
+from 1 to 255.  This Directive modifies the behavior of the \*(Aq\-f\*(Aq
 Directive and has no effect without it.
-
-This is useful, for example, if you have a very old disk and don\'t
+.Sp
+This is useful, for example, if you have a very old disk and don't
 want to keep getting messages about the hours-on-lifetime Attribute
 (usually Attribute 9) failing.  This Directive may appear multiple
 times for a single device, if you want to ignore multiple Attributes.
@@ -1212,12 +1276,12 @@ times for a single device, if you want to ignore multiple Attributes.
 .B \-I ID
 [ATA only] Ignore device Attribute \fBID\fP when tracking changes in the
 Attribute values.  \fBID\fP must be a decimal integer in the range
-from 1 to 255.  This Directive modifies the behavior of the \'\-p\',
-\'\-u\', and \'\-t\' tracking Directives and has no effect without one
-of them.
-
+from 1 to 255.  This Directive modifies the behavior of the \*(Aq\-p\*(Aq,
+\*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking Directives and has no effect
+without one of them.
+.Sp
 This is useful, for example, if one of the device Attributes is the disk
-temperature (usually Attribute 194 or 231). It\'s annoying to get reports
+temperature (usually Attribute 194 or 231).  It's annoying to get reports
 each time the temperature changes.  This Directive may appear multiple
 times for a single device, if you want to ignore multiple Attributes.
 .TP
@@ -1225,39 +1289,39 @@ times for a single device, if you want to ignore multiple Attributes.
 [ATA only] When tracking, report the \fIRaw\fP value of Attribute \fBID\fP
 along with its (normally reported) \fINormalized\fP value.  \fBID\fP must
 be a decimal integer in the range from 1 to 255.  This Directive modifies
-the behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives
-and has no effect without one of them.  This Directive may be given
-multiple times.
-
+the behavior of the \*(Aq\-p\*(Aq, \*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking
+Directives and has no effect without one of them.
+This Directive may be given multiple times.
+.Sp
 A common use of this Directive is to track the device Temperature
 (often ID=194 or 231).
-
-If the optional flag \'!\' is appended, a change of the Normalized
+.Sp
+If the optional flag \*(Aq!\*(Aq is appended, a change of the Normalized
 value is considered critical.  The report will be logged as LOG_CRIT
-and a warning email will be sent if \'\-m\' is specified.
+and a warning email will be sent if \*(Aq\-m\*(Aq is specified.
 .TP
 .B \-R ID[!]
 [ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute
 \fBID\fP changes.  (Normally \fBsmartd\fP only tracks/reports changes
 of the \fINormalized\fP Attribute values.)  \fBID\fP must be a decimal
 integer in the range from 1 to 255.  This Directive modifies the
-behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives and
-has no effect without one of them.  This Directive may be given
-multiple times.
-
-If this Directive is given, it automatically implies the \'\-r\'
+behavior of the \*(Aq\-p\*(Aq, \*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking
+Directives and has no effect without one of them.
+This Directive may be given multiple times.
+.Sp
+If this Directive is given, it automatically implies the \*(Aq\-r\*(Aq
 Directive for the same Attribute, so that the Raw value of the
 Attribute is reported.
-
+.Sp
 A common use of this Directive is to track the device Temperature
 (often ID=194 or 231).  It is also useful for understanding how
 different types of system behavior affects the values of certain
 Attributes.
-
-If the optional flag \'!\' is appended, a change of the Raw
+.Sp
+If the optional flag \*(Aq!\*(Aq is appended, a change of the Raw
 value is considered critical.  The report will be logged as
-LOG_CRIT and a warning email will be sent if \'\-m\' is specified.
-An example is \'-R 5!\' to warn when new sectors are reallocated.
+LOG_CRIT and a warning email will be sent if \*(Aq\-m\*(Aq is specified.
+An example is \*(Aq\-R 5!\*(Aq to warn when new sectors are reallocated.
 .TP
 .B \-C ID[+]
 [ATA only] Report if the current number of pending sectors is
@@ -1267,20 +1331,20 @@ value is the Current Pending Sector count.  The allowed range of
 ID\ =\ 0.  If the \fB\-C ID\fP option is not given, then it defaults to
 \fB\-C 197\fP (since Attribute 197 is generally used to monitor
 pending sectors).  If the name of this Attribute is changed by a
-\'\-v 197,FORMAT,NAME\' directive, the default is changed to
+\*(Aq\-v 197,FORMAT,NAME\*(Aq directive, the default is changed to
 \fB\-C 0\fP.
-
-If \'+\' is specified, a report is only printed if the number of sectors
-has increased between two check cycles. Some disks do not reset this
+.Sp
+If \*(Aq+\*(Aq is specified, a report is only printed if the number of sectors
+has increased between two check cycles.  Some disks do not reset this
 attribute when a bad sector is reallocated.
-See also \'\-v 197,increasing\' below.
-
+See also \*(Aq\-v 197,increasing\*(Aq below.
+.Sp
 The warning email counter is reset if the number of pending sectors
 dropped to 0.  This typically happens when all pending sectors have
 been reallocated or could be read again.
-
+.Sp
 A pending sector is a disk sector (containing 512 bytes of your data)
-which the device would like to mark as ``bad" and reallocate.
+which the device would like to mark as "bad" and reallocate.
 Typically this is because your computer tried to read that sector, and
 the read failed because the data on it has been corrupted and has
 inconsistent Error Checking and Correction (ECC) codes.  This is
@@ -1299,22 +1363,23 @@ value is the Offline Uncorrectable Sector count.  The allowed range of
 ID\ =\ 0.  If the \fB\-U ID\fP option is not given, then it defaults to
 \fB\-U 198\fP (since Attribute 198 is generally used to monitor
 offline uncorrectable sectors).  If the name of this Attribute is changed
-by a \'\-v 198,FORMAT,NAME\' (except \'\-v 198,FORMAT,Offline_Scan_UNC_SectCt\'),
-directive, the default is changed to \fB\-U 0\fP.
-
-If \'+\' is specified, a report is only printed if the number of sectors
-has increased since the last check cycle. Some disks do not reset this
+by a \*(Aq\-v 198,FORMAT,NAME\*(Aq (except
+\*(Aq\-v 198,FORMAT,Offline_Scan_UNC_SectCt\*(Aq), directive, the default
+is changed to \fB\-U 0\fP.
+.Sp
+If \*(Aq+\*(Aq is specified, a report is only printed if the number of sectors
+has increased since the last check cycle.  Some disks do not reset this
 attribute when a bad sector is reallocated.
-See also \'\-v 198,increasing\' below.
-
+See also \*(Aq\-v 198,increasing\*(Aq below.
+.Sp
 The warning email counter is reset if the number of offline uncorrectable
 sectors dropped to 0.  This typically happens when all offline uncorrectable
 sectors have been reallocated or could be read again.
-
+.Sp
 An offline uncorrectable sector is a disk sector which was not
 readable during an off-line scan or a self-test.  This is important
 to know, because if you have data stored in this disk sector, and you
-need to read it, the read will fail.  Please see the previous \'\-C\'
+need to read it, the read will fail.  Please see the previous \*(Aq\-C\*(Aq
 option for more details.
 .TP
 .B \-W DIFF[,INFO[,CRIT]]
@@ -1323,64 +1388,63 @@ degrees since last report, or if new min or max temperature is detected.
 Report or Warn if the temperature is greater or equal than one of
 \fBINFO\fP or \fBCRIT\fP degrees Celsius.
 If the limit \fBCRIT\fP is reached, a message with loglevel
-\fB\'LOG_CRIT\'\fP will be logged to syslog and a warning email
-will be send if \'\-m\' is specified. If only the limit \fBINFO\fP is
-reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
-
+\fB\*(AqLOG_CRIT\*(Aq\fP will be logged to syslog and a warning email
+will be send if \*(Aq\-m\*(Aq is specified.  If only the limit \fBINFO\fP is
+reached, a message with loglevel \fB\*(AqLOG_INFO\*(Aq\fP will be logged.
+.Sp
 The warning email counter is reset if the temperature dropped below
 \fBINFO\fP or \fBCRIT\fP-5 if \fBINFO\fP is not specified.
-
+.Sp
 If this directive is used in conjunction with state persistence
-(\'\-s\' option), the min and max temperature values are preserved
-across boot cycles. The minimum temperature value is not updated
+(\*(Aq\-s\*(Aq option), the min and max temperature values are preserved
+across boot cycles.  The minimum temperature value is not updated
 during the first 30 minutes after startup.
-
+.Sp
 To disable any of the 3 reports, set the corresponding limit to 0.
-Trailing zero arguments may be omitted. By default, all temperature
-reports are disabled (\'-W 0\').
-
+Trailing zero arguments may be omitted.  By default, all temperature
+reports are disabled (\*(Aq\-W 0\*(Aq).
+.Sp
 To track temperature changes of at least 2 degrees, use:
-.nf
+.br
 .B \-W 2
-.fi
+.br
 To log informal messages on temperatures of at least 40 degrees, use:
-.nf
+.br
 .B \-W 0,40
-.fi
+.br
 For warning messages/mails on temperatures of at least 45 degrees, use:
-.nf
+.br
 .B \-W 0,0,45
-.fi
+.br
 To combine all of the above reports, use:
-.nf
+.br
 .B \-W 2,40,45
-.fi
-
+.Sp
 For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius
-by default. This can be changed to Attribute 9 or 220 by the drive
-database or by the \'\-v 9,temp\' or \'\-v 220,temp\' directive.
-.\" %IF OS FreeBSD Linux Windows Cygwin
-
+by default.  This can be changed to Attribute 9 or 220 by the drive
+database or by the \*(Aq\-v 9,temp\*(Aq or \*(Aq\-v 220,temp\*(Aq directive.
+.\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
+.Sp
 [NEW EXPERIMENTAL SMARTD FEATURE]
 For NVMe devices, smartd checks the maximum of the Composite Temperature value
 and all Temperature Sensor values reported by SMART/Health Information log.
-.\" %ENDIF OS FreeBSD Linux Windows Cygwin
+.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
 .TP
 .B \-F TYPE
 [ATA only] Modifies the behavior of \fBsmartd\fP to compensate for some
 known and understood device firmware bug.  This directive may be used
 multiple times.  The valid arguments are:
-
+.Sp
 .I none
 \- Assume that the device firmware obeys the ATA specifications.  This
-is the default, unless the device has presets for \'\-F\' in the
+is the default, unless the device has presets for \*(Aq\-F\*(Aq in the
 drive database.  Using this directive will override any preset values.
-
+.Sp
 .I nologdir
 \- Suppresses read attempts of SMART or GP Log Directory.
 Support for all standard logs is assumed without an actual check.
 Some Intel SSDs may freeze if log address 0 is read.
-
+.Sp
 .I samsung
 \- In some Samsung disks (example: model SV4012H Firmware Version:
 RM100-08) some of the two- and four-byte quantities in the SMART data
@@ -1390,81 +1454,81 @@ in byte-reversed order.  Some signs that your disk needs this option
 are (1) no self-test log printed, even though you have run self-tests;
 (2) very large numbers of ATA errors reported in the ATA error log;
 (3) strange and impossible values for the ATA error log timestamps.
-
+.Sp
 .I samsung2
 \- In some Samsung disks the number of ATA errors reported is byte swapped.
 Enabling this option tells \fBsmartd\fP to evaluate this quantity in
 byte-reversed order.
-
+.Sp
 .I samsung3
 \- Some Samsung disks (at least SP2514N with Firmware VF100-37) report
 a self-test still in progress with 0% remaining when the test was already
-completed. If this directive is specified, \fBsmartd\fP will not skip the
-next scheduled self-test (see Directive \'\-s\' above) in this case.
-
+completed.  If this directive is specified, \fBsmartd\fP will not skip the
+next scheduled self-test (see Directive \*(Aq\-s\*(Aq above) in this case.
+.Sp
 .I xerrorlba
 \- This only affects \fBsmartctl\fP.
-
+.Sp
 [Please see the \fBsmartctl \-F\fP command-line option.]
 .TP
 .B \-v ID,FORMAT[:BYTEORDER][,NAME]
 [ATA only] Sets a vendor-specific raw value print FORMAT, an optional
 BYTEORDER and an optional NAME for Attribute ID.
 This directive may be used multiple times.
-Please see \fBsmartctl -v\fP command-line option for further details.
-
+Please see \fBsmartctl \-v\fP command-line option for further details.
+.Sp
 The following arguments affect smartd warning output:
-
+.Sp
 .I 197,increasing
 \- Raw Attribute number 197 (Current Pending Sector Count) is not
-reset if uncorrectable sectors are reallocated.  This sets \'-C 197+\'
-if no other \'-C\' directive is specified.
-
+reset if uncorrectable sectors are reallocated.  This sets \*(Aq\-C 197+\*(Aq
+if no other \*(Aq\-C\*(Aq directive is specified.
+.Sp
 .I 198,increasing
 \- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not
-reset if uncorrectable sectors are reallocated.  This sets \'-U 198+\'
-if no other \'-U\' directive is specified.
+reset if uncorrectable sectors are reallocated.  This sets \*(Aq\-U 198+\*(Aq
+if no other \*(Aq\-U\*(Aq directive is specified.
 .TP
 .B \-P TYPE
 [ATA only] Specifies whether \fBsmartd\fP should use any preset options
 that are available for this drive.
 The valid arguments to this Directive are:
-
+.Sp
 .I use
 \- use any presets that are available for this drive.  This is the default.
-
+.Sp
 .I ignore
 \- do not use any presets for this drive.
-
+.Sp
 .I show
 \- show the presets listed for this drive in the database.
-
+.Sp
 .I showall
 \- show the presets that are available for all drives and then exit.
-
+.Sp
 [Please see the
 .B smartctl \-P
 command-line option.]
 .TP
 .B \-a
-Equivalent to turning on all of the following Directives: 
-.B \'\-H\' 
+Equivalent to turning on all of the following Directives:
+.B \*(Aq\-H\*(Aq
 to check the SMART health status,
-.B \'\-f\' 
+.B \*(Aq\-f\*(Aq
 to report failures of Usage (rather than Prefail) Attributes,
-.B \'\-t\' 
+.B \*(Aq\-t\*(Aq
 to track changes in both Prefailure and Usage Attributes,
-.B \'\-l\ error\'
+.B \*(Aq\-l\ error\*(Aq
 to report increases in the number of ATA errors,
-.B \'\-l\ selftest\'
+.B \*(Aq\-l\ selftest\*(Aq
 to report increases in the number of Self-Test Log errors,
-.B \'\-l\ selfteststs\'
+.B \*(Aq\-l\ selfteststs\*(Aq
 to report changes of Self-Test execution status,
-.B \'\-C 197\'
+.B \*(Aq\-C 197\*(Aq
 to report nonzero values of the current pending sector count, and
-.B \'\-U 198\'
+.B \*(Aq\-U 198\*(Aq
 to report nonzero values of the offline pending sector count.
-
+.Sp
 Note that \-a is the default for ATA devices.  If none of these other
 Directives is given, then \-a is assumed.
 .TP
@@ -1483,92 +1547,103 @@ to see what SMART functionality your disk(s) support(s).  If you do
 not like voluminous syslog messages, a good choice of
 \fBsmartd\fP
 configuration file Directives might be:
-.nf
-.B \-H \-l\ selftest \-l\ error \-f.
-.fi
-If you want more frequent information, use:
-.B -a.
-
+.br
+\fB\-H \-l selftest \-l error \-f\fP.
+.br
+If you want more frequent information, use: \fB\-a\fP.
+.Sp
 .TP
 .B ADDITIONAL DETAILS ABOUT DEVICESCAN
 If a non-comment entry in the configuration file is the text
 string \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
 ignore any remaining lines in the configuration file, and will scan
 for devices (see also \fBsmartd\fP(8) man page).
-
+.Sp
 If \fBDEVICESCAN\fP is not followed by any Directives, then smartd
 will scan for both ATA and SCSI devices, and will monitor all possible
 SMART properties of any devices that are found.
-
+.Sp
 \fBDEVICESCAN\fP may optionally be followed by any valid Directives,
 which will be applied to all devices that are found in the scan.  For
 example
-.nf
-.B DEVICESCAN -m root@example.com
-.fi
+.br
+.B DEVICESCAN \-m root@example.com
+.br
 will scan for all devices, and then monitor them.  It will send one
 email warning per device for any problems that are found.
-.nf
-.B  DEVICESCAN -d ata -m root@example.com
-.fi
-will do the same, but restricts the scan to ATA devices only.  
-.nf
-.B  DEVICESCAN -H -d ata -m root@example.com
-.fi
+.br
+.B  DEVICESCAN \-d ata \-m root@example.com
+.br
+will do the same, but restricts the scan to ATA devices only.
+.br
+.B  DEVICESCAN \-H \-d ata \-m root@example.com
+.br
 will do the same, but only monitors the SMART health status of the
 devices, (rather than the default \-a, which monitors all SMART
 properties).
 .br
 [NEW EXPERIMENTAL SMARTD FEATURE]
-Multiple \'\-d TYPE\' options may be specified with DEVICESCAN
+Multiple \*(Aq\-d TYPE\*(Aq options may be specified with DEVICESCAN
 to combine the scan results of more than one TYPE.
-
-Configuration entries for specific devices may precede the \fBDEVICESCAN\fP entry.
+.Sp
+Configuration entries for specific devices may precede the \fBDEVICESCAN\fP
+entry.
 For example
-.nf
-.B  DEFAULT -m root@example.com
-.B  /dev/sda -s S/../.././02
-.B  /dev/sdc -d ignore
-.B  DEVICESCAN -s L/../.././02
-.fi
-will scan for all devices except /dev/sda and /dev/sdc, monitor them, and run a long
-test between 2-3am every morning.  Device /dev/sda will also be monitored, but
-only a short test will be run.  Device /dev/sdc will be ignored.
+.br
+.B  DEFAULT \-m root@example.com
+.br
+.B  /dev/sda \-s S/../.././02
+.br
+.B  /dev/sdc \-d ignore
+.br
+.B  DEVICESCAN \-s L/../.././02
+.br
+will scan for all devices except /dev/sda and /dev/sdc, monitor them, and
+run a long test between 2\(en3 am every morning.
+Device /dev/sda will also be monitored, but only a short test will be run.
+Device /dev/sdc will be ignored.
 Warning emails will be sent for all monitored devices.
-
+.Sp
+A device is ignored by DEVICESCAN if a configuration line with the same
+device name exists.
+.br
+[NEW EXPERIMENTAL SMARTD FEATURE]
+A device name is also ignored if another device with same identify
+information (vendor, model, firmware version, serial number, WWN) already
+exists.
+.Sp
 .TP
-.B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
-These are two examples of shell scripts that can be used with the \'\-M
-exec PATH\' Directive described previously.  The paths to these scripts
-and similar executables is the PATH argument to the \'\-M exec PATH\'
+.B EXAMPLES OF SHELL SCRIPTS FOR \*(Aq\-M exec\*(Aq
+These are two examples of shell scripts that can be used with the \*(Aq\-M
+exec PATH\*(Aq Directive described previously.  The paths to these scripts
+and similar executables is the PATH argument to the \*(Aq\-M exec PATH\*(Aq
 Directive.
-
-Example 1: This script is for use with \'\-m ADDRESS -M exec PATH\'.  It appends
-the output of
-.B smartctl -a
+.Sp
+Example 1: This script is for use with \*(Aq\-m ADDRESS \-M exec PATH\*(Aq.
+It appends the output of
+.B smartctl \-a
 to the output of the smartd email warning message and sends it to ADDRESS.
-
-.nf
-\fB
+.Sp
+.Vb 4
 #! /bin/sh
 
 # Save the email message (STDIN) to a file:
 cat > /root/msg
 
-# Append the output of smartctl -a to the message:
-/usr/local/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
-# Now email the message to the user at address ADD:
-/usr/bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
-\fP
-.fi
+# Append the output of smartctl \-a to the message:
+/usr/local/sbin/smartctl \-a \-d $SMART_DEVICETYPE \e
+  $SMARTD_DEVICE >> /root/msg
 
-Example 2: This script is for use with \'\-m <nomailer> \-M exec
-PATH\'. It warns all users about a disk problem, waits 30 seconds, and
+# Now email the message to the user at address ADD:
+/usr/bin/mail \-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS \e
+  < /root/msg
+.Ve
+.Sp
+Example 2: This script is for use with \*(Aq\-m <nomailer> \-M exec
+PATH\*(Aq.  It warns all users about a disk problem, waits 30 seconds, and
 then powers down the machine.
-
-.nf
-\fB
+.Sp
+.Vb 4
 #! /bin/sh
 
 # Warn all users of a problem
@@ -1582,35 +1657,34 @@ EOF
 sleep 30
 
 # Power down the machine
-/sbin/shutdown -hf now
-\fP
-.fi
-
+/sbin/shutdown \-hf now
+.Ve
+.Sp
 Some example scripts are distributed with the smartmontools package,
 in /usr/local/share/doc/smartmontools/examplescripts/.
-
+.Sp
 Please note that these scripts typically run as root, so any files
 that they read/write should not be writable by ordinary users or
 reside in directories like /tmp that are writable by ordinary users
 and may expose your system to symlink attacks.
-
+.Sp
 As previously described, if the scripts write to STDOUT or STDERR,
 this is interpreted as indicating that there was an internal error
 within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
 The remainder is flushed.
-
+.Sp
 .\" %IF NOT OS Windows
 .SH FILES
 .TP
 .B /usr/local/etc/smartd.conf
 full path of this file.
-
+.Sp
 .\" %ENDIF NOT OS Windows
 .SH SEE ALSO
 \fBsmartd\fP(8), \fBsmartctl\fP(8),
 \fBmail\fP(1), \fBregex\fP(7).
-
+.Sp
 .SH PACKAGE VERSION
 CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
 .br
-$Id: smartd.conf.5.in 4307 2016-04-24 12:37:31Z chrfranke $
+$Id: smartd.conf.5.in 4589 2017-11-04 15:30:54Z chrfranke $
index 99e0c23762a3cc8daaf686a28fae584a0cf9dacb..2f1cdc86bd97ea3b2ecb61d91b22b52b7efc0f40 100644 (file)
@@ -2,7 +2,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-11 Bruce Allen
- * Copyright (C) 2008-16 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 2000    Michael Cornwell <cornwell@acm.org>
  * Copyright (C) 2008    Oliver Bock <brevilo@users.sourceforge.net>
  *
@@ -100,7 +100,7 @@ typedef int pid_t;
 #define SIGQUIT_KEYNAME "CONTROL-\\"
 #endif // _WIN32
 
-const char * smartd_cpp_cvsid = "$Id: smartd.cpp 4308 2016-04-24 13:36:10Z chrfranke $"
+const char * smartd_cpp_cvsid = "$Id: smartd.cpp 4556 2017-10-15 17:31:30Z chrfranke $"
   CONFIG_H_CVSID;
 
 using namespace smartmontools;
@@ -157,7 +157,11 @@ static std::string configfile_alt;
 static std::string warning_script;
 
 // command-line: when should we exit?
-static int quit=0;
+enum quit_t {
+  QUIT_NODEV, QUIT_NODEVSTARTUP, QUIT_NEVER, QUIT_ONECHECK,
+  QUIT_SHOWTESTS, QUIT_ERRORS
+};
+static quit_t quit = QUIT_NODEV;
 
 // command-line; this is the default syslog(3) log facility to use.
 static int facility=LOG_DAEMON;
@@ -238,6 +242,7 @@ struct dev_config
   std::string state_file;                 // Path of the persistent state file, empty if none
   std::string attrlog_file;               // Path of the persistent attrlog file, empty if none
   bool ignore;                            // Ignore this entry
+  bool id_is_unique;                      // True if dev_idinfo is unique (includes S/N or WWN)
   bool smartcheck;                        // Check SMART status
   bool usagefailed;                       // Check for failed Usage Attributes
   bool prefail;                           // Track changes in Prefail Attributes
@@ -277,6 +282,7 @@ struct dev_config
   int set_standby; // set(1..255->0..254) standby timer
   bool set_security_freeze; // Freeze ATA security
   int set_wcache; // disable(-1), enable(1) write cache
+  int set_dsn; // disable(0x2), enable(0x1) DSN
 
   bool sct_erc_set;                       // set SCT ERC to:
   unsigned short sct_erc_readtime;        // ERC read time (deciseconds)
@@ -297,6 +303,7 @@ struct dev_config
 dev_config::dev_config()
 : lineno(0),
   ignore(false),
+  id_is_unique(false),
   smartcheck(false),
   usagefailed(false),
   prefail(false),
@@ -324,7 +331,7 @@ dev_config::dev_config()
   set_lookahead(0),
   set_standby(0),
   set_security_freeze(false),
-  set_wcache(0),
+  set_wcache(0), set_dsn(0),
   sct_erc_set(false),
   sct_erc_readtime(0), sct_erc_writetime(0),
   curr_pending_id(0), offl_pending_id(0),
@@ -429,6 +436,8 @@ struct temp_dev_state
   unsigned char temperature;              // last recorded Temperature (in Celsius)
   time_t tempmin_delay;                   // time where Min Temperature tracking will start
 
+  bool removed;                           // true if open() failed for removable device
+
   bool powermodefail;                     // true if power mode check failed
   int powerskipcnt;                       // Number of checks skipped due to idle or standby mode
   int lastpowermodeskipped;               // the last power mode that was skipped
@@ -462,6 +471,7 @@ temp_dev_state::temp_dev_state()
   not_cap_selective(false),
   temperature(0),
   tempmin_delay(0),
+  removed(false),
   powermodefail(false),
   powerskipcnt(0),
   lastpowermodeskipped(0),
@@ -794,8 +804,8 @@ static bool write_dev_attrlog(const char * path, const dev_state & state)
     fprintf(f, "\tnon-medium-errors;%" PRIu64 ";", state.scsi_nonmedium_error.nme.counterPC0);
   }
   // write SCSI current temperature if it is monitored
-  if(state.TempPageSupported && state.temperature)
-     fprintf(f, "\ttemperature;%d;", state.temperature);
+  if (state.temperature)
+    fprintf(f, "\ttemperature;%d;", state.temperature);
   // end of line
   fprintf(f, "\n");
   return true;
@@ -1081,7 +1091,7 @@ static void MailWarning(const dev_config & cfg, dev_state & state, int which, co
   if (!(pfp=popen(command, "r")))
     // failed to popen() mail process
     PrintOut(LOG_CRIT,"%s %s to %s: failed (fork or pipe failed, or no memory) %s\n", 
-            newwarn,  executable, newadd, errno?strerror(errno):"");
+             newwarn,  executable, newadd, errno?strerror(errno):"");
   else {
     // pipe suceeded!
     int len, status;
@@ -1093,50 +1103,50 @@ static void MailWarning(const dev_config & cfg, dev_state & state, int which, co
       int newlen = len<EBUFLEN ? len : EBUFLEN-1;
       buffer[newlen]='\0';
       PrintOut(LOG_CRIT,"%s %s to %s produced unexpected output (%s%d bytes) to STDOUT/STDERR: \n%s\n", 
-              newwarn, executable, newadd, len!=newlen?"here truncated to ":"", newlen, buffer);
+               newwarn, executable, newadd, len!=newlen?"here truncated to ":"", newlen, buffer);
       
       // flush pipe if needed
       while (fread(buffer, 1, EBUFLEN, pfp) && count<EBUFLEN)
-       count++;
+        count++;
 
       // tell user that pipe was flushed, or that something is really wrong
       if (count && count<EBUFLEN)
-       PrintOut(LOG_CRIT,"%s %s to %s: flushed remaining STDOUT/STDERR\n", 
-                newwarn, executable, newadd);
+        PrintOut(LOG_CRIT,"%s %s to %s: flushed remaining STDOUT/STDERR\n",
+                 newwarn, executable, newadd);
       else if (count)
-       PrintOut(LOG_CRIT,"%s %s to %s: more than 1 MB STDOUT/STDERR flushed, breaking pipe\n", 
-                newwarn, executable, newadd);
+        PrintOut(LOG_CRIT,"%s %s to %s: more than 1 MB STDOUT/STDERR flushed, breaking pipe\n",
+                 newwarn, executable, newadd);
     }
     
     // if something went wrong with mail process, print warning
     errno=0;
     if (-1==(status=pclose(pfp)))
       PrintOut(LOG_CRIT,"%s %s to %s: pclose(3) failed %s\n", newwarn, executable, newadd,
-              errno?strerror(errno):"");
+               errno?strerror(errno):"");
     else {
       // mail process apparently succeeded. Check and report exit status
       if (WIFEXITED(status)) {
-       // exited 'normally' (but perhaps with nonzero status)
+        // exited 'normally' (but perhaps with nonzero status)
         int status8 = WEXITSTATUS(status);
-       if (status8>128)  
-         PrintOut(LOG_CRIT,"%s %s to %s: failed (32-bit/8-bit exit status: %d/%d) perhaps caught signal %d [%s]\n", 
-                  newwarn, executable, newadd, status, status8, status8-128, strsignal(status8-128));
-       else if (status8)  
-         PrintOut(LOG_CRIT,"%s %s to %s: failed (32-bit/8-bit exit status: %d/%d)\n", 
-                  newwarn, executable, newadd, status, status8);
-       else
-         PrintOut(LOG_INFO,"%s %s to %s: successful\n", newwarn, executable, newadd);
+        if (status8>128)
+          PrintOut(LOG_CRIT,"%s %s to %s: failed (32-bit/8-bit exit status: %d/%d) perhaps caught signal %d [%s]\n",
+                   newwarn, executable, newadd, status, status8, status8-128, strsignal(status8-128));
+        else if (status8)
+          PrintOut(LOG_CRIT,"%s %s to %s: failed (32-bit/8-bit exit status: %d/%d)\n",
+                   newwarn, executable, newadd, status, status8);
+        else
+          PrintOut(LOG_INFO,"%s %s to %s: successful\n", newwarn, executable, newadd);
       }
       
       if (WIFSIGNALED(status))
-       PrintOut(LOG_INFO,"%s %s to %s: exited because of uncaught signal %d [%s]\n", 
-                newwarn, executable, newadd, WTERMSIG(status), strsignal(WTERMSIG(status)));
+        PrintOut(LOG_INFO,"%s %s to %s: exited because of uncaught signal %d [%s]\n",
+                 newwarn, executable, newadd, WTERMSIG(status), strsignal(WTERMSIG(status)));
       
       // this branch is probably not possible. If subprocess is
       // stopped then pclose() should not return.
       if (WIFSTOPPED(status)) 
-       PrintOut(LOG_CRIT,"%s %s to %s: process STOPPED because it caught signal %d [%s]\n",
-                newwarn, executable, newadd, WSTOPSIG(status), strsignal(WSTOPSIG(status)));
+        PrintOut(LOG_CRIT,"%s %s to %s: process STOPPED because it caught signal %d [%s]\n",
+                 newwarn, executable, newadd, WSTOPSIG(status), strsignal(WSTOPSIG(status)));
       
     }
   }
@@ -1199,6 +1209,7 @@ static void reset_warning_mail(const dev_config & cfg, dev_state & state, int wh
 #ifndef _WIN32
 
 // Output multiple lines via separate syslog(3) calls.
+__attribute_format_printf(2, 0)
 static void vsyslog_lines(int priority, const char * fmt, va_list ap)
 {
   char buf[512+EBUFLEN]; // enough space for exec cmd output in MailWarning()
@@ -1289,19 +1300,19 @@ void checksumwarning(const char * string)
 // that the daemon is really up and running and has a pid to kill it
 static bool WaitForPidFile()
 {
-    int waited, max_wait = 10;
-    struct stat stat_buf;
+  int waited, max_wait = 10;
+  struct stat stat_buf;
 
-    if (pid_file.empty() || debugmode)
-       return true;
+  if (pid_file.empty() || debugmode)
+    return true;
 
-    for(waited = 0; waited < max_wait; ++waited) {
-       if (!stat(pid_file.c_str(), &stat_buf)) {
-               return true;
-       } else
-               sleep(1);
-    }
-    return false;
+  for(waited = 0; waited < max_wait; ++waited) {
+    if (!stat(pid_file.c_str(), &stat_buf)) {
+      return true;
+    } else
+      sleep(1);
+  }
+  return false;
 }
 
 #endif // _WIN32
@@ -1313,14 +1324,13 @@ static bool WaitForPidFile()
 static void DaemonInit()
 {
 #ifndef _WIN32
-  pid_t pid;
-  int i;  
 
   // flush all buffered streams.  Else we might get two copies of open
   // streams since both parent and child get copies of the buffers.
   fflush(NULL);
 
   if (do_fork) {
+    pid_t pid;
     if ((pid=fork()) < 0) {
       // unable to fork!
       PrintOut(LOG_CRIT,"smartd unable to fork daemon process!\n");
@@ -1330,7 +1340,7 @@ static void DaemonInit()
       // we are the parent process, wait for pid file, then exit cleanly
       if(!WaitForPidFile()) {
         PrintOut(LOG_CRIT,"PID file %s didn't show up!\n", pid_file.c_str());
-       EXIT(EXIT_STARTUP);
+        EXIT(EXIT_STARTUP);
       } else
         EXIT(0);
     }
@@ -1352,21 +1362,16 @@ static void DaemonInit()
   }
 
   // close any open file descriptors
-  for (i=getdtablesize();i>=0;--i)
+  for (int i = getdtablesize(); --i >= 0; )
     close(i);
   
-#define NO_warn_unused_result(cmd) { if (cmd) {} ; }
-
-  // redirect any IO attempts to /dev/null for stdin
-  i=open("/dev/null",O_RDWR);
-  if (i>=0) {
-    // stdout
-    NO_warn_unused_result(dup(i));
-    // stderr
-    NO_warn_unused_result(dup(i));
-  };
+  // redirect any IO attempts to /dev/null and change to root directory
+  int fd = open("/dev/null", O_RDWR);
+  if (!(fd == 0 && dup(fd) == 1 && dup(fd) == 2 && !chdir("/"))) {
+    PrintOut(LOG_CRIT, "smartd unable to redirect to /dev/null or to chdir to root!\n");
+    EXIT(EXIT_STARTUP);
+  }
   umask(0022);
-  NO_warn_unused_result(chdir("/"));
 
   if (do_fork)
     PrintOut(LOG_INFO, "smartd has fork()ed into background mode. New PID=%d.\n", (int)getpid());
@@ -1431,8 +1436,8 @@ static void Directives()
            "  -l TYPE Monitor SMART log or self-test status:\n"
            "          error, selftest, xerror, offlinests[,ns], selfteststs[,ns]\n"
            "  -l scterc,R,W  Set SCT Error Recovery Control\n"
-           "  -e      Change device setting: aam,[N|off], apm,[N|off], lookahead,[on|off],\n"
-           "          security-freeze, standby,[N|off], wcache,[on|off]\n"
+           "  -e      Change device setting: aam,[N|off], apm,[N|off], dsn,[on|off],\n"
+           "          lookahead,[on|off], security-freeze, standby,[N|off], wcache,[on|off]\n"
            "  -f      Monitor 'Usage' Attributes, report failures\n"
            "  -m ADD  Send email warning to address ADD\n"
            "  -M TYPE Modify email warning behavior (see man page)\n"
@@ -1469,6 +1474,8 @@ static const char *GetValidArgList(char opt)
   case 'A':
   case 's':
     return "<PATH_PREFIX>";
+  case 'B':
+    return "[+]<FILE_NAME>";
   case 'c':
     return "<FILE_NAME>, -";
   case 'l':
@@ -1477,7 +1484,6 @@ static const char *GetValidArgList(char opt)
     return "nodev, errors, nodevstartup, never, onecheck, showtests";
   case 'r':
     return "ioctl[,N], ataioctl[,N], scsiioctl[,N], nvmeioctl[,N]";
-  case 'B':
   case 'p':
   case 'w':
     return "<FILE_NAME>";
@@ -1744,12 +1750,32 @@ static void format_set_result_msg(std::string & msg, const char * name, bool ok,
     msg += ":on";
 }
 
+// Return true and print message if CFG.dev_idinfo is already in PREV_CFGS
+static bool is_duplicate_dev_idinfo(const dev_config & cfg, const dev_config_vector & prev_cfgs)
+{
+  if (!cfg.id_is_unique)
+    return false;
+
+  for (unsigned i = 0; i < prev_cfgs.size(); i++) {
+    if (!prev_cfgs[i].id_is_unique)
+      continue;
+    if (cfg.dev_idinfo != prev_cfgs[i].dev_idinfo.c_str())
+      continue;
+
+    PrintOut(LOG_INFO, "Device: %s, same identity as %s, ignored\n",
+             cfg.dev_name.c_str(), prev_cfgs[i].dev_name.c_str());
+    return true;
+  }
+
+  return false;
+}
 
 // TODO: Add '-F swapid' directive
 const bool fix_swapped_id = false;
 
 // scan to see what ata devices there are, and if they support SMART
-static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atadev)
+static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atadev,
+                         const dev_config_vector * prev_cfgs)
 {
   int supported=0;
   struct ata_identify_device drive;
@@ -1791,9 +1817,16 @@ static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atade
   char cap[32];
   cfg.dev_idinfo = strprintf("%s, S/N:%s, %sFW:%s, %s", model, serial, wwn, firmware,
                      format_capacity(cap, sizeof(cap), sizes.capacity, "."));
+  cfg.id_is_unique = true; // TODO: Check serial?
 
   PrintOut(LOG_INFO, "Device: %s, %s\n", name, cfg.dev_idinfo.c_str());
 
+  // Check for duplicates
+  if (prev_cfgs && is_duplicate_dev_idinfo(cfg, *prev_cfgs)) {
+    CloseDevice(atadev, name);
+    return 1;
+  }
+
   // Show if device in database, and use preset vendor attribute
   // options unless user has requested otherwise.
   if (cfg.ignorepresets)
@@ -2079,7 +2112,7 @@ static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atade
         && powermode!=0x80 && powermode!=0x81 && powermode!=0x82 && powermode!=0x83
         && powermode!=0xff) {
       PrintOut(LOG_CRIT, "Device: %s, CHECK POWER STATUS returned %d, not ATA compliant, ignoring -n Directive\n",
-              name, powermode);
+               name, powermode);
       cfg.powermode=0;
     }
   }
@@ -2106,6 +2139,10 @@ static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atade
     format_set_result_msg(msg, "Wr-cache", ata_set_features(atadev,
       (cfg.set_wcache > 0? ATA_ENABLE_WRITE_CACHE : ATA_DISABLE_WRITE_CACHE)), cfg.set_wcache);
 
+  if (cfg.set_dsn)
+    format_set_result_msg(msg, "DSN", ata_set_features(atadev,
+      ATA_ENABLE_DISABLE_DSN, (cfg.set_dsn > 0 ? 0x1 : 0x2)));
+
   if (cfg.set_security_freeze)
     format_set_result_msg(msg, "Security freeze",
       ata_nodata_command(atadev, ATA_SECURITY_FREEZE_LOCK));
@@ -2174,7 +2211,8 @@ static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atade
 
 // on success, return 0. On failure, return >0.  Never return <0,
 // please.
-static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scsidev)
+static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scsidev,
+                          const dev_config_vector * prev_cfgs)
 {
   int err, req_len, avail_len, version, len;
   const char *device = cfg.name.c_str();
@@ -2192,17 +2230,17 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
     req_len = 64;
     if ((err = scsiStdInquiry(scsidev, inqBuf, req_len))) {
       PrintOut(LOG_INFO, "Device: %s, Both 36 and 64 byte INQUIRY failed; "
-              "skip device\n", device);
+               "skip device\n", device);
       return 2;
     }
   }
-  version = (inqBuf[2] & 0x7f);        /* Accept old ISO/IEC 9316:1995 variants */
+  version = (inqBuf[2] & 0x7f); /* Accept old ISO/IEC 9316:1995 variants */
 
   avail_len = inqBuf[4] + 5;
   len = (avail_len < req_len) ? avail_len : req_len;
   if (len < 36) {
     PrintOut(LOG_INFO, "Device: %s, INQUIRY response less than 36 bytes; "
-            "skip device\n", device);
+             "skip device\n", device);
     return 2;
   }
 
@@ -2225,17 +2263,17 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
   if ((version >= 0x3) && (version < 0x8)) {
     /* SPC to SPC-5 */
     if (0 == scsiInquiryVpd(scsidev, SCSI_VPD_DEVICE_IDENTIFICATION,
-                           vpdBuf, sizeof(vpdBuf))) {
+                            vpdBuf, sizeof(vpdBuf))) {
       len = vpdBuf[3];
       scsi_decode_lu_dev_id(vpdBuf + 4, len, lu_id, sizeof(lu_id), NULL);
     }
   }
   serial[0] = '\0';
   if (0 == scsiInquiryVpd(scsidev, SCSI_VPD_UNIT_SERIAL_NUMBER,
-                         vpdBuf, sizeof(vpdBuf))) {
-         len = vpdBuf[3];
-         vpdBuf[4 + len] = '\0';
-         scsi_format_id_string(serial, (const unsigned char *)&vpdBuf[4], len);
+                          vpdBuf, sizeof(vpdBuf))) {
+          len = vpdBuf[3];
+          vpdBuf[4 + len] = '\0';
+          scsi_format_id_string(serial, (const unsigned char *)&vpdBuf[4], len);
   }
 
   unsigned int lb_size;
@@ -2253,12 +2291,19 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
                      (lu_id[0] ? ", lu id: " : ""), (lu_id[0] ? lu_id : ""),
                      (serial[0] ? ", S/N: " : ""), (serial[0] ? serial : ""),
                      (si_str[0] ? ", " : ""), (si_str[0] ? si_str : ""));
-  
+  cfg.id_is_unique = (lu_id[0] || serial[0]);
+
   // format "model" string
   scsi_format_id_string(vendor, (const unsigned char *)&inqBuf[8], 8);
   scsi_format_id_string(model, (const unsigned char *)&inqBuf[16], 16);
   PrintOut(LOG_INFO, "Device: %s, %s\n", device, cfg.dev_idinfo.c_str());
 
+  // Check for duplicates
+  if (prev_cfgs && is_duplicate_dev_idinfo(cfg, *prev_cfgs)) {
+    CloseDevice(scsidev, device);
+    return 1;
+  }
+
   // check that device is ready for commands. IE stores its stuff on
   // the media.
   if ((err = scsiTestUnitReady(scsidev))) {
@@ -2296,7 +2341,7 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
   // smart if it is off). This may change to be the same as the ATA side.
   if (!scsi_IsExceptionControlEnabled(&iec)) {
     PrintOut(LOG_INFO, "Device: %s, IE (SMART) not enabled, skip device\n"
-                      "Try 'smartctl -s on %s' to turn on SMART features\n", 
+                       "Try 'smartctl -s on %s' to turn on SMART features\n",
                         device, device);
     CloseDevice(scsidev, device);
     return 3;
@@ -2345,11 +2390,12 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
                     &asc, &ascq, &currenttemp, &triptemp)) {
       PrintOut(LOG_INFO, "Device: %s, unexpectedly failed to read SMART values\n", device);
       state.SuppressReport = 1;
-      if (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit) {
-        PrintOut(LOG_INFO, "Device: %s, can't monitor Temperature, ignoring -W %d,%d,%d\n",
-                 device, cfg.tempdiff, cfg.tempinfo, cfg.tempcrit);
-        cfg.tempdiff = cfg.tempinfo = cfg.tempcrit = 0;
-      }
+    }
+    if (   (state.SuppressReport || !currenttemp)
+        && (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit)) {
+      PrintOut(LOG_INFO, "Device: %s, can't monitor Temperature, ignoring -W %d,%d,%d\n",
+               device, cfg.tempdiff, cfg.tempinfo, cfg.tempcrit);
+      cfg.tempdiff = cfg.tempinfo = cfg.tempcrit = 0;
     }
   }
   
@@ -2442,7 +2488,8 @@ static int nvme_get_max_temp_kelvin(const nvme_smart_log & smart_log)
   return k;
 }
 
-static int NVMeDeviceScan(dev_config & cfg, dev_state & state, nvme_device * nvmedev)
+static int NVMeDeviceScan(dev_config & cfg, dev_state & state, nvme_device * nvmedev,
+                          const dev_config_vector * prev_cfgs)
 {
   const char *name = cfg.name.c_str();
 
@@ -2472,9 +2519,16 @@ static int NVMeDeviceScan(dev_config & cfg, dev_state & state, nvme_device * nvm
     format_capacity(capstr, sizeof(capstr), capacity, ".");
   cfg.dev_idinfo = strprintf("%s, S/N:%s, FW:%s%s%s%s", model, serial, firmware,
                              nsstr, (capstr[0] ? ", " : ""), capstr);
+  cfg.id_is_unique = true; // TODO: Check serial?
 
   PrintOut(LOG_INFO, "Device: %s, %s\n", name, cfg.dev_idinfo.c_str());
 
+  // Check for duplicates
+  if (prev_cfgs && is_duplicate_dev_idinfo(cfg, *prev_cfgs)) {
+    CloseDevice(nvmedev, name);
+    return 1;
+  }
+
   // Read SMART/Health log
   nvme_smart_log smart_log;
   if (!nvme_read_smart_log(nvmedev, smart_log)) {
@@ -2530,6 +2584,68 @@ static int NVMeDeviceScan(dev_config & cfg, dev_state & state, nvme_device * nvm
   return 0;
 }
 
+// Open device for next check, return false on error
+static bool open_device(const dev_config & cfg, dev_state & state, smart_device * device,
+                        const char * type)
+{
+  const char * name = cfg.name.c_str();
+
+  // If user has asked, test the email warning system
+  if (cfg.emailtest)
+    MailWarning(cfg, state, 0, "TEST EMAIL from smartd for device: %s", name);
+
+  // User may have requested (with the -n Directive) to leave the disk
+  // alone if it is in idle or standby mode.  In this case check the
+  // power mode first before opening the device for full access,
+  // and exit without check if disk is reported in standby.
+  if (device->is_ata() && cfg.powermode && !state.powermodefail && !state.removed) {
+    // Note that 'is_powered_down()' handles opening the device itself, and
+    // can be used before calling 'open()' (that's the whole point of 'is_powered_down()'!).
+    if (device->is_powered_down())
+    {
+      // skip at most powerskipmax checks
+      if (!cfg.powerskipmax || state.powerskipcnt<cfg.powerskipmax) {
+        // report first only except if state has changed, avoid waking up system disk
+        if ((!state.powerskipcnt || state.lastpowermodeskipped != -1) && !cfg.powerquiet) {
+          PrintOut(LOG_INFO, "Device: %s, is in %s mode, suspending checks\n", name, "STANDBY (OS)");
+          state.lastpowermodeskipped = -1;
+        }
+        state.powerskipcnt++;
+        return false;
+      }
+    }
+  }
+
+  // if we can't open device, fail gracefully rather than hard --
+  // perhaps the next time around we'll be able to open it
+  if (!device->open()) {
+    // For removable devices, print error message only once and suppress email
+    if (!cfg.removable) {
+      PrintOut(LOG_INFO, "Device: %s, open() of %s device failed: %s\n", name, type, device->get_errmsg());
+      MailWarning(cfg, state, 9, "Device: %s, unable to open %s device", name, type);
+    }
+    else if (!state.removed) {
+      PrintOut(LOG_INFO, "Device: %s, removed %s device: %s\n", name, type, device->get_errmsg());
+      state.removed = true;
+    }
+    else if (debugmode)
+      PrintOut(LOG_INFO, "Device: %s, %s device still removed: %s\n", name, type, device->get_errmsg());
+    return false;
+  }
+
+  if (debugmode)
+    PrintOut(LOG_INFO,"Device: %s, opened %s device\n", name, type);
+
+  if (!cfg.removable)
+    reset_warning_mail(cfg, state, 9, "open of %s device worked again", type);
+  else if (state.removed) {
+    PrintOut(LOG_INFO, "Device: %s, reconnected %s device\n", name, type);
+    state.removed = false;
+  }
+
+  return true;
+}
+
 // If the self-test log has got more self-test errors (or more recent
 // self-test errors) recorded, then notify user.
 static void CheckSelfTestLogs(const dev_config & cfg, dev_state & state, int newi)
@@ -3129,46 +3245,10 @@ static void check_attribute(const dev_config & cfg, dev_state & state,
 static int ATACheckDevice(const dev_config & cfg, dev_state & state, ata_device * atadev,
                           bool firstpass, bool allow_selftests)
 {
-  const char * name = cfg.name.c_str();
-
-  // If user has asked, test the email warning system
-  if (cfg.emailtest)
-    MailWarning(cfg, state, 0, "TEST EMAIL from smartd for device: %s", name);
-
-  // User may have requested (with the -n Directive) to leave the disk
-  // alone if it is in idle or standby mode.  In this case check the
-  // power mode first before opening the device for full access,
-  // and exit without check if disk is reported in standby.
-  if (cfg.powermode && !state.powermodefail) {
-    // Note that 'is_powered_down()' handles opening the device itself, and
-    // can be used before calling 'open()' (that's the whole point of 'is_powered_down()'!).
-    if (atadev->is_powered_down())
-    {
-      // skip at most powerskipmax checks
-      if (!cfg.powerskipmax || state.powerskipcnt<cfg.powerskipmax) {
-        // report first only except if state has changed, avoid waking up system disk
-        if ((!state.powerskipcnt || state.lastpowermodeskipped != -1) && !cfg.powerquiet) {
-          PrintOut(LOG_INFO, "Device: %s, is in %s mode, suspending checks\n", name, "STANDBY (OS)");
-          state.lastpowermodeskipped = -1;
-        }
-        state.powerskipcnt++;
-        return 0;
-      }
-    }
-  }
-
-  // if we can't open device, fail gracefully rather than hard --
-  // perhaps the next time around we'll be able to open it.  ATAPI
-  // cd/dvd devices will hang awaiting media if O_NONBLOCK is not
-  // given (see linux cdrom driver).
-  if (!atadev->open()) {
-    PrintOut(LOG_INFO, "Device: %s, open() failed: %s\n", name, atadev->get_errmsg());
-    MailWarning(cfg, state, 9, "Device: %s, unable to open device", name);
+  if (!open_device(cfg, state, atadev, "ATA"))
     return 1;
-  }
-  if (debugmode)
-    PrintOut(LOG_INFO,"Device: %s, opened ATA device\n", name);
-  reset_warning_mail(cfg, state, 9, "open device worked again");
+
+  const char * name = cfg.name.c_str();
 
   // user may have requested (with the -n Directive) to leave the disk
   // alone if it is in idle or sleeping mode.  In this case check the
@@ -3407,104 +3487,85 @@ static int ATACheckDevice(const dev_config & cfg, dev_state & state, ata_device
 
 static int SCSICheckDevice(const dev_config & cfg, dev_state & state, scsi_device * scsidev, bool allow_selftests)
 {
-    const char * name = cfg.name.c_str();
+  if (!open_device(cfg, state, scsidev, "SCSI"))
+    return 1;
 
-    // If the user has asked for it, test the email warning system
-    if (cfg.emailtest)
-      MailWarning(cfg, state, 0, "TEST EMAIL from smartd for device: %s", name);
+  const char * name = cfg.name.c_str();
 
-    // if we can't open device, fail gracefully rather than hard --
-    // perhaps the next time around we'll be able to open it
-    if (!scsidev->open()) {
-      PrintOut(LOG_INFO, "Device: %s, open() failed: %s\n", name, scsidev->get_errmsg());
-      MailWarning(cfg, state, 9, "Device: %s, unable to open device", name);
-      return 1;
-    } else if (debugmode)
-        PrintOut(LOG_INFO,"Device: %s, opened SCSI device\n", name);
-    reset_warning_mail(cfg, state, 9, "open device worked again");
-
-    UINT8 asc = 0, ascq = 0;
-    UINT8 currenttemp = 0, triptemp = 0;
-    if (!state.SuppressReport) {
-        if (scsiCheckIE(scsidev, state.SmartPageSupported, state.TempPageSupported,
-                        &asc, &ascq, &currenttemp, &triptemp)) {
-            PrintOut(LOG_INFO, "Device: %s, failed to read SMART values\n",
-                      name);
-            MailWarning(cfg, state, 6, "Device: %s, failed to read SMART values", name);
-            state.SuppressReport = 1;
-        }
+  UINT8 asc = 0, ascq = 0;
+  UINT8 currenttemp = 0, triptemp = 0;
+  if (!state.SuppressReport) {
+    if (scsiCheckIE(scsidev, state.SmartPageSupported, state.TempPageSupported,
+                    &asc, &ascq, &currenttemp, &triptemp)) {
+      PrintOut(LOG_INFO, "Device: %s, failed to read SMART values\n",
+               name);
+      MailWarning(cfg, state, 6, "Device: %s, failed to read SMART values", name);
+      state.SuppressReport = 1;
     }
-    if (asc > 0) {
-        const char * cp = scsiGetIEString(asc, ascq);
-        if (cp) {
-            PrintOut(LOG_CRIT, "Device: %s, SMART Failure: %s\n", name, cp);
-            MailWarning(cfg, state, 1,"Device: %s, SMART Failure: %s", name, cp);
-        } else if (asc == 4 && ascq == 9) {
-            PrintOut(LOG_INFO,"Device: %s, self-test in progress\n", name);  
-        } else if (debugmode)
-            PrintOut(LOG_INFO,"Device: %s, non-SMART asc,ascq: %d,%d\n",
-                     name, (int)asc, (int)ascq);  
+  }
+  if (asc > 0) {
+    const char * cp = scsiGetIEString(asc, ascq);
+    if (cp) {
+      PrintOut(LOG_CRIT, "Device: %s, SMART Failure: %s\n", name, cp);
+      MailWarning(cfg, state, 1,"Device: %s, SMART Failure: %s", name, cp);
+    } else if (asc == 4 && ascq == 9) {
+      PrintOut(LOG_INFO,"Device: %s, self-test in progress\n", name);
     } else if (debugmode)
-        PrintOut(LOG_INFO,"Device: %s, SMART health: passed\n", name);  
+      PrintOut(LOG_INFO,"Device: %s, non-SMART asc,ascq: %d,%d\n",
+               name, (int)asc, (int)ascq);
+  } else if (debugmode)
+    PrintOut(LOG_INFO,"Device: %s, SMART health: passed\n", name);
 
-    // check temperature limits
-    if (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit || !cfg.attrlog_file.empty())
-      CheckTemperature(cfg, state, currenttemp, triptemp);
+  // check temperature limits
+  if (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit)
+    CheckTemperature(cfg, state, currenttemp, triptemp);
 
-    // check if number of selftest errors has increased (note: may also DECREASE)
-    if (cfg.selftest)
-      CheckSelfTestLogs(cfg, state, scsiCountFailedSelfTests(scsidev, 0));
-    
-    if (allow_selftests && !cfg.test_regex.empty()) {
-      char testtype = next_scheduled_test(cfg, state, true/*scsi*/);
-      if (testtype)
-        DoSCSISelfTest(cfg, state, scsidev, testtype);
+  // check if number of selftest errors has increased (note: may also DECREASE)
+  if (cfg.selftest)
+    CheckSelfTestLogs(cfg, state, scsiCountFailedSelfTests(scsidev, 0));
+
+  if (allow_selftests && !cfg.test_regex.empty()) {
+    char testtype = next_scheduled_test(cfg, state, true/*scsi*/);
+    if (testtype)
+      DoSCSISelfTest(cfg, state, scsidev, testtype);
+  }
+  if (!cfg.attrlog_file.empty()){
+    // saving error counters to state
+    UINT8 tBuf[252];
+    if (state.ReadECounterPageSupported && (0 == scsiLogSense(scsidev,
+      READ_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
+      scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[0].errCounter);
+      state.scsi_error_counters[0].found=1;
     }
-    if (!cfg.attrlog_file.empty()){
-      // saving error counters to state
-      UINT8 tBuf[252];
-      if (state.ReadECounterPageSupported && (0 == scsiLogSense(scsidev,
-          READ_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
-          scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[0].errCounter);
-          state.scsi_error_counters[0].found=1;
-      }
-      if (state.WriteECounterPageSupported && (0 == scsiLogSense(scsidev,
-          WRITE_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
-          scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[1].errCounter);
-          state.scsi_error_counters[1].found=1;
-      }
-      if (state.VerifyECounterPageSupported && (0 == scsiLogSense(scsidev,
-          VERIFY_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
-          scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[2].errCounter);
-          state.scsi_error_counters[2].found=1;
-      }
-      if (state.NonMediumErrorPageSupported && (0 == scsiLogSense(scsidev,
-          NON_MEDIUM_ERROR_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
-          scsiDecodeNonMediumErrPage(tBuf, &state.scsi_nonmedium_error.nme);
-          state.scsi_nonmedium_error.found=1;
-      }
+    if (state.WriteECounterPageSupported && (0 == scsiLogSense(scsidev,
+      WRITE_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
+      scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[1].errCounter);
+      state.scsi_error_counters[1].found=1;
     }
-    CloseDevice(scsidev, name);
-    return 0;
+    if (state.VerifyECounterPageSupported && (0 == scsiLogSense(scsidev,
+      VERIFY_ERROR_COUNTER_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
+      scsiDecodeErrCounterPage(tBuf, &state.scsi_error_counters[2].errCounter);
+      state.scsi_error_counters[2].found=1;
+    }
+    if (state.NonMediumErrorPageSupported && (0 == scsiLogSense(scsidev,
+      NON_MEDIUM_ERROR_LPAGE, 0, tBuf, sizeof(tBuf), 0))) {
+      scsiDecodeNonMediumErrPage(tBuf, &state.scsi_nonmedium_error.nme);
+      state.scsi_nonmedium_error.found=1;
+    }
+    // store temperature if not done by CheckTemperature() above
+    if (!(cfg.tempdiff || cfg.tempinfo || cfg.tempcrit))
+      state.temperature = currenttemp;
+  }
+  CloseDevice(scsidev, name);
+  return 0;
 }
 
 static int NVMeCheckDevice(const dev_config & cfg, dev_state & state, nvme_device * nvmedev)
 {
-  const char * name = cfg.name.c_str();
-
-  // TODO: Use common open function for ATA/SCSI/NVMe
-  // If user has asked, test the email warning system
-  if (cfg.emailtest)
-    MailWarning(cfg, state, 0, "TEST EMAIL from smartd for device: %s", name);
-
-  if (!nvmedev->open()) {
-    PrintOut(LOG_INFO, "Device: %s, open() failed: %s\n", name, nvmedev->get_errmsg());
-    MailWarning(cfg, state, 9, "Device: %s, unable to open device", name);
+  if (!open_device(cfg, state, nvmedev, "NVMe"))
     return 1;
-  }
-  if (debugmode)
-    PrintOut(LOG_INFO,"Device: %s, opened NVMe device\n", name);
-  reset_warning_mail(cfg, state, 9, "open device worked again");
+
+  const char * name = cfg.name.c_str();
 
   // Read SMART/Health log
   nvme_smart_log smart_log;
@@ -3831,7 +3892,7 @@ static void printoutvaliddirectiveargs(int priority, char d)
     PrintOut(priority, "%s", get_valid_firmwarebug_args());
     break;
   case 'e':
-    PrintOut(priority, "aam,[N|off], apm,[N|off], lookahead,[on|off], "
+    PrintOut(priority, "aam,[N|off], apm,[N|off], lookahead,[on|off], dsn,[on|off] "
                        "security-freeze, standby,[N|off], wcache,[on|off]");
     break;
   }
@@ -4353,6 +4414,14 @@ static int ParseToken(char * token, dev_config & cfg, smart_devtype_list & scan_
           else
             badarg = true;
         }
+        else if (!strcmp(arg2, "dsn")) {
+          if (off)
+            cfg.set_dsn = -1;
+          else if (on)
+            cfg.set_dsn = 1;
+          else
+            badarg = true;
+        }
         else
           badarg = true;
       }
@@ -4730,23 +4799,24 @@ static void ParseOpts(int argc, char **argv)
     switch(optchar) {
     case 'q':
       // when to quit
-      if (!(strcmp(optarg,"nodev"))) {
-        quit=0;
-      } else if (!(strcmp(optarg,"nodevstartup"))) {
-        quit=1;
-      } else if (!(strcmp(optarg,"never"))) {
-        quit=2;
-      } else if (!(strcmp(optarg,"onecheck"))) {
-        quit=3;
-        debugmode=1;
-      } else if (!(strcmp(optarg,"showtests"))) {
-        quit=4;
-        debugmode=1;
-      } else if (!(strcmp(optarg,"errors"))) {
-        quit=5;
-      } else {
-        badarg = true;
+      if (!strcmp(optarg, "nodev"))
+        quit = QUIT_NODEV;
+      else if (!strcmp(optarg, "nodevstartup"))
+        quit = QUIT_NODEVSTARTUP;
+      else if (!strcmp(optarg, "never"))
+        quit = QUIT_NEVER;
+      else if (!strcmp(optarg, "onecheck")) {
+        quit = QUIT_ONECHECK;
+        debugmode = 1;
+      }
+      else if (!strcmp(optarg, "showtests")) {
+        quit = QUIT_SHOWTESTS;
+        debugmode = 1;
       }
+      else if (!strcmp(optarg, "errors"))
+        quit = QUIT_ERRORS;
+      else
+        badarg = true;
       break;
     case 'l':
       // set the log facility level
@@ -5003,20 +5073,6 @@ static int MakeConfigEntries(const dev_config & base_cfg,
   return devlist.size();
 }
  
-static void CanNotRegister(const char *name, const char *type, int line, bool scandirective)
-{
-  if (!debugmode && scandirective)
-    return;
-  if (line)
-    PrintOut(scandirective?LOG_INFO:LOG_CRIT,
-             "Unable to register %s device %s at line %d of file %s\n",
-             type, name, line, configfile);
-  else
-    PrintOut(LOG_INFO,"Unable to register %s device %s\n",
-             type, name);
-  return;
-}
-
 // Returns negative value (see ParseConfigFile()) if config file
 // had errors, else number of entries which may be zero or positive. 
 static int ReadOrMakeConfigEntries(dev_config_vector & conf_entries, smart_device_list & scanned_devs)
@@ -5101,6 +5157,89 @@ static bool is_duplicate_device(const smart_device * dev,
   return false;
 }
 
+// Register one device, return false on error
+static bool register_device(dev_config & cfg, dev_state & state, smart_device_auto_ptr & dev,
+                            const dev_config_vector * prev_cfgs)
+{
+  bool scanning;
+  if (!dev) {
+    // Get device of appropriate type
+    dev = smi()->get_smart_device(cfg.name.c_str(), cfg.dev_type.c_str());
+    if (!dev) {
+      if (cfg.dev_type.empty())
+        PrintOut(LOG_INFO, "Device: %s, unable to autodetect device type\n", cfg.name.c_str());
+      else
+        PrintOut(LOG_INFO, "Device: %s, unsupported device type '%s'\n", cfg.name.c_str(), cfg.dev_type.c_str());
+      return false;
+    }
+    scanning = false;
+  }
+  else {
+    // Use device from device scan
+    scanning = true;
+  }
+
+  // Save old info
+  smart_device::device_info oldinfo = dev->get_info();
+
+  // Open with autodetect support, may return 'better' device
+  dev.replace( dev->autodetect_open() );
+
+  // Report if type has changed
+  if (oldinfo.dev_type != dev->get_dev_type())
+    PrintOut(LOG_INFO, "Device: %s, type changed from '%s' to '%s'\n",
+      cfg.name.c_str(), oldinfo.dev_type.c_str(), dev->get_dev_type());
+
+  // Return if autodetect_open() failed
+  if (!dev->is_open()) {
+    if (debugmode || !scanning)
+      PrintOut(LOG_INFO, "Device: %s, open() failed: %s\n", dev->get_info_name(), dev->get_errmsg());
+    return false;
+  }
+
+  // Update informal name
+  cfg.name = dev->get_info().info_name;
+  PrintOut(LOG_INFO, "Device: %s, opened\n", cfg.name.c_str());
+
+  int status;
+  const char * typemsg;
+  // register ATA device
+  if (dev->is_ata()){
+    typemsg = "ATA";
+    status = ATADeviceScan(cfg, state, dev->to_ata(), prev_cfgs);
+  }
+  // or register SCSI device
+  else if (dev->is_scsi()){
+    typemsg = "SCSI";
+    status = SCSIDeviceScan(cfg, state, dev->to_scsi(), prev_cfgs);
+  }
+  // or register NVMe device
+  else if (dev->is_nvme()) {
+    typemsg = "NVMe";
+    status = NVMeDeviceScan(cfg, state, dev->to_nvme(), prev_cfgs);
+  }
+  else {
+    PrintOut(LOG_INFO, "Device: %s, neither ATA, SCSI nor NVMe device\n", cfg.name.c_str());
+    return false;
+  }
+
+  if (status) {
+    if (!scanning || debugmode) {
+      if (cfg.lineno)
+        PrintOut(scanning ? LOG_INFO : LOG_CRIT,
+          "Unable to register %s device %s at line %d of file %s\n",
+          typemsg, cfg.name.c_str(), cfg.lineno, configfile);
+      else
+        PrintOut(LOG_INFO, "Unable to register %s device %s\n",
+          typemsg, cfg.name.c_str());
+    }
+
+    return false;
+  }
+
+  return true;
+}
+
 // This function tries devices from conf_entries.  Each one that can be
 // registered is moved onto the [ata|scsi]devices lists and removed
 // from the conf_entries list.
@@ -5129,11 +5268,10 @@ static void RegisterDevices(const dev_config_vector & conf_entries, smart_device
       continue;
     }
 
-    // get device of appropriate type
     smart_device_auto_ptr dev;
-    bool scanning = false;
 
     // Device may already be detected during devicescan
+    bool scanning = false;
     if (i < scanned_devs.size()) {
       dev = scanned_devs.release(i);
       if (dev) {
@@ -5147,88 +5285,30 @@ static void RegisterDevices(const dev_config_vector & conf_entries, smart_device
       }
     }
 
-    if (!dev) {
-      dev = smi()->get_smart_device(cfg.name.c_str(), cfg.dev_type.c_str());
-      if (!dev) {
-        if (cfg.dev_type.empty())
-          PrintOut(LOG_INFO,"Device: %s, unable to autodetect device type\n", cfg.name.c_str());
-        else
-          PrintOut(LOG_INFO,"Device: %s, unsupported device type '%s'\n", cfg.name.c_str(), cfg.dev_type.c_str());
-        continue;
-      }
-    }
-
-    // Save old info
-    smart_device::device_info oldinfo = dev->get_info();
-
-    // Open with autodetect support, may return 'better' device
-    dev.replace( dev->autodetect_open() );
-
-    // Report if type has changed
-    if (oldinfo.dev_type != dev->get_dev_type())
-      PrintOut(LOG_INFO,"Device: %s, type changed from '%s' to '%s'\n",
-        cfg.name.c_str(), oldinfo.dev_type.c_str(), dev->get_dev_type());
-
-    if (!dev->is_open()) {
-      // For linux+devfs, a nonexistent device gives a strange error
-      // message.  This makes the error message a bit more sensible.
-      // If no debug and scanning - don't print errors
-      if (debugmode || !scanning)
-        PrintOut(LOG_INFO, "Device: %s, open() failed: %s\n", dev->get_info_name(), dev->get_errmsg());
-      continue;
-    }
-
-    // Update informal name
-    cfg.name = dev->get_info().info_name;
-    PrintOut(LOG_INFO, "Device: %s, opened\n", cfg.name.c_str());
-
-    // Prepare initial state
+    // Register device
+    // If scanning, pass dev_idinfo of previous devices for duplicate check
     dev_state state;
-
-    // register ATA devices
-    if (dev->is_ata()){
-      if (ATADeviceScan(cfg, state, dev->to_ata())) {
-        CanNotRegister(cfg.name.c_str(), "ATA", cfg.lineno, scanning);
-        dev.reset();
-      }
-    }
-    // or register SCSI devices
-    else if (dev->is_scsi()){
-      if (SCSIDeviceScan(cfg, state, dev->to_scsi())) {
-        CanNotRegister(cfg.name.c_str(), "SCSI", cfg.lineno, scanning);
-        dev.reset();
-      }
-    }
-    // or register NVMe devices
-    else if (dev->is_nvme()) {
-      if (NVMeDeviceScan(cfg, state, dev->to_nvme())) {
-        CanNotRegister(cfg.name.c_str(), "NVMe", cfg.lineno, scanning);
-        dev.reset();
+    if (!register_device(cfg, state, dev, (scanning ? &configs : 0))) {
+      // if device is explictly listed and we can't register it, then
+      // exit unless the user has specified that the device is removable
+      if (!scanning) {
+        if (!(cfg.removable || quit == QUIT_NEVER)) {
+          PrintOut(LOG_CRIT, "Unable to register device %s (no Directive -d removable). Exiting.\n", cfg.name.c_str());
+          EXIT(EXIT_BADDEV);
+        }
+        PrintOut(LOG_INFO, "Device: %s, not available\n", cfg.name.c_str());
+        // Prevent retry of registration
+        ignored_entries.push_back(cfg);
       }
-    }
-    else {
-      PrintOut(LOG_INFO, "Device: %s, neither ATA, SCSI nor NVMe device\n", cfg.name.c_str());
-      dev.reset();
+      continue;
     }
 
-    if (dev) {
-      // move onto the list of devices
-      configs.push_back(cfg);
-      states.push_back(state);
-      devices.push_back(dev);
-      if (!scanning)
-        numnoscan = devices.size();
-    }
-    // if device is explictly listed and we can't register it, then
-    // exit unless the user has specified that the device is removable
-    else if (!scanning) {
-      if (cfg.removable || quit==2)
-        PrintOut(LOG_INFO, "Device %s not available\n", cfg.name.c_str());
-      else {
-        PrintOut(LOG_CRIT, "Unable to register device %s (no Directive -d removable). Exiting.\n", cfg.name.c_str());
-        EXIT(EXIT_BADDEV);
-      }
-    }
+    // move onto the list of devices
+    configs.push_back(cfg);
+    states.push_back(state);
+    devices.push_back(dev);
+    if (!scanning)
+      numnoscan = devices.size();
   }
 
   init_disable_standby_check(configs);
@@ -5320,7 +5400,8 @@ static int main_worker(int argc, char **argv)
           if (!(configs.size() == devices.size() && configs.size() == states.size()))
             throw std::logic_error("Invalid result from RegisterDevices");
         }
-        else if (quit==2 || ((quit==0 || quit==1) && !firstpass)) {
+        else if (   quit == QUIT_NEVER
+                 || ((quit == QUIT_NODEV || quit == QUIT_NODEVSTARTUP) && !firstpass)) {
           // user has asked to continue on error in configuration file
           if (!firstpass)
             PrintOut(LOG_INFO,"Reusing previous configuration\n");
@@ -5332,7 +5413,7 @@ static int main_worker(int argc, char **argv)
       }
 
       // Log number of devices we are monitoring...
-      if (devices.size() > 0 || quit==2 || (quit==1 && !firstpass)) {
+      if (devices.size() > 0 || quit == QUIT_NEVER || (quit == QUIT_NODEVSTARTUP && !firstpass)) {
         int numata = 0, numscsi = 0;
         for (unsigned i = 0; i < devices.size(); i++) {
           const smart_device * dev = devices.at(i);
@@ -5349,7 +5430,7 @@ static int main_worker(int argc, char **argv)
         return EXIT_NODEV;
       }
 
-      if (quit==4) {
+      if (quit == QUIT_SHOWTESTS) {
         // user has asked to print test schedule
         PrintTestSchedule(configs, states, devices);
         return 0;
@@ -5375,7 +5456,7 @@ static int main_worker(int argc, char **argv)
 
     // check all devices once,
     // self tests are not started in first pass unless '-q onecheck' is specified
-    CheckDevicesOnce(configs, states, devices, firstpass, (!firstpass || quit==3));
+    CheckDevicesOnce(configs, states, devices, firstpass, (!firstpass || quit == QUIT_ONECHECK));
 
      // Write state files
     if (!state_path_prefix.empty())
@@ -5387,7 +5468,7 @@ static int main_worker(int argc, char **argv)
       write_all_dev_attrlogs(configs, states);
 
     // user has asked us to exit after first check
-    if (quit==3) {
+    if (quit == QUIT_ONECHECK) {
       PrintOut(LOG_INFO,"Started with '-q onecheck' option. All devices sucessfully checked once.\n"
                "smartd is exiting (exit status 0)\n");
       return 0;
index afc67db08750da3291a81ff84b8e8775f01ddcce..dd5aedae72df428393efdc8db9766628f302cec0 100644 (file)
@@ -1,8 +1,8 @@
 #! /bin/sh
 
 # smartmontools init file for smartd
-# Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
-# $Id: smartd.initd.in 4120 2015-08-27 16:12:21Z samm2 $
+# Copyright (C) 2002-8 Bruce Allen
+# $Id: smartd.initd.in 4431 2017-08-08 19:38:15Z chrfranke $
 
 # For RedHat and cousins:
 # chkconfig: 2345 40 40
@@ -45,7 +45,7 @@ report_unsupported () {
     echo "Currently the smartmontools package has no init script for"
     echo "the $1 OS/distribution. If you can provide one or this"
     echo "one works after removing some ifdefs, please contact"
-    echo "smartmontools-support@lists.sourceforge.net."
+    echo "smartmontools-support@listi.jpberlin.de."
     exit 1
 }
 
@@ -147,7 +147,7 @@ if [ -f /etc/redhat-release -o -f /etc/yellowdog-release -o -f /etc/mandrake-rel
 elif [ -f /etc/slackware-version ] ; then
 
     # Source configuration file.  This should define the shell variable smartd_opts.
-    # Email smartmontools-support@lists.sourceforge.net if there is a better choice
+    # Email smartmontools-support mailing list if there is a better choice
     # of path for Slackware.
 
     [ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools
@@ -494,7 +494,7 @@ elif uname -a | grep FreeBSD > /dev/null 2>&1 ; then
 elif uname -a | grep SunOS > /dev/null 2>&1 ; then
 
     # Source configuration file.  This should define the shell variable smartd_opts.
-    # Email smartmontools-support@lists.sourceforge.net if there is a better choice
+    # Email smartmontools-support mailing list if there is a better choice
     # of path for Solaris
 
     [ -r /etc/default/smartmontools ] && . /etc/default/smartmontools
@@ -543,7 +543,7 @@ built into ATA and SCSI Hard Drives. \
 http://www.smartmontools.org/"
 
     # Source configuration file.  This should define the shell variable smartd_opts.
-    # Email smartmontools-support@lists.sourceforge.net if there is a better choice
+    # Email smartmontools-support mailing list if there is a better choice
     # of path for Cygwin
 
     [ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools
@@ -658,5 +658,5 @@ fi
 # One should NEVER arrive here, except for a badly written case above,
 # that fails to exit.
 echo "SOMETHING IS WRONG WITH THE SMARTD STARTUP SCRIPT"
-echo "PLEASE CONTACT smartmontools-support@lists.sourceforge.net"
+echo "PLEASE CONTACT smartmontools-support@listi.jpberlin.de"
 exit 1
index 81be61098d079ae37487208e591147f45b86c1c6..4f9142519641ee1197ca7fba1d1e11da350ced75 100644 (file)
@@ -2,7 +2,9 @@
 #
 # smartd warning script
 #
-# Copyright (C) 2012-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+# Home page of code is: http://www.smartmontools.org
+#
+# Copyright (C) 2012-16 Christian Franke
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 #
-# $Id: smartd_warning.sh.in 3932 2014-06-29 19:02:38Z chrfranke $
+# $Id: smartd_warning.sh.in 4351 2016-10-17 18:53:40Z chrfranke $
 #
 
 set -e
 
 # Set by config.status
+@ENABLE_SCRIPTPATH_TRUE@export PATH="@scriptpath@"
 PACKAGE="@PACKAGE@"
 VERSION="@VERSION@"
 prefix="@prefix@"
index 1517be5dcc08e7f8bc9831c63f1858b5a2cc5d54..0ba5b90afb5abdf6745117edd0e521dd558640e0 100644 (file)
@@ -1,8 +1,8 @@
 .ig
 Copyright (C) 2013 Hannes von Haugwitz <hannes@vonhaugwitz.com>
-Copyright (C) 2014-16 Christian Franke
+Copyright (C) 2014-17 Christian Franke
 
-$Id: update-smart-drivedb.8.in 4223 2016-02-26 20:18:40Z chrfranke $
+$Id: update-smart-drivedb.8.in 4584 2017-11-03 22:43:32Z chrfranke $
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -13,15 +13,28 @@ You should have received a copy of the GNU General Public License
 (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 
 ..
+.\" Macros borrowed from pages generated with Pod::Man
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
 .TH UPDATE-SMART-DRIVEDB 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 update-smart-drivedb \- update smartmontools drive database
-
+.Sp
 .SH "SYNOPSIS"
 .B update-smart-drivedb
 .RI [ OPTIONS ]
 .RI [ DESTFILE ]
-
+.Sp
 .SH "DESCRIPTION"
 .\" %IF NOT OS ALL
 .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
@@ -33,10 +46,9 @@ updates
 .B /usr/local/share/smartmontools/drivedb.h
 or
 .I DESTFILE
-from smartmontools SVN repository.
-
-It tries to download first from the current branch and then from
-trunk. The tools used for downloading are either
+from branches/RELEASE_6_0_DRIVEDB of smartmontools SVN repository.
+.PP
+The tools used for downloading are either
 .BR curl (1),
 .BR wget (1),
 .BR lynx (1),
@@ -50,18 +62,22 @@ trunk. The tools used for downloading are either
 .\" %ENDIF OS OpenBSD
 or
 .BR svn (1).
-
+.PP
+[NEW EXPERIMENTAL UPDATE-SMART-DRIVEDB FEATURE]
+The downloaded file is verified with OpenPGP/GPG key ID DFD22559.
+The public key block is included in the script.
+.PP
 The old file is kept if the downloaded file is identical (ignoring
 the differences in Id string) otherwise it is moved to
 .BR drivedb.h.old .
-
+.Sp
 .SH "OPTIONS"
 .TP
 .B \-s SMARTCTL
 Use the
 .BR smartctl (8)
 executable at path SMARTCTL for drive database syntax check.
-The form \'\-s \-\' disables the syntax check.
+The form \*(Aq\-s \-\*(Aq disables the syntax check.
 The default is
 .BR /usr/local/sbin/smartctl .
 .TP
@@ -79,7 +95,8 @@ TOOL is one of:
 The default is the first one found in PATH.
 .TP
 .B \-u LOCATION
-Use URL of LOCATION for download. LOCATION is one of:
+Use URL of LOCATION for download.
+LOCATION is one of:
 .br
 .I sf
 (Sourceforge code browser via HTTPS),
@@ -96,6 +113,11 @@ Use URL of LOCATION for download. LOCATION is one of:
 The default is
 .IR svn .
 .TP
+.B \-\-trunk
+Download from SVN trunk.
+This requires \*(Aq\-\-no\-verify\*(Aq unless the trunk version is still
+identical to branches/RELEASE_6_0_DRIVEDB.
+.TP
 .B \-\-cacert FILE
 Use CA certificates from FILE to verify the peer.
 .TP
@@ -104,24 +126,33 @@ Use CA certificate files from DIR to verify the peer.
 .TP
 .B \-\-insecure
 Don't abort download if certificate verification fails.
-This option is also required if a HTTP URL is selected with \'-u\' option.
+This option is also required if a HTTP URL is selected with \*(Aq\-u\*(Aq
+option.
+.TP
+.B \-\-no\-verify
+Don't verify signature with GnuPG.
+.TP
+.B \-\-export\-key
+Print the OpenPGP/GPG public key block.
 .TP
 .B \-\-dryrun
 Print download commands only.
 .TP
 .B \-v
 Verbose output.
-
+.Sp
 .SH "EXAMPLES"
-.nf
+.Vb 2
 # update-smart-drivedb
-/usr/local/share/smartmontools/drivedb.h updated from branches/RELEASE_6_0_DRIVEDB
-.fi
-
+/usr/local/share/smartmontools/drivedb.h updated from \e
+branches/RELEASE_6_0_DRIVEDB
+.Ve
+.Sp
 .SH "EXIT STATUS"
 The exit status is 0 if the database has been successfully
-updated. If an error occurs the exit status is 1.
-
+updated.
+If an error occurs the exit status is 1.
+.Sp
 .SH FILES
 .TP
 .B /usr/local/sbin/update-smart-drivedb
@@ -133,34 +164,40 @@ used to check syntax of new drive database.
 .B /usr/local/share/smartmontools/drivedb.h
 current drive database.
 .TP
-.B /usr/local/share/smartmontools/drivedb.h.old
-previous drive database.
+.B /usr/local/share/smartmontools/drivedb.h.raw
+current drive database with unexpanded SVN Id string.
+.TP
+.B /usr/local/share/smartmontools/drivedb.h.raw.asc
+signature file.
 .TP
-.B /usr/local/share/smartmontools/drivedb.h.error
-new drive database if rejected due to syntax errors.
+.B /usr/local/share/smartmontools/drivedb.h.*old*
+previous files.
+.TP
+.B /usr/local/share/smartmontools/drivedb.h.*error*
+new files if rejected due to errors.
 .TP
 .B /usr/local/share/smartmontools/drivedb.h.lastcheck
 empty file created if downloaded file was identical.
-
+.Sp
 .SH AUTHORS
 \fBChristian Franke\fP.
 .br
 This manual page was originally written by
 .BR "Hannes von Haugwitz <hannes@vonhaugwitz.com>" .
-
+.Sp
 .SH REPORTING BUGS
 To submit a bug report, create a ticket in smartmontools wiki:
 .br
-<\fBhttp://www.smartmontools.org/\fP>.
+<\fBhttps://www.smartmontools.org/\fP>.
 .br
 Alternatively send the info to the smartmontools support mailing list:
 .br
-<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
-
+<\fBhttps://listi.jpberlin.de/mailman/listinfo/smartmontools-support\fB>.
+.Sp
 .SH SEE ALSO
 \fBsmartctl\fP(8), \fBsmartd\fP(8).
-
+.Sp
 .SH PACKAGE VERSION
 CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
 .br
-$Id: update-smart-drivedb.8.in 4223 2016-02-26 20:18:40Z chrfranke $
+$Id: update-smart-drivedb.8.in 4584 2017-11-03 22:43:32Z chrfranke $
index 98434446c3004195f9c2cc24338df299f33b7215..d98f6f7397ed99215860976437daf119af75c141 100644 (file)
@@ -2,7 +2,9 @@
 #
 # smartmontools drive database update script
 #
-# Copyright (C) 2010-16 Christian Franke
+# Home page of code is: http://www.smartmontools.org
+#
+# Copyright (C) 2010-17 Christian Franke
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 #
-# $Id: update-smart-drivedb.in 4224 2016-02-26 20:29:24Z chrfranke $
+# $Id: update-smart-drivedb.in 4584 2017-11-03 22:43:32Z chrfranke $
 #
 
 set -e
 
 # Set by config.status
+@ENABLE_SCRIPTPATH_TRUE@export PATH="@scriptpath@"
 PACKAGE="@PACKAGE@"
 VERSION="@VERSION@"
 prefix="@prefix@"
@@ -36,6 +39,9 @@ BRANCH="@DRIVEDB_BRANCH@"
 # Default drivedb location
 DRIVEDB="$drivedbdir/drivedb.h"
 
+# GnuPG used to verify signature (disabled if empty)
+GPG="@gnupg@"
+
 # Smartctl used for syntax check
 SMARTCTL="$sbindir/smartctl"
 
@@ -57,16 +63,18 @@ Usage: $myname [OPTIONS] [DESTFILE]
                     svn (SVN repository via HTTPS) [default]
                     svni (SVN repository via HTTP)
                     trac (Trac code browser via HTTPS)
+  --trunk         Download from SVN trunk (may require '--no-verify')
   --cacert FILE   Use CA certificates from FILE to verify the peer
   --capath DIR    Use CA certificate files from DIR to verify the peer
   --insecure      Don't abort download if certificate verification fails
+  --no-verify     Don't verify signature
+  --export-key    Print the OpenPGP/GPG public key block
   --dryrun        Print download commands only
   -v              Verbose output
 
 Updates $DRIVEDB
-or DESTFILE from smartmontools SVN repository.
-Tries to download first from branch $BRANCH
-and then from trunk.
+or DESTFILE from branches/$BRANCH of smartmontools
+SVN repository.
 EOF
   exit 1
 }
@@ -149,7 +157,7 @@ vrun2()
 # download URL FILE
 download()
 {
-  local f u se rc
+  local f u rc
   u=$1; f=$2
   rc=0
 
@@ -207,15 +215,136 @@ download()
   return $rc
 }
 
+# check_file FILE FIRST_CHAR MIN_SIZE MAX_SIZE
+check_file()
+{
+  local firstchar f maxsize minsize size
+  test -z "$dryrun" || return 0
+  f=$1; firstchar=$2; minsize=$3; maxsize=$4
+
+  # Check first chars
+  case `dd if="$f" bs=1 count=1 2>/dev/null` in
+    $firstchar) ;;
+    \<) echo "HTML error message"; return 1 ;;
+    *)   echo "unknown file contents"; return 1 ;;
+  esac
+
+  # Check file size
+  size=`wc -c < "$f"`
+  if test "$size" -lt $minsize; then
+    echo "too small file size $size bytes"
+    return 1
+  fi
+  if test "$size" -gt $maxsize; then
+    echo "too large file size $size bytes"
+    return 1
+  fi
+  return 0
+}
+
+# unexpand_svn_id < INFILE > OUTFILE
+unexpand_svn_id()
+{
+  sed 's,\$''Id'': drivedb\.h [0-9][0-9]* 2[-0-9]* [012][:0-9]*Z [a-z][a-z]* \$,$''Id''$,'
+}
+
+# Smartmontools Signing Key (through 2018)
+# <smartmontools-database@listi.jpberlin.de>
+# Key ID DFD22559
+public_key="\
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQENBFgOYoEBCAC93841SlFmpp6640hKUvZ8PbZR6OGnZnMXD6QRVzpibXGZXUDB
+f6unujun5Ql4ObAWt6QuRqz5Gk2gF8tcOfN6edR/uK5gyX2rlWVLoZKOV91a3aDI
+iIDh018tLWOpHg3VxgHL6f0iMcFogUYnD5zhC5Z2GVhFb/cVpj+ocZWcxQLQGPVv
+uZPUQWrvdpFEzcnxPMtJJDqXEChzhrdFTXGm69ERxULOro7yDmG1Y5xWmhdGnPPM
+cuCXVVlADz/Gh1w+ay7RqFnzPjqjQmHAuggns467TJEcS0yiX4LJnEoKLyPGen9L
+FH6z38xHCNt4Da05/OeRgXwVLH9M95lu8d6TABEBAAG0U1NtYXJ0bW9udG9vbHMg
+U2lnbmluZyBLZXkgKHRocm91Z2ggMjAxOCkgPHNtYXJ0bW9udG9vbHMtZGF0YWJh
+c2VAbGlzdGkuanBiZXJsaW4uZGU+iQFBBBMBAgArAhsDBQkEHA0ABgsJCAcDAgYV
+CAIJCgsEFgIDAQIeAQIXgAUCWe5KCQIZAQAKCRDzh2PO39IlWbM5CAC6GNFXkJEu
+Beu1TV2e3N47IwZDsQXypn8DGBVh5VmhFGVHPO5dgBBGXEHBcpiFk6RGXOqyLQar
+bZd0qmGaTCuakUU5MipCB/fPEpOm15CSPzJIAAHz0HiDgJc8YW+JfGUA6P4EHa+r
+OyYcfCu66NNYTjBQJ/wHcwcuIY1xNzEMhb4TCEcM/Nex9zZ7d0+WTWsK4U8m3ui3
+IDESRssCzTTjc5gH/tMz8KuEwY3v91mHc0/vNYVQZx9atWOuuj3JJKqdr8oll/qo
+/33gIadY66dgArQhqybdPFCEKckhoHvlPxoqg7XPKSw6oyBxM/0wf/gM5MGsUImD
+qu1djwVlKH7xiQEcBBMBAgAGBQJZ7kylAAoJEC/N7AvTrxqroQQH/jrZAGT5t8uy
+zRTzJCf3Bco8FqwKcfw8hhpF1Uaypa+quxkpYz9PtP+3e9lGxl0XSEzOwHjfgGWX
+ISUOM1ufVxo2hSLG87yO7naFAtylL8l0Zny8Fb6kmT9f3vMktbHdXHUTDNrCUkoE
+lEwwDK3qaur8IPUaIKeSTC3C8E/DVnasLs9cpOs2LPIKr3ishbqbHNeWOgGyHbA4
+KCtvQzBhun9drmtQJW6OyCC9FcIoqPSFM/bs2KHf7qATNu9kSMg/YWw7WLAD4GPq
+H9us1GigQ0h6Y4KG5EgmkFvuQFPLHvT4rtqv51zzs1iwFh4+GIagFp+HJ2jnlp+G
+cZcySlwfnem0V1NtYXJ0bW9udG9vbHMgU2lnbmluZyBLZXkgKHRocm91Z2ggMjAx
+OCkgPHNtYXJ0bW9udG9vbHMtZGF0YWJhc2VAbGlzdHMuc291cmNlZm9yZ2UubmV0
+PokBPgQTAQIAKAUCWA5igQIbAwUJBBwNAAYLCQgHAwIGFQgCCQoLBBYCAwECHgEC
+F4AACgkQ84djzt/SJVldMQf+MxE3PM70mnIr/Dcrubt8AA3JeMkThNV2xFe9Rdkl
+4tJ1ogU8T5PCgMqJ4Gei9mUmbiQu1CKLSf9k/oxBRcLZK8Fav+BMj0+4YERfZx7J
+Qzou3f0RX8u3pc/+pRXLE6lH/Luk453NzqM3tCFyWgw89dEzFlwYpWx7AfxiFwvH
+ShEPNKZdEp+aBAu8oW9lSKiwLNFsembSGVh+5+3yMiKK02oOdC/NPKTnxxDgvzl4
+Ulm3dNjI3uuBtFNFvs6qKk8CXV9AfM2993QxaCtRMph/ymqX4zXcecvJYpn3vulF
+bAzDTzge7TVhkmaupzDNLeE8IS5sgUjSOM1x3+2SkBiVSYkBHAQTAQIABgUCWA5k
+YwAKCRDfDxpJxKSQOp+/CADTlsgisoXI6b+0oohRaD4ZVl5eBtkvTrxNQf6EF7Z1
+uPkVOqi1OLWFGyAmbeLcRmN6c4/DVcaa6GAG7GA+KQwVPRCyC+9Ibsn/+uG6ZFXA
+ez+0eG9NxOfkCnYH8ZP8o2VH+9uKJlGGujh9o5r1SNGVifoLGTc8NkWCW+MAKj8d
+w8WW+wDc80YrdCRrSyLrRU9NLTSE4pIJWKcHLwG63xkXHQPPR1lsJgzdAalfEv1T
+QdIF3sM+GXp4lZ6buahFDiILBh1vj+5C9TdpWZAlqHDYFICa7Rv/MvQa4O9UUl3S
+lN3sed8zwAmL3HeoXE5tBu8iatMaS9e3BmSsVYlhd/q+iQEcBBMBAgAGBQJYDmSW
+AAoJEC/N7AvTrxqr8HsH+QGQuhHYt9Syccd8AF36psyT03mqgbGLMZL8H9ngoa9Z
+qVMq7O8Aqz23SGTtuNuw6EyrcHo7Dy1311GftshI6arsFNJxE2ZNGIfGocRxu9m3
+Ez+AysWT9sxz/haHE+d58NTg+/7R8YWS1q+Tk6m8dA0Xyf3tMBsIJfj0zJvuGMbC
+Lmd93Yw4nk76qtSn9UHbnf76UJN5SctAd8+gK3uO6O4XDcZqC06xkWKl193lzcC8
+sZJBdI15NszC3y/epnILDDMBUNQMBm/XlCYQUetyrJnAVzFGXurtjEXQ/DDnbfy2
+Z8efoG8rtq7v3fxS1TC5jSVOIEqOE4TwzRz1Y/dfqSU=
+=CNK4
+-----END PGP PUBLIC KEY BLOCK-----
+"
+
+# gpg_verify FILE.asc FILE
+gpg_verify()
+{
+  local gnupgtmp opts out rc
+  opts="--quiet ${q:+--no-secmem-warnin} --batch --no-tty"
+
+  # Create temp home dir
+  gnupgtmp="$tmpdir/.gnupg.$$.tmp"
+  rm -f -r "$gnupgtmp"
+  mkdir "$gnupgtmp" || exit 1
+  chmod 0700 "$gnupgtmp"
+
+  # Import public key
+  "$GPG" $opts --homedir="$gnupgtmp" --import <<EOF
+$public_key
+EOF
+  test $? = 0 || exit 1
+
+  # Verify
+  rc=0
+  out=`"$GPG" $opts --homedir="$gnupgtmp" --verify "$1" "$2" </dev/null 2>&1` || rc=1
+  vecho "$out"
+
+  rm -f -r "$gnupgtmp"
+  return $rc
+}
+
+# mv_all PREFIX OLD NEW
+mv_all()
+{
+  mv "${1}${2}"         "${1}${3}"
+  mv "${1}${2}.raw"     "${1}${3}.raw"
+  mv "${1}${2}.raw.asc" "${1}${3}.raw.asc"
+}
+
 # Parse options
 smtctl=$SMARTCTL
 tool=
 url=
 q="-q"
 dryrun=
+trunk=
 cacert=
 capath=
 insecure=
+no_verify=
 
 while true; do case $1 in
   -s)
@@ -237,6 +366,9 @@ while true; do case $1 in
   --dryrun)
     dryrun=t ;;
 
+  --trunk)
+    trunk=trunk ;;
+
   --cacert)
     shift; test -n "$1" || usage
     cacert=$1 ;;
@@ -248,6 +380,15 @@ while true; do case $1 in
   --insecure)
     insecure=t ;;
 
+  --no-verify)
+    no_verify=t ;;
+
+  --export-key)
+    cat <<EOF
+$public_key
+EOF
+    exit 0 ;;
+
   -*)
     usage ;;
 
@@ -291,95 +432,104 @@ case "$tool:$insecure" in
   lynx:t) warning "'--insecure' is ignored if '-t lynx' is used" ;;
 esac
 
-# Try possible branch first, then trunk
-errmsg=
-errmsg2=
-for location in "branches/$BRANCH" "trunk"; do
-  test -z "$errmsg" || errmsg2=$errmsg
-  vecho "Download from $location with $tool"
-
-  # Adjust URL
-  case $location in
-    trunk) src=$url ;;
-    *)     src=`echo "$url" | sed "s,/trunk/,/$location/,"` ;;
-  esac
-
-  # Download
-  test -n "$dryrun" || rm -f "$DEST.new" || exit 1
-  rc=0
-  download "$src" "$DEST.new" || rc=$?
-  test -z "$dryrun" || continue
+# Check for smartctl
+if [ "$smtctl" != "-" ]; then
+  "$smtctl" -V >/dev/null 2>&1 \
+  || error "$smtctl: not found ('-s -' to ignore)"
+fi
 
-  errmsg=
-  if [ $rc != 0 ]; then
-    errmsg="download from $location failed ($tool: exit $rc)"
-    continue
-  fi
+# Check for GnuPG
+if [ -z "$no_verify" ]; then
+  test -n "$GPG" \
+  || error "GnuPG is not available ('--no-verify' to ignore)"
+  "$GPG" --version >/dev/null 2>&1 \
+  || error "$GPG: not found ('--no-verify' to ignore)"
+fi
 
-  # Check file contents
-  case `sed 1q "$DEST.new"` in
-    /*) ;;
-    \<*)
-      errmsg="download from $location failed (HTML error message)"
-      continue ;;
-    *)
-      errmsg="download from $location failed (Unknown file contents)"
-      continue ;;
-  esac
+# Use destination directory as temp directory for gpg
+tmpdir=`dirname "$DEST"`
 
-  # Check file size
-  size=`wc -c < "$DEST.new"`
-  if [ "$size" -lt 10000 ]; then
-    errmsg="download from $location failed (too small file size $size bytes)"
-    continue
-  fi
-  if [ "$size" -gt 1000000 ]; then
-    errmsg="download from $location failed (too large file size $size bytes)"
-    break
-  fi
+# Adjust URLs
+src=`echo "$url" | sed "s,/trunk/,/branches/$BRANCH/,"`
+src_asc=`echo "$src" | sed "s,/drivedb\.h,/drivedb.h.raw.asc,"`
+test -z "$trunk" || src=$url
 
-  break
-done
+# Download
+test -n "$dryrun" || rm -f "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc"
 
-test -z "$dryrun" || exit 0
+vecho "Download ${trunk:-branches/$BRANCH}/drivedb.h with $tool"
+rc=0
+download "$src" "$DEST.new" || rc=$?
+if [ $rc != 0 ]; then
+  rm -f "$DEST.new"
+  error "${trunk:-$BRANCH}/drivedb.h: download failed ($tool: exit $rc)"
+fi
+if ! errmsg=`check_file "$DEST.new" '/' 10000 1000000`; then
+  mv "$DEST.new" "$DEST.error"
+  error "$DEST.error: $errmsg"
+fi
 
-if [ -n "$errmsg" ]; then
+vecho "Download branches/$BRANCH/drivedb.h.raw.asc with $tool"
+rc=0
+download "$src_asc" "$DEST.new.raw.asc" || rc=$?
+if [ $rc != 0 ]; then
+  rm -f "$DEST.new" "$DEST.new.raw.asc"
+  error "$BRANCH/drivedb.h.raw.asc: download failed ($tool: exit $rc)"
+fi
+if ! errmsg=`check_file "$DEST.new.raw.asc" '-' 200 2000`; then
   rm -f "$DEST.new"
-  test -z "$errmsg2" || echo "$myname: $errmsg2" >&2
-  error "$errmsg"
+  mv "$DEST.new.raw.asc" "$DEST.error.raw.asc"
+  error "$DEST.error.raw.asc: $errmsg"
 fi
 
-# Adjust timestamp and permissions
-touch "$DEST.new"
-chmod 0644 "$DEST.new"
+test -z "$dryrun" || exit 0
+
+# Create raw file with unexpanded SVN Id
+# (This assumes newlines are LF and not CR/LF)
+unexpand_svn_id < "$DEST.new" > "$DEST.new.raw"
+
+# Adjust timestamps and permissions
+touch "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc"
+chmod 0644 "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc"
+
+if [ -z "$no_verify" ]; then
+  # Verify raw file
+  if ! gpg_verify "$DEST.new.raw.asc" "$DEST.new.raw"; then
+    mv_all "$DEST" ".new" ".error"
+    test -n "$trunk" || error "$DEST.error.raw: *** BAD signature ***"
+    error "$DEST.error.raw: signature from branch no longer valid ('--no-verify' to ignore)"
+  fi
+fi
 
 if [ "$smtctl" != "-" ]; then
   # Check syntax
-  rm -f "$DEST.error"
-  if "$smtctl" -B "$DEST.new" -P showall >/dev/null; then
-    test -n "$q" || echo "$smtctl: syntax OK"
-  else
-    mv "$DEST.new" "$DEST.error"
-    echo "$DEST.error: rejected by $smtctl, probably no longer compatible" >&2
-    exit 1
+  if ! "$smtctl" -B "$DEST.new" -P showall >/dev/null; then
+    mv_all "$DEST" ".new" ".error"
+    error "$DEST.error: rejected by $smtctl, probably no longer compatible"
   fi
+  vecho "$smtctl: syntax OK"
 fi
 
 # Keep old file if identical, ignore missing Id keyword expansion in new file
 rm -f "$DEST.lastcheck"
 if [ -f "$DEST" ]; then
-  if    cmp "$DEST" "$DEST.new" >/dev/null 2>/dev/null \
-     || cat "$DEST" | sed 's|\$''Id''[^$]*\$|$''Id''$|' \
-        | cmp - "$DEST.new" >/dev/null 2>/dev/null; then
-    rm -f "$DEST.new"
-    touch "$DEST.lastcheck"
-    echo "$DEST is already up to date"
-    exit 0
+  if [ -f "$DEST.raw" ] && [ -f "$DEST.raw.asc" ]; then
+    if    cmp "$DEST.raw"     "$DEST.new.raw"     >/dev/null 2>&1 \
+       && cmp "$DEST.raw.asc" "$DEST.new.raw.asc" >/dev/null 2>&1 \
+       && {   cmp "$DEST"     "$DEST.new" >/dev/null 2>&1 \
+           || cmp "$DEST.raw" "$DEST.new" >/dev/null 2>&1; }
+    then
+      rm -f "$DEST.new" "$DEST.new.raw" "$DEST.new.raw.asc"
+      touch "$DEST.lastcheck"
+      echo "$DEST is already up to date"
+      exit 0
+    fi
+    mv_all "$DEST" "" ".old"
+  else
+    mv "$DEST" "$DEST.old"
   fi
-  mv "$DEST" "$DEST.old"
 fi
 
-mv "$DEST.new" "$DEST"
-
-echo "$DEST updated from $location"
+mv_all "$DEST" ".new" ""
 
+echo "$DEST updated from ${trunk:-branches/$BRANCH}${no_verify:+ (NOT VERIFIED)}"
index 40fb2bdc09fc074da1a6a6863eb5dcb8ef1b2a5b..5aabd26d8671aa801c850fdd9dbbbfeab25be443 100644 (file)
@@ -4,7 +4,7 @@
  * Home page of code is: http://www.smartmontools.org
  *
  * Copyright (C) 2002-12 Bruce Allen
- * Copyright (C) 2008-16 Christian Franke
+ * Copyright (C) 2008-17 Christian Franke
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -52,7 +52,7 @@
 #include "atacmds.h"
 #include "dev_interface.h"
 
-const char * utility_cpp_cvsid = "$Id: utility.cpp 4309 2016-04-24 14:59:15Z chrfranke $"
+const char * utility_cpp_cvsid = "$Id: utility.cpp 4583 2017-11-03 21:10:09Z chrfranke $"
                                  UTILITY_H_CVSID INT64_H_CVSID;
 
 const char * packet_types[] = {
@@ -90,7 +90,7 @@ std::string format_version_info(const char * prog_name, bool full /*= false*/)
       "(build date " __DATE__ ")" // checkout without expansion of Id keywords
 #endif
       " [%s] " BUILD_INFO "\n"
-    "Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org\n",
+    "Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org\n",
     prog_name, smi()->get_os_version_str().c_str()
   );
   if (!full)
@@ -314,7 +314,12 @@ void dateandtimezoneepoch(char *buffer, time_t tval){
   // Remove newline
   lenm1=strlen(datebuffer)-1;
   datebuffer[lenm1>=0?lenm1:0]='\0';
-  
+
+#if defined(_WIN32) && defined(_MSC_VER)
+  // tzname is missing in MSVC14
+  #define tzname _tzname
+#endif
+
   // correct timezone name
   if (tmval->tm_isdst==0)
     // standard time zone
@@ -733,7 +738,7 @@ const char * format_capacity(char * str, int strsize, uint64_t val,
 }
 
 // return (v)sprintf() formatted std::string
-
+__attribute_format_printf(1, 0)
 std::string vstrprintf(const char * fmt, va_list ap)
 {
   char buf[512];
@@ -782,7 +787,14 @@ int safe_snprintf(char *buf, int size, const char *fmt, ...)
   return i;
 }
 
-#else // HAVE_WORKING_SNPRINTF
+static void check_snprintf() {}
+
+#elif defined(__GNUC__) && (__GNUC__ >= 7)
+
+// G++ 7+: Assume sane implementation and avoid -Wformat-truncation warning
+static void check_snprintf() {}
+
+#else
 
 static void check_snprintf()
 {
@@ -790,8 +802,7 @@ static void check_snprintf()
   int n1 = snprintf(buf, 8, "123456789");
   int n2 = snprintf(buf, 0, "X");
   if (!(!strcmp(buf, "1234567") && n1 == 9 && n2 == 1))
-    throw std::logic_error("Function snprintf() does not conform to C99,\n"
-                           "please contact " PACKAGE_BUGREPORT);
+    throw std::logic_error("Function snprintf() does not conform to C99");
 }
 
 #endif // HAVE_WORKING_SNPRINTF
@@ -800,7 +811,5 @@ static void check_snprintf()
 void check_config()
 {
   check_endianness();
-#ifdef HAVE_WORKING_SNPRINTF
   check_snprintf();
-#endif
 }