From 840933cd4eaca75ebb4d63928023e7d1d24f4a8c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 21 Feb 2008 17:56:33 +0100 Subject: Try and fix getifaddrs check on irix: dont't try to include config.h The missing header file is judged "catastrophic" on irix. Michael (cherry picked from commit 5778c90819a5a5cee38be690f442c571f3a6a051) (This used to be commit 0d4522a06d4465f6eadbdf14381c9e08cf7e1dc9) --- source4/lib/replace/getifaddrs.m4 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.m4 b/source4/lib/replace/getifaddrs.m4 index 4cf86d89cc..5d5edf1cbd 100644 --- a/source4/lib/replace/getifaddrs.m4 +++ b/source4/lib/replace/getifaddrs.m4 @@ -60,6 +60,7 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[ AC_TRY_RUN([ +#define NO_CONFIG_H 1 #define HAVE_IFACE_AIX 1 #define AUTOCONF_TEST 1 #undef _XOPEN_SOURCE_EXTENDED @@ -74,6 +75,7 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[ AC_TRY_RUN([ +#define NO_CONFIG_H 1 #define HAVE_IFACE_IFCONF 1 #define AUTOCONF_TEST 1 #include "$libreplacedir/getifaddrs.c"], @@ -86,6 +88,7 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[ AC_TRY_RUN([ +#define NO_CONFIG_H 1 #define HAVE_IFACE_IFREQ 1 #define AUTOCONF_TEST 1 #include "$libreplacedir/getifaddrs.c"], -- cgit From c513546cda3d453748c88589b83015489fc6f14f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 21 Feb 2008 18:16:10 +0100 Subject: libreplace: fix compile errors in getifaddrs.c Michael (cherry picked from commit 22cdd4cb507022d9c670b7d5cbc8d357b0b91637) (This used to be commit 4da2d999a28c8fd3e93480194a153cf6a10de986) --- source4/lib/replace/getifaddrs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c index 4037d647d7..f12062bd8e 100644 --- a/source4/lib/replace/getifaddrs.c +++ b/source4/lib/replace/getifaddrs.c @@ -81,7 +81,6 @@ int rep_getifaddrs(struct ifaddrs **ifap) char buff[8192]; int fd, i, n; struct ifreq *ifr=NULL; - int total = 0; struct in_addr ipaddr; struct in_addr nmask; char *iname; @@ -106,7 +105,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) n = ifc.ifc_len / sizeof(struct ifreq); /* Loop through interfaces, looking for given IP address */ - for (i=n-1;i>=0 && total < max_interfaces;i--) { + for (i=n-1; i>=0; i--) { if (ioctl(fd, SIOCGIFADDR, &ifr[i]) != 0) { freeifaddrs(*ifap); } @@ -166,11 +165,10 @@ int rep_getifaddrs(struct ifaddrs **ifap) char buff[8192]; int fd, i, n; struct ifreq *ifr=NULL; - int total = 0; struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif; + struct ifaddrs *curif, *lastif; *ifap = NULL; @@ -201,7 +199,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) /* Loop through interfaces */ - for (i = 0; i Date: Fri, 22 Feb 2008 00:24:11 +0100 Subject: Add missing initalizations of lastif in rep_getifaddr implementations. Michael (cherry picked from commit 65710e752f72070cb911867ff9f31f91904ca5c0) (This used to be commit 5bd613a2cda5d287706f2ce72f4ee08a7fa45b72) --- source4/lib/replace/getifaddrs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c index f12062bd8e..60049caa99 100644 --- a/source4/lib/replace/getifaddrs.c +++ b/source4/lib/replace/getifaddrs.c @@ -84,7 +84,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; @@ -168,7 +169,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; @@ -268,7 +270,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; -- cgit From c2f92013c3304bf49622f7e0d5658f768898a4f1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Feb 2008 00:27:00 +0100 Subject: Fix linked list of ifaddrs in implementations of rep_getifaddrs. Produce proper list instead of one-node-loop. Michael (cherry picked from commit ec9f4f5066ba7a8bf3af931fd4969590140c0b2b) (This used to be commit 744d5ba7adab65a9774a18eb42b7090f49e423f2) --- source4/lib/replace/getifaddrs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c index 60049caa99..37cd950e09 100644 --- a/source4/lib/replace/getifaddrs.c +++ b/source4/lib/replace/getifaddrs.c @@ -115,7 +115,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } curif->ifa_name = strdup(ifr[i].ifr_name); @@ -208,7 +208,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } strioctl.ic_cmd = SIOCGIFFLAGS; @@ -306,7 +306,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } curif->ifa_name = strdup(ifr->ifr_name); -- cgit From 88c919c14af3b5e5cb9524ce3bb778b7c7bc6c72 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Feb 2008 00:34:41 +0100 Subject: libreplace: fix creation of conftest files for getifaddrs tests. Add missing includes of replace.c and defines of SOCKET_WRAPPER_NOT_REPLACE. Michael (cherry picked from commit 26e6ebc7090b5742deb67805d85d809cafb4543d) (This used to be commit e00c6513e05afe91d4c419287283b34e931a161c) --- source4/lib/replace/getifaddrs.m4 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.m4 b/source4/lib/replace/getifaddrs.m4 index 5d5edf1cbd..dd2a95cb81 100644 --- a/source4/lib/replace/getifaddrs.m4 +++ b/source4/lib/replace/getifaddrs.m4 @@ -44,9 +44,10 @@ iface=no; iface=no; AC_CACHE_CHECK([for iface getifaddrs],libreplace_cv_HAVE_IFACE_GETIFADDRS,[ AC_TRY_RUN([ -#define NO_CONFIG_H 1 #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/getifaddrs.c"], libreplace_cv_HAVE_IFACE_GETIFADDRS=yes,libreplace_cv_HAVE_IFACE_GETIFADDRS=no,libreplace_cv_HAVE_IFACE_GETIFADDRS=cross)]) @@ -60,10 +61,12 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[ AC_TRY_RUN([ -#define NO_CONFIG_H 1 #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/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 @@ -75,9 +78,11 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[ AC_TRY_RUN([ -#define NO_CONFIG_H 1 #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/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 @@ -88,9 +93,11 @@ fi if test $iface = no; then AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[ AC_TRY_RUN([ -#define NO_CONFIG_H 1 #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/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 -- cgit From bf7d3b6ef440d61a8d65001f99c7526bb830f5d3 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Feb 2008 10:42:22 +0100 Subject: libreplace: Fix comment originating from old samba source. Michael (This used to be commit 0440bcfe6359ca4842f473b1ca799cad9f1c6c96) --- source4/lib/replace/getifaddrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c index 37cd950e09..a6f06e545f 100644 --- a/source4/lib/replace/getifaddrs.c +++ b/source4/lib/replace/getifaddrs.c @@ -363,7 +363,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) #endif #ifdef AUTOCONF_TEST -/* this is the autoconf driver to test get_interfaces() */ +/* this is the autoconf driver to test getifaddrs() */ int main() { -- cgit From e9b0056586f6e57d4d1243c5622c568497e04d38 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Feb 2008 13:53:05 +0100 Subject: libreplace: don't use socketwrapper for getifaddrs() implementations. Michael (cherry picked from commit 85eec1d1d6b674294c50eb912fbe7d5a1dd42909) (This used to be commit a83db886e50b6ceeb71d93bf86fb5e0964b8d45f) --- source4/lib/replace/getifaddrs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c index a6f06e545f..053657475d 100644 --- a/source4/lib/replace/getifaddrs.c +++ b/source4/lib/replace/getifaddrs.c @@ -19,6 +19,8 @@ along with this program. If not, see . */ +#define SOCKET_WRAPPER_NOT_REPLACE + #include "replace.h" #include "system/network.h" -- cgit From 0a8b1fd092c9a64c04f6f05d41b3d7ecec7ccc6f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 25 Feb 2008 14:03:07 -0500 Subject: Update homepages for talloc, tdb and ldb subprojects (This used to be commit 8cb07814bc6627fc8eba228eafd13336e3ca3758) --- source4/lib/ldb/web/index.html | 24 ++++++++++-------------- source4/lib/talloc/web/index.html | 20 ++++++++------------ source4/lib/tdb/web/index.html | 14 ++++++-------- 3 files changed, 24 insertions(+), 34 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/web/index.html b/source4/lib/ldb/web/index.html index 76dbbdeafb..26dd344527 100644 --- a/source4/lib/ldb/web/index.html +++ b/source4/lib/ldb/web/index.html @@ -42,9 +42,9 @@ The main features that separate ldb from other solutions are: Currently ldb is completely lacking in programmer or user documentation. This is your opportunity to make a contribution! Start with the public functions declared in ldb.h +href="http://samba.org/ftp/unpacked/ldb/include/ldb.h">ldb.h and the example code in the tools +href="http://samba.org/ftp/unpacked/ldb/tools/">tools directory. Documentation in the same docbook format used by Samba would be preferred. @@ -53,21 +53,17 @@ would be preferred. ldb does not currently have its own mailing list or bug tracking system. For now, please use the samba-technical -mailing list, and the Samba -bugzilla bug tracking system. +mailing list or the ldb +mailing list, and the Samba bugzilla bug tracking system.

Download

-You can download the latest release either via rsync or anonymous -svn. To fetch via svn use the following commands: - -
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/ldb ldb
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/tdb tdb
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/talloc talloc
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/replace libreplace
-
- +You can download the latest release either via rsync or thtough git.
+
+To fetch via git see the following guide:
+Using Git for Samba Development
+Once you have cloned the tree switch to the v4-0-test branch and cd into the source/lib/ldb directory.
+
To fetch via rsync use these commands:
diff --git a/source4/lib/talloc/web/index.html b/source4/lib/talloc/web/index.html
index 628030ad4c..5deab93665 100644
--- a/source4/lib/talloc/web/index.html
+++ b/source4/lib/talloc/web/index.html
@@ -12,7 +12,7 @@ destructors. It is the core memory allocator used in Samba4, and has
 made a huge difference in many aspects of Samba4 development.

To get started with talloc, I would recommend you read the talloc guide. +href="http://samba.org/ftp/unpacked/talloc/talloc_guide.txt">talloc guide.

Discussion and bug reports

@@ -24,20 +24,16 @@ bugzilla bug tracking system.

Download

-You can download the latest release either via rsync or git. -To fetch via git use the following command: - -
-  git-clone git://git.samba.org/samba.git samba
-  cd samba
-  git checkout -b samba4 origin/v4-0-test
-
- +You can download the latest release either via rsync or git.
+
+To fetch via git see the following guide:
+Using Git for Samba Development
+Once you have cloned the tree switch to the v4-0-test branch and cd into the source/lib/talloc directory.
+
To fetch via rsync use this command:
-  rsync -Pavz samba.org::ftp/unpacked/samba_4_0_test/source/lib/talloc .
-  rsync -Pavz samba.org::ftp/unpacked/samba_4_0_test/source/lib/libreplace .
+  rsync -Pavz samba.org::ftp/unpacked/talloc .
 

diff --git a/source4/lib/tdb/web/index.html b/source4/lib/tdb/web/index.html index 979665ae76..a53da6b8f7 100644 --- a/source4/lib/tdb/web/index.html +++ b/source4/lib/tdb/web/index.html @@ -22,14 +22,12 @@ bugzilla bug tracking system.

Download

-You can download the latest release either via rsync or anonymous -svn. To fetch via svn use the following commands: - -
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/tdb tdb
-  svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/lib/replace libreplace
-
- +You can download the latest release either via rsync or git.
+
+To fetch via git see the following guide:
+Using Git for Samba Development
+Once you have cloned the tree switch to the v4-0-test branch and cd into the source/lib/tdb directory.
+
To fetch via rsync use these commands:
-- 
cgit 


From 901addd4a18a9a166fc3518a7bce70969f884e6f Mon Sep 17 00:00:00 2001
From: Michael Adam 
Date: Tue, 26 Feb 2008 11:18:51 +0100
Subject: Fix build on VOS: socklen_t is needed for rep_inet_ntop: move it up.

Michael
(This used to be commit 8a26a6e8f11aca5119b15e304213548ad608dc5b)
---
 source4/lib/replace/system/network.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'source4/lib')

diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h
index d09e3f71f8..a84b22e5d0 100644
--- a/source4/lib/replace/system/network.h
+++ b/source4/lib/replace/system/network.h
@@ -83,6 +83,11 @@
 #include 
 #endif
 
+#ifndef HAVE_SOCKLEN_T
+#define HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
 #ifdef REPLACE_INET_NTOA
 /* define is in "replace.h" */
 char *rep_inet_ntoa(struct in_addr ip);
@@ -245,11 +250,6 @@ void rep_freeifaddrs(struct ifaddrs *);
 #define HOST_NAME_MAX 256
 #endif
 
-#ifndef HAVE_SOCKLEN_T
-#define HAVE_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
 #ifndef HAVE_SA_FAMILY_T
 #define HAVE_SA_FAMILY_T
 typedef unsigned short int sa_family_t;
-- 
cgit 


From 28464179174d2c3d1c1bc124ba9c2519e08a5fc9 Mon Sep 17 00:00:00 2001
From: Michael Adam 
Date: Tue, 26 Feb 2008 13:24:54 +0100
Subject: libreplace: Add tests for connect and gethostbyname.

Provide dummy replacements when a function isnt found.
The functions are also searched for in certain libraries,
and variables SOCKET_LIBS and NSL_LIBS are set accordingly.

One purpose of this is to fix the getifaddrs tests on
systems where e.g. the socket calls require special libs
for linking.

Michael
(This used to be commit 900d17acb95f1becfc46656a12c107336c027ef7)
---
 source4/lib/replace/libreplace.m4    |  1 +
 source4/lib/replace/replace.h        | 10 +++++++++
 source4/lib/replace/socket.c         | 35 +++++++++++++++++++++++++++++++
 source4/lib/replace/socket.m4        | 40 ++++++++++++++++++++++++++++++++++++
 source4/lib/replace/system/network.h | 10 +++++++++
 5 files changed, 96 insertions(+)
 create mode 100644 source4/lib/replace/socket.c
 create mode 100644 source4/lib/replace/socket.m4

(limited to 'source4/lib')

diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index 2e0cd34f4a..e0cc57f4c8 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -344,6 +344,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(getaddrinfo.m4)
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index 3f91544e97..0d16f4ffd0 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -340,6 +340,16 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
 /* prototype is in "system/network.h" */
 #endif
 
+#ifndef HAVE_CONNECT
+#define connect rep_connect
+/* prototype is in "system/network.h" */
+#endif
+
+#ifndef HAVE_GETHOSTBYNAME
+#define gethostbyname rep_gethostbyname
+/* prototype is in "system/network.h" */
+#endif
+
 #ifndef HAVE_GETIFADDRS
 #define getifaddrs rep_getifaddrs
 /* prototype is in "system/network.h" */
diff --git a/source4/lib/replace/socket.c b/source4/lib/replace/socket.c
new file mode 100644
index 0000000000..35e975fce7
--- /dev/null
+++ b/source4/lib/replace/socket.c
@@ -0,0 +1,35 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * Dummy replacements for socket functions.
+ *
+ * Copyright (C) Michael Adam  2008
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+
+#include "replace.h"
+#include "system/network.h"
+
+int rep_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+struct hostent *rep_gethostbyname(const char *name)
+{
+	errno = ENOSYS;
+	return NULL;
+}
diff --git a/source4/lib/replace/socket.m4 b/source4/lib/replace/socket.m4
new file mode 100644
index 0000000000..c0c8f93e81
--- /dev/null
+++ b/source4/lib/replace/socket.m4
@@ -0,0 +1,40 @@
+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, SOCKET_LIBS, connect)
+	AC_CHECK_LIB_EXT(nsl, SOCKET_LIBS, connect)
+	AC_CHECK_LIB_EXT(socket, SOCKET_LIBS, connect)
+	AC_CHECK_LIB_EXT(inet, SOCKET_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, NSL_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(nsl, NSL_LIBS, gethostbyname)
+	AC_CHECK_LIB_EXT(socket, NSL_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
+
diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h
index a84b22e5d0..410c6d7cca 100644
--- a/source4/lib/replace/system/network.h
+++ b/source4/lib/replace/system/network.h
@@ -103,6 +103,16 @@ int rep_inet_pton(int af, const char *src, void *dst);
 const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #endif
 
+#ifndef HAVE_CONNECT
+/* define is in "replace.h" */
+int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
+#endif
+
+#ifndef HAVE_GETHOSTBYNAME
+/* define is in "replace.h" */
+struct hostent *rep_gethostbyname(const char *name);
+#endif
+
 #ifdef HAVE_IFADDRS_H
 #include 
 #endif
-- 
cgit 


From 3a90bed29f6ddb2566f73f02a59eef1b0f1b7554 Mon Sep 17 00:00:00 2001
From: Michael Adam 
Date: Wed, 27 Feb 2008 01:29:12 +0100
Subject: libreplace: fix standalone build on some systems.

getifaddr tests include system/network.h, which does not
find getaddrinfo.h without "-I.".

Michael
(This used to be commit cd95c702ed90128f659e27709c61d4c6abc969ef)
---
 source4/lib/replace/configure.ac | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'source4/lib')

diff --git a/source4/lib/replace/configure.ac b/source4/lib/replace/configure.ac
index beeb77e152..72d788ddcc 100644
--- a/source4/lib/replace/configure.ac
+++ b/source4/lib/replace/configure.ac
@@ -3,6 +3,8 @@ AC_INIT(replace.c)
 AC_CONFIG_SRCDIR([replace.c])
 AC_CONFIG_HEADER(config.h)
 
+CFLAGS="$CFLAGS -I."
+
 AC_LIBREPLACE_ALL_CHECKS
 
 if test "$ac_cv_prog_gcc" = yes; then
-- 
cgit 


From b6f8132e928509e751f0dc35c93fb024105709ee Mon Sep 17 00:00:00 2001
From: Michael Adam 
Date: Wed, 27 Feb 2008 01:41:30 +0100
Subject: libreplace: fix standalone build - add necessary libs.

The libs needed for getifaddrs replacements have to be added
to LIBS and used for the testsuite target.

Michael
(This used to be commit e7c1d6513b945b205abe84b18a251d06e737e659)
---
 source4/lib/replace/Makefile.in   | 4 +++-
 source4/lib/replace/getifaddrs.m4 | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

(limited to 'source4/lib')

diff --git a/source4/lib/replace/Makefile.in b/source4/lib/replace/Makefile.in
index 30f39ac6cb..af9522f3a6 100644
--- a/source4/lib/replace/Makefile.in
+++ b/source4/lib/replace/Makefile.in
@@ -10,6 +10,7 @@ VPATH = @libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
 INSTALL = @INSTALL@
+LIBS = @LIBS@
 
 .PHONY: test all showflags install installcheck clean distclean realdistclean
 
@@ -25,6 +26,7 @@ showflags:
 	@echo '  CC     = $(CC)'
 	@echo '  CFLAGS = $(CFLAGS)'
 	@echo '  LDFLAGS= $(LDFLAGS)'
+	@echo '  LIBS   = $(LIBS)'
 
 install: all
 	mkdir -p $(libdir)
@@ -41,7 +43,7 @@ installcheck: install test
 TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o
 
 testsuite: libreplace.a $(TEST_OBJS)
-	$(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS)
+	$(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS)
 
 .c.o:
 	@echo Compiling $*.c
diff --git a/source4/lib/replace/getifaddrs.m4 b/source4/lib/replace/getifaddrs.m4
index dd2a95cb81..767797e8d2 100644
--- a/source4/lib/replace/getifaddrs.m4
+++ b/source4/lib/replace/getifaddrs.m4
@@ -71,6 +71,7 @@ AC_TRY_RUN([
            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])
+	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
@@ -87,6 +88,7 @@ AC_TRY_RUN([
            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])
+	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
@@ -102,6 +104,7 @@ AC_TRY_RUN([
            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])
+	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
-- 
cgit 


From c9009b9876e14ce9bd9e6941a8344e1f5e47dd21 Mon Sep 17 00:00:00 2001
From: Michael Adam 
Date: Wed, 27 Feb 2008 10:33:32 +0100
Subject: libreplace: standalone build: use -I$srcdir instead of -I.

Michael
(This used to be commit ff311e613226e660998824b887cb9595ffbe0275)
---
 source4/lib/replace/configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'source4/lib')

diff --git a/source4/lib/replace/configure.ac b/source4/lib/replace/configure.ac
index 72d788ddcc..f5e054f476 100644
--- a/source4/lib/replace/configure.ac
+++ b/source4/lib/replace/configure.ac
@@ -3,7 +3,7 @@ AC_INIT(replace.c)
 AC_CONFIG_SRCDIR([replace.c])
 AC_CONFIG_HEADER(config.h)
 
-CFLAGS="$CFLAGS -I."
+CFLAGS="$CFLAGS -I$srcdir"
 
 AC_LIBREPLACE_ALL_CHECKS
 
-- 
cgit