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 <stdint.h>*/

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

<br>
<hr align="left" width="577" size="1" color="cccccc">
<table>
  <tr>
    <td style="font-size: 14.7px"><a href="http://card.tom.com/" target="_blank">“考试放假 校园生活 发送贺卡给同桌的你”</a></td>
  </tr>
  <tr>
    <td style="font-size: 14.7px"><a href="http://search.tom.com/mp3/" target="_blank">送你10万首MP3金曲,点此下载</a></td>
  </tr>  
  <tr>
    <td style="font-size: 14.7px"><a href="http://vip.163.net/info/040609_75z/mail.html" target="_blank"><font color="red"><b>三周年夏季风暴,收费邮箱全线7.5折<br>最高可省75元,最低价格每天只须一毛钱。</b></font></a></td>
  </tr>
</table>
<table cellpadding="1" cellspacing="1" border="0" style="margin-top:10px;">
  <tr> 
    <td nowrap><a href="http://vip.163.net" target="_blank"><font color="#000000"> 邮箱订购及咨询热线(24小时):8008309163 或 020-87324711</font></a></td>    
  </tr>
</table>