=begin
When including <ruby.h> in a C program there is this error in the header:
In file included from /usr/include/ruby-1.9.0/ruby/ruby.h:25,
from /usr/include/ruby-1.9.0/ruby.h:15,
/usr/include/ruby-1.9.0/x86_64-linux/ruby/config.h:1:1: warning: "PACKAGE_NAME" redefined
In message "Re: [ruby-core:23973] [Bug #940] ruby/config.h:1:1: warning: "PACKAGE_NAME" redefined"
on Tue, 23 Jun 2009 08:24:42 +0900, Luca Bigliardi redmine@ruby-lang.org writes:
|How to reproduce:
|
|- start a project with autotools (including autoheader)
|- create a C/C++ file including both ruby.h and config.h generated by autotools
I have no idea to fix this issue when including independently
generated header files in single source file. Probably people behind
autotools know how to resolve.
If in your project you have to do conditional compilation depending
on the features found by the "./configure" script then the way to
do it is let autotools define in config.h something like HAVE_FEATURE
so in your code you simply do:
#ifdef HAVE_FEATURE
....
#endif
If in a C/C++ module you have to deal at the same time with conditional
compilation and ruby bindings then you have to include both config.h and ruby.h
Ruby somewhere defines its own PACKAGE_NAME PACKAGE_STRING PACKAGE_TARNAME
PACKAGE_VERSION which are already defined in config.h created by your "./configure".
To me it sounds like the problem comes our from the fact that you're installing your own
config.h and referencing it from an header you provide as an interface.