summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-17 13:37:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:39 -0500
commita2eca9174c7803732658a1e6f7e8ed873c4fb6fd (patch)
tree237a5c57dd5b5b311ddc9830f48a7f9fa8401b38 /source4/lib
parent04b2dfd9350a218f61a2d83576ca9454e8cfed2b (diff)
downloadsamba-a2eca9174c7803732658a1e6f7e8ed873c4fb6fd.tar.gz
samba-a2eca9174c7803732658a1e6f7e8ed873c4fb6fd.tar.bz2
samba-a2eca9174c7803732658a1e6f7e8ed873c4fb6fd.zip
r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the
configure check for the interfaces. should fix the build on some old sun boxes metze (This used to be commit f20e251bfd9f1eb7ce5c00739631b1625a2aa467)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/basic.mk11
-rw-r--r--source4/lib/netif/config.m442
-rw-r--r--source4/lib/socket/config.m451
-rw-r--r--source4/lib/socket/config.mk10
-rw-r--r--source4/lib/socket/interface.c (renamed from source4/lib/netif/interface.c)2
-rw-r--r--source4/lib/socket/netif.c (renamed from source4/lib/netif/netif.c)0
-rw-r--r--source4/lib/socket/netif.h (renamed from source4/lib/netif/netif.h)2
7 files changed, 63 insertions, 55 deletions
diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk
index bce5b85b32..145adfa3f0 100644
--- a/source4/lib/basic.mk
+++ b/source4/lib/basic.mk
@@ -18,17 +18,6 @@ include util/config.mk
include tdr/config.mk
##############################
-# Start SUBSYSTEM LIBNETIF
-[SUBSYSTEM::LIBNETIF]
-PRIVATE_PROTO_HEADER = netif/proto.h
-OBJ_FILES = \
- netif/interface.o \
- netif/netif.o
-PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL EXT_NSL
-# End SUBSYSTEM LIBNETIF
-##############################
-
-##############################
# Start SUBSYSTEM LIBCRYPTO
[SUBSYSTEM::LIBCRYPTO]
OBJ_FILES = \
diff --git a/source4/lib/netif/config.m4 b/source4/lib/netif/config.m4
deleted file mode 100644
index 9880440f21..0000000000
--- a/source4/lib/netif/config.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-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
-iface=no;
-AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
-AC_TRY_RUN([
-#define HAVE_IFACE_AIX 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
- samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
-if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-fi
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFCONF 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
- samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
-if test x"$samba_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],samba_cv_HAVE_IFACE_IFREQ,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFREQ 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
- samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
-if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
-fi
-fi
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index 7ea7e2b809..0965cd1245 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -97,3 +97,54 @@ if $have_ipv6 = true; then
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
+#
+# This tests need LIBS="$NSL_LIBS $SOCKET_LIBS"
+#
+old_LIBS=$LIBS
+LIBS="$NSL_LIBS $SOCKET_LIBS"
+iface=no;
+AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
+AC_TRY_RUN([
+#define HAVE_IFACE_AIX 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+ samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
+if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
+ iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
+fi
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFCONF 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+ samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
+if test x"$samba_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],samba_cv_HAVE_IFACE_IFREQ,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFREQ 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+ samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
+if test x"$samba_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
diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk
index 1e22edb1d7..a823efb23e 100644
--- a/source4/lib/socket/config.mk
+++ b/source4/lib/socket/config.mk
@@ -1,3 +1,13 @@
+##############################
+# Start SUBSYSTEM LIBNETIF
+[SUBSYSTEM::LIBNETIF]
+PRIVATE_PROTO_HEADER = netif_proto.h
+OBJ_FILES = \
+ interface.o \
+ netif.o
+PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL EXT_SOCKET EXT_NSL
+# End SUBSYSTEM LIBNETIF
+##############################
################################################
# Start MODULE socket_ipv4
diff --git a/source4/lib/netif/interface.c b/source4/lib/socket/interface.c
index 019b05cfbb..5b2b4fd1ab 100644
--- a/source4/lib/netif/interface.c
+++ b/source4/lib/socket/interface.c
@@ -22,7 +22,7 @@
#include "includes.h"
#include "system/network.h"
-#include "lib/netif/netif.h"
+#include "lib/socket/netif.h"
#include "dlinklist.h"
/** used for network interfaces */
diff --git a/source4/lib/netif/netif.c b/source4/lib/socket/netif.c
index 0344febf38..0344febf38 100644
--- a/source4/lib/netif/netif.c
+++ b/source4/lib/socket/netif.c
diff --git a/source4/lib/netif/netif.h b/source4/lib/socket/netif.h
index 558fda4792..ad7c31eb9e 100644
--- a/source4/lib/netif/netif.h
+++ b/source4/lib/socket/netif.h
@@ -29,5 +29,5 @@ struct iface_struct {
#define MAX_INTERFACES 128
#ifndef AUTOCONF_TEST
-#include "lib/netif/proto.h"
+#include "lib/socket/netif_proto.h"
#endif