summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-15 19:14:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:46 -0500
commit6e3b94d3bcaacba0fed4f977248b0fbe6fcd6812 (patch)
tree0ef8b4654d78808431f0855e93156c76f90f3b0c /source4/lib
parentdce0c9e4fd6c47f44694fd276c3a91b689312ccd (diff)
downloadsamba-6e3b94d3bcaacba0fed4f977248b0fbe6fcd6812.tar.gz
samba-6e3b94d3bcaacba0fed4f977248b0fbe6fcd6812.tar.bz2
samba-6e3b94d3bcaacba0fed4f977248b0fbe6fcd6812.zip
r18563: - move more of the header checks into lib/replace/
- change the test for net/if.h to do a full compile, not just an existance test. net/if.h is completely broken on hpux, and can never compile (it uses stuff before it defines it), so by using a AC_TRY_COMPILE() test we avoid using net/if.h on hpux, which should fix the build (This used to be commit bde18f3d5ce837f600bae8d63f31d92a579fe1f2)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/replace/libreplace.m431
-rw-r--r--source4/lib/socket/config.m45
2 files changed, 27 insertions, 9 deletions
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index 26c6caae41..d98845f3b4 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -88,6 +88,33 @@ if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
fi
+AC_CHECK_HEADERS(sys/syslog.h syslog.h)
+AC_CHECK_HEADERS(sys/time.h time.h)
+AC_CHECK_HEADERS(stdarg.h vararg.h)
+AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
+AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
+AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
+
+
+dnl we need to check that net/if.h really can be used, to cope with hpux
+dnl where including it always fails
+AC_TRY_COMPILE([
+ #include <stdio.h>
+ #if STDC_HEADERS
+ # include <stdlib.h>
+ # include <stddef.h>
+ #else
+ # if HAVE_STDLIB_H
+ # include <stdlib.h>
+ # endif
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif],
+ [#include <net/if.h>],
+ AC_DEFINE(HAVE_NET_IF_H, 1, usability of net/if.h))
+
+
AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
AC_TRY_RUN([
#include <stdio.h>
@@ -117,10 +144,6 @@ AC_TRY_COMPILE([
[socklen_t foo;],,
[AC_DEFINE(socklen_t, int,[Socket length type])])
-AC_CHECK_HEADERS(sys/syslog.h syslog.h)
-AC_CHECK_HEADERS(sys/time.h time.h)
-AC_CHECK_HEADERS(sys/socket.h netinet/in.h)
-AC_CHECK_HEADERS(stdarg.h vararg.h)
AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid strlcpy strlcat innetgr initgroups memmove strdup)
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index 5cb567238c..250b3001eb 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -1,5 +1,3 @@
-AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/un.h)
-
AC_CHECK_FUNCS(writev)
AC_CHECK_FUNCS(readv)
@@ -98,9 +96,6 @@ fi
dnl don't build ipv6 by default, unless the above test enables it, or
dnl the configure uses --with-static-modules=socket_ipv6
-AC_CHECK_HEADERS(arpa/inet.h net/if.h netdb.h netinet/in.h sys/time.h)
-AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
-
##################
# look for a method of finding the list of network interfaces