Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
cmake: solaris fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
thughes authored and ry committed Dec 2, 2010
1 parent cf1811a commit e681abe
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
11 changes: 11 additions & 0 deletions cmake/libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# libraries
#

include(CheckLibraryExists)
include(FindPackageHandleStandardArgs)
set(HAVE_CONFIG_H True)
add_definitions(-DHAVE_CONFIG_H=1)
Expand All @@ -10,6 +11,8 @@ find_package(OpenSSL QUIET)
find_package(Threads)
find_library(RT rt)
find_library(DL dl)
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)

if(RT)
set(extra_libs ${extra_libs} ${RT})
Expand All @@ -24,6 +27,14 @@ if(${node_platform} MATCHES freebsd)
set(extra_libs ${extra_libs} KVM)
endif()

if(${HAVE_SOCKET_LIB})
set(extra_libs ${extra_libs} socket)
endif()

if(${HAVE_NSL_LIB})
set(extra_libs ${extra_libs} nsl)
endif()

if(${OPENSSL_FOUND} MATCHES True)
add_definitions(-DHAVE_OPENSSL=1)
set(HAVE_OPENSSL True)
Expand Down
4 changes: 3 additions & 1 deletion cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ if(${node_platform} MATCHES darwin)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/ChangeLog.txt")
#set(CPACK_RESOURCE_FILE_WELCOME "")
else()
elseif(${node_platform} MATCHES linux)
set(CPACK_GENERATOR "TGZ;DEB;RPM")
else()
set(CPACK_GENERATOR "TGZ")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tom Hughes <tom.hughes@palm.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Evented I/O for V8 JavaScript.")
Expand Down
4 changes: 4 additions & 0 deletions cmake/v8_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if(NOT SHARED_V8)
elseif(${node_platform} MATCHES linux)
execute_process(COMMAND sh -c "cat /proc/cpuinfo | grep processor | sort | uniq | wc -l"
OUTPUT_VARIABLE cpu_count)
elseif(${node_platform} MATCHES sunos)
execute_process(COMMAND sh -c "psrinfo | wc -l" OUTPUT_VARIABLE cpu_count)
else()
set(cpu_count 1)
endif()

if(${cpu_count} GREATER 1)
Expand Down
18 changes: 17 additions & 1 deletion deps/c-ares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,21 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${node_platform}-${cares_arch})
add_definitions(-DHAVE_CONFIG_H=1)

include(CheckLibraryExists)
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)

file(GLOB lib_sources *.c)
add_library(cares ${lib_sources})
add_library(cares ${lib_sources})

if(${HAVE_SOCKET_LIB})
set(cares_libs ${cares_libs} socket)
endif()

if(${HAVE_NSL_LIB})
set(cares_libs ${cares_libs} nsl)
endif()

if(cares_libs)
target_link_libraries(cares ${cares_libs})
endif()

0 comments on commit e681abe

Please sign in to comment.