Ticket #1: configure-getopt.patch

File configure-getopt.patch, 1.6 KB (added by Christian Franke, 10 years ago)

Proposed patch for configure.in and Makefile.am, requires r3083.

  • Makefile.am

    diff --git a/Makefile.am b/Makefile.am
    index d2bc922..d8897c8 100644
    a b endif 
    2121if ENABLE_ATTRIBUTELOG
    2222AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"'
    2323endif
     24if NEED_GETOPT_LONG
     25AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG
     26endif
    2427
    2528sbin_PROGRAMS = smartd  \
    2629                smartctl
    EXTRA_smartctl_SOURCES += \ 
    161164
    162165endif
    163166
     167if NEED_GETOPT_LONG
     168
     169smartctl_SOURCES += \
     170        getopt/getopt.c \
     171        getopt/getopt.h \
     172        getopt/getopt1.c
     173
     174smartd_SOURCES += \
     175        getopt/getopt.c \
     176        getopt/getopt.h \
     177        getopt/getopt1.c
     178
     179endif
     180
    164181if OS_SOLARIS
    165182# This block is required because Solaris uses manual page section 1m
    166183# for administrative command (linux/freebsd use section 8) and Solaris
  • configure.in

    diff --git a/configure.in b/configure.in
    index a733bca..6822cb5 100644
    a b dnl Checks for typedefs, structures, and compiler characteristics. 
    107107AC_CHECK_TYPES([int64_t, uint64_t])
    108108
    109109dnl Checks for library functions.
    110 AC_CHECK_FUNCS([getopt_long], , [
    111   AC_MSG_NOTICE([smartmontools does no longer support platforms without getopt_long().])
    112   AC_MSG_NOTICE([Please inform ${PACKAGE_BUGREPORT},])
    113   AC_MSG_NOTICE([including details about your build environment.])
    114   AC_MSG_ERROR([function getopt_long() not found])
    115 ])
     110AC_CHECK_FUNCS([getopt_long], [need_getopt_long=no], [need_getopt_long=yes])
     111AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"])
    116112
    117113AC_CHECK_FUNCS([getdomainname])
    118114AC_CHECK_FUNCS([gethostname])