Index: configure.in =================================================================== --- configure.in (revision 3108) +++ configure.in (working copy) @@ -107,12 +107,8 @@ AC_CHECK_TYPES([int64_t, uint64_t]) dnl Checks for library functions. -AC_CHECK_FUNCS([getopt_long], , [ - AC_MSG_NOTICE([smartmontools does no longer support platforms without getopt_long().]) - AC_MSG_NOTICE([Please inform ${PACKAGE_BUGREPORT},]) - AC_MSG_NOTICE([including details about your build environment.]) - AC_MSG_ERROR([function getopt_long() not found]) -]) +AC_CHECK_FUNCS([getopt_long], [need_getopt_long=no], [need_getopt_long=yes]) +AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"]) AC_CHECK_FUNCS([getdomainname]) AC_CHECK_FUNCS([gethostname]) Index: os_qnxnto.cpp =================================================================== --- os_qnxnto.cpp (revision 3108) +++ os_qnxnto.cpp (working copy) @@ -624,7 +624,7 @@ cpt.cam_timeout=cpt.cam_timeout?cpt.cam_timeout:CAM_TIME_DEFAULT; if(cpt.cam_sense_len) { - SETIOV(&iov[1],cpt.cam_sense_ptr,cpt.cam_sense_len); + SETIOV(&iov[1],(void *)cpt.cam_sense_ptr,cpt.cam_sense_len); cpt.cam_sense_ptr=sizeof(cpt); icnt++; } Index: Makefile.am =================================================================== --- Makefile.am (revision 3108) +++ Makefile.am (working copy) @@ -21,6 +21,9 @@ if ENABLE_ATTRIBUTELOG AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"' endif +if NEED_GETOPT_LONG +AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__ +endif sbin_PROGRAMS = smartd \ smartctl @@ -161,6 +164,20 @@ endif +if NEED_GETOPT_LONG + +smartctl_SOURCES += \ + getopt/getopt.c \ + getopt/getopt.h \ + getopt/getopt1.c + +smartd_SOURCES += \ + getopt/getopt.c \ + getopt/getopt.h \ + getopt/getopt1.c + +endif + if OS_SOLARIS # This block is required because Solaris uses manual page section 1m # for administrative command (linux/freebsd use section 8) and Solaris