diff options
author | Tom Hughes <tom.hughes@palm.com> | 2010-11-22 19:31:40 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-23 00:32:49 +0300 |
commit | 446beebd79d52b24bd8d9e0a44f6378a711f32b9 (patch) | |
tree | 021d60bfdb825519ab102213c65efb5299e6a2db /deps | |
parent | b52b4196ab22227aea7afef100c4ca8e2f1b8729 (diff) |
Add cmake build support.
Squashed commit of ca128f7dcd28cbcfba154c8577ed54d4aa71dd02 with
contributions from Mark Constable (markc@renta.net) and Daniel Gröber
(darklord@darkboxed.org).
Diffstat (limited to 'deps')
-rw-r--r-- | deps/c-ares/CMakeLists.txt | 6 | ||||
-rw-r--r-- | deps/http_parser/CMakeLists.txt | 2 | ||||
-rw-r--r-- | deps/libeio/CMakeLists.txt | 27 | ||||
-rw-r--r-- | deps/libeio/config.h.cmake | 17 | ||||
-rw-r--r-- | deps/libev/CMakeLists.txt | 37 | ||||
-rw-r--r-- | deps/libev/config.h.cmake | 65 |
6 files changed, 154 insertions, 0 deletions
diff --git a/deps/c-ares/CMakeLists.txt b/deps/c-ares/CMakeLists.txt new file mode 100644 index 00000000000..98be04a3762 --- /dev/null +++ b/deps/c-ares/CMakeLists.txt @@ -0,0 +1,6 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${node_platform}-${cares_arch}) +add_definitions(-DHAVE_CONFIG_H=1) + +file(GLOB lib_sources *.c) +add_library(cares ${lib_sources})
\ No newline at end of file diff --git a/deps/http_parser/CMakeLists.txt b/deps/http_parser/CMakeLists.txt new file mode 100644 index 00000000000..7dd9fd2c318 --- /dev/null +++ b/deps/http_parser/CMakeLists.txt @@ -0,0 +1,2 @@ +include_directories (.) +add_library (http_parser http_parser.c)
\ No newline at end of file diff --git a/deps/libeio/CMakeLists.txt b/deps/libeio/CMakeLists.txt new file mode 100644 index 00000000000..78224db75ce --- /dev/null +++ b/deps/libeio/CMakeLists.txt @@ -0,0 +1,27 @@ +include(CheckFunctionExists) +include(FindThreads) + +if(!${CMAKE_USE_PTHREADS_INIT}) + message(FATAL_ERROR "Unable to find pthreads") +endif() + +include_directories(${platform}) +add_definitions(-DHAVE_CONFIG_H=1 -D_GNU_SOURCE) + +check_function_exists(futimes HAVE_FUTIMES) +check_function_exists(readahead HAVE_READAHEAD) +check_function_exists(fdatasync HAVE_FDATASYNC) +check_function_exists(pread HAVE_PREAD) +check_function_exists(pwrite HAVE_PWRITE) +check_function_exists(sendfile HAVE_SENDFILE) +check_function_exists(sync_file_range HAVE_SYNC_FILE_RANGE) + +if(${HAVE_PREAD} AND ${HAVE_PWRITE}) + set(HAVE_PREADWRITE 1) +endif() + +configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/deps/libeio/config.h) +include_directories(${PROJECT_BINARY_DIR}/deps/libeio) + +add_library(eio eio.c) +target_link_libraries(eio ${CMAKE_THREAD_LIBS_INIT}) diff --git a/deps/libeio/config.h.cmake b/deps/libeio/config.h.cmake new file mode 100644 index 00000000000..c4c128ce305 --- /dev/null +++ b/deps/libeio/config.h.cmake @@ -0,0 +1,17 @@ +/* futimes(2) is available */ +#cmakedefine HAVE_FUTIMES 1 + +/* readahead(2) is available (linux) */ +#cmakedefine HAVE_READAHEAD 1 + +/* fdatasync(2) is available */ +#cmakedefine HAVE_FDATASYNC 1 + +/* pread(2) and pwrite(2) are available */ +#cmakedefine HAVE_PREADWRITE 1 + +/* sendfile(2) is available and supported */ +#cmakedefine HAVE_SENDFILE 1 + +/* sync_file_range(2) is available */ +#cmakedefine HAVE_SYNC_FILE_RANGE 1 diff --git a/deps/libev/CMakeLists.txt b/deps/libev/CMakeLists.txt new file mode 100644 index 00000000000..9c84fc19c23 --- /dev/null +++ b/deps/libev/CMakeLists.txt @@ -0,0 +1,37 @@ +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckLibraryExists) + +#include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${PROJECT_BINARY_DIR}/deps/libev) +add_definitions(-DHAVE_CONFIG_H=1 -DEV_MULTIPLICITY=0) + +check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H) +check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H) +check_include_files(sys/event.h HAVE_SYS_EVENT_H) +check_include_files(sys/queue.h HAVE_SYS_QUEUE_H) +check_include_files(port.h HAVE_PORT_H) +check_include_files(poll.h HAVE_POLL_H) +check_include_files(sys/select.h HAVE_SYS_SELECT_H) +check_include_files(sys/eventfd.h HAVE_SYS_EVENTFD_H) + +check_function_exists(inotify_init HAVE_INOTIFY_INIT) +check_function_exists(epoll_ctl HAVE_EPOLL_CTL) +check_function_exists(kqueue HAVE_KQUEUE) +check_function_exists(port_create HAVE_PORT_CREATE) +check_function_exists(poll HAVE_POLL) +check_function_exists(select HAVE_SELECT) +check_function_exists(eventfd HAVE_EVENTFD) +check_function_exists(nanosleep HAVE_NANOSLEEP) + +# check first without rt +check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) + +check_library_exists(rt clock_gettime "" HAVE_LIBRT) +# then check with rt +check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME) + +check_library_exists(m ceil "" HAVE_LIBM) + +configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/deps/libev/config.h) +add_library (ev ev.c) diff --git a/deps/libev/config.h.cmake b/deps/libev/config.h.cmake new file mode 100644 index 00000000000..54286b700ae --- /dev/null +++ b/deps/libev/config.h.cmake @@ -0,0 +1,65 @@ +/* Define to 1 if you have the `clock_gettime' function. */ +#cmakedefine HAVE_CLOCK_GETTIME 1 + +/* "use syscall interface for clock_gettime" */ +#cmakedefine HAVE_CLOCK_SYSCALL 1 + +/* Define to 1 if you have the `epoll_ctl' function. */ +#cmakedefine HAVE_EPOLL_CTL 1 + +/* Define to 1 if you have the `eventfd' function. */ +#cmakedefine HAVE_EVENTFD 1 + +/* Define to 1 if you have the `inotify_init' function. */ +#cmakedefine HAVE_INOTIFY_INIT 1 + +/* Define to 1 if you have the `kqueue' function. */ +#cmakedefine HAVE_KQUEUE 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#cmakedefine HAVE_LIBM 1 + +/* Define to 1 if you have the `rt' library (-lrt). */ +/* #undef HAVE_LIBRT */ + +/* Define to 1 if you have the `nanosleep' function. */ +#cmakedefine HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the `poll' function. */ +#cmakedefine HAVE_POLL 1 + +/* Define to 1 if you have the <poll.h> header file. */ +#cmakedefine HAVE_POLL_H 1 + +/* Define to 1 if you have the `port_create' function. */ +#cmakedefine HAVE_PORT_CREATE 1 + +/* Define to 1 if you have the <port.h> header file. */ +#cmakedefine HAVE_PORT_H 1 + +/* Define to 1 if you have the `select' function. */ +#cmakedefine HAVE_SELECT 1 + +/* Define to 1 if you have the <sys/epoll.h> header file. */ +#cmakedefine HAVE_SYS_EPOLL_H 1 + +/* Define to 1 if you have the <sys/eventfd.h> header file. */ +#cmakedefine HAVE_SYS_EVENTFD_H 1 + +/* Define to 1 if you have the <sys/event.h> header file. */ +#cmakedefine HAVE_SYS_EVENT_H 1 + +/* Define to 1 if you have the <sys/inotify.h> header file. */ +#cmakedefine HAVE_SYS_INOTIFY_H 1 + +/* Define to 1 if you have the <sys/queue.h> header file. */ +#cmakedefine HAVE_SYS_QUEUE_H 1 + +/* Define to 1 if you have the <sys/select.h> header file. */ +#cmakedefine HAVE_SYS_SELECT_H 1 + +/* Name of package */ +#define PACKAGE "libev" + +/* Version number of package */ +#define VERSION "3.9" |