summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-07-02 21:20:23 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-07-02 21:20:23 +0200
commit82b49378dfa407673118a8ce2f1c85122ab349d5 (patch)
treea32a8aa345e6bfe5e4f19c48cb839eddc4dfc87e
parentf8fb16502c0cbf66668bddcb64f0562653134fc1 (diff)
downloadpianobar-windows-82b49378dfa407673118a8ce2f1c85122ab349d5.tar.gz
pianobar-windows-82b49378dfa407673118a8ce2f1c85122ab349d5.tar.bz2
pianobar-windows-82b49378dfa407673118a8ce2f1c85122ab349d5.zip
waitress: socket() needs a library on SunOS
-rw-r--r--libwaitress/src/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/libwaitress/src/CMakeLists.txt b/libwaitress/src/CMakeLists.txt
index 1facec9..96ac328 100644
--- a/libwaitress/src/CMakeLists.txt
+++ b/libwaitress/src/CMakeLists.txt
@@ -1,7 +1,21 @@
+INCLUDE (CheckFunctionExists)
+INCLUDE (CheckLibraryExists)
+
set (CMAKE_C_FLAGS -Wall)
+set (EXTRA_LIBS "")
+
+# required on sunos
+CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+ IF(NOT CMAKE_HAVE_CONNECT)
+ CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+ IF (CMAKE_LIB_SOCKET_HAS_CONNECT)
+ SET (EXTRA_LIBS -lsocket)
+ ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT)
+ENDIF(NOT CMAKE_HAVE_CONNECT)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_library (waitress STATIC main.c)
+target_link_libraries (waitress ${EXTRA_LIBS})