]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - configure.ac
Correct maintscript syntax
[mirror_smartmontools-debian.git] / configure.ac
1 #
2 # $Id: configure.ac 3977 2014-07-26 11:03:24Z chrfranke $
3 #
4 dnl Process this file with autoconf to produce a configure script.
5 AC_PREREQ(2.50)
6 AC_INIT(smartmontools, 6.4, smartmontools-support@lists.sourceforge.net)
7 AC_CONFIG_SRCDIR(smartctl.cpp)
8
9 smartmontools_cvs_tag=`echo '$Id: configure.ac 3977 2014-07-26 11:03:24Z chrfranke $'`
10 smartmontools_release_date=2014-07-26
11 smartmontools_release_time="09:49:11 UTC"
12
13 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments])
14 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date])
15 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time])
16 AC_DEFINE_UNQUOTED(CONFIG_H_CVSID, "$smartmontools_cvs_tag", [smartmontools CVS Tag])
17 AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE, "http://smartmontools.sourceforge.net/", [smartmontools Home Page])
18
19 AC_CONFIG_HEADER([config.h])
20
21 AM_INIT_AUTOMAKE([foreign])
22
23 AM_MAINTAINER_MODE
24
25 AC_LANG([C++])
26 dnl Checks for programs.
27 AC_PROG_CXX
28 AM_PROG_AS
29 AC_PROG_INSTALL
30
31 m4_pattern_forbid([^PKG_PROG_])
32 if test "$cross_compiling" = "no"; then
33 m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG],
34 [AC_MSG_WARN([m4/pkg.m4 missing, systemd detection disabled])])
35 fi
36
37 AC_ARG_VAR(WINDMC, [Windows message compiler command])
38 AC_ARG_VAR(WINDRES, [Windows resource compiler command])
39 AC_ARG_VAR(MAKENSIS, [NSIS compiler command])
40
41 AC_CANONICAL_HOST
42 case "${host}" in
43 *-*-mingw*)
44 AC_CHECK_TOOL(WINDMC, [windmc])
45 AC_CHECK_TOOL(WINDRES, [windres])
46
47 AC_MSG_CHECKING([for makensis])
48 if test -z "$MAKENSIS"; then
49 if test -n "$PROGRAMFILES" && "$PROGRAMFILES/NSIS/makensis" -VERSION >/dev/null 2>&1; then
50 MAKENSIS="$PROGRAMFILES/NSIS/makensis"
51 elif makensis -VERSION >/dev/null 2>&1; then
52 MAKENSIS=makensis
53 fi
54 fi
55 AC_MSG_RESULT([${MAKENSIS:-no}])
56 ;;
57 esac
58
59 # Check for SVN.
60 AC_MSG_CHECKING([whether this is a build from SVN])
61 is_svn_build=no
62 svn_deps=
63 if test -f "$srcdir/.svn/wc.db"; then
64 # SVN 1.7, 1.8 working copy
65 svn_deps='${srcdir}/.svn/wc.db'
66 elif test -f "${srcdir}/.svn/entries"; then
67 # SVN <= 1.6 working copy (SVN 1.7 has empty entries file)
68 svn_deps='${srcdir}/.svn/entries'
69 fi
70 if test -n "$svn_deps"; then
71 is_svn_build=unknown
72 if (cd "$srcdir" && svn --version && svnversion && svn info) >/dev/null 2>&1; then
73 is_svn_build=yes
74 fi
75 fi
76 AC_SUBST([svn_deps])
77 AM_CONDITIONAL(IS_SVN_BUILD, [test "$is_svn_build" = "yes"])
78 AC_MSG_RESULT([$is_svn_build])
79
80 # Note: On Linux, clock_gettime() requires -lrt which implies -lpthreads
81 # Check ommitted for now, gettimeofday() provides reasonable precision
82 # AC_SEARCH_LIBS(clock_gettime, rt)
83
84 dnl Checks for header files.
85 AC_CHECK_HEADERS([locale.h])
86 AC_CHECK_HEADERS([dev/ata/atavar.h])
87 AC_CHECK_HEADERS([netdb.h])
88 dnl we need [u]int64_t and friends.
89 AC_CHECK_HEADERS([inttypes.h]) dnl C99, UNIX98, solaris 2.6+
90 AC_CHECK_HEADERS([stdint.h]) dnl C99
91 AC_CHECK_HEADERS([sys/inttypes.h]) dnl pre-UNIX98
92 AC_CHECK_HEADERS([sys/int_types.h]) dnl pre-UNIX98, solaris 2.6+
93 dnl Check for FreeBSD twe include files...currently missing on 5.2, but should be there
94 AC_CHECK_HEADERS([sys/tweio.h])
95 AC_CHECK_HEADERS([sys/twereg.h])
96 dnl Check for FreeBSD twa include files...
97 AC_CHECK_HEADERS([sys/tw_osl_ioctl.h])
98 dnl This header file is needed for cciss_ioctl.h at least on SuSE LINUX
99 AC_CHECK_HEADERS([linux/compiler.h])
100 dnl Check for the FreeBSD CCISS system header and use internal one if not found
101 AC_CHECK_HEADERS([dev/ciss/cissio.h],
102 [AC_DEFINE([CISS_LOCATION],[<dev/ciss/cissio.h>],[freebsd ciss header location])],
103 [AC_DEFINE([CISS_LOCATION],["cissio_freebsd.h"],[freebsd ciss header location])]
104 )
105 dnl Check for Linux CCISS include file
106 AC_CHECK_HEADERS([linux/cciss_ioctl.h], [], [], [AC_INCLUDES_DEFAULT
107 #ifdef HAVE_LINUX_COMPILER_H
108 # include <linux/compiler.h>
109 #endif
110 ])
111 dnl Check for Windows DDK and WMI header files
112 AC_CHECK_HEADERS([ntdddisk.h ddk/ntdddisk.h], [], [], [AC_INCLUDES_DEFAULT
113 #include <windows.h>
114 ])
115 AC_CHECK_HEADERS([wbemcli.h])
116
117 dnl Checks for typedefs, structures, and compiler characteristics.
118 AC_CHECK_TYPES([int64_t, uint64_t])
119
120 dnl Checks for library functions.
121 AC_CHECK_FUNCS([getopt_long], [need_getopt_long=no], [need_getopt_long=yes])
122 AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"])
123 AC_CHECK_FUNCS([regcomp], [need_regex=no], [need_regex=yes])
124 AM_CONDITIONAL(NEED_REGEX, [test "$need_regex" = "yes"])
125
126 AC_CHECK_FUNCS([sigset])
127 AC_CHECK_FUNCS([strtoull])
128 AC_CHECK_FUNCS([uname])
129 AC_CHECK_FUNCS([clock_gettime ftime gettimeofday])
130
131 # Check byte ordering (defines WORDS_BIGENDIAN)
132 AC_C_BIGENDIAN
133
134 # check for __attribute__((packed))
135 # (sizeof() check is required to avoid false positives if other
136 # __attribute__((x)) are supported)
137 AC_MSG_CHECKING([whether $CXX supports __attribute__((packed))])
138 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[
139 struct s { char a; short b; } __attribute__((packed));
140 typedef char t[sizeof(struct s) == 3 ? 1 : -1];]])],
141 [gcc_have_attr_packed=yes], [gcc_have_attr_packed=no])
142 AC_SUBST(gcc_have_attr_packed)
143 if test "$gcc_have_attr_packed" = "yes"; then
144 AC_DEFINE(HAVE_ATTR_PACKED, 1, [Define to 1 if C++ compiler supports __attribute__((packed))])
145 fi
146 AC_MSG_RESULT([$gcc_have_attr_packed])
147
148 AC_SUBST(CPPFLAGS)
149 AC_SUBST(LDFLAGS)
150 AC_SUBST(ASFLAGS)
151
152 AC_ARG_WITH(systemdenvfile,
153 [AS_HELP_STRING([--with-systemdenvfile=@<:@FILE|no@:>@],
154 [Path of systemd EnvironmentFile (implies --with-systemdsystemunitdir=yes) [SYSCONFDIR/sysconfig/smartmontools]])],
155 [systemdenvfile=; test "$withval" != "no" && systemdenvfile="$withval"; systemd_default=yes],
156 [systemdenvfile='${sysconfdir}/sysconfig/smartmontools'; systemd_default=auto])
157 AC_SUBST(systemdenvfile)
158
159 AC_ARG_WITH(systemdsystemunitdir,
160 [AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR|auto|yes|no@:>@], [Location of systemd service files [auto]])],
161 [], [with_systemdsystemunitdir=$systemd_default])
162
163 systemdsystemunitdir=
164 case "$with_systemdsystemunitdir" in
165 auto|yes)
166 if test -n "$PKG_CONFIG"; then
167 AC_MSG_CHECKING([for systemdsystemunitdir])
168 systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd 2>/dev/null`
169 AC_MSG_RESULT([${systemdsystemunitdir:-no}])
170 fi
171 case "$with_systemdsystemunitdir:$sysconfdir:$systemdsystemunitdir" in
172 yes:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;;
173 yes:*:*|auto:*:|auto:/etc:*) ;;
174 *) systemdsystemunitdir='${prefix}'$systemdsystemunitdir ;;
175 esac ;;
176 no) ;;
177 *) systemdsystemunitdir="$with_systemdsystemunitdir" ;;
178 esac
179 AC_SUBST(systemdsystemunitdir)
180 AM_CONDITIONAL(INSTALL_SYSTEMDUNIT, [test -n "$systemdsystemunitdir"])
181
182 AC_ARG_WITH(initscriptdir,
183 [AS_HELP_STRING([--with-initscriptdir@<:@=DIR|auto|yes|no@:>@], [Location of init scripts [auto]])],
184 [], [with_initscriptdir=auto])
185
186 initddir=
187 case "$with_initscriptdir:$cross_compiling:$systemdsystemunitdir" in
188 auto:no:|yes:*)
189 AC_MSG_CHECKING([for init (rc) directory])
190 for dir in rc.d/init.d init.d rc.d; do
191 if test -d /etc/$dir; then
192 initddir='${sysconfdir}'/$dir
193 break
194 fi
195 done
196 AC_MSG_RESULT([${initddir:-no}])
197 case "$with_initscriptdir:$initddir" in
198 yes:) AC_MSG_ERROR([Location of init scripts not found]) ;;
199 esac ;;
200 auto:*|no:*) ;;
201 *) initddir="$with_initscriptdir" ;;
202 esac
203 AC_SUBST(initddir)
204 AM_CONDITIONAL(INSTALL_INITSCRIPT, [test -n "$initddir"])
205
206 # use different init script templates for different OS
207 case "${host}" in
208 *-*-freebsd*)
209 initdfile="smartd.freebsd.initd"
210 ;;
211 *)
212 initdfile="smartd.initd"
213 ;;
214 esac
215 AC_SUBST(initdfile)
216
217 AC_ARG_WITH(docdir,
218 [AS_HELP_STRING([--with-docdir=DIR], [Location of documentation [DATADIR/doc/smartmontools]])],
219 [docdir="$withval"],
220 [ if test -z "$docdir"; then
221 # autoconf 2.5x without '--docdir' support
222 docdir='${datadir}/doc/${PACKAGE}'
223 fi
224 ])
225 AC_SUBST(docdir)
226
227 AC_ARG_WITH(exampledir,
228 [AS_HELP_STRING([--with-exampledir=DIR], [Location of example scripts [DOCDIR/examplescripts]])],
229 [exampledir="$withval"], [exampledir='${docdir}/examplescripts'])
230 AC_SUBST(exampledir)
231
232 AC_ARG_ENABLE(drivedb,
233 [AS_HELP_STRING([--disable-drivedb], [Disables drive database file])],
234 [], [enable_drivedb=yes])
235
236 AC_ARG_WITH(drivedbdir,
237 [AS_HELP_STRING([--with-drivedbdir=DIR], [Location of drive database file [DATADIR/smartmontools]])],
238 [drivedbdir="$withval"; enable_drivedb=yes],
239 [drivedbdir=; test "$enable_drivedb" = "yes" && drivedbdir='${datadir}/${PACKAGE}'])
240 AC_SUBST(drivedbdir)
241 AM_CONDITIONAL(ENABLE_DRIVEDB, [test "$enable_drivedb" = "yes"])
242
243 AC_ARG_WITH(smartdscriptdir,
244 [AS_HELP_STRING([--with-smartdscriptdir=DIR], [Location of smartd_warning.sh script [SYSCONFDIR]])],
245 [smartdscriptdir="$withval"], [smartdscriptdir='${sysconfdir}'])
246 AC_SUBST(smartdscriptdir)
247
248 AC_ARG_WITH(smartdplugindir,
249 [AS_HELP_STRING([--with-smartdplugindir=@<:@DIR|no@:>@],
250 [Location of smartd_warning.sh plugin scripts [SMARTDSCRIPTDIR/smartd_warning.d]])],
251 [smartdplugindir=; test "$withval" != "no" && smartdplugindir="$withval"],
252 [smartdplugindir='${smartdscriptdir}/smartd_warning.d'])
253 AC_SUBST(smartdplugindir)
254
255 AC_ARG_ENABLE(savestates, [AS_HELP_STRING([--enable-savestates], [Enables default smartd state files])])
256
257 AC_ARG_WITH(savestates,
258 [AS_HELP_STRING([--with-savestates=PREFIX],
259 [Prefix for default smartd state files (implies --enable-savestates) [LOCALSTATEDIR/lib/smartmontools/smartd.]])],
260 [savestates="$withval"; enable_savestates="yes"],
261 [savestates=; test "$enable_savestates" = "yes" && savestates='${localstatedir}/lib/${PACKAGE}/smartd.'])
262 savestatesdir="${savestates%/*}"
263 AC_SUBST(savestates)
264 AC_SUBST(savestatesdir)
265 AM_CONDITIONAL(ENABLE_SAVESTATES, [test "$enable_savestates" = "yes"])
266
267 AC_ARG_ENABLE(attributelog, [AS_HELP_STRING([--enable-attributelog], [Enables default smartd attribute log files])])
268
269 AC_ARG_WITH(attributelog,
270 [AS_HELP_STRING([--with-attributelog=PREFIX],
271 [Prefix for default smartd attribute log files (implies --enable-attributelog) [LOCALSTATEDIR/lib/smartmontools/attrlog.]])],
272 [attributelog="$withval"; enable_attributelog="yes"],
273 [attributelog=; test "$enable_attributelog" = "yes" && attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.'])
274 attributelogdir="${attributelog%/*}"
275 AC_SUBST(attributelog)
276 AC_SUBST(attributelogdir)
277 AM_CONDITIONAL(ENABLE_ATTRIBUTELOG, [test "$enable_attributelog" = "yes"])
278
279 AC_ARG_ENABLE(sample,
280 [AS_HELP_STRING([--enable-sample], [Enables appending .sample to the installed smartd rc script and configuration file])],
281 [smartd_suffix=; test "$enableval" = "yes" && smartd_suffix=".sample"],
282 [smartd_suffix=;])
283 AC_SUBST(smartd_suffix)
284
285 AC_ARG_WITH(os-deps,
286 [AS_HELP_STRING([--with-os-deps='os_module.o ...'], [Specify OS dependent module(s) [guessed]])],
287 [ for x in $with_os_deps; do
288 case $x in
289 *.o) ;;
290 *) AC_MSG_ERROR([non-object file specified by --with-os-deps]) ;;
291 esac
292 done
293 ],[])
294
295 AC_ARG_WITH(selinux,
296 [AS_HELP_STRING([--with-selinux@<:@=yes|no@:>@], [Enables SELinux support [no]])],
297 [ if test "$withval" = "yes"; then
298 AC_CHECK_HEADERS([selinux/selinux.h], [], [AC_MSG_ERROR([Missing SELinux header files])])
299 AC_CHECK_LIB(selinux, matchpathcon, [], [AC_MSG_ERROR([Missing or incorrect SELinux library files])])
300 fi
301 ],[])
302 AC_SUBST(with_selinux)
303 if test "$with_selinux" = "yes"; then
304 AC_DEFINE(WITH_SELINUX, 1, [Define to 1 if SELinux support is enabled])
305 fi
306
307 AC_ARG_WITH(libcap-ng,
308 [AS_HELP_STRING([--with-libcap-ng@<:@=auto|yes|no@:>@], [Add Libcap-ng support to smartd [auto]])],
309 [], [with_libcap_ng=auto])
310
311 use_libcap_ng=no
312 if test "$with_libcap_ng" != "no"; then
313 AC_CHECK_LIB(cap-ng, capng_clear,
314 [AC_DEFINE(HAVE_LIBCAP_NG, 1, [Define to 1 if you have the `cap-ng' library (-lcap-ng).])
315 CAPNG_LDADD="-lcap-ng"; use_libcap_ng=yes])
316
317 if test "$use_libcap_ng" = "yes"; then
318 AC_CHECK_HEADER(cap-ng.h, [], [AC_MSG_ERROR([libcap-ng libraries found but headers are missing])])
319 elif test "$with_libcap_ng" = "yes"; then
320 AC_MSG_ERROR([libcap-ng support was requested but the library was not found])
321 fi
322 fi
323
324 AC_MSG_CHECKING([whether to use libcap-ng])
325 AC_SUBST(CAPNG_LDADD)
326 AM_CONDITIONAL(ENABLE_CAPABILITIES, [test "$use_libcap_ng" = "yes"])
327 AC_MSG_RESULT([$use_libcap_ng])
328
329 # Assume broken snprintf only on Windows with MSVCRT (MinGW without ANSI stdio support)
330 libc_have_working_snprintf=yes
331
332 case "$host" in
333 *-*-mingw*)
334 case " $CPPFLAGS $CXXFLAGS" in
335 *\ -[[DU]]__USE_MINGW_ANSI_STDIO*)
336 ;;
337 *)
338 # Older MinGW do not properly define PRI?64 if __USE_MINGW_ANSI_STDIO is set
339 # Newer MinGW set __USE_MINGW_ANSI_STDIO in first C++ include which may be too late
340 AC_MSG_CHECKING([whether __USE_MINGW_ANSI_STDIO is defined by C++ includes])
341 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
342 #undef __USE_MINGW_ANSI_STDIO
343 #include <iostream>
344 #ifndef __USE_MINGW_ANSI_STDIO
345 #error false
346 #endif]])],
347 [CXXFLAGS="-D__USE_MINGW_ANSI_STDIO $CXXFLAGS"],
348 [libc_have_working_snprintf=no])
349 AC_MSG_RESULT([$libc_have_working_snprintf])
350 ;;
351 esac ;;
352 esac
353
354 AC_ARG_WITH(working-snprintf,
355 [AS_HELP_STRING([--with-working-snprintf@<:@=yes|no@:>@],
356 [Function snprintf() handles output truncation as specified by C99 [MinGW:guessed,others:yes]])],
357 [libc_have_working_snprintf=$withval])
358
359 if test "$libc_have_working_snprintf" = "yes"; then
360 AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane])
361 fi
362
363 if test "$prefix" = "NONE"; then
364 dnl no prefix and no mandir, so use ${prefix}/share/man as default
365 if test "$mandir" = '${prefix}/man'; then
366 AC_SUBST([mandir], ['${prefix}/share/man'])
367 fi
368 fi
369
370 AC_SUBST(releaseversion,['${PACKAGE}-${VERSION}'])
371 AC_SUBST(smartmontools_release_date)
372 AC_SUBST(smartmontools_release_time)
373
374 # Set platform-specific modules and symbols
375 os_libs=
376 os_dltools='curl wget lynx'
377 os_mailer=mail
378 os_hostname="'hostname'"
379 os_dnsdomainname=
380 os_nisdomainname="'domainname'"
381 os_darwin=no
382 os_solaris=no
383 os_win32=no
384 os_win32_mingw=no
385 os_win64=no
386 os_man_filter=
387 case "${host}" in
388 *-*-linux*)
389 os_deps='os_linux.o cciss.o dev_areca.o'
390 os_dnsdomainname="'dnsdomainname' 'hostname -d'"
391 os_nisdomainname="'nisdomainname' 'hostname -y' 'domainname'"
392 os_man_filter=Linux
393 ;;
394 *-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*)
395 os_deps='os_freebsd.o cciss.o dev_areca.o'
396 os_libs='-lcam'
397 os_dltools='curl wget lynx fetch'
398 AC_CHECK_LIB(usb, libusb20_dev_get_device_desc)
399 os_man_filter=FreeBSD
400 ;;
401 sparc-*-solaris*)
402 os_deps='os_solaris.o os_solaris_ata.o'
403 os_mailer='mailx'
404 os_solaris=yes
405 os_man_filter=Solaris
406 ;;
407 *-pc-solaris*)
408 os_deps='os_solaris.o'
409 os_mailer='mailx'
410 os_solaris=yes
411 os_man_filter=Solaris
412 ;;
413 *-*-netbsd*)
414 os_deps='os_netbsd.o'
415 os_libs='-lutil'
416 os_man_filter=NetBSD
417 ;;
418 *-*-openbsd*)
419 os_deps='os_openbsd.o'
420 os_libs='-lutil'
421 os_dltools='curl wget lynx ftp'
422 os_man_filter=OpenBSD
423 ;;
424 *-*-cygwin*)
425 os_deps='os_win32.o dev_areca.o'
426 os_mailer='email'
427 os_hostname="'hostname' 'echo "'"${HOSTNAME?unset}"'"'"
428 os_dnsdomainname="'dnsdomainname' 'hostname -d' 'echo "'"${USERDNSDOMAIN?unset}"'"'"
429 os_nisdomainname=
430 os_win32=yes
431 os_man_filter=Cygwin
432 ;;
433 x86_64-*-mingw*)
434 os_deps='os_win32.o dev_areca.o'
435 os_win32=yes
436 os_win32_mingw=yes
437 os_win64=yes
438 os_man_filter=Windows
439 ;;
440 *-*-mingw*)
441 os_deps='os_win32.o dev_areca.o'
442 os_win32=yes
443 os_win32_mingw=yes
444 os_man_filter=Windows
445 ;;
446 *-*-darwin*)
447 os_deps='os_darwin.o'
448 os_libs='-framework CoreFoundation -framework IOKit'
449 os_darwin=yes
450 os_man_filter=Darwin
451 ;;
452 *-*-nto-qnx*)
453 os_deps='os_qnxnto.o'
454 ;;
455 *)
456 os_deps='os_generic.o'
457 ;;
458 esac
459
460 # Replace if '--with-os-deps' was specified
461 test -z "$with_os_deps" || os_deps="$with_os_deps"
462
463 # Check if we need adapter to old interface (dev_legacy.cpp)
464 os_src=`echo "${os_deps}"|sed -n 's,^\([[^ .]]*\)\.o.*$,\1.cpp,p'`
465 AC_MSG_CHECKING([whether ${os_src} uses new interface])
466 if grep "smart_interface" "${srcdir}/${os_src}" >/dev/null 2>&1; then
467 os_new_interface=yes
468 else
469 os_new_interface=no
470 os_deps="${os_deps} dev_legacy.o"
471 AC_DEFINE(OLD_INTERFACE, 1, [Define to 1 if os_*.cpp still uses the old interface])
472 fi
473 AC_MSG_RESULT([$os_new_interface])
474
475 AC_SUBST([os_deps])
476 AC_SUBST([os_libs])
477 AC_SUBST([os_dltools])
478 AC_SUBST([os_mailer])
479 AC_SUBST([os_hostname])
480 AC_SUBST([os_dnsdomainname])
481 AC_SUBST([os_nisdomainname])
482 AC_SUBST([os_man_filter])
483
484 # Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
485 DRIVEDB_BRANCH=`echo $VERSION | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
486 | sed -n 's,^\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\)$,RELEASE_\1_\2_DRIVEDB,p'`
487 if test -z "$DRIVEDB_BRANCH"; then
488 AC_MSG_ERROR([Unable to create DRIVEDB_BRANCH from VERSION=$VERSION])
489 fi
490 AC_SUBST([DRIVEDB_BRANCH])
491
492 # Enable platform-specific makefile sections
493 AM_CONDITIONAL(OS_DARWIN, [test "$os_darwin" = "yes"])
494 AM_CONDITIONAL(OS_SOLARIS, [test "$os_solaris" = "yes"])
495 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
496 AM_CONDITIONAL(OS_WIN32_MINGW, [test "$os_win32_mingw" = "yes"])
497 AM_CONDITIONAL(OS_WIN32_NSIS, [test -n "$MAKENSIS"])
498 AM_CONDITIONAL(OS_WIN64, [test "$os_win64" = "yes"])
499
500 dnl Add -Wall and -W if using g++ and its not already specified.
501 if test "$GXX" = "yes"; then
502 if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
503 CXXFLAGS="$CXXFLAGS -Wall"
504 fi
505 # In the next line, do NOT delete the 2 spaces inside double quotes.
506 if test -z "`echo "$CXXFLAGS " | grep "\-W " 2> /dev/null`" ; then
507 CXXFLAGS="$CXXFLAGS -W"
508 fi
509
510 else
511 dnl We are NOT using gcc, so enable host-specific compiler flags
512 case "${host}" in
513 sparc*-*-solaris*)
514 dnl set CXXFLAGS for Solaris/SPARC C++ compiler
515 if test -z "`echo "$CXXFLAGS" | grep "\-xmemalign" 2> /dev/null`" ; then
516 dnl we have to tell the compilers about packed ATA structures
517 CXXFLAGS="-xmemalign=1i $CXXFLAGS"
518 fi
519 esac
520 case "${host}" in
521 *-*-solaris*)
522 if test -z "`echo "$CXXFLAGS" | grep "\-xO" 2> /dev/null`" ; then
523 dnl turn on optimization if user has not explicitly set its value
524 CXXFLAGS="-xO2 $CXXFLAGS"
525 fi
526 if test -z "`echo "$CXXFLAGS" | grep "\-erroff" 2> /dev/null`" ; then
527 dnl suppress trivial warnings
528 CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS"
529 fi
530 esac
531 fi
532
533 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_BUILD_HOST, "${host}", [smartmontools Build Host])
534
535 AC_SUBST(CXXFLAGS)
536
537 AC_CONFIG_FILES(Makefile)
538 AC_OUTPUT
539 AC_PROG_MAKE_SET
540
541 echo "-----------------------------------------------------------------------------" >&AS_MESSAGE_FD
542 echo "${PACKAGE}-${VERSION} configuration:" >&AS_MESSAGE_FD
543 echo "host operating system: $host" >&AS_MESSAGE_FD
544 echo "C++ compiler: $CXX" >&AS_MESSAGE_FD
545 echo "C compiler: $CC" >&AS_MESSAGE_FD
546 echo "preprocessor flags: $CPPFLAGS" >&AS_MESSAGE_FD
547 echo "C++ compiler flags: $CXXFLAGS" >&AS_MESSAGE_FD
548 echo "C compiler flags: $CFLAGS" >&AS_MESSAGE_FD
549 echo "linker flags: $LDFLAGS" >&AS_MESSAGE_FD
550 echo "OS specific modules: $os_deps $os_libs $LIBS" >&AS_MESSAGE_FD
551
552 case "$host_os" in
553 mingw*)
554 echo "resource compiler: $WINDRES" >&AS_MESSAGE_FD
555 echo "message compiler: $WINDMC" >&AS_MESSAGE_FD
556 echo "NSIS compiler: $MAKENSIS" >&AS_MESSAGE_FD
557 if test -n "$drivedbdir"; then
558 echo "drive database file: EXEDIR/drivedb.h" >&AS_MESSAGE_FD
559 if test -n "$MAKENSIS"; then
560 echo "database update tool: EXEDIR/update-smart-drivedb.exe" >&AS_MESSAGE_FD
561 fi
562 else
563 echo "drive database file: [[disabled]]" >&AS_MESSAGE_FD
564 fi
565 if test -n "$savestates"; then
566 echo "smartd save files: `eval eval eval echo $savestates`MODEL-SERIAL.TYPE.state" >&AS_MESSAGE_FD
567 fi
568 if test -n "$attributelog"; then
569 echo "smartd attribute logs: `eval eval eval echo $attributelog`MODEL-SERIAL.TYPE.csv" >&AS_MESSAGE_FD
570 fi
571 ;;
572
573 *)
574 echo "binary install path: `eval eval eval echo $sbindir`" >&AS_MESSAGE_FD
575 echo "man page install path: `eval eval eval echo $mandir`" >&AS_MESSAGE_FD
576 echo "doc file install path: `eval eval eval echo $docdir`" >&AS_MESSAGE_FD
577 echo "examples install path: `eval eval eval echo $exampledir`" >&AS_MESSAGE_FD
578 if test -n "$drivedbdir"; then
579 echo "drive database file: `eval eval eval echo $drivedbdir`/drivedb.h" >&AS_MESSAGE_FD
580 echo "database update script: `eval eval eval echo $sbindir`/update-smart-drivedb" >&AS_MESSAGE_FD
581 echo "download tools: `eval eval eval echo $os_dltools`" >&AS_MESSAGE_FD
582 else
583 echo "drive database file: [[disabled]]" >&AS_MESSAGE_FD
584 fi
585 echo "local drive database: `eval eval eval echo $sysconfdir`/smart_drivedb.h" >&AS_MESSAGE_FD
586 echo "smartd config file: `eval eval eval echo $sysconfdir`/smartd.conf${smartd_suffix}" >&AS_MESSAGE_FD
587 echo "smartd warning script: `eval eval eval echo $smartdscriptdir`/smartd_warning.sh" >&AS_MESSAGE_FD
588 if test -n "$smartdplugindir"; then
589 echo "smartd plugin path: `eval eval eval echo $smartdplugindir`" >&AS_MESSAGE_FD
590 else
591 echo "smartd plugin path: [[disabled]]" >&AS_MESSAGE_FD
592 fi
593 if test -n "$initddir"; then
594 echo "smartd initd script: `eval eval eval echo $initddir`/smartd${smartd_suffix}" >&AS_MESSAGE_FD
595 elif test -z "$systemdsystemunitdir"; then
596 echo "smartd initd script: [[disabled]]" >&AS_MESSAGE_FD
597 fi
598 if test -n "$systemdsystemunitdir"; then
599 echo "smartd systemd file: `eval eval eval echo $systemdsystemunitdir`/smartd.service" >&AS_MESSAGE_FD
600 if test -n "$systemdenvfile"; then
601 echo "smartd environ file: `eval eval eval echo $systemdenvfile`" >&AS_MESSAGE_FD
602 else
603 echo "smartd environ file: [[disabled]]" >&AS_MESSAGE_FD
604 fi
605 fi
606 if test -n "$savestates"; then
607 echo "smartd save files: `eval eval eval echo $savestates`MODEL-SERIAL.TYPE.state" >&AS_MESSAGE_FD
608 else
609 echo "smartd save files: [[disabled]]" >&AS_MESSAGE_FD
610 fi
611 if test -n "$attributelog"; then
612 echo "smartd attribute logs: `eval eval eval echo $attributelog`MODEL-SERIAL.TYPE.csv" >&AS_MESSAGE_FD
613 else
614 echo "smartd attribute logs: [[disabled]]" >&AS_MESSAGE_FD
615 fi
616 echo "libcap-ng support: $use_libcap_ng" >&AS_MESSAGE_FD
617 case "$host_os" in
618 linux*) echo "SELinux support: ${with_selinux-no}" >&AS_MESSAGE_FD ;;
619 esac
620 ;;
621 esac
622 echo "-----------------------------------------------------------------------------" >&AS_MESSAGE_FD