diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index 4f8bb8e..fe062b3 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -49,8 +49,10 @@ JAVA = java JNAERATOR = jnaerator-0.11-shaded.jar JNAERATORARGS = -mode StandaloneJar -runtime JNAerator -library miniupnpc JNAERATORBASEURL = http://jnaerator.googlecode.com/files/ -#following libs are needed on Solaris -#LDLIBS=-lsocket -lnsl -lresolv + +ifeq (SunOS, $(OS)) + LDFLAGS=-lsocket -lnsl -lresolv +endif # APIVERSION is used to build SONAME APIVERSION = 9 @@ -225,10 +227,10 @@ else $(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^ endif -upnpc-static: upnpc.o $(LIBRARY) $(LDLIBS) +upnpc-static: upnpc.o $(LIBRARY) $(CC) $(LDFLAGS) -o $@ $^ -upnpc-shared: upnpc.o $(SHAREDLIBRARY) $(LDLIBS) +upnpc-shared: upnpc.o $(SHAREDLIBRARY) $(CC) $(LDFLAGS) -o $@ $^ testminixml: $(TESTMINIXMLOBJS) diff --git a/miniupnpc/connecthostport.c b/miniupnpc/connecthostport.c index 83142b0..98a00c4 100644 --- a/miniupnpc/connecthostport.c +++ b/miniupnpc/connecthostport.c @@ -24,6 +24,7 @@ #else /* #ifdef _WIN32 */ #include #include +#include #include #define closesocket close #include