[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Windows Build & Gnulib Problems - Feature Branch
From: |
Conrad T. Pino |
Subject: |
Windows Build & Gnulib Problems - Feature Branch |
Date: |
Tue, 20 Sep 2005 00:26:10 -0700 |
Hi Derek,
We have problems between Gnulib, MS VC6 and Windows:
1. MS VC6 defines "mbsinit" function only for C++ code
as in "inline" function that always returns "1". It's
not available to C code. The Windows "config.h" file
does "#undef HAVE_MBSINIT" but it's not honored. The
"inline" function is within an "#ifdef __cplusplus"
block.
2. File "src/subr.c" depends on "lib/canon-host.c" so
the link fails.
3. File "lib/canon-host.c" won't compile (error below)
since Windows doesn't have "sys/socket.h" or "netdb.h"
files.
4. Faking the missing files (from #1 above) shows that
"lib/canon-host.c" depends on "lib/getaddrinfo.c" which
has compile errors also.
5. I can get down to the missing "mbinit" with the patch
at the end of this message.
We have options. What's your opinion about them?
Conrad
References to "mbsinit" function follow:
============================================================
H:\cvs-1.12>grep -dn "(HAVE_MBSINIT|mbsinit)" *.h *.c
File lib\mbuiter.h:
137 assert (mbsinit (&iter->state));
172 if (mbsinit (&iter->state))
File windows-NT\config.h:
479 /* Define to 1 if you have the `mbsinit' function. */
480 #undef HAVE_MBSINIT
File lib\fnmatch.c:
324 assert (mbsinit (&ps));
328 assert (mbsinit (&ps));
354 assert (mbsinit (&ps));
File lib\quotearg.c:
58 # undef HAVE_MBSINIT
61 #if !defined mbsinit && !HAVE_MBSINIT
62 # define mbsinit(ps) 1
465 while (! mbsinit (&mbstate));
File lib\regex_internal.c:
287 && mbsinit (&pstr->cur_state))
File lib\strftime.c:
69 # define mbsinit(ps) (*(ps) == 0)
562 while (! mbsinit (&mbstate));
Link errors after adding all files that compile as is:
============================================================
--------------------Configuration: cvsnt - Win32 Debug--------------------
Linking...
subr.obj : error LNK2001: unresolved external symbol _ch_strerror
subr.obj : error LNK2001: unresolved external symbol _canon_host
libdiff.lib(strcasecmp.obj) : error LNK2001: unresolved external symbol _mbsinit
.\WinDebug\cvs.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
cvs.exe - 4 error(s), 0 warning(s)
Errors compiling "lib/canon-host.c":
============================================================
--------------------Configuration: libcvs - Win32 Debug--------------------
Compiling...
canon-host.c
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.h(25) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or
directory
Error executing cl.exe.
cvs.exe - 1 error(s), 0 warning(s)
Errors compiling "lib/getaddrinfo.c":
============================================================
--------------------Configuration: libcvs - Win32 Debug--------------------
Compiling...
getaddrinfo.c
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(54) : error C2065: 'PF_UNSPEC' :
undeclared identifier
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(80) : error C2065: 'SOCK_STREAM'
: undeclared identifier
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(80) : error C2065: 'SOCK_DGRAM' :
undeclared identifier
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(94) : warning C4013:
'getservbyname' undefined; assuming extern returning int
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(94) : warning C4047: '=' :
'struct servent *' differs in levels of indirection from
'int '
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(101) : warning C4013:
'gethostbyname' undefined; assuming extern returning int
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(101) : warning C4047: '=' :
'struct hostent *' differs in levels of indirection from
'int '
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(102) : error C2037: left of
'h_addr_list' specifies undefined struct/union 'hostent'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(105) : error C2037: left of
'h_addrtype' specifies undefined struct/union 'hostent'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(127) : error C2037: left of
'h_addrtype' specifies undefined struct/union 'hostent'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(175) : error C2037: left of
'h_name' specifies undefined struct/union 'hostent'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(176) : error C2037: left of
'h_name' specifies undefined struct/union 'hostent'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(190) : error C2037: left of
'sa_family' specifies undefined struct/union 'sockaddr'
h:\conrad\projects\cvs-1.12\lib\getaddrinfo.c(190) : error C2037: left of
'h_addrtype' specifies undefined struct/union 'hostent'
Error executing cl.exe.
cvs.exe - 10 error(s), 4 warning(s)
Index: lib/libcvs.dsp
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/libcvs.dsp,v
retrieving revision 1.27
diff -u -p -r1.27 libcvs.dsp
--- lib/libcvs.dsp 12 Jun 2005 20:37:12 -0000 1.27
+++ lib/libcvs.dsp 20 Sep 2005 07:15:12 -0000
@@ -97,6 +97,10 @@ SOURCE=.\basename.c
# End Source File
# Begin Source File
+SOURCE=".\canon-host.c"
+# End Source File
+# Begin Source File
+
SOURCE=.\canonicalize.c
# End Source File
# Begin Source File
@@ -145,6 +149,10 @@ SOURCE=.\getdate.c
# End Source File
# Begin Source File
+SOURCE=.\getdelim.c
+# End Source File
+# Begin Source File
+
SOURCE=.\getline.c
# End Source File
# Begin Source File
@@ -177,6 +185,10 @@ SOURCE=.\lstat.c
# End Source File
# Begin Source File
+SOURCE=.\mbchar.c
+# End Source File
+# Begin Source File
+
SOURCE=.\md5.c
# End Source File
# Begin Source File
@@ -238,6 +250,10 @@ SOURCE=.\strftime.c
# Begin Source File
SOURCE=.\stripslash.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strnlen1.c
# End Source File
# Begin Source File
Index: windows-NT/netdb.h
===================================================================
RCS file: windows-NT/netdb.h
diff -N windows-NT/netdb.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ windows-NT/netdb.h 20 Sep 2005 07:15:13 -0000
@@ -0,0 +1 @@
+/* empty file */
Index: windows-NT/sys/socket.h
===================================================================
RCS file: windows-NT/sys/socket.h
diff -N windows-NT/sys/socket.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ windows-NT/sys/socket.h 20 Sep 2005 07:15:13 -0000
@@ -0,0 +1,4 @@
+#define WIN32_LEAN_AND_MEAN 1
+#include <winsock2.h>
+
+typedef size_t socklen_t;
- Windows Build & Gnulib Problems - Feature Branch,
Conrad T. Pino <=