I need to compile a small C program to run on solaris 9 and 10. There is no C compiler on the target servers. I have compiled and tested the program on Linux over x86.
I hope you can advise on the way forward. I see the following options:
- install a C compiler, the lightest possible, on the target servers and compile the program
- set-up a sparc solaris (9 or 10) on top of virtualbox on my windows laptop, install the c compiler and then compile the program
Thanks in advance.
To run an application on both Solaris 9 and 10, you need to build it on Solaris 9. The application will then run on Solaris 9 and 10. (If you build on Solaris 10, you cannot expect the application to work on 9.)
The most recent Studio version that can be run on Solaris 9 is Studio 12 (but not updates 1, 2, or 3).
You can still get Studio 12 here, but since it dates from 2007, I don't know for how much longer.
Studio does not do cross-compilation, so you need to build on a system of the same type as the target system -- SPARC or x86. I don't know whether Solaris 9 can be installed on Virtual Box, but you can try. If it works, you can install the compiler, build on that system, then deploy on other Solaris 9 and 10 x86 systems.
You can of course build the application on each of Solaris 9 and 10, but usually that is not necessary, and it complicates deployment and support.
I believe Solaris 9 is End Of Life, so it would be a good idea to upgrade S9 systems to S10 or S11. I realize that such a change might not be up to you. :-)