I am writing this socket program in C and have run into an issue in my make file while using the -lsocket during compilation. I have to have this program compile on both Solaris and Linux. From what I have read -lsocket is not needed to be invoked during compilation on Linux but it does on Solaris? Is this true?
If this is true is there a way to determine in the make file what OS I am on and use -lsocket if on Solaris and not use it if on Linux? I know in perl I could simply compare the default variable $^O and since perl is built on C I would assume there is a way to perform this in native C. If so how could I do this?


