aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-11-04 13:16:38 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-11-04 19:27:53 +0100
commitb8e7408b92dd8c1bd33b810ea3d6268fb8437c97 (patch)
tree51539811325f3f87343c6526d0cc8e36e4770665
parent099e5b69201608b5f52a3e527c180aedb45db905 (diff)
downloadriscv-openocd-b8e7408b92dd8c1bd33b810ea3d6268fb8437c97.zip
riscv-openocd-b8e7408b92dd8c1bd33b810ea3d6268fb8437c97.tar.gz
riscv-openocd-b8e7408b92dd8c1bd33b810ea3d6268fb8437c97.tar.bz2
configure: fix build problems with eCos
Various include files require some other include files to be included first. Copied solution from net/if.h. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--configure.in63
1 files changed, 57 insertions, 6 deletions
diff --git a/configure.in b/configure.in
index 1b86403..5772383 100644
--- a/configure.in
+++ b/configure.in
@@ -35,27 +35,78 @@ AC_TYPE_LONG_LONG_INT
AC_SEARCH_LIBS([ioperm], [ioperm])
AC_SEARCH_LIBS([dlopen], [dl])
-AC_CHECK_HEADERS(arpa/inet.h)
+AC_CHECK_HEADERS(sys/socket.h)
+AC_CHECK_HEADERS(arpa/inet.h, [], [], [dnl
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
AC_CHECK_HEADERS(elf.h)
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(fcntl.h)
-AC_CHECK_HEADERS(ifaddrs.h)
+AC_CHECK_HEADERS(ifaddrs.h, [], [], [dnl
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
AC_CHECK_HEADERS(malloc.h)
AC_CHECK_HEADERS(netdb.h)
-AC_CHECK_HEADERS(netinet/in.h)
-AC_CHECK_HEADERS(netinet/tcp.h)
+AC_CHECK_HEADERS([netinet/in.h], [], [], [dnl
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/tcp.h, [], [], [dnl
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/poll.h)
AC_CHECK_HEADERS(sys/select.h)
-AC_CHECK_HEADERS(sys/socket.h)
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
#include <stdio.h>
#ifdef STDC_HEADERS