Alexandre Julliard : configure: Check for the necessary data structure for if_nameindex().

Alexandre Julliard julliard at winehq.org
Wed May 3 16:06:15 CDT 2017


Module: wine
Branch: master
Commit: a6fc8f6c82f832115e2fdd7b3762fa344d437fa5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a6fc8f6c82f832115e2fdd7b3762fa344d437fa5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May  3 21:20:43 2017 +0200

configure: Check for the necessary data structure for if_nameindex().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure    | 39 ++++++++++++++++++++++++++++++++++++++-
 configure.ac | 14 +++++++++++++-
 2 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 53882d5..04d6f54 100755
--- a/configure
+++ b/configure
@@ -15284,7 +15284,6 @@ for ac_func in \
 	getpwuid \
 	gettimeofday \
 	getuid \
-	if_nameindex \
 	isnanf \
 	kqueue \
 	lstat \
@@ -16150,6 +16149,44 @@ _ACEOF
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for if_nameindex" >&5
+$as_echo_n "checking for if_nameindex... " >&6; }
+if ${wine_cv_have_if_nameindex+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+int
+main ()
+{
+struct if_nameindex *p = if_nameindex(); return p->if_index;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  wine_cv_have_if_nameindex=yes
+else
+  wine_cv_have_if_nameindex=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_if_nameindex" >&5
+$as_echo "$wine_cv_have_if_nameindex" >&6; }
+if test "$wine_cv_have_if_nameindex" = "yes"
+then
+
+$as_echo "#define HAVE_IF_NAMEINDEX 1" >>confdefs.h
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigaddset" >&5
 $as_echo_n "checking for sigaddset... " >&6; }
 if ${wine_cv_have_sigaddset+:} false; then :
diff --git a/configure.ac b/configure.ac
index e86f143..1431fb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2015,7 +2015,6 @@ AC_CHECK_FUNCS(\
 	getpwuid \
 	gettimeofday \
 	getuid \
-	if_nameindex \
 	isnanf \
 	kqueue \
 	lstat \
@@ -2203,6 +2202,19 @@ AC_CHECK_MEMBERS([struct ff_effect.direction],,,
 #include <linux/input.h>
 #endif])
 
+AC_CACHE_CHECK([for if_nameindex],wine_cv_have_if_nameindex,
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif]],
+                              [[struct if_nameindex *p = if_nameindex(); return p->if_index;]])],[wine_cv_have_if_nameindex=yes],[wine_cv_have_if_nameindex=no]))
+if test "$wine_cv_have_if_nameindex" = "yes"
+then
+  AC_DEFINE(HAVE_IF_NAMEINDEX, 1, [Define to 1 if you have the `if_nameindex' function.])
+fi
+
 AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset,
                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[sigset_t set; sigaddset(&set,SIGTERM);]])],[wine_cv_have_sigaddset=yes],[wine_cv_have_sigaddset=no]))
 if test "$wine_cv_have_sigaddset" = "yes"




More information about the wine-cvs mailing list