diff options
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | src/flexdef.h | 10 |
2 files changed, 18 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 36bf58e..0115064 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,10 @@ AC_PATH_PROG([INDENT], indent, [\${top_srcdir}/build-aux/missing indent]) # checks for headers -AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h regex.h unistd.h]) +AC_CHECK_HEADERS([regex.h sys/stat.h sys/wait.h unistd.h], [], + [AC_MSG_ERROR(required header not found on your system)]) + +AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h]) # checks for libraries @@ -147,16 +150,20 @@ AC_FUNC_REALLOC AS_IF([test "$cross_compiling" = yes], AC_MSG_WARN([result $ac_cv_func_realloc_0_nonnull guessed because of cross compilation])) -AC_CHECK_FUNCS(dup2 dnl +AC_CHECK_FUNCS([dup2 dnl memset dnl -pow dnl regcomp dnl -setlocale dnl strchr dnl strdup dnl -strtol) - -AC_CHECK_FUNCS(reallocarray) +strtol dnl +], [], [AC_MSG_ERROR(required library function not found on your system)]) + +# Optional library functions +AC_CHECK_FUNCS([dnl +pow dnl Used only by "examples/manual/expr" +setlocale dnl Needed only if NLS is enabled +reallocarray dnl OpenBSD function. We have replacement if not available. +]) AC_CONFIG_FILES( Makefile diff --git a/src/flexdef.h b/src/flexdef.h index e5ab8e0..b3162e2 100644 --- a/src/flexdef.h +++ b/src/flexdef.h @@ -57,24 +57,22 @@ #ifdef HAVE_LIMITS_H #include <limits.h> #endif -#ifdef HAVE_UNISTD_H +/* Required: dup() and dup2() in <unistd.h> */ #include <unistd.h> -#endif #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif #ifdef HAVE_SYS_PARAMS_H #include <sys/params.h> #endif -#ifdef HAVE_SYS_STAT_H +/* Required: stat() in <sys/stat.h> */ #include <sys/stat.h> -#endif +/* Required: wait() in <sys/wait.h> */ #include <sys/wait.h> #include <stdbool.h> #include <stdarg.h> -#ifdef HAVE_REGEX_H +/* Required: regcomp(), regexec() and regerror() in <regex.h> */ #include <regex.h> -#endif #include "flexint.h" /* We use gettext. So, when we write strings which should be translated, we mark them with _() */ |