From a6fc8f6c82f832115e2fdd7b3762fa344d437fa5 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 May 2017 21:20:43 +0200 Subject: [PATCH] configure: Check for the necessary data structure for if_nameindex(). Signed-off-by: Alexandre Julliard --- configure | 39 ++++++++++++++++++++++++++++++++++++++- configure.ac | 14 +++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 53882d537ac..04d6f5443f2 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 +#endif +#ifdef HAVE_NET_IF_H +# include +#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 e86f143f483..1431fb67787 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 #endif]) +AC_CACHE_CHECK([for if_nameindex],wine_cv_have_if_nameindex, + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NET_IF_H +# include +#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 ]], [[sigset_t set; sigaddset(&set,SIGTERM);]])],[wine_cv_have_sigaddset=yes],[wine_cv_have_sigaddset=no])) if test "$wine_cv_have_sigaddset" = "yes" -- 2.11.4.GIT