cmake - show command line for a test
Peter Kümmel
syntheticpp at gmx.net
Sun Feb 12 23:50:09 CET 2006
Christian Ehrlicher wrote:
> for example getaddrinfo isn't found - don't know why. Simply look into
> CMakeErro.log and you'll see that some functions aren't found which
> normally are available on windows.
>
> Christian
>
The function-check does not work because of the principle linker error,
and the symbol-check didn't work because of a bad #define in sys/socket.h
and sys/types.h.
We could change the configure process to also find the win symbols, see
the diff. There are also some small changes which fixes compile errors.
Feel free to check it in.
Peter
Index: ConfigureChecks.cmake
===================================================================
--- ConfigureChecks.cmake (Revision 508866)
+++ ConfigureChecks.cmake (Arbeitskopie)
@@ -315,3 +315,9 @@
set(CONFIG_KDELIBS_DOXYDIR "\"/tmp/\"")
+
+# checks on win32
+
+check_symbol_exists(getaddrinfo "winsock2.h;ws2tcpip.h" HAVE_GETADDRINFO_SYMBOL)
Index: config.h.cmake
===================================================================
--- config.h.cmake (Revision 508030)
+++ config.h.cmake (Arbeitskopie)
@@ -521,3 +522,15 @@
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
#endif
+
+
+#cmakedefine HAVE_GETADDRINFO_SYMBOL 1
+#if defined(HAVE_GETADDRINFO_SYMBOL)
+#define HAVE_GETADDRINFO 1
+#endif
+
Index: win/include/msvc/sys/types.h
===================================================================
--- win/include/msvc/sys/types.h (Revision 508030)
+++ win/include/msvc/sys/types.h (Arbeitskopie)
@@ -41,10 +41,6 @@
#endif
-#ifndef socklen_t
-#define socklen_t int
-#endif
-
Index: win/include/msvc/sys/socket.h
===================================================================
--- win/include/msvc/sys/socket.h (Revision 508030)
+++ win/include/msvc/sys/socket.h (Arbeitskopie)
@@ -20,6 +20,9 @@
#ifndef _SOCKET_H
#define _SOCKET_H
+#include <winsock2.h>
+#include <Ws2tcpip.h>
+
#include <sys/types.h>
#ifdef __cplusplus
@@ -36,9 +39,6 @@
int msg_accrightslen; /* Length of rights list */
};
-#ifndef socklen_t
-#define socklen_t int
-#endif
/* Socket types. */
#define SOCK_STREAM 1 /* stream (connection) socket */
Index: kdecore/netsupp_win32.cpp
===================================================================
--- kdecore/netsupp_win32.cpp (Revision 508030)
+++ kdecore/netsupp_win32.cpp (Arbeitskopie)
@@ -36,11 +36,12 @@
int err = EAI_SERVICE;
return err;
}
-
+/* part of winsock
KDECORE_EXPORT char *gai_strerror(int errorcode)
{
return 0;
}
+*/
int getnameinfo(const struct sockaddr *sa,
unsigned int salen,
char *host, size_t hostlen,
Index: kdecore/network/kresolverstandardworkers.cpp
===================================================================
--- kdecore/network/kresolverstandardworkers.cpp (Revision 508030)
+++ kdecore/network/kresolverstandardworkers.cpp (Arbeitskopie)
@@ -495,10 +495,11 @@
results.setError(KResolver::Memory);
break;
+#ifdef EAI_SYSTEM // not on windows?
case EAI_SYSTEM:
results.setError(KResolver::SystemError, errno);
break;
-
+#endif
default:
results.setError(KResolver::UnknownError, errno);
break;
More information about the Kde-buildsystem
mailing list