diff --git a/miniupnpc/CMakeLists.txt b/miniupnpc/CMakeLists.txt index 1c57173..179a9ff 100644 --- a/miniupnpc/CMakeLists.txt +++ b/miniupnpc/CMakeLists.txt @@ -27,7 +27,7 @@ if (NOT WIN32) target_compile_definitions(miniupnpc-private INTERFACE MINIUPNPC_SET_SOCKET_TIMEOUT _BSD_SOURCE _DEFAULT_SOURCE) - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") # add_definitions (-D_POSIX_C_SOURCE=200112L) target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600) endif () @@ -93,11 +93,12 @@ endif () if (WIN32) target_link_libraries(miniupnpc-private INTERFACE ws2_32 iphlpapi) -#elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") -# find_library (SOCKET_LIBRARY NAMES socket) -# find_library (NSL_LIBRARY NAMES nsl) -# find_library (RESOLV_LIBRARY NAMES resolv) -# set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) +elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS") + target_link_libraries(miniupnpc-private INTERFACE socket nsl resolv) + find_library (SOCKET_LIBRARY NAMES socket) + find_library (NSL_LIBRARY NAMES nsl) + find_library (RESOLV_LIBRARY NAMES resolv) + set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS}) elseif (HAIKU) target_link_libraries(miniupnpc-private INTERFACE network) find_library (SOCKET_LIBRARY NAMES network) diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index 794bbe2..8517e09 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -62,7 +62,7 @@ JNAERATORARGS = -mode StandaloneJar -runtime JNAerator -library miniupnpc #JNAERATORBASEURL = http://jnaerator.googlecode.com/files/ JNAERATORBASEURL = https://repo1.maven.org/maven2/com/nativelibs4java/jnaerator/0.12 -ifneq (, $(findstring sun, $(OS))) +ifneq (, $(findstring sun, $(OS))$(findstring solaris, $(OS))) LDLIBS=-lsocket -lnsl -lresolv CFLAGS += -D__EXTENSIONS__ CFLAGS += -std=c99