1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-01 07:24:29 +00:00

Fixup getifaddrs() detection for BSD, and use the results properly.

svn path=/trunk/kdenetwork/krfb/; revision=199586
This commit is contained in:
Adriaan de Groot 2003-01-13 13:31:52 +00:00
parent 339ffe8ecf
commit 3eaaf8e907
3 changed files with 13 additions and 4 deletions

View File

@ -5,16 +5,17 @@ KDE_CHECK_HEADER(X11/extensions/XTest.h,
#check for getifaddrs(3) (as in glibc >= 2.3 and newer bsds)
AC_MSG_CHECKING(for getifaddrs support)
AC_TRY_LINK( [
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
],[
getifaddrs(0);
],[
AC_DEFINE(HAVE_GETIFADDRS,1,[Define if getifaddrs is available])
COMPILE_GETIFADDRS="getifaddrs.cpp"
AC_MSG_RESULT(yes)
COMPILE_GETIFADDRS=""
],[
AC_MSG_RESULT(no)
COMPILE_GETIFADDRS=""
COMPILE_GETIFADDRS="getifaddrs.cpp"
])
AC_SUBST(COMPILE_GETIFADDRS)

View File

@ -23,6 +23,8 @@
* removed glibc dependencies
*/
#include "config.h"
#ifndef HAVE_GETIFADDRS
#include "getifaddrs.h"

View File

@ -22,10 +22,16 @@
* removed glibs dependencies
*/
#include <net/if.h>
#include "config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>
#include <net/if.h>
#ifdef HAVE_GETIFADDRS
#include <sys/socket.h>
#include <ifaddrs.h>
#define kde_getifaddrs(a) getifaddrs(a)