diff --git a/configure.ac b/configure.ac index ca071fa..cb9c7a3 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,9 @@ AC_CHECK_HEADERS([linux/serial.h]) AC_CHECK_HEADERS([IOKit/serial/ioss.h]) AC_CHECK_HEADERS([getopt.h]) +# Checks for global variable declarations. +AC_CHECK_DECLS([optreset]) + # Checks for library functions. AC_FUNC_STRERROR_R AC_CHECK_FUNCS([localtime_r gmtime_r]) diff --git a/examples/dctool.c b/examples/dctool.c index 4d70c0e..c3ac6c0 100644 --- a/examples/dctool.c +++ b/examples/dctool.c @@ -217,6 +217,9 @@ main (int argc, char *argv[]) argc -= optind; argv += optind; optind = RESET; +#if defined(HAVE_DECL_OPTRESET) && HAVE_DECL_OPTRESET + optreset = 1; +#endif // Translate the help option into a command. char *argv_help[] = {(char *) "help", NULL, NULL};