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.octo.it/?p=rrdtool.git;a=commitdiff_plain;h=ada61d751f17efb1bce52c9ceaff1b71293a8563 make sure we pickup the correct config.h ... -- Blair Zajac blair orcaware.com git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@748 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/bindings/perl-shared/RRDs.xs b/bindings/perl-shared/RRDs.xs index f7e5360..76f86b8 100644 --- a/bindings/perl-shared/RRDs.xs +++ b/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