It appears that SEMS 1.1.0 was not tested at all against Solaris 10.

I just checked, and there are multiple problems: use of PF_UNIX without importing the socket headers, use of SUN_LEN (which doesn't exist on Solaris), use of operator+ with a const char * and a std::string (not defined), and others -- I haven't even got it to compile yet.

Not good.

Here is a quick patch for these issues (it gets through the compilation errors for them, but *I have not tested the correctness of the code*).

There are other issues at which I might look in the future.

I suggest that you start with SEMS trunk and work through the issues, sending diffs to [email protected].


diff -r sems-1.1.0/core/AmUtils.cpp sems-1.1.0-modified/core/AmUtils.cpp
984,985c984,997
<   string sol_putenv = name + "=" + var;
<   putenv(sol_putenv.c_str());
---
> // On Solaris, operator+ is not defined for const char * and string.
>   // Do it the hard way.
>   size_t namelen = strlen(name);
>   size_t varlen  = var.length();
> char *sol_putenv = (char *)malloc(sizeof(char) * (namelen + varlen + 2));
>   if (NULL == sol_putenv) {
>     ERROR("Could not allocate memory for add_env_path.");
>     return;
>   }
>   strncpy(sol_putenv, name, namelen);
>   sol_putenv[namelen] = '=';
>   strncpy(sol_putenv + namelen + 1, var.c_str(), varlen);
>   sol_putenv[namelen + varlen + 1] = 0;
>   putenv(sol_putenv);
diff -r sems-1.1.0/core/compat/solaris.h sems-1.1.0-modified/core/ compat/solaris.h
34a35
> #include <sys/socket.h>
79a81,83
> // Of course Solaris doesn't have SUN_LEN.
> #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
>

-R

On  15 Feb 2009, at 11:09 PM, newbie wrote:

Hi Richard,

Can you kindly let me know if we can compile SEMS in solaris 10?

I have tried and isn't doing anything


here is gmake all
http://pastebin.com/d1673d60e

and here is gmake install
http://pastebin.com/m5127cab9


Regards,
Yasen

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to