From 0da4ceb3b90b4f9bf1374c1fa6e8e14309f27113 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Mon, 27 Oct 2014 15:13:14 +0100 Subject: [PATCH] actually create the defines used to distinguisch the glib from the pcre cases --- configure.ac | 11 +++++++++-- m4/acinclude.m4 | 4 ++-- src/rrd_create.c | 2 +- src/rrd_graph.c | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8f53cff7..92002600 100644 --- a/configure.ac +++ b/configure.ac @@ -215,7 +215,7 @@ CONFIGURE_PART(Checking for Header Files) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -AC_CHECK_HEADERS(pcre.h langinfo.h stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h grp.h pwd.h) +AC_CHECK_HEADERS(langinfo.h stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h grp.h pwd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -552,10 +552,17 @@ AM_CONDITIONAL(BUILD_RRDRESTORE,[test $enable_rrd_restore != no]) EX_CHECK_ALL(glib-2.0, glib_check_version, glib.h, glib-2.0, 2.28.7, ftp://ftp.gtk.org/pub/glib/2.28/, "") -AC_CHECK_FUNC(g_regex_new,[],[ +AC_CHECK_FUNC(g_regex_new,[ + AC_DEFINE(HAVE_G_REGEX_NEW,[1],[our glib has g_regex_new]) +],[ AC_MSG_CHECKING(if pcre is available to supply the missing regex support in glib) AC_MSG_RESULT(checking now ...) EX_CHECK_ALL(pcre, pcre_compile, pcre.h, pcre, x.x.x, [get a newer glib and you will not need pcre at all],"") + AC_CHECK_FUNC(g_regex_new,[ + AC_DEFINE(HAVE_PCRE_COMPILE,[1],[we have pcre to replace missing regexp support form glib]) + ],[ + AC_MSG_ERROR([you need either glib with g_regex support or libpcre to compile rrdtool.]) + ]) ]) diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 234ef48d..bf7271d5 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -79,8 +79,8 @@ AC_DEFUN([EX_CHECK_ALL], LIBS="${ex_check_save_LIBS}" CPPFLAGS="${ex_check_save_CPPFLAGS}" LDFLAGS="${ex_check_save_LDFLAGS}" - fi - AC_LANG_POP(C) + fi + AC_LANG_POP(C) ] ) diff --git a/src/rrd_create.c b/src/rrd_create.c index 75121953..3b1efdf0 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -20,7 +20,7 @@ #include "rrd_tool.h" #ifndef HAVE_G_REGEX_NEW -#ifdef HAVE_PCRE_H +#ifdef HAVE_PCRE_COMPILE #include #else #error "you must have either glib with regexp support or libpcre" diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 26897f10..b61feda0 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -22,7 +22,7 @@ #ifdef HAVE_G_REGEX_NEW #include #else -#ifdef HAVE_PCRE_H +#ifdef HAVE_PCRE_COMPILE #include #else #error "you must have either glib with regexp support or libpcre" -- 2.47.3