ENDIF(NOT BUILD_CPU_MODE)
IF("${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xa -xregs=no%frameptr -xstrconst")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xa -xregs=no%frameptr -xstrconst -xc99")
set(SUN_BUILD32 "-xtarget=generic")
set(SUN_BUILD64 "-xtagret=generic64")
IF(ENABLE_OPTIMIZATION MATCHES "ON")
LIST(APPEND CMAKE_REQUIRED_LIBRARIES dl)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES resolv)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES nsl)
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES socket)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES umem)
SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
/usr/local/include
DOC "Path where the libevent header files can be found")
+FIND_PATH(LIBEVENT_EVHTTP evhttp.h PATHS /opt/include
+ /usr/include
+ /usr/local/include
+ DOC "Path where the libevhttp header files can be found")
+
GET_FILENAME_COMPONENT(LIBEVENT_PATH "${LIBEVENT_LIBRARY}" PATH)
INCLUDE_DIRECTORIES("${LIBEVENT_INCLUDE}")
LINK_DIRECTORIES("${LIBEVENT_PATH}")
CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN)
CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES)
CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG)
-CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG)
+IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
+ CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG)
+ENDIF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
IF(SUPPORT_W)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W")
ENDIF(SUPPORT_W)
#include "rrd.h"
#include "json/jansson.h"
-#include <evhttp.h>
+
#if (_EVENT_NUMERIC_VERSION > 0x02010000) && defined(HAVE_OPENSSL)
#define HAVE_WEBUI_SSL
#include <openssl/ssl.h>
#include <event2/bufferevent.h>
#include <event2/util.h>
#include <event2/bufferevent_ssl.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+#else
+#ifdef LIBEVENT_EVHTTP
+# include <evhttp.h>
+#else
+# warning "Your libevent version is too old for webui work and therefore it will be disabled"
+#endif
#endif
/* Another workaround for old libevent */
TRUE /* Killable */
};
+#if defined(LIBEVENT_EVHTTP) || (defined(_EVENT_NUMERIC_VERSION) && (_EVENT_NUMERIC_VERSION > 0x02010000))
/*
* Worker's context
*/
close_log (rspamd_main->logger);
exit (EXIT_SUCCESS);
}
+#else
+
+gpointer
+init_webui_worker (void)
+{
+ return NULL;
+}
+/*
+ * Start worker process
+ */
+void
+start_webui_worker (struct rspamd_worker *worker)
+{
+ exit (EXIT_SUCCESS);
+}
+#endif