[Daniel Burrows <Daniel_Burrows brown edu>] Re: Bug#42459: glib.m4 is incorrect for C++ programs



Here's an interesting request from a Debian GLib user. He says that
only a small change is needed to get GLib's autoconf stuff to behave
with C++; can this be implemented?



On Wed, Aug 04, 1999 at 11:34:04AM -0700, Ben Gertzfield was heard to say:
> Well, other than advocate the STL (which I won't do, as I know how evil
> it can be) I don't know what to tell you. glib is not compatible with
> C++, but that is not really a bug..

  Actually, glib is compatible with C++ (as far as I know -- at least I've
used it in C++ programs :) )  In fact, the header has an explicit 'extern "C"'
to allow C++ programs to compile against it, and I believe libgtk-- does
exactly that.  The only problem is that the aclocal macro AM_PATH_GLIB in
glib.m4 is incorrect in situations where AC_LANG_CPLUSPLUS has been given.
All I had to do to fix it was to move AM_PATH_GLIB to before AC_LANG_CPLUSPLUS,
but a 'nicer' solution is to fix AM_PATH_GLIB by altering both CFLAGS and
CPPFLAGS prior to calling AC_TRY_COMPILE.  (to my knowledge C++ and C are the
only languages that glib supports, so we don't need to worry about a slippery
slope here, with support added for every possible language.  I think.)

  Daniel

-- 
  He wasn't good or evil or cruel or extreme in any way but one, which was
that he had elevated greyness to the status of a fine art and cultivated a
mind that was as bleak and pitiless and logical as the slopes of Hell.

           -- Terry Pratchett, _The Light Fantastic__




-- 
Brought to you by the letters H and G and the number 0.
"Ohhhh, Mentos Boy!"
Debian GNU/Linux maintainer of Gimp and GTK+ -- http://www.debian.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]