From 621742727a40e190e073d9fde7f4bce3c01e81c5 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Fri, 18 Nov 2016 20:56:18 +0100 Subject: [PATCH] configure: De-duplicate code in AC_CHECK_HEADERS Combine all checks that have the same required includes. Change-Id: I9b4567766e037922c2ffb737f32e9c12af43bf0e Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/3884 Tested-by: jenkins Reviewed-by: Paul Fertser --- configure.ac | 58 +--------------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/configure.ac b/configure.ac index c6c31bef1..f25dbc516 100644 --- a/configure.ac +++ b/configure.ac @@ -45,67 +45,11 @@ AC_SEARCH_LIBS([ioperm], [ioperm]) AC_SEARCH_LIBS([dlopen], [dl]) AC_CHECK_HEADERS([sys/socket.h]) -AC_CHECK_HEADERS([arpa/inet.h], [], [], [dnl -#include -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -]) AC_CHECK_HEADERS([elf.h]) AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([fcntl.h]) -AC_CHECK_HEADERS([ifaddrs.h], [], [], [dnl -#include -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -]) AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([netdb.h]) -AC_CHECK_HEADERS([netinet/in.h], [], [], [dnl -#include -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -]) -AC_CHECK_HEADERS([netinet/tcp.h], [], [], [dnl -#include -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -]) AC_CHECK_HEADERS([poll.h]) AC_CHECK_HEADERS([pthread.h]) AC_CHECK_HEADERS([strings.h]) @@ -116,7 +60,7 @@ AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_HEADERS([unistd.h]) -AC_CHECK_HEADERS([net/if.h], [], [], [dnl +AC_CHECK_HEADERS([arpa/inet.h ifaddrs.h netinet/in.h netinet/tcp.h net/if.h], [], [], [dnl #include #ifdef STDC_HEADERS # include