[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2480-g151d62d

Stefan Metzmacher metze at samba.org
Fri May 16 07:15:33 GMT 2008


The branch, v3-3-test has been updated
       via  151d62da1321322615daadabb41d049974f5fe6a (commit)
       via  cd37fdb2401bfd6c23160e34f03238faa1f5cbd3 (commit)
       via  dbbc05c87ba2b2d9b3247cfba58bc1a3f12ad4f5 (commit)
       via  734ade407ed8d5b61a831509c3efc90fc521fe1b (commit)
       via  d7038405d68eb3c69ef10f63ce37db838eb44b7a (commit)
       via  2f43e282e0fa723dd62e3b28e529c6eb01ef5b8a (commit)
       via  9aa0f6626d6a69ceeb8bb4ea71ea3d4a6157d101 (commit)
       via  b078ae2b56c9a932655ef619a7af5ce0aeb904dd (commit)
       via  438ddd9c81e74e3042154cf5f0416043ee6a8c35 (commit)
       via  7669daa9f536b73a0b933a3d3fcac68c1771dc15 (commit)
       via  09632f9694599e626e889e54310383878c51413f (commit)
       via  c48b2d8679dd139323936af68b48707c5a9f500c (commit)
       via  6f5f736867a3c5b8c7e6f4e73b031e36783ed1bc (commit)
       via  104316884576a2d904d9d8b2d7c1e0dc80817b66 (commit)
       via  a3d675a7738cc04bb765064a060780198721d94a (commit)
       via  0c9b24e1e75c5c10d3f3baafb80c5c27bb7e4c78 (commit)
       via  0987c32645e4851badab4c1daffb4ee7982ea153 (commit)
       via  2a3ddc23cc8d050dfe5b4e1c0e139a7c97cc3b59 (commit)
       via  8a241cf150fba787c82cbcb03730083ced442fbb (commit)
      from  f8883107499ca48db9b0e63718d1d8e384535833 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 151d62da1321322615daadabb41d049974f5fe6a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 11:01:09 2008 +0200

    libreplace: try to fix the build on HP-UX which has if_nametoindex() in -lipv6
    
    metze
    (cherry picked from commit da2179ee5d5b6094ab63a9d9d6a8d59893937087)

commit cd37fdb2401bfd6c23160e34f03238faa1f5cbd3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:39:41 2008 +0200

    libreplace: make sure system/network.h is only used when AC_LIBREPLACE_NETWORK_CHECKS was used
    
    metze
    (cherry picked from commit 3fddd36e119f73a5021370450f9687ef9d252bab)

commit dbbc05c87ba2b2d9b3247cfba58bc1a3f12ad4f5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:32:19 2008 +0200

    libreplace: export LIBREPLACE_NETWORK_OBJS and LIBREPLACE_NETWORK_LIBS vars
    
    metze
    (cherry picked from commit aa7ef1af746319a3d771decd0ec03dabe8b8ad28)

commit 734ade407ed8d5b61a831509c3efc90fc521fe1b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:27:23 2008 +0200

    libreplace: include inet_ntoa.o when the system one is broken
    
    metze
    (cherry picked from commit 67845d3471711d24069636d0d4032f9d53748334)

commit d7038405d68eb3c69ef10f63ce37db838eb44b7a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:08:42 2008 +0200

    libreplace: merge getifaddrs.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit 0234d397fefee8e1d0dcd3402f748c2251021c90)

commit 2f43e282e0fa723dd62e3b28e529c6eb01ef5b8a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:06:39 2008 +0200

    libreplace: merge getaddrinfo.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit 64591d064dc3da6074f0f7539911a6e433d9cc43)

commit 9aa0f6626d6a69ceeb8bb4ea71ea3d4a6157d101
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:04:51 2008 +0200

    libreplace: merge socketpair.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit f9f8f93adcc7161ebb18f5a0bf28c73d951a15ad)

commit b078ae2b56c9a932655ef619a7af5ce0aeb904dd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:02:21 2008 +0200

    libreplace: merge inet_pton.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit 3a70274c908e31453942b442351eab8423c1a53d)

commit 438ddd9c81e74e3042154cf5f0416043ee6a8c35
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 10:00:58 2008 +0200

    libreplace: merge inet_ntop.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit 223ef6c08efb52251d0a772bb0c481b2803cf0ce)

commit 7669daa9f536b73a0b933a3d3fcac68c1771dc15
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 09:59:16 2008 +0200

    libreplace: merge inet_aton.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit fba00736c870f449c0eee32fe0d7b0d539dca51f)

commit 09632f9694599e626e889e54310383878c51413f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 09:58:07 2008 +0200

    libreplace: merge inet_ntoa.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit 82e826253b6d18832931dbb5c1dda009889bf9e0)

commit c48b2d8679dd139323936af68b48707c5a9f500c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 8 09:56:10 2008 +0200

    libreplace: merge socket.m4 into libreplace_network.m4
    
    metze
    (cherry picked from commit c70eba87dbbac6c2c1e68c343cdd410577c1686f)

commit 6f5f736867a3c5b8c7e6f4e73b031e36783ed1bc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 8 13:43:45 2008 +0200

    Fix typo.
    (cherry picked from commit bd089818a3182698dfe85039c1b2e22d8c2835bb)

commit 104316884576a2d904d9d8b2d7c1e0dc80817b66
Author: William Jojo <jojowil at hvcc.edu>
Date:   Thu May 8 12:41:57 2008 +0200

    Add undefined symbol flag for AIX.
    (cherry picked from commit dabdf24e86f038e3afc67532fa5bf60a37992161)

commit a3d675a7738cc04bb765064a060780198721d94a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 7 17:38:41 2008 +0200

    libreplace: also use AC_LIBREPLACE_NETWORK_CHECKS for the standalone build
    
    metze
    (cherry picked from commit 04f4523ed032946b8f0e74ac6f7458010159e3bb)

commit 0c9b24e1e75c5c10d3f3baafb80c5c27bb7e4c78
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 7 17:20:38 2008 +0200

    libreplace: use AC_LIBREPLACE_NETWORK_CHECKS only for samba
    
    metze

commit 0987c32645e4851badab4c1daffb4ee7982ea153
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 7 17:15:36 2008 +0200

    libreplace: use AC_LIBREPLACE_NETWORK_CHECKS only for samba
    
    metze
    (cherry picked from commit 3451b54bf7f5e37a589ec261d28c2a8b6f9788ed)

commit 2a3ddc23cc8d050dfe5b4e1c0e139a7c97cc3b59
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 7 16:50:19 2008 +0200

    libreplace: split out network checks into a AC_LIBREPLACE_NETWORK_CHECKS macro
    
    Note: moving it out of AC_LIBREPLACE_BROKEN_CHECKS will be the next step
    
    metze
    (cherry picked from commit 55a904b1d7aeca849d450e371b18afca5b0c6218)

commit 8a241cf150fba787c82cbcb03730083ced442fbb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 7 13:10:31 2008 +0200

    libreplace: always provide utime() and utimes()
    
    I'd like to also provide futimes(), but it seems
    that some systems doesn't support a it at kernel level.
    
    If someone knows how to write a portable replacement
    for futimes() please tell me...
    
    metze
    (cherry picked from commit a9604fe4a323dccb537cf02ea7594437b4995803)

-----------------------------------------------------------------------

Summary of changes:
 source/configure.in                      |    1 +
 source/lib/replace/README                |    2 +
 source/lib/replace/configure.ac          |    1 +
 source/lib/replace/getaddrinfo.m4        |   32 ---
 source/lib/replace/getifaddrs.m4         |  128 -------------
 source/lib/replace/inet_aton.m4          |    1 -
 source/lib/replace/inet_ntoa.m4          |   19 --
 source/lib/replace/inet_ntop.m4          |    1 -
 source/lib/replace/inet_pton.m4          |    1 -
 source/lib/replace/libreplace.m4         |   64 +------
 source/lib/replace/libreplace_ld.m4      |    3 +
 source/lib/replace/libreplace_network.m4 |  307 ++++++++++++++++++++++++++++++
 source/lib/replace/replace.c             |   27 +++
 source/lib/replace/replace.h             |   10 +
 source/lib/replace/samba.m4              |    1 +
 source/lib/replace/socket.m4             |   39 ----
 source/lib/replace/socketpair.m4         |    1 -
 source/lib/replace/system/config.m4      |    2 +-
 source/lib/replace/system/network.h      |    4 +
 source/lib/replace/system/time.h         |   15 ++
 source/lib/replace/test/testsuite.c      |  145 ++++++++++++++
 21 files changed, 518 insertions(+), 286 deletions(-)
 delete mode 100644 source/lib/replace/getaddrinfo.m4
 delete mode 100644 source/lib/replace/getifaddrs.m4
 delete mode 100644 source/lib/replace/inet_aton.m4
 delete mode 100644 source/lib/replace/inet_ntoa.m4
 delete mode 100644 source/lib/replace/inet_ntop.m4
 delete mode 100644 source/lib/replace/inet_pton.m4
 create mode 100644 source/lib/replace/libreplace_network.m4
 delete mode 100644 source/lib/replace/socket.m4
 delete mode 100644 source/lib/replace/socketpair.m4


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index a2f725b..bc36ced 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -651,6 +651,7 @@ SAVE_CPPFLAGS="${CPPFLAGS}"
 CPPFLAGS="${CPPFLAGS} ${SAMBA_CONFIGURE_CPPFLAGS}"
 
 AC_LIBREPLACE_BROKEN_CHECKS
+AC_LIBREPLACE_NETWORK_CHECKS
 
 CPPFLAGS="${SAVE_CPPFLAGS}"
 
diff --git a/source/lib/replace/README b/source/lib/replace/README
index 43f7b08..4d94317 100644
--- a/source/lib/replace/README
+++ b/source/lib/replace/README
@@ -62,6 +62,8 @@ getnameinfo
 gai_strerror
 getifaddrs
 freeifaddrs
+utime
+utimes
 
 Types:
 bool
diff --git a/source/lib/replace/configure.ac b/source/lib/replace/configure.ac
index 02dc08b..81997e0 100644
--- a/source/lib/replace/configure.ac
+++ b/source/lib/replace/configure.ac
@@ -6,6 +6,7 @@ AC_CONFIG_HEADER(config.h)
 CFLAGS="$CFLAGS -I$srcdir"
 
 AC_LIBREPLACE_ALL_CHECKS
+AC_LIBREPLACE_NETWORK_CHECKS
 
 if test "$ac_cv_prog_gcc" = yes; then
    CFLAGS="$CFLAGS -Wall"
diff --git a/source/lib/replace/getaddrinfo.m4 b/source/lib/replace/getaddrinfo.m4
deleted file mode 100644
index bc6e69e..0000000
--- a/source/lib/replace/getaddrinfo.m4
+++ /dev/null
@@ -1,32 +0,0 @@
-dnl test for getaddrinfo/getnameinfo
-AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
-AC_TRY_LINK([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-#include <netdb.h>],
-[
-struct sockaddr sa;
-struct addrinfo *ai = NULL;
-int ret = getaddrinfo(NULL, NULL, NULL, &ai);
-if (ret != 0) {
-	const char *es = gai_strerror(ret);
-}
-freeaddrinfo(ai);
-ret = getnameinfo(&sa, sizeof(sa),
-		NULL, 0,
-		NULL, 0, 0);
-
-],
-libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
-if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
-	AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
-	AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo])
-	AC_DEFINE(HAVE_FREEADDRINFO,1,[Whether the system has freeaddrinfo])
-	AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
-else
-	LIBREPLACEOBJ="${LIBREPLACEOBJ} getaddrinfo.o"
-fi
diff --git a/source/lib/replace/getifaddrs.m4 b/source/lib/replace/getifaddrs.m4
deleted file mode 100644
index 927bc67..0000000
--- a/source/lib/replace/getifaddrs.m4
+++ /dev/null
@@ -1,128 +0,0 @@
-AC_CHECK_HEADERS([ifaddrs.h])
-
-dnl Used when getifaddrs is not available
-AC_CHECK_MEMBERS([struct sockaddr.sa_len], 
-	 [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has a sa_len member])],
-	 [],
-	 [#include <sys/socket.h>])
-
-dnl test for getifaddrs and freeifaddrs
-AC_CACHE_CHECK([for getifaddrs and freeifaddrs],libreplace_cv_HAVE_GETIFADDRS,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ifaddrs.h>
-#include <netdb.h>],
-[
-struct ifaddrs *ifp = NULL;
-int ret = getifaddrs (&ifp);
-freeifaddrs(ifp);
-],
-libreplace_cv_HAVE_GETIFADDRS=yes,libreplace_cv_HAVE_GETIFADDRS=no)])
-if test x"$libreplace_cv_HAVE_GETIFADDRS" = x"yes"; then
-    AC_DEFINE(HAVE_GETIFADDRS,1,[Whether the system has getifaddrs])
-    AC_DEFINE(HAVE_FREEIFADDRS,1,[Whether the system has freeifaddrs])
-	AC_DEFINE(HAVE_STRUCT_IFADDRS,1,[Whether struct ifaddrs is available])
-fi
-
-##################
-# look for a method of finding the list of network interfaces
-#
-# This tests need LIBS="${LIBREPLACE_NETWORK_LIBS}"
-#
-old_LIBS=$LIBS
-LIBS="${LIBREPLACE_NETWORK_LIBS}"
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I$libreplacedir"
-iface=no;
-##################
-# look for a method of finding the list of network interfaces
-iface=no;
-AC_CACHE_CHECK([for iface getifaddrs],libreplace_cv_HAVE_IFACE_GETIFADDRS,[
-AC_TRY_RUN([
-#define HAVE_IFACE_GETIFADDRS 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
-           libreplace_cv_HAVE_IFACE_GETIFADDRS=yes,libreplace_cv_HAVE_IFACE_GETIFADDRS=no,libreplace_cv_HAVE_IFACE_GETIFADDRS=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_GETIFADDRS" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_GETIFADDRS,1,[Whether iface getifaddrs is available])
-else
-	LIBREPLACEOBJ="${LIBREPLACEOBJ} getifaddrs.o"
-fi
-
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[
-AC_TRY_RUN([
-#define HAVE_IFACE_AIX 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#undef _XOPEN_SOURCE_EXTENDED
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
-           libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-fi
-fi
-
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFCONF 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
-           libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
-fi
-fi
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFREQ 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
-           libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
-fi
-fi
-
-LIBS=$old_LIBS
-CPPFLAGS="$SAVE_CPPFLAGS"
-
diff --git a/source/lib/replace/inet_aton.m4 b/source/lib/replace/inet_aton.m4
deleted file mode 100644
index 853688e..0000000
--- a/source/lib/replace/inet_aton.m4
+++ /dev/null
@@ -1 +0,0 @@
-AC_CHECK_FUNCS(inet_aton,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_aton.o"])
diff --git a/source/lib/replace/inet_ntoa.m4 b/source/lib/replace/inet_ntoa.m4
deleted file mode 100644
index 5aaa935..0000000
--- a/source/lib/replace/inet_ntoa.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-AC_CHECK_FUNCS(inet_ntoa,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_ntoa.o"])
-
-AC_CACHE_CHECK([for broken inet_ntoa],libreplace_cv_REPLACE_INET_NTOA,[
-AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-main() { struct in_addr ip; ip.s_addr = 0x12345678;
-if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
-    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
-exit(1);}],
-           libreplace_cv_REPLACE_INET_NTOA=yes,libreplace_cv_REPLACE_INET_NTOA=no,libreplace_cv_REPLACE_INET_NTOA=cross)])
-if test x"$libreplace_cv_REPLACE_INET_NTOA" = x"yes"; then
-    AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
-fi
diff --git a/source/lib/replace/inet_ntop.m4 b/source/lib/replace/inet_ntop.m4
deleted file mode 100644
index 6f39056..0000000
--- a/source/lib/replace/inet_ntop.m4
+++ /dev/null
@@ -1 +0,0 @@
-AC_CHECK_FUNCS(inet_ntop,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_ntop.o"])
diff --git a/source/lib/replace/inet_pton.m4 b/source/lib/replace/inet_pton.m4
deleted file mode 100644
index 51de927..0000000
--- a/source/lib/replace/inet_pton.m4
+++ /dev/null
@@ -1 +0,0 @@
-AC_CHECK_FUNCS(inet_pton,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_pton.o"])
diff --git a/source/lib/replace/libreplace.m4 b/source/lib/replace/libreplace.m4
index 8e17258..2b33d97 100644
--- a/source/lib/replace/libreplace.m4
+++ b/source/lib/replace/libreplace.m4
@@ -96,65 +96,10 @@ 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)
 AC_CHECK_HEADERS(sys/mount.h mntent.h)
 AC_CHECK_HEADERS(stropts.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_CACHE_CHECK([for usable net/if.h],libreplace_cv_USABLE_NET_IF_H,[
-	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-		AC_INCLUDES_DEFAULT
-		#if HAVE_SYS_SOCKET_H
-		# include <sys/socket.h>
-		#endif
-		#include <net/if.h>
-		int main(void) {return 0;}])],
-		[libreplace_cv_USABLE_NET_IF_H=yes],
-		[libreplace_cv_USABLE_NET_IF_H=no]
-	)
-])
-if test x"$libreplace_cv_USABLE_NET_IF_H" = x"yes";then
-	AC_DEFINE(HAVE_NET_IF_H, 1, usability of net/if.h)
-fi
-
-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>
-#include <netinet/in.h>
-])
-AC_HAVE_TYPE([struct sockaddr_in6], [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-])
-
-if test x"$ac_cv_type_struct_sockaddr_storage" = x"yes"; then
-AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,
-                AC_DEFINE(HAVE_SS_FAMILY, 1, [Defined if struct sockaddr_storage has ss_family field]),,
-                [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-		])
-
-if test x"$ac_cv_member_struct_sockaddr_storage_ss_family" != x"yes"; then
-AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
-                AC_DEFINE(HAVE___SS_FAMILY, 1, [Defined if struct sockaddr_storage has __ss_family field]),,
-                [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-		])
-fi
-fi
-
 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)
@@ -326,15 +271,7 @@ m4_include(getpass.m4)
 m4_include(strptime.m4)
 m4_include(win32.m4)
 m4_include(timegm.m4)
-m4_include(socket.m4)
-m4_include(inet_ntop.m4)
-m4_include(inet_pton.m4)
-m4_include(inet_aton.m4)
-m4_include(inet_ntoa.m4)
-m4_include(getaddrinfo.m4)
 m4_include(repdir.m4)
-m4_include(getifaddrs.m4)
-m4_include(socketpair.m4)
 
 AC_CHECK_FUNCS([syslog printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
 
@@ -361,5 +298,6 @@ CFLAGS="$CFLAGS -I$libreplacedir"
 
 m4_include(libreplace_cc.m4)
 m4_include(libreplace_ld.m4)
+m4_include(libreplace_network.m4)
 m4_include(libreplace_macros.m4)
 m4_include(autoconf-2.60.m4)
diff --git a/source/lib/replace/libreplace_ld.m4 b/source/lib/replace/libreplace_ld.m4
index f0d10c1..9995d69 100644
--- a/source/lib/replace/libreplace_ld.m4
+++ b/source/lib/replace/libreplace_ld.m4
@@ -270,6 +270,9 @@ AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_ALLOW_UNDEF_FLAG],
 		*darwin*)
 			LD_SHLIB_ALLOW_UNDEF_FLAG="-undefined dynamic_lookup"
 			;;
+		*aix*)
+			LD_SHLIB_ALLOW_UNDEF_FLAG="--Wl,-bnoentry"
+			;;
 	esac
 
 	AC_SUBST(LD_SHLIB_ALLOW_UNDEF_FLAG)
diff --git a/source/lib/replace/libreplace_network.m4 b/source/lib/replace/libreplace_network.m4
new file mode 100644
index 0000000..5ab71f1
--- /dev/null
+++ b/source/lib/replace/libreplace_network.m4
@@ -0,0 +1,307 @@
+AC_DEFUN_ONCE(AC_LIBREPLACE_NETWORK_CHECKS,
+[
+echo "LIBREPLACE_NETWORK_CHECKS: START"
+
+AC_DEFINE(LIBREPLACE_NETWORK_CHECKS, 1, [LIBREPLACE_NETWORK_CHECKS were used])
+LIBREPLACE_NETWORK_OBJS=""
+LIBREPLACE_NETWORK_LIBS=""
+
+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)
+
+dnl we need to check that net/if.h really can be used, to cope with hpux
+dnl where including it always fails
+AC_CACHE_CHECK([for usable net/if.h],libreplace_cv_USABLE_NET_IF_H,[
+	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+		AC_INCLUDES_DEFAULT
+		#if HAVE_SYS_SOCKET_H
+		# include <sys/socket.h>
+		#endif
+		#include <net/if.h>
+		int main(void) {return 0;}])],
+		[libreplace_cv_USABLE_NET_IF_H=yes],
+		[libreplace_cv_USABLE_NET_IF_H=no]
+	)
+])
+if test x"$libreplace_cv_USABLE_NET_IF_H" = x"yes";then
+	AC_DEFINE(HAVE_NET_IF_H, 1, usability of net/if.h)
+fi
+
+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>
+#include <netinet/in.h>
+])
+AC_HAVE_TYPE([struct sockaddr_in6], [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+])
+
+if test x"$ac_cv_type_struct_sockaddr_storage" = x"yes"; then
+AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,
+                AC_DEFINE(HAVE_SS_FAMILY, 1, [Defined if struct sockaddr_storage has ss_family field]),,
+                [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+		])
+
+if test x"$ac_cv_member_struct_sockaddr_storage_ss_family" != x"yes"; then
+AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
+                AC_DEFINE(HAVE___SS_FAMILY, 1, [Defined if struct sockaddr_storage has __ss_family field]),,
+                [
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+		])
+fi
+fi
+
+dnl The following test is roughl taken from the cvs sources.
+dnl
+dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
+dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+dnl libsocket.so which has a bad implementation of gethostbyname (it
+dnl only looks in /etc/hosts), so we only look for -lsocket if we need
+dnl it.
+AC_CHECK_FUNCS(connect)
+if test x"$ac_cv_func_connect" = x"no"; then
+	AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, connect)
+	AC_CHECK_LIB_EXT(inet, LIBREPLACE_NETWORK_LIBS, connect)
+	dnl We can't just call AC_CHECK_FUNCS(connect) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_nsl_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_socket_connect" = x"yes" ||
+		test x"$ac_cv_lib_ext_inet_connect" = x"yes"
+	then
+		AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
+	fi
+fi
+
+AC_CHECK_FUNCS(gethostbyname)
+if test x"$ac_cv_func_gethostbyname" = x"no"; then
+	AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, gethostbyname)
+	dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" = x"yes" ||
+		test x"$ac_cv_lib_ext_nsl_gethostbyname" = x"yes" ||
+		test x"$ac_cv_lib_ext_socket_gethostbyname" = x"yes"
+	then
+		AC_DEFINE(HAVE_GETHOSTBYNAME,1,
+			  [Whether the system has gethostbyname()])
+	fi
+fi
+
+dnl HP-UX has if_nametoindex in -lipv6
+AC_CHECK_FUNCS(if_nametoindex)
+if test x"$ac_cv_func_if_nametoindex" = x"no"; then
+	AC_CHECK_LIB_EXT(ipv6, LIBREPLACE_NETWORK_LIBS, if_nametoindex)
+	dnl We can't just call AC_CHECK_FUNCS(if_nametoindex) here,
+	dnl because the value has been cached.
+	if test x"$ac_cv_lib_ext_ipv6_if_nametoindex" = x"yes"
+	then
+		AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
+			  [Whether the system has if_nametoindex()])
+	fi
+fi
+
+# The following tests need LIBS="${LIBREPLACE_NETWORK_LIBS}"
+old_LIBS=$LIBS
+LIBS="${LIBREPLACE_NETWORK_LIBS}"
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$libreplacedir"
+
+AC_CHECK_FUNCS(socketpair,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} socketpair.o"])
+
+AC_CACHE_CHECK([for broken inet_ntoa],libreplace_cv_REPLACE_INET_NTOA,[
+AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H


-- 
Samba Shared Repository


More information about the samba-cvs mailing list