Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Please merge :) #10

Closed
wants to merge 1 commit into from

2 participants

@maksbotan

No description provided.

@krieger-od
Owner

Pulled and split into a0c7163 and 8b406ec

@krieger-od krieger-od closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 1, 2012
  1. @maksbotan
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -8,3 +8,4 @@ Makefile
whdd-cli
whdd-curses
version.h
+config.h
View
5 CMakeLists.txt
@@ -2,11 +2,6 @@ cmake_minimum_required (VERSION 2.6)
project (whdd)
-find_library (RT rt)
-if (RT STREQUAL "RT-NOTFOUND")
- message (SEND_ERROR "-lrt not found!")
-endif (RT STREQUAL "RT-NOTFOUND")
-
find_library (NCURSESW ncursesw)
if (NCURSESW STREQUAL "NCURSESW-NOTFOUND")
message (SEND_ERROR "-lncursesw not found!")
View
2  console_ui/CMakeLists.txt
@@ -5,6 +5,6 @@ include_directories ( ${PROJECT_SOURCE_DIR}/libdevcheck
${PROJECT_BINARY_DIR}/libdevcheck )
target_link_libraries ( whdd-cli ${PROJECT_BINARY_DIR}/libdevcheck/libdevcheck.a
- ${RT} pthread )
+ rt pthread )
install (TARGETS whdd-cli DESTINATION bin)
View
2  console_visualized_ui/CMakeLists.txt
@@ -5,7 +5,7 @@ add_dependencies (whdd-curses devcheck)
include_directories ( ${PROJECT_SOURCE_DIR}/libdevcheck
${PROJECT_BINARY_DIR}/libdevcheck)
target_link_libraries (whdd-curses
- ${RT} ${NCURSESW} ${MENUW} ${DIALOG} m pthread
+ ${NCURSESW} ${MENUW} ${DIALOG} m pthread rt
${PROJECT_BINARY_DIR}/libdevcheck/libdevcheck.a)
set_property (TARGET whdd-curses PROPERTY COMPILE_FLAGS -std=c99)
View
5 libdevcheck/CMakeLists.txt
@@ -1,4 +1,9 @@
+include (CheckSymbolExists)
+check_symbol_exists (CLOCK_MONOTONIC_RAW "time.h" HAVE_CLOCK_MONOTONIC_RAW)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+
add_custom_command (
OUTPUT version.h
COMMAND cd ${PROJECT_SOURCE_DIR}/libdevcheck/ && ./version.sh >
View
2  libdevcheck/config.h.in
@@ -0,0 +1,2 @@
+
+#cmakedefine HAVE_CLOCK_MONOTONIC_RAW
View
5 libdevcheck/libdevcheck.c
@@ -7,6 +7,7 @@
#include "libdevcheck.h"
#include "action.h"
+#include "config.h"
clockid_t DC_BEST_CLOCK;
@@ -15,6 +16,7 @@ DC_Ctx *dc_init(void) {
if (!ctx)
return NULL;
+#ifdef HAVE_CLOCK_MONOTONIC_RAW
/* determine best available clock */
int r;
struct timespec dummy;
@@ -23,6 +25,9 @@ DC_Ctx *dc_init(void) {
if (r) {
DC_BEST_CLOCK = CLOCK_MONOTONIC;
}
+#else
+ DC_BEST_CLOCK = CLOCK_MONOTONIC;
+#endif
#define ACTION_REGISTER(x) { \
extern DC_Action x; \
Something went wrong with that request. Please try again.