You should use _exit(2) instead of exit(3) in your daemon initialization code (forking twice). It's because exit(3) will call the cleanup routines that registered by atexit(3) or on_exit(3), in terms of C++ program, if you have global or static CPP objects (not allocated in heap), they will be destroyed when exiting. E.g., if one object which creates a Unix Domain Socket (or a tmp file) in constructor , and destroys it in destructors, you will lose it in your grandchild process (the daemon process). Unix Programming FAQ section 1.1.3 has documented it very clearly.
And there is no daemon(3) implementation in Solaris' libc, you could use the one provided in Unix Programming FAQ, Daemon Utility functions.
Here is the Chinese Version of Unix Programming FAQ.
After I fixied the exit(3) problem in scim_utility.cpp, scim-helper-manager works now (the following picture is scim-tomoe handwritting IM for Japanese), and the xim frontend also works with ximcp protocol.
I found the problem is that scim-anthy requires the iconv descriptor from EUC-JP (and EUC-JP-ms) to UCS-4LE (or BE), but failed on Solaris. Refer to /usr/lib/iconv, you will see that there is no share object for that conversion.
Then I use gnu iconv (downloaded from sunfreeware) to build both scim-server and scim-anthy. Finally, it works!
Here is the [patch].
In summary, it adds "#include <alloca.h>" in every file that calls alloca (3C). And the reason of following change
-#define NL "NL"
+const char* NL = "NL";
is that with SunStudio C compiler, the NL returned by get_token_in () maybe in different address from the NL in get_line_in (), so mkdepgraph will fall into an infinite loop, and keep on calling realloc () to occupy a lot of memory. Now, scim_anthy does not work well, however iiimf anthyLE works fine, should be a problem in scim_anthy ... ...
I finally successfully built scim on my solaris x86 and sparc machines with sunstudio 10/11 C++ compiler. Here is the screenshot that I am inputing chinese characters with smartpinyin IM engine.
However, I can not connect scim with XIM client yet. Still trying ... ...
To build the source, you need CBE (Common Build Environment) installed, and set the ACLOCAL_FLAGS including all the aclocal directories in your system, then set LDFLAGS=-lsocket before you run configure script. Here is the [patch] for scim server, and the [patch] for scim-pinyin.
Note: the 1st patch will break the building of linux version.