From: oetiker Date: Sun, 15 Jan 2006 13:31:12 +0000 (+0000) Subject: make sure we pickup the correct config.h ... -- Blair Zajac blair orcaware.com X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a6f735b6dd884d80df165c160187fce871fdaef1;p=rrdtool-all.git make sure we pickup the correct config.h ... -- Blair Zajac blair orcaware.com git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@748 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/bindings/perl-shared/RRDs.xs b/program/bindings/perl-shared/RRDs.xs index f7e5360f..76f86b8a 100644 --- a/program/bindings/perl-shared/RRDs.xs +++ b/program/bindings/perl-shared/RRDs.xs @@ -10,7 +10,25 @@ extern "C" { } #endif +/* + * rrd_tool.h includes config.h, but at least on Ubuntu Breezy Badger + * 5.10 with gcc 4.0.2, the C preprocessor picks up Perl's config.h + * which is included from the Perl includes and never reads rrdtool's + * config.h. Without including rrdtool's config.h, this module does + * not compile, so include it here with an explicit path. + * + * Because rrdtool's config.h redefines VERSION which is originally + * set via Perl's Makefile.PL and passed down to the C compiler's + * command line, save the original value and reset it after the + * includes. + */ +#define VERSION_SAVED VERSION +#undef VERSION +#include "../../config.h" #include "../../src/rrd_tool.h" +#undef VERSION +#define VERSION VERSION_SAVED +#undef VERSION_SAVED /* perl 5.004 compatibility */ #if PERLPATCHLEVEL < 5