option(USE_POLARSSL_TESTCERT "Link to the PolarSSL test certificate and key." OFF)
option(USE_POLARSSL_HAVEGE "Use the PolarSSL HAVEGE random generator key." OFF)
+option(USE_SHAREDMEMORY_API "Compile with Sharedmemory API support" OFF)
+
if(USE_POLARSSL_TESTCERT OR USE_POLARSSL_HAVEGE)
if(SSL MATCHES "openssl" OR SSL MATCHES "gnutls")
message(FATAL_ERROR "Selecting USE_POLARSSL_TESTCERT or USE_POLARSSL_HAVEGE implies SSL=polarssl")
# Configure options.
AC_ARG_WITH([ssl], [AC_HELP_STRING([--with-ssl=@<:@LIB@:>@], [SSL library (openssl|polarssl) @<:@default=polarssl@:>@])], [], [with_ssl=polarssl])
+AC_ARG_ENABLE([shmapi], [AC_HELP_STRING([--enable-shmapi], [compile with Sharedmemory API support @<:@default=no@:>@])],[],[enable_shmapi=no] )
AC_ARG_ENABLE(polarssl-test-cert, [ --enable-polarssl-test-cert Link to PolarSSL test certificate and key @<:@default=no@:>@], [enable_polarssl_test_cert=yes])
-AC_ARG_ENABLE(polarssl-havege, [ --enable-polarssl-havege Link to PolarSSL HAVEGE random generator key @<:@default=no@:>@ Deafult: /dev/urandom], [enable_polarssl_havege=yes])
+AC_ARG_ENABLE(polarssl-havege, [ --enable-polarssl-havege Link to PolarSSL HAVEGE random generator key @<:@default=no@:>@ Default: /dev/urandom], [enable_polarssl_havege=yes])
+
+
+
# Checks for programs.
AC_PROG_CC
AM_CONDITIONAL(USE_OPENSSL, test x$with_ssl = xopenssl)
AM_CONDITIONAL(USE_GNUTLS, test x$with_ssl = xgnutls)
+AS_IF([test "x$enable_shmapi" != xno],
+ [
+ AM_CONDITIONAL(USE_SHAREDMEMORY_API, true)
+ AC_DEFINE([USE_SHAREDMEMORY_API],[],[Use sharedmemory API])
+ ], [
+ AM_CONDITIONAL(USE_SHAREDMEMORY_API, false)
+])
+
+
+
AC_DEFINE([DEFAULT_CONFIG], ["/etc/umurmur.conf"], [Default config])
# Checks for header files.
${CMAKE_CURRENT_SOURCE_DIR}/crypt.c
${CMAKE_CURRENT_SOURCE_DIR}/log.c
${CMAKE_CURRENT_SOURCE_DIR}/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/sharedmemory.c
${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.c
${CMAKE_CURRENT_SOURCE_DIR}/messages.c
${CMAKE_CURRENT_SOURCE_DIR}/pds.c
list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssli_gnutls.c)
endif(SSL MATCHES "openssl")
+if(USE_SHAREDMEMORY_API)
+ list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/sharedmemory.c)
+endif(USE_SHAREDMEMORY_API)
+
set(SOURCE ${SOURCE} ${SOURCE_FILES} PARENT_SCOPE)
umurmurd_SOURCES+=ssli_polarssl.c
endif
endif
+
+if USE_SHAREDMEMORY_API
+umurmurd_SOURCES+=sharedmemory.c
+endif
Chan_init();
Client_init();
Ban_init();
- Sharedmemory_init();
+#ifdef USE_SHAREDMEMORY_API
+ Sharedmemory_init();
+#endif
+
#ifdef POSIX_PRIORITY_SCHEDULING
if (realtime)
setscheduler();
Server_run();
+#ifdef USE_SHAREDMEMORY_API
Sharedmemory_deinit();
+#endif
+
Ban_deinit();
SSLi_deinit();
Chan_free();
if (pollfds[nofServerSocks + i].revents & POLLOUT)
Client_write_fd(pollfds[nofServerSocks + i].fd);
}
+#ifdef USE_SHAREDMEMORY_API
Sharedmemory_update();
+#endif
}
}
+#ifndef SHAREDMEMORY_H_777736932196\r
+#define SHAREDMEMORY_H_777736932196\r
+\r
#include <stdlib.h>\r
#include <string.h>\r
\r
void Sharedmemory_init(void);\r
void Sharedmemory_update(void);\r
void Sharedmemory_deinit(void);\r
+\r
+#endif // SHAREDMEMORY_H_777736932196
\ No newline at end of file