File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / smartmontools / configure.ac
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:17:35 2013 UTC (10 years, 11 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>