=?gb2312?B?W1NDSU1dIG5vdGVzIGZvciBjb21waWxpbmcgc2NpbS0wLjk5LjAgb24=?= =?gb2312?B?IHNwYXJjIFNvbGFyaXMgMi42?=

=?gb2312?B?bHRzbw==?= ltsoltso at tom.com
Tue Jun 22 03:51:43 PDT 2004


James et all,

Following is the problem I encountered and the solution I took when I compile scim-0.99 on Sparc Solaris 2.6 with gcc 3.3.1  . Some tips may be useful for you to make a portable configuration.

1. I have to comment out the 29th line of src/scim_chartraits.cpp, because my compiler complained it can't find stdint.h when compiling.

/*#include */

2. I substitute AF_LOCAL to AF_UNIX and substitute PF_LOCAL to PF_UNIX in file src/scim_socket.cpp bacasuse the compiler complained that AF_LOCAL and PF_LOCAL undeclared.
AF_LOCAL  -->  AF_UNIX
PF_LOCAL  -->  PF_UNIX

3. add following definition to src/scim_socket.cpp also for undeclared issue.

#ifndef SUN_LEN
#define SUN_LEN(su)                                                     \
  (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif
#ifndef socklen_t
#define socklen_t  int
#endif

4. manually change the line "LIBS =" to "LIBS = -lnsl -lsocket" in src/Makefile, because when make in "src" directory:
./.libs/libscim-1.0.so: undefined reference to `connect'
./.libs/libscim-1.0.so: undefined reference to `socket'
./.libs/libscim-1.0.so: undefined reference to `accept'
./.libs/libscim-1.0.so: undefined reference to `bind'
./.libs/libscim-1.0.so: undefined reference to `listen'
./.libs/libscim-1.0.so: undefined reference to `inet_ntoa'
./.libs/libscim-1.0.so: undefined reference to `gethostbyname'

5. change munmap function call in modules/IMEngine/scim_generic_table.cpp

munmap (m_mmapped_ptr, m_mmapped_size);
  
  ||
  ||
  \/

munmap ((char *)m_mmapped_ptr, m_mmapped_size);

for following error message:
scim_generic_table.cpp:858: error: invalid conversion from `void*' to `char*'
scim_generic_table.cpp: In member function `void GenericTableContent::clear()':
scim_generic_table.cpp:1489: error: invalid conversion from `void*' to `char*'

6. the compiler complained suseconds_t undeclared when compile some file, so I add this line to src/scim.h:
typedef signed long suseconds_t;

7. add following code to src/scim.h, reason as above.

#ifndef WAIT_ANY
#define WAIT_ANY (-1)
#endif

8. After I finished scim build, I find the socket module was not build. loot up the configure log file, I found that it:
checking for gethostbyname... no
checking for gethostbyname_r... no
checking for socket... no
checking for bind... no
checking for accept... no
checking for connect... no
checking for listen... no

so, I have to use this command re-compile:
./configure --prefix=$PREFIX LIBS="-lnsl -lsocket"

9. modify the 78th line of src/scim_socket.cpp, 
while ((res = gethostbyname_r (host, &hostbuf, tmphstbuf, hstbuflen, &hp, &herr)) == ERANGE) {
	||
	||
	\/
while ((res = (int)gethostbyname_r (host, &hostbuf, tmphstbuf, hstbuflen,(int *) &hp)) == ERANGE) {

for following reason:
scim_socket.cpp: In function `in_addr scim::__gethostname(const char*)':
scim_socket.cpp:78: error: cannot convert `hostent**' to `int*' for argument `5
   ' to `hostent* gethostbyname_r(const char*, hostent*, char*, int, int*)'
scim_socket.cpp: In function `in_addr scim::__gethostname(const char*)':
scim_socket.cpp:78: error: invalid conversion from `hostent*' to `int'



Regards,
Dennis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://freedesktop.org/pipermail/scim/attachments/20040622/1c4aa2fc/attachment.html


More information about the scim mailing list