diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | runtime/msg.c | 10 | ||||
-rw-r--r-- | tools/syslogd.c | 5 |
4 files changed, 36 insertions, 2 deletions
@@ -1,5 +1,9 @@ ---------------------------------------------------------------------------- Version 7.2.2 [v7-stable] 2012-10-?? +- enabled to build without libuuid, at loss of uuid functionality + this enables smoother builds on older systems that do not support + libuuid. Loss of functionality should usually not matter too much as + uuid support has only recently been added and is very seldom used. - bugfix: omfwd did not properly support "template" parameter - bugfix: potential segfault when re_match() function was used Thanks to oxpa for the patch. diff --git a/configure.ac b/configure.ac index 331c77b7..206ad156 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,6 @@ PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.2) PKG_CHECK_MODULES(LIBEE, libee >= 0.4.0) PKG_CHECK_MODULES([JSON_C], [json]) -PKG_CHECK_MODULES([LIBUUID], [uuid]) case "${host}" in *-*-linux*) @@ -729,6 +728,23 @@ AC_SUBST(SNMP_CFLAGS) AC_SUBST(SNMP_LIBS) +# uuid support +AC_ARG_ENABLE(uuid, + [AS_HELP_STRING([--enable-uuid],[Enable support for uuid generation @<:@default=yes@:>@])], + [case "${enableval}" in + yes) enable_elasticsearch="yes" ;; + no) enable_elasticsearch="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-uuid) ;; + esac], + [enable_uuid=yes] +) +if test "x$enable_elasticsearch" = "xyes"; then + PKG_CHECK_MODULES([LIBUUID], [uuid]) + AC_DEFINE(USE_LIBUUID, 1, [Define if you want to enable libuuid support]) +fi +AM_CONDITIONAL(ENABLE_UUID, test x$enable_uuid = xyes) + + # elasticsearch support AC_ARG_ENABLE(elasticsearch, [AS_HELP_STRING([--enable-elasticsearch],[Enable elasticsearch output module @<:@default=no@:>@])], @@ -1365,6 +1381,7 @@ echo " rsyslog runtime will be built: $enable_rsyslogrt" echo " rsyslogd will be built: $enable_rsyslogd" echo " GUI components will be built: $enable_gui" echo " Unlimited select() support enabled: $enable_unlimited_select" +echo " uuid support enabled: $enable_uuid" echo echo "---{ input plugins }---" echo " Klog functionality enabled: $enable_klog ($os_type)" diff --git a/runtime/msg.c b/runtime/msg.c index d874178b..1318de22 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -45,7 +45,9 @@ #if HAVE_MALLOC_H # include <malloc.h> #endif -#include <uuid/uuid.h> +#ifdef USE_LIBUUID + #include <uuid/uuid.h> +#endif #include "rsyslog.h" #include "srUtils.h" #include "stringbuf.h" @@ -547,8 +549,10 @@ propNameStrToID(uchar *pName, propid_t *pPropID) *pPropID = PROP_MSGID; } else if(!strcmp((char*) pName, "parsesuccess")) { *pPropID = PROP_PARSESUCCESS; +#ifdef USE_LIBUUID } else if(!strcmp((char*) pName, "uuid")) { *pPropID = PROP_UUID; +#endif /* here start system properties (those, that do not relate to the message itself */ } else if(!strcmp((char*) pName, "$now")) { *pPropID = PROP_SYS_NOW; @@ -1264,6 +1268,7 @@ char *getProtocolVersionString(msg_t *pM) return(pM->iProtocolVersion ? "1" : "0"); } +#ifdef USE_LIBUUID /* note: libuuid seems not to be thread-safe, so we need * to get some safeguards in place. */ @@ -1318,6 +1323,7 @@ void getUUID(msg_t *pM, uchar **pBuf, int *piLen) } dbgprintf("[getUUID] END\n"); } +#endif void getRawMsg(msg_t *pM, uchar **pBuf, int *piLen) @@ -2796,9 +2802,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, case PROP_MSGID: pRes = (uchar*)getMSGID(pMsg); break; +#ifdef USE_LIBUUID case PROP_UUID: getUUID(pMsg, &pRes, &bufLen); break; +#endif case PROP_PARSESUCCESS: pRes = (uchar*)getParseSuccess(pMsg); break; diff --git a/tools/syslogd.c b/tools/syslogd.c index 05cbfc13..a3cbc799 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1419,6 +1419,11 @@ static void printVersion(void) #else printf("\tRuntime Instrumentation (slow code):\tNo\n"); #endif +#ifdef USE_LIBUUID + printf("\tuuid support:\t\t\t\tYes\n"); +#else + printf("\tuuid support:\t\t\t\tNo\n"); +#endif printf("\nSee http://www.rsyslog.com for more information.\n"); } |