[omniORB] autoconf issue

Stefan Seefeld seefeld@sympatico.ca
Wed Jun 12 18:11:01 2002


hi there,

the omniconfig.h file that is installed in $prefix/include
contains macros of the form 'PACKAGE_NAME' that are obviously
not suitable for other software including that header.
AC_INIT generates these, but the config.h file is (according
to the authors) not meant to be exported.

Having experienced the exact same problem in the Fresco (Berlin)
project, I found a simple way around:

Assume that the header which is generated by the autotools is
acconfig.hh. I then define a header 'config.hh' which looks about
so:

#ifndef _Berlin_config_hh
#define _Berlin_config_hh

#include <Berlin/acconfig.hh>

#define Berlin_VERSION PACKAGE_VERSION

// silly autoconf defines them...*sigh*
// death to the macros !
//
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#endif


d.h. the autotool generated header is included, the
important information is saved into a macro with less
chance of name clashing, then all those PACKAGE macros
are undefined so they can't collide any more.
Needless to say, the only header that is ever seen by
third party software is config.hh. acconfig.hh is really
private.

I'd suggest the same kind of thing for omniconfig.h

Best regards,
		Stefan