1 From 3aefaf300478cd6fbc4892d5baaf70521ed323af Mon Sep 17 00:00:00 2001
2 From: Yves Rutschle <git1@rutschle.net>
3 Date: Thu, 9 Jul 2015 15:31:42 +0200
4 Subject: [PATCH] Added Makefile option to build without libpcre
11 VERSION=$(shell ./genver.sh -r)
12 USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
13 +USELIBPCRE=1 # Use libpcre? (necessary to use regex probe)
14 USELIBWRAP?= # Use libwrap?
15 USELIBCAP= # Use libcap?
16 COV_TEST= # Perform test coverage?
17 @@ -27,6 +28,10 @@ ifneq ($(strip $(USELIBWRAP)),)
21 +ifneq ($(strip $(USELIBPCRE)),)
25 ifneq ($(strip $(USELIBCONFIG)),)
26 LIBS:=$(LIBS) -lconfig
40 @@ -226,6 +228,7 @@ static int is_tls_protocol(const char *p
42 static int regex_probe(const char *p, int len, struct proto *proto)
45 regex_t **probe = proto->data;
46 regmatch_t pos = { 0, len };
48 @@ -233,6 +236,11 @@ static int regex_probe(const char *p, in
51 return (*probe != NULL);
53 + /* Should never happen as we check when loading config file */
54 + fprintf(stderr, "FATAL: regex probe called but not built in\n");
64 #include <libconfig.h>
72 @@ -174,6 +176,7 @@ static int config_listen(config_t *confi
74 static void setup_regex_probe(struct proto *p, config_setting_t* probes)
77 int num_probes, errsize, i, res;
80 @@ -201,6 +204,10 @@ static void setup_regex_probe(struct pro
85 + fprintf(stderr, "line %d: regex probe specified but not compiled in\n", config_setting_source_line(probes));