From: Florian Forster Date: Thu, 25 Oct 2007 21:13:27 +0000 (+0200) Subject: Build system: Set the appropriate CPPFLAGS and LDFLAGS when checking for librrd and... X-Git-Tag: collectd-4.2.0~1^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c67453e4739117ddc8dab0e907953f0fb7a0170;p=collectd.git Build system: Set the appropriate CPPFLAGS and LDFLAGS when checking for librrd and it's header. --- diff --git a/configure.in b/configure.in index 6c0f3b45..eb96d4e1 100644 --- a/configure.in +++ b/configure.in @@ -683,19 +683,25 @@ AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to r ], [with_rrdtool="yes"]) if test "x$with_rrdtool" = "xyes" then - SAVE_CFLAGS="$CFLAGS" + SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" - CFLAGS="$CFLAGS $librrd_cflags" + CPPFLAGS="$CPPFLAGS $librrd_cflags" LDFLAGS="$LDFLAGS $librrd_ldflags" AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"]) - CFLAGS="$SAVE_CFLAGS" + CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" fi if test "x$with_rrdtool" = "xyes" then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + + CPPFLAGS="$CPPFLAGS $librrd_cflags" + LDFLAGS="$LDFLAGS $librrd_ldflags" + AC_CHECK_LIB(rrd_th, rrd_update_r, [with_rrdtool="yes" librrd_ldflags="$librrd_ldflags -lrrd_th -lm" @@ -709,6 +715,9 @@ then [-lm]) ] [-lm]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" fi if test "x$with_rrdtool" = "xyes" then