Browse Source

[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 5 months ago committed by Glenn Strauss
parent
commit
c0f040eae7
  1. 4
      configure.ac
  2. 4
      src/CMakeLists.txt
  3. 2
      src/meson.build
  4. 2
      tests/CMakeLists.txt
  5. 2
      tests/meson.build

4
configure.ac

@ -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])

4
src/CMakeLists.txt

@ -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})

2
src/meson.build

@ -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

2
tests/CMakeLists.txt

@ -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})

2
tests/meson.build

@ -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