summaryrefslogtreecommitdiff
path: root/source4/lib/replace/libreplace.m4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-10-18 08:34:19 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:18 +0100
commit1a766af41e9e3bdffc343098c2ec1b5018b33a26 (patch)
treeb79bab4d219acd7a9565cc090fc0cbc4f8c20be0 /source4/lib/replace/libreplace.m4
parent4bb52bfcb7997f0b8c0491126edfd136260b2f9f (diff)
downloadsamba-1a766af41e9e3bdffc343098c2ec1b5018b33a26.tar.gz
samba-1a766af41e9e3bdffc343098c2ec1b5018b33a26.tar.bz2
samba-1a766af41e9e3bdffc343098c2ec1b5018b33a26.zip
r25695: [libreplace] fix the standalone build of libreplace
all configure results which are used in replace.h or any system/*.h should be in the in the libreplace *.m4 files! metze (This used to be commit 95462d614d68a93e85232e3a779f8bfa86fba4d1)
Diffstat (limited to 'source4/lib/replace/libreplace.m4')
-rw-r--r--source4/lib/replace/libreplace.m439
1 files changed, 12 insertions, 27 deletions
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index 4bdbf3a504..26b4c3636d 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -137,23 +137,20 @@ if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
fi
-dnl test for struct addrinfo
-AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[
-AC_TRY_COMPILE([
+AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
+AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
+AC_HAVE_TYPE([struct sockaddr_storage], [
+#include <sys/socket.h>
#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+#include <netinet/in.h>
+])
+AC_HAVE_TYPE([struct sockaddr_in6], [
#include <sys/socket.h>
-#include <netdb.h>],
-[
-struct addrinfo ai;
-],
-samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)])
-if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then
- AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo])
-fi
+#include <sys/types.h>
+#include <netinet/in.h>
+])
dnl test for getaddrinfo/getnameinfo
AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[
@@ -185,18 +182,6 @@ if test x"$samba_cv_HAVE_GETADDRINFO" = x"yes"; then
AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
fi
-
-dnl Provided by replace.c:
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>],
-[socklen_t foo;],,
-[AC_DEFINE(socklen_t, int,[Socket length type])])
-
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 initgroups memmove strdup)