Bug 90223 - ./configure report error while checking the usability of ws2tcpip.h
Summary: ./configure report error while checking the usability of ws2tcpip.h
Status: RESOLVED NOTOURBUG
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.8
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 05:03 UTC by zydadan
Modified: 2015-04-30 14:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
configuration error screen snapshot (182.14 KB, text/plain)
2015-04-29 05:03 UTC, zydadan
Details
config.log which is generated in ./configure failure, as you wish. (117.69 KB, text/plain)
2015-04-29 12:29 UTC, zydadan
Details

Description zydadan 2015-04-29 05:03:18 UTC
Created attachment 115425 [details]
configuration error screen snapshot

Build System : MSYS2 64 bits,added component "mingw-w64-cross-gcc 4.9.2"
configure command line is :
./configure --enable-shared=yes --enable-static=yes --prefix=/mingw64 --host=x86_64-pc-msys

error snapshot:
...
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... yes
configure: WARNING: ws2tcpip.h: present but cannot be compiled
configure: WARNING: ws2tcpip.h:     check for missing prerequisite headers?
configure: WARNING: ws2tcpip.h: see the Autoconf documentation
configure: WARNING: ws2tcpip.h:     section "Present But Cannot Be Compiled"
configure: WARNING: ws2tcpip.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------------------------------------------- ##
configure: WARNING:     ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=dbus ##
configure: WARNING:     ## ---------------------------------------------------------------------- ##
checking for ws2tcpip.h... no
...
configure: error: Explicitly requested expat but expat not found
Comment 1 Simon McVittie 2015-04-29 10:32:32 UTC
No need for screenshots, text is enough.

(In reply to zydadan from comment #0)
> checking ws2tcpip.h usability... no
> checking ws2tcpip.h presence... yes
> configure: WARNING: ws2tcpip.h: present but cannot be compiled
> configure: WARNING: ws2tcpip.h:     check for missing prerequisite headers?
> configure: WARNING: ws2tcpip.h: see the Autoconf documentation
> configure: WARNING: ws2tcpip.h:     section "Present But Cannot Be Compiled"

If you look in config.log you should find detailed compiler errors from what happens when configure tries to #include <ws2tcpip.h>. Please provide those here.

It looks as though it might be necessary to #include <winsock2.h> first: <https://msdn.microsoft.com/en-us/library/windows/desktop/ms738562%28v=vs.85%29.aspx>

Alternatively, it seems that we already include that header unconditionally on Windows:

(dbus/dbus-sysdeps.h)
#ifdef DBUS_WIN
#include <ws2tcpip.h>
#endif

so we can probably just drop this check from the Autoconf and CMake build systems, and change

#ifdef HAVE_WS2TCPIP_H
/* getaddrinfo for Windows CE (and Windows).  */
#include <ws2tcpip.h>
#endif

to just

#include <ws2tcpip.h>

in dbus/dbus-sysdeps-win.c.
Comment 2 Ralf Habacker 2015-04-29 12:04:57 UTC
(In reply to zydadan from comment #0)
> ...
> configure: error: Explicitly requested expat but expat not found

there are no expat development header available.
Comment 3 zydadan 2015-04-29 12:29:03 UTC
Created attachment 115439 [details]
config.log which is generated in ./configure failure, as you wish.
Comment 4 Simon McVittie 2015-04-29 13:37:48 UTC
(In reply to zydadan from comment #0)
> checking for ws2tcpip.h... no
> ...
> configure: error: Explicitly requested expat but expat not found

As Ralf spotted, these two issues are unrelated. There are two unrelated failures in this log:

1) ws2tcpip.h
=============

The check for ws2tcpip.h detects it as present but unusable. Looking into the detailed log, we see:

In file included from /usr/include/w32api/winsock2.h:56:0,
                 from /usr/include/w32api/ws2tcpip.h:17,
                 from conftest.c:110:
/usr/include/w32api/psdk_inc/_fd_types.h:100:2: warning: #warning "fd_set and associated macros have been defined in sys/types.      This can cause runtime problems with W32 sockets" [-Wcpp]
 #warning "fd_set and associated macros have been defined in sys/types.  \
  ^
In file included from /usr/include/w32api/ws2tcpip.h:17:0,
                 from conftest.c:110:
/usr/include/w32api/winsock2.h:1004:34: error: conflicting types for 'gethostname'
   WINSOCK_API_LINKAGE int WSAAPI gethostname(char *name,int namelen);
                                  ^
In file included from /usr/include/stdio.h:29:0,
                 from conftest.c:77:
/usr/include/sys/unistd.h:249:6: note: previous declaration of 'gethostname' was here
  int _EXFUN(gethostname, (char *__name, size_t __len));
      ^

I think this means that your development environment is broken... you can only have one correct signature for gethostname().

You used:

> --host=x86_64-pc-msys

but on my Debian system, the mingw-w64 cross-build environment uses the GNU tuple x86_64-w64-mingw32, and this seems to be the canonical one as documented on http://sourceforge.net/p/mingw-w64/wiki2/TypeTriplets/.

2) Expat
========

> configure: error: Explicitly requested expat but expat not found

You don't have Expat development files installed. Compiling D-Bus requires Expat. There is no workaround or way to avoid this, you must obtain a suitable Expat library before continuing.

Neither of these two issues seems to be a bug in D-Bus.
Comment 5 zydadan 2015-04-29 16:10:06 UTC
Thanks for you all!

I'm compiling dbus in windows7 64bit with msys2 64bit.

Even when I installed all the expat component and pass '--host=x86_64-w64-mingw32' to ./configure, there are still many problems in compiling.

1. expat component installed, pass '--host=x86_64-w64-mingw32' to ./configure, but ./configure still reports error:
configure: error: Explicitly requested expat but expat not found

2. expat component installed, do not pass '--host=x86_64-w64-mingw32' to ./configure. configuration succeeds, but error raised in compiling :

activation-helper.c: 在函数‘switch_user’中:
activation-helper.c:308:3: 警告:隐式声明函数‘initgroups’ [-Wimplicit-function-declaration]
   if (initgroups (user, pw->pw_gid))
   ^
activation-helper.c:308:3: 警告:对‘initgroups’的嵌套的外部声明 [-Wnested-externs]

I think this should still not be the bug of dbus -- just as Mr.Simon McVittie mentioned --. but, could you help me to solve it if possible? thanks!
Comment 6 zydadan 2015-04-30 14:28:42 UTC
Well, I've made the compilation passed in msys2 on windows 7 by doing as below:
In MINGW32 shell, add "--host=i686-w64-mingw32 --build=i686-pc-msys" as extra options to ./configure
In MINGW64 shell, add "--host=x86_64-w64-mingw32 --build=x86_64-pc-msys" as extra options to ./configure
In MSYS2 shell, it seems that there is no way to make compilation passed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.