]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - configure.in
Updated changelog
[mirror_smartmontools-debian.git] / configure.in
CommitLineData
832b75ed 1#
a7e8ffec 2# $Id: configure.in 3365 2011-06-09 18:47:31Z chrfranke $
832b75ed
GG
3#
4dnl Process this file with autoconf to produce a configure script.
5AC_PREREQ(2.50)
cfbba5b9 6AC_INIT(smartmontools, 5.41, smartmontools-support@lists.sourceforge.net)
4d59bff9 7AC_CONFIG_SRCDIR(smartctl.cpp)
832b75ed 8
eb07ddf2 9smartmontools_configure_date=`date -u +'%Y-%m-%d %T %Z'`
a7e8ffec
GI
10smartmontools_cvs_tag=`echo '$Id: configure.in 3365 2011-06-09 18:47:31Z chrfranke $'`
11smartmontools_release_date=2011-06-09
12smartmontools_release_time="18:46:32 UTC"
832b75ed
GG
13
14AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments])
15AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_DATE, "$smartmontools_configure_date", [smartmontools Configure Date])
16AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date])
17AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time])
18AC_DEFINE_UNQUOTED(CONFIG_H_CVSID, "$smartmontools_cvs_tag", [smartmontools CVS Tag])
19AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE, "http://smartmontools.sourceforge.net/", [smartmontools Home Page])
20
21AM_CONFIG_HEADER(config.h)
22
23AM_INIT_AUTOMAKE
24
25AM_MAINTAINER_MODE
26
4d59bff9 27AC_LANG_CPLUSPLUS
832b75ed 28dnl Checks for programs.
4d59bff9 29AC_PROG_CXX
832b75ed
GG
30AM_PROG_AS
31AC_PROG_INSTALL
a7e8ffec 32PKG_PROG_PKG_CONFIG
832b75ed 33
cfbba5b9
GI
34AC_ARG_VAR(WINDMC, [Windows message compiler command])
35AC_ARG_VAR(WINDRES, [Windows resource compiler command])
36AC_ARG_VAR(MAKENSIS, [NSIS compiler command])
37
832b75ed
GG
38AC_CANONICAL_HOST
39dnl Set flags which may affect AC_CHECK_*.
40case "${host}" in
cfbba5b9
GI
41 *-*-mingw*)
42 # Cygwin gcc 4.x does no longer support '-mno-cygwin' to select MinGW gcc.
43 if test "${build}" = "${host}" && test -x /usr/bin/uname && \
44 /usr/bin/uname | grep -i '^CYGWIN' >/dev/null; then
45 AC_MSG_ERROR([Build with MinGW on Cygwin requires cross-compilation, see INSTALL file.])
46 fi
47 AC_CHECK_PROGS(WINDMC, [${host}-windmc windmc])
48 AC_CHECK_PROGS(WINDRES, [${host}-windres windres])
49
50 AC_MSG_CHECKING([checking for makensis])
51 if test -z "$MAKENSIS"; then
52 if test -n "$PROGRAMFILES" && "$PROGRAMFILES/NSIS/makensis" -VERSION >/dev/null 2>&1; then
53 MAKENSIS="$PROGRAMFILES/NSIS/makensis"
54 elif makensis -VERSION >/dev/null 2>&1; then
55 MAKENSIS=makensis
56 fi
57 fi
58 AC_MSG_RESULT([${MAKENSIS:-no}])
59
60 CPPFLAGS="$CPPFLAGS -I$srcdir/os_win32"
61 ;;
62 *-*-freebsd*)
63 CPPFLAGS="$CPPFLAGS -I/usr/src/sys"
64 ;;
832b75ed
GG
65esac
66
2127e193
GI
67# Check for SVN.
68AC_MSG_CHECKING([whether this is a build from SVN])
69is_svn_build=no
70if test -f "$srcdir/.svn/entries"; 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
75fi
76AM_CONDITIONAL(IS_SVN_BUILD, [test "$is_svn_build" = "yes"])
77AC_MSG_RESULT([$is_svn_build])
78
79dnl Checks for libraries needed for name services (Solaris needs
832b75ed
GG
80dnl libnsl, might in the future also need libsocket)
81# AC_SEARCH_LIBS (FUNCTION, SEARCH-LIBS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
2127e193
GI
82AC_SEARCH_LIBS(socket, socket)
83AC_SEARCH_LIBS(gethostbyname, nsl)
84AC_SEARCH_LIBS(getaddrinfo, nsl)
85AC_SEARCH_LIBS(getdomainname, nsl)
832b75ed
GG
86
87dnl Checks for header files.
88AC_CHECK_HEADERS([locale.h])
832b75ed
GG
89AC_CHECK_HEADERS([dev/ata/atavar.h])
90AC_CHECK_HEADERS([netdb.h])
91dnl we need [u]int64_t and friends.
92AC_CHECK_HEADERS([inttypes.h]) dnl C99, UNIX98, solaris 2.6+
93AC_CHECK_HEADERS([stdint.h]) dnl C99
94AC_CHECK_HEADERS([sys/inttypes.h]) dnl pre-UNIX98
95AC_CHECK_HEADERS([sys/int_types.h]) dnl pre-UNIX98, solaris 2.6+
96dnl Check for FreeBSD twe include files...currently missing on 5.2, but should be there
97AC_CHECK_HEADERS([sys/tweio.h])
98AC_CHECK_HEADERS([sys/twereg.h])
99dnl Check for FreeBSD twa include files...
100AC_CHECK_HEADERS([sys/tw_osl_ioctl.h])
a37e7145
GG
101dnl Check for FreeBSD ciss include files...
102AC_CHECK_HEADERS([dev/ciss/cissio.h])
1953ff6d 103dnl This header file is needed for cciss_ioctl.h at least on SuSE LINUX
ba59cff1 104AC_CHECK_HEADERS([linux/compiler.h])
1953ff6d
GG
105dnl Check for Linux CCISS include file
106AC_CHECK_HEADERS([linux/cciss_ioctl.h], [], [], [AC_INCLUDES_DEFAULT
107#ifdef HAVE_LINUX_COMPILER_H
108# include <linux/compiler.h>
109#endif
110])
cfbba5b9
GI
111dnl Check for Windows DDK and WMI header files
112AC_CHECK_HEADERS([ntdddisk.h ddk/ntdddisk.h], [], [], [AC_INCLUDES_DEFAULT
113#include <windows.h>
114])
115AC_CHECK_HEADERS([wbemcli.h])
832b75ed
GG
116
117dnl Checks for typedefs, structures, and compiler characteristics.
118AC_CHECK_TYPES([int64_t, uint64_t])
119
120dnl Checks for library functions.
e9583e0c
GI
121AC_CHECK_FUNCS([getopt_long], [need_getopt_long=no], [need_getopt_long=yes])
122AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"])
123AC_CHECK_FUNCS([regcomp], [need_regex=no], [need_regex=yes])
124AM_CONDITIONAL(NEED_REGEX, [test "$need_regex" = "yes"])
2127e193 125
832b75ed
GG
126AC_CHECK_FUNCS([getdomainname])
127AC_CHECK_FUNCS([gethostname])
2127e193 128AC_CHECK_FUNCS([getaddrinfo])
832b75ed
GG
129AC_CHECK_FUNCS([gethostbyname])
130AC_CHECK_FUNCS([sigset])
131AC_CHECK_FUNCS([strtoull])
132AC_CHECK_FUNCS([uname])
133
e9583e0c
GI
134# Check byte ordering (defines WORDS_BIGENDIAN)
135AC_C_BIGENDIAN
136
832b75ed 137# Check whether snprintf appends null char and returns expected length on overflow
832b75ed
GG
138AC_MSG_CHECKING([for working snprintf])
139AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[ char buf[]="ABCDEFGHI";
140 int i=snprintf(buf,8,"12345678"); return !(!buf[7] && i==8); ]])],
4d59bff9 141 [libc_have_working_snprintf=yes],
cfbba5b9
GI
142 [libc_have_working_snprintf=no],
143 [libc_have_working_snprintf=unknown])
832b75ed
GG
144AC_SUBST(libc_have_working_snprintf)
145if test "$libc_have_working_snprintf" = "yes"; then
cfbba5b9 146 AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane])
832b75ed
GG
147fi
148AC_MSG_RESULT([$libc_have_working_snprintf])
149
150# check for __attribute__((packed))
7f0798ef 151AC_MSG_CHECKING([whether $CXX supports __attribute__((packed))])
832b75ed
GG
152AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[struct a { int b; } __attribute__((packed));]])],
153 [gcc_have_attr_packed=yes], [gcc_have_attr_packed=no])
34ad0c5f
GG
154AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
155#error "Sun's compiler cannot handle __attribute__((packed))!"
156#endif]])],
157 [true], [gcc_have_attr_packed=no])
832b75ed
GG
158AC_SUBST(gcc_have_attr_packed)
159if test "$gcc_have_attr_packed" = "yes"; then
cfbba5b9 160 AC_DEFINE(HAVE_ATTR_PACKED, 1, [Define to 1 if C++ compiler supports __attribute__((packed))])
832b75ed
GG
161fi
162AC_MSG_RESULT([$gcc_have_attr_packed])
163
164AC_SUBST(CPPFLAGS)
165AC_SUBST(LDFLAGS)
166AC_SUBST(ASFLAGS)
167
a7e8ffec
GI
168AC_ARG_WITH(systemdsystemunitdir,
169 [AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR|auto|yes|no@:>@], [Location of systemd service files [auto]])],
170 [], [with_systemdsystemunitdir=auto])
171
172systemdsystemunitdir=
173case "$with_systemdsystemunitdir" in
174 auto|yes)
175 test -n "$PKG_CONFIG" && systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
176 case "$with_systemdsystemunitdir:$sysconfdir:$systemdsystemunitdir" in
177 yes:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;;
178 yes:*:*|auto:*:|auto:/etc:*) ;;
179 *) systemdsystemunitdir='${prefix}'$systemdsystemunitdir ;;
180 esac ;;
181 no) ;;
182 *) systemdsystemunitdir="$with_systemdsystemunitdir" ;;
183esac
184AC_SUBST(systemdsystemunitdir)
185AM_CONDITIONAL(INSTALL_SYSTEMDUNIT, [test -n "$systemdsystemunitdir"])
186
a23d5117 187AC_ARG_WITH(initscriptdir,
a7e8ffec
GI
188 [AC_HELP_STRING([--with-initscriptdir@<:@=DIR|auto|yes|no@:>@], [Location of init scripts [auto]])],
189 [], [with_initscriptdir=auto])
190
191AC_MSG_CHECKING(which init (rc) directory to use)
192initddir=""
193for dir in rc.d/init.d init.d rc.d; do
194 if test -d /etc/$dir; then
195 initddir='${sysconfdir}'/$dir
196 break
197 fi
198done
199AC_MSG_RESULT([${initddir:-not found}])
200
201case "$with_initscriptdir" in
202 auto) test -n "$systemdsystemunitdir" && initddir= ;;
203 yes)
204 if test -z "$initddir"; then
205 AC_MSG_ERROR([Location of init scripts not found])
206 fi ;;
207 no) initddir= ;;
208 *) initddir="$with_initscriptdir" ;;
209esac
210
832b75ed 211AC_SUBST(initddir)
a7e8ffec
GI
212AM_CONDITIONAL(INSTALL_INITSCRIPT, [test -n "$initddir"])
213
214# use different init script templates for different OS
215case "${host}" in
216 *-*-freebsd*)
217 initdfile="smartd.freebsd.initd"
218 ;;
219 *)
220 initdfile="smartd.initd"
221 ;;
222esac
223AC_SUBST(initdfile)
832b75ed 224
a23d5117
GI
225AC_ARG_WITH(docdir,
226 [AC_HELP_STRING([--with-docdir=DIR],[Location of documentation [DATADIR/doc/smartmontools]])],
227 [docdir="$withval"],
228 [ if test -z "$docdir"; then
229 # autoconf 2.5x without '--docdir' support
230 docdir='${datadir}/doc/${PACKAGE}'
a23d5117
GI
231 fi
232 ])
832b75ed
GG
233AC_SUBST(docdir)
234
cfbba5b9
GI
235AC_ARG_WITH(exampledir,
236 [AC_HELP_STRING([--with-exampledir=DIR],[Location of example scripts [DOCDIR/examplescripts]])],
237 [exampledir="$withval"], [exampledir='${docdir}/examplescripts'])
238AC_SUBST(exampledir)
239
240AC_ARG_ENABLE(drivedb,
241 [AC_HELP_STRING([--disable-drivedb],[Disables drive database file])],
242 [], [enable_drivedb=yes])
2127e193
GI
243
244AC_ARG_WITH(drivedbdir,
245 [AC_HELP_STRING([--with-drivedbdir=DIR],[Location of drive database file (implies --enable-drivedb) [DATADIR/smartmontools]])],
cfbba5b9 246 [drivedbdir="$withval"; enable_drivedb=yes],
2127e193
GI
247 [drivedbdir=; test "$enable_drivedb" = "yes" && drivedbdir='${datadir}/${PACKAGE}'])
248AC_SUBST(drivedbdir)
249AM_CONDITIONAL(ENABLE_DRIVEDB, [test "$enable_drivedb" = "yes"])
250
251AC_ARG_ENABLE(savestates, [AC_HELP_STRING([--enable-savestates],[Enables default smartd state files])])
252
253AC_ARG_WITH(savestates,
254 [AC_HELP_STRING([--with-savestates=PREFIX],[Prefix for default smartd state files (implies --enable-savestates) [LOCALSTATEDIR/lib/smartmontools/smartd.]])],
255 [savestates="$withval"; enable_savestates="yes"],
256 [savestates=; test "$enable_savestates" = "yes" && savestates='${localstatedir}/lib/${PACKAGE}/smartd.'])
257savestatesdir="${savestates%/*}"
258AC_SUBST(savestates)
259AC_SUBST(savestatesdir)
260AM_CONDITIONAL(ENABLE_SAVESTATES, [test "$enable_savestates" = "yes"])
261
262AC_ARG_ENABLE(attributelog, [AC_HELP_STRING([--enable-attributelog],[Enables default smartd attribute log files])])
263
264AC_ARG_WITH(attributelog,
265 [AC_HELP_STRING([--with-attributelog=PREFIX],[Prefix for default smartd attribute log files (implies --enable-attributelog) [LOCALSTATEDIR/lib/smartmontools/attrlog.]])],
266 [attributelog="$withval"; enable_attributelog="yes"],
267 [attributelog=; test "$enable_attributelog" = "yes" && attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.'])
268attributelogdir="${attributelog%/*}"
269AC_SUBST(attributelog)
270AC_SUBST(attributelogdir)
271AM_CONDITIONAL(ENABLE_ATTRIBUTELOG, [test "$enable_attributelog" = "yes"])
272
cfbba5b9
GI
273AC_ARG_ENABLE(sample,
274 [AC_HELP_STRING([--enable-sample],[Enables appending .sample to the installed smartd rc script and configuration file])],
275 [smartd_suffix=; test "$enableval" = "yes" && smartd_suffix=".sample"],
276 [smartd_suffix=;])
832b75ed 277AC_SUBST(smartd_suffix)
832b75ed 278
2127e193
GI
279AC_ARG_WITH(os-deps,
280 [AC_HELP_STRING([--with-os-deps='os_module.o ...'],[Specify OS dependent module(s) [guessed]])],
281 [ for x in $with_os_deps; do
282 case $x in
283 *.o) ;;
284 *) AC_MSG_ERROR([non-object file specified by --with-os-deps]) ;;
285 esac
286 done
287 ],[])
288
cfbba5b9
GI
289AC_ARG_WITH(selinux,
290 [AC_HELP_STRING([--with-selinux@<:@=yes|no@:>@],[Enables SELinux support [no]])],
291 [ if test "$withval" = "yes"; then
292 AC_CHECK_HEADERS([selinux/selinux.h], [], [AC_MSG_ERROR([Missing SELinux header files])])
293 AC_CHECK_LIB(selinux, matchpathcon, [], [AC_MSG_ERROR([Missing or incorrect SELinux library files])])
294 fi
295 ],[])
2127e193
GI
296AC_SUBST(with_selinux)
297if test "$with_selinux" = "yes"; then
cfbba5b9 298 AC_DEFINE(WITH_SELINUX, 1, [Define to 1 if SELinux support is enabled])
2127e193
GI
299fi
300
a23d5117 301AC_ARG_WITH(libcap-ng,
cfbba5b9 302 [AC_HELP_STRING([--with-libcap-ng@<:@=auto|yes|no@:>@],[Add Libcap-ng support to smartd [auto]])],
a7e8ffec 303 [], [with_libcap_ng=auto])
a23d5117
GI
304
305use_libcap_ng=no
306if test "$with_libcap_ng" != "no"; then
307 AC_CHECK_LIB(cap-ng, capng_clear,
308 [AC_DEFINE(HAVE_LIBCAP_NG, 1, [Define to 1 if you have the `cap-ng' library (-lcap-ng).])
309 CAPNG_LDADD="-lcap-ng"; use_libcap_ng=yes])
310
311 if test "$use_libcap_ng" = "yes"; then
312 AC_CHECK_HEADER(cap-ng.h, [], [AC_MSG_ERROR([libcap-ng libraries found but headers are missing])])
313 elif test "$with_libcap_ng" = "yes"; then
314 AC_MSG_ERROR([libcap-ng support was requested but the library was not found])
315 fi
316fi
317
318AC_MSG_CHECKING([whether to use libcap-ng])
319AC_SUBST(CAPNG_LDADD)
320AM_CONDITIONAL(ENABLE_CAPABILITIES, [test "$use_libcap_ng" = "yes"])
321AC_MSG_RESULT([$use_libcap_ng])
322
832b75ed
GG
323if test "$prefix" = "NONE"; then
324 dnl no prefix and no mandir, so use ${prefix}/share/man as default
325 if test "$mandir" = '${prefix}/man'; then
326 AC_SUBST([mandir], ['${prefix}/share/man'])
327 fi
328fi
329
330AC_SUBST(releaseversion,['${PACKAGE}-${VERSION}'])
331AC_SUBST(smartmontools_release_date)
332AC_SUBST(smartmontools_release_time)
333
cfbba5b9
GI
334# Set platform-specific modules and symbols
335os_libs=
336os_dltools='curl wget lynx'
337os_mailer=
338os_darwin=no
339os_solaris=no
340os_win32=no
341os_win32_mingw=no
7f0798ef 342os_win64=no
832b75ed 343case "${host}" in
cfbba5b9
GI
344 *-*-linux*)
345 os_deps='os_linux.o cciss.o'
346 ;;
347 *-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*)
348 os_deps='os_freebsd.o cciss.o'
349 os_libs='-lcam'
350 os_dltools='curl wget lynx fetch'
351 AC_CHECK_LIB(usb, libusb20_dev_get_device_desc)
352 ;;
353 sparc-*-solaris*)
354 os_deps='os_solaris.o os_solaris_ata.o'
355 os_mailer='mailx'
356 os_solaris=yes
357 ;;
358 *-pc-solaris*)
359 os_deps='os_solaris.o'
360 os_mailer='mailx'
361 os_solaris=yes
362 ;;
363 *-*-netbsd*)
364 os_deps='os_netbsd.o'
365 os_libs='-lutil'
366 ;;
367 *-*-openbsd*)
368 os_deps='os_openbsd.o'
369 os_libs='-lutil'
370 os_dltools='curl wget lynx ftp'
371 ;;
372 *-*-cygwin*)
373 os_deps='os_win32.o'
374 os_win32=yes
375 ;;
376 x86_64-*-mingw*)
377 os_deps='os_win32.o'
378 os_win32=yes
379 os_win32_mingw=yes
380 os_win64=yes
381 ;;
382 *-*-mingw*)
383 os_deps='os_win32.o'
384 os_win32=yes
385 os_win32_mingw=yes
386 ;;
387 *-*-darwin*)
388 os_deps='os_darwin.o'
389 os_libs='-framework CoreFoundation -framework IOKit'
390 os_darwin=yes
391 ;;
392 *-*-nto-qnx*)
393 os_deps='os_qnxnto.o'
394 ;;
395 *)
396 os_deps='os_generic.o'
397 ;;
832b75ed
GG
398esac
399
2127e193
GI
400# Replace if '--with-os-deps' was specified
401test -z "$with_os_deps" || os_deps="$with_os_deps"
832b75ed 402
2127e193
GI
403# Check if we need adapter to old interface (dev_legacy.cpp)
404os_src=`echo "${os_deps}"|sed -n 's,^\([[^ .]]*\)\.o.*$,\1.cpp,p'`
405AC_MSG_CHECKING([whether ${os_src} uses new interface])
406if grep "smart_interface" "${srcdir}/${os_src}" >/dev/null 2>&1; then
407 os_new_interface=yes
408else
409 os_new_interface=no
410 os_deps="${os_deps} dev_legacy.o"
411 AC_DEFINE(OLD_INTERFACE, 1, [Define to 1 if os_*.cpp still uses the old interface])
412fi
413AC_MSG_RESULT([$os_new_interface])
414
cfbba5b9
GI
415AC_SUBST([os_deps])
416AC_SUBST([os_libs])
417AC_SUBST([os_dltools])
418if test -n "$os_mailer"; then
419 AC_DEFINE_UNQUOTED(DEFAULT_MAILER, "$os_mailer", [Default mailer if "mail" is unavailable])
420fi
421
422# Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
423DRIVEDB_BRANCH=`echo $VERSION | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
424 | sed -n 's,^\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\)$,RELEASE_\1_\2_DRIVEDB,p'`
425if test -z "$DRIVEDB_BRANCH"; then
426 AC_MSG_ERROR([Unable to create DRIVEDB_BRANCH from VERSION=$VERSION])
427fi
428AC_SUBST([DRIVEDB_BRANCH])
429
430# Enable platform-specific makefile sections
431AM_CONDITIONAL(OS_DARWIN, [test "$os_darwin" = "yes"])
432AM_CONDITIONAL(OS_SOLARIS, [test "$os_solaris" = "yes"])
433AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
434AM_CONDITIONAL(OS_WIN32_MINGW, [test "$os_win32_mingw" = "yes"])
435AM_CONDITIONAL(OS_WIN32_NSIS, [test -n "$MAKENSIS"])
436AM_CONDITIONAL(OS_WIN32_WINDMC, [test -n "$WINDMC" && test "$WINDMC" != "no" && test -n "$WINDRES"])
7f0798ef 437AM_CONDITIONAL(OS_WIN64, [test "$os_win64" = "yes"])
832b75ed 438
bed94269
GI
439dnl Add -Wall and -W if using g++ and its not already specified.
440if test "$GXX" = "yes"; then
4d59bff9
GG
441 if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
442 CXXFLAGS="$CXXFLAGS -Wall"
832b75ed
GG
443 fi
444# In the next line, do NOT delete the 2 spaces inside double quotes.
4d59bff9
GG
445 if test -z "`echo "$CXXFLAGS " | grep "\-W " 2> /dev/null`" ; then
446 CXXFLAGS="$CXXFLAGS -W"
832b75ed 447 fi
bed94269 448
832b75ed
GG
449else
450 dnl We are NOT using gcc, so enable host-specific compiler flags
451 case "${host}" in
34ad0c5f
GG
452 sparc*-*-solaris*)
453 dnl set CXXFLAGS for Solaris/SPARC C++ compiler
4d59bff9 454 if test -z "`echo "$CXXFLAGS" | grep "\-xmemalign" 2> /dev/null`" ; then
832b75ed 455 dnl we have to tell the compilers about packed ATA structures
4d59bff9 456 CXXFLAGS="-xmemalign=1i $CXXFLAGS"
832b75ed 457 fi
34ad0c5f
GG
458 esac
459 case "${host}" in
460 *-*-solaris*)
4d59bff9 461 if test -z "`echo "$CXXFLAGS" | grep "\-xO" 2> /dev/null`" ; then
832b75ed 462 dnl turn on optimization if user has not explicitly set its value
4d59bff9 463 CXXFLAGS="-xO2 $CXXFLAGS"
832b75ed 464 fi
4d59bff9 465 if test -z "`echo "$CXXFLAGS" | grep "\-erroff" 2> /dev/null`" ; then
2127e193
GI
466 dnl suppress trivial warnings
467 CXXFLAGS="-erroff=%none,wbadinitl,wbadasgl,badargtypel2w,badargtype2w $CXXFLAGS"
4d59bff9 468 fi
832b75ed
GG
469 esac
470fi
471
472AC_DEFINE_UNQUOTED(SMARTMONTOOLS_BUILD_HOST, "${host}", [smartmontools Build Host])
473
4d59bff9 474AC_SUBST(CXXFLAGS)
832b75ed 475
cfbba5b9
GI
476AC_CONFIG_FILES(Makefile)
477AC_OUTPUT
832b75ed 478AC_PROG_MAKE_SET
a23d5117 479
e9583e0c
GI
480echo "-----------------------------------------------------------------------------" >&AS_MESSAGE_FD
481echo "${PACKAGE}-${VERSION} configuration:" >&AS_MESSAGE_FD
482echo "host operating system: $host" >&AS_MESSAGE_FD
483echo "C++ compiler: $CXX" >&AS_MESSAGE_FD
cfbba5b9 484echo "C compiler: $CC" >&AS_MESSAGE_FD
e9583e0c
GI
485echo "preprocessor flags: $CPPFLAGS" >&AS_MESSAGE_FD
486echo "C++ compiler flags: $CXXFLAGS" >&AS_MESSAGE_FD
cfbba5b9 487echo "C compiler flags: $CFLAGS" >&AS_MESSAGE_FD
e9583e0c 488echo "linker flags: $LDFLAGS" >&AS_MESSAGE_FD
cfbba5b9 489echo "OS specific modules: $os_deps $os_libs $LIBS" >&AS_MESSAGE_FD
e9583e0c
GI
490
491case "$host_os" in
492 mingw*)
cfbba5b9
GI
493 echo "resource compiler: $WINDRES" >&AS_MESSAGE_FD
494 echo "message compiler: $WINDMC" >&AS_MESSAGE_FD
495 echo "NSIS compiler: $MAKENSIS" >&AS_MESSAGE_FD
e9583e0c
GI
496 if test -n "$drivedbdir"; then
497 echo "drive database file: EXEDIR/drivedb.h" >&AS_MESSAGE_FD
cfbba5b9
GI
498 if test -n "$MAKENSIS"; then
499 echo "database update tool: EXEDIR/update-smart-drivedb.exe" >&AS_MESSAGE_FD
500 fi
e9583e0c
GI
501 else
502 echo "drive database file: [[disabled]]" >&AS_MESSAGE_FD
503 fi
504 if test -n "$savestates"; then
505 echo "smartd save files: `eval eval eval echo $savestates`MODEL-SERIAL.TYPE.state" >&AS_MESSAGE_FD
506 fi
507 if test -n "$attributelog"; then
508 echo "smartd attribute logs: `eval eval eval echo $attributelog`MODEL-SERIAL.TYPE.csv" >&AS_MESSAGE_FD
509 fi
510 ;;
511
512 *)
513 echo "binary install path: `eval eval eval echo $sbindir`" >&AS_MESSAGE_FD
514 echo "man page install path: `eval eval eval echo $mandir`" >&AS_MESSAGE_FD
515 echo "doc file install path: `eval eval eval echo $docdir`" >&AS_MESSAGE_FD
cfbba5b9 516 echo "examples install path: `eval eval eval echo $exampledir`" >&AS_MESSAGE_FD
e9583e0c
GI
517 if test -n "$drivedbdir"; then
518 echo "drive database file: `eval eval eval echo $drivedbdir`/drivedb.h" >&AS_MESSAGE_FD
519 echo "database update script: `eval eval eval echo $sbindir`/update-smart-drivedb" >&AS_MESSAGE_FD
cfbba5b9 520 echo "download tools: `eval eval eval echo $os_dltools`" >&AS_MESSAGE_FD
e9583e0c
GI
521 else
522 echo "drive database file: [[disabled]]" >&AS_MESSAGE_FD
e9583e0c
GI
523 fi
524 echo "local drive database: `eval eval eval echo $sysconfdir`/smart_drivedb.h" >&AS_MESSAGE_FD
525 echo "smartd config file: `eval eval eval echo $sysconfdir`/smartd.conf${smartd_suffix}" >&AS_MESSAGE_FD
a7e8ffec
GI
526 if test -n "$initddir"; then
527 echo "smartd initd script: `eval eval eval echo $initddir`/smartd${smartd_suffix}" >&AS_MESSAGE_FD
528 elif test -z "$systemdsystemunitdir"; then
529 echo "smartd initd script: [[disabled]]" >&AS_MESSAGE_FD
530 fi
531 if test -n "$systemdsystemunitdir"; then
532 echo "smartd systemd file: `eval eval eval echo $systemdsystemunitdir`/smartd.service" >&AS_MESSAGE_FD
533 fi
e9583e0c
GI
534 if test -n "$savestates"; then
535 echo "smartd save files: `eval eval eval echo $savestates`MODEL-SERIAL.TYPE.state" >&AS_MESSAGE_FD
536 else
537 echo "smartd save files: [[disabled]]" >&AS_MESSAGE_FD
538 fi
539 if test -n "$attributelog"; then
540 echo "smartd attribute logs: `eval eval eval echo $attributelog`MODEL-SERIAL.TYPE.csv" >&AS_MESSAGE_FD
541 else
542 echo "smartd attribute logs: [[disabled]]" >&AS_MESSAGE_FD
543 fi
544 echo "libcap-ng support: $use_libcap_ng" >&AS_MESSAGE_FD
545 case "$host_os" in
546 linux*) echo "SELinux support: ${with_selinux-no}" >&AS_MESSAGE_FD ;;
547 esac
548 ;;
549esac
550echo "-----------------------------------------------------------------------------" >&AS_MESSAGE_FD