libreplace: try to fix the build on HP-UX which has if_nametoindex() in -lipv6
authorStefan Metzmacher <metze@samba.org>
Thu, 8 May 2008 09:01:09 +0000 (11:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 May 2008 07:07:13 +0000 (09:07 +0200)
metze

source/lib/replace/libreplace_network.m4

index 56c603a1552b5adca2c0d98f5374c5e104edbbe1..5ab71f160adea17d094d539159a26b2be9941458 100644 (file)
@@ -102,6 +102,19 @@ if test x"$ac_cv_func_gethostbyname" = x"no"; then
        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}"