diff options
author | Corey Farrell <git@cfware.com> | 2017-03-31 13:09:38 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-04-03 16:16:09 -0400 |
commit | 8e36064109b6fabc6cd8caa59e48f9b523c7485b (patch) | |
tree | 25fa6a4cd51fa3ce7c5bebd4a5e9446665ce9282 /configure.ac | |
parent | cf4dd32befbd82bb9534f0f16bbc21341c03e8e5 (diff) |
core: Improve/simplify handling of required headers.
* Report failures if configure finds a required header is missing.
* Deduplicate includes between asterisk.h, astmm.h and compat.h.
* Unconditionally include headers in compat.h if required elsewhere.
Change-Id: Ie67d0185ca71fbfb81c9bdfaebe46a49e3c56dc5
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index b0f04887a..a8e66bccd 100644 --- a/configure.ac +++ b/configure.ac @@ -588,9 +588,34 @@ AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z]) AC_FUNC_ALLOCA AC_HEADER_DIRENT +if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then + AC_MSG_ERROR([*** Could not find dirent header that defines 'DIR'.]) +fi + AC_HEADER_STDC +if test "$ac_cv_header_stdc" != "yes"; then + AC_MSG_ERROR([*** ANSI C header files not found.]) +fi + AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/event.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h]) +if test "$ac_cv_header_sys_wait_h" != "yes"; then + AC_MSG_ERROR([*** POSIX.1 compatible sys/wait.h is required.]) +fi + +# Check for headers that are unconditionally required on all platforms. Do not use +# this to check for headers that are only needed by modules. +AC_CHECK_HEADERS([ \ + arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \ + inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h resolv.h \ + sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \ + sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \ + sys/time.h sys/types.h sys/un.h \ + termios.h time.h unistd.h \ +], [], [ + AC_MSG_ERROR([*** A required header was not found.]) +]) + +AC_CHECK_HEADERS([arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h]) # Any one of these packages support a mandatory requirement, so we want to check on them as early as possible. AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], []) |