A few months ago, Theo Schlossnagle posted a patch. As recently as late November, I compiled trafficserver on Opensolaris and had to make quite a lot of changes over and above Theo's patch.
I've just revisited it today, and found that once again a lot of further changes are required. I'm attaching a patch to build libinktomi++ on opensolaris with Sun CC. This is work-in-progress, but sufficiently simple that you might want to apply it and save the next poor *** repeating this work! 1. InkTime.cc: ctime_r on Solaris doesn't match your usage! 2. ink_string.cc: you cast const char** to char** in calling iconv which breaks on solaris/SunCC. The cast looks suspect in the first place (potential segfault-fodder), and simply removing it fixes the build. 3. ink_port.h: need to add solaris to HOST_OS test. 4. DAllocator.h: The change in template types in r888963 breaks the build, as SunCC doesn't like the #defined template. I haven't checked the problem r888963 fixes, and don't know how to work around this, though the log file entry suggests that my fix won't break anything too critical! Hope this is useful! -- Nick Kew
Index: InkTime.cc =================================================================== --- InkTime.cc (revision 898536) +++ InkTime.cc (working copy) @@ -156,7 +156,11 @@ char * ink_ctime_r(const ink_time_t * clock, char *buf) { +#if (HOST_OS == solaris) + return ctime_r(clock, buf, 48); +#else return ctime_r(clock, buf); +#endif } struct tm * Index: DAllocator.h =================================================================== --- DAllocator.h (revision 898536) +++ DAllocator.h (working copy) @@ -83,8 +83,13 @@ int alignment; int el_size; - SList(AllocPoolDescriptor,link) pools; - Que(AllocDescriptor,link) free_list; +#if (HOST_OS == solaris) + SLL<AllocPoolDescriptor> pools; + Queue<AllocDescriptor> free_list; +#else + SList<AllocPoolDescriptor> pools; + Que<AllocDescriptor> free_list; +#endif DAllocator(); ~DAllocator(); Index: ink_string.cc =================================================================== --- ink_string.cc (revision 898536) +++ ink_string.cc (working copy) @@ -424,7 +424,7 @@ inbytesleft = inlen; outbytesleft = *outlen; - if (iconv(ic, (char **) &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1) { + if (iconv(ic, &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1) { iconv_close(ic); goto strip; } Index: ink_port.h =================================================================== --- ink_port.h (revision 898536) +++ ink_port.h (working copy) @@ -60,7 +60,7 @@ #define _CRTIMP #define HAVE_64_BIT -#if (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin) +#if (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin) || (HOST_OS == solaris) #define POSIX_THREAD #define POSIX_THREAD_10031c #else