[build] Haiku build fix (fixes #3136)

Haiku needs to link to additional lib -lnetwork for socket funcs
(similar to Solaris need for -lsocket -lnsl)

(edited: gstrauss)

x-ref:
  "haiku build fix proposal"
  https://redmine.lighttpd.net/issues/3136
master
David Carlier 1 year ago committed by Glenn Strauss
parent 1b11cd7aeb
commit c0f040eae7

@ -146,8 +146,8 @@ AC_CHECK_TYPES([socklen_t],
)
dnl openssl on solaris needs -lsocket -lnsl
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl socket])
AC_SEARCH_LIBS([socket], [socket network])
AC_SEARCH_LIBS([gethostbyname], [nsl socket network])
dnl On Haiku accept() and friends are in libnetwork
AC_SEARCH_LIBS([accept], [network])

@ -213,6 +213,8 @@ endif()
check_library_exists(elftc elftc_copyfile "libelftc.h" HAVE_ELFTC_COPYFILE)
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(CMAKE_REQUIRED_LIBRARIES "socket;nsl")
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(CMAKE_REQUIRED_LIBRARIES "network")
endif()
check_c_source_compiles("
#include <sys/types.h>
@ -1154,6 +1156,8 @@ if(WIN32)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(SOCKLIBS socket nsl)
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(SOCKLIBS network)
endif()
if(SOCKLIBS)
target_link_libraries(lighttpd ${SOCKLIBS})

@ -27,6 +27,8 @@ if target_machine.system() == 'sunos'
socket_libs = [ compiler.find_library('socket')
, compiler.find_library('nsl')
]
elif target_machine.system() == 'haiku'
socket_libs = [ compiler.find_library('network') ]
endif

@ -5,6 +5,8 @@ if(WIN32)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(SOCKLIBS socket nsl)
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(SOCKLIBS network)
endif()
if(SOCKLIBS)
target_link_libraries(fcgi-responder ${SOCKLIBS})

@ -7,6 +7,8 @@ if target_machine.system() == 'sunos'
socket_libs = [ compiler.find_library('socket')
, compiler.find_library('nsl')
]
elif target_machine.system() == 'haiku'
socket_libs = [ compiler.find_library('network') ]
endif
executable('fcgi-responder',

Loading…
Cancel
Save