gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] [GCL, Axiom] proper bfd/CONST fix


From: Camm Maguire
Subject: Re: [Gcl-devel] [GCL, Axiom] proper bfd/CONST fix
Date: 17 Jun 2002 08:51:07 -0400

Greetings, and thanks for your post!

I got in this morning, and discovered your email only after committing
my own attempt to address your problem.  I see from what you've
written below that the solution I implemented probably won't work
right, and you have the right idea here.

I had to add the IN_GCC to get rid of the DEFUN macro in ansidecl.h,
which was wreaking havoc with gcl's own depending on the different
orders of header file inclusion.  As these macros are all labeled

/* These are obsolete.  Do not use.  */
#ifndef IN_GCC
#define CONST           const
#define VOLATILE        volatile
#define SIGNED          signed

#define PROTO(type, name, arglist)      type name arglist
#define EXFUN(name, proto)              name proto
#define DEFUN(name, arglist, args)      name(args)
#define DEFUN_VOID(name)                name(void)
...

we probably don't want to define the macro unless we have to.  I think
that combining the idea I had for a compile time test with your
investigations might do the trick.  Here is the configure section:

#
# Old binutils appear to need CONST defined to const
#
                        AC_MSG_CHECKING(if need to define CONST for bfd)
                        AC_TRY_RUN([#include <bfd.h>
                                    int main() { symbol_info t; return 0;}],
                                AC_MSG_RESULT(no)
                                AC_DEFINE(HAVE_LIBBFD)
                                LIBS="$LIBS  $BFDLIB $IBRLIB",
                                AC_TRY_RUN([#include <bfd.h>
                                            #define CONST const
                                            int main() {symbol_info t; return 
0;}],
                                        AC_MSG_RESULT(yes) 
                                        AC_DEFINE(NEED_CONST)
                                        AC_DEFINE(HAVE_LIBBFD)
                                        LIBS="$LIBS  $BFDLIB $IBRLIB",
                                        AC_MSG_RESULT(cannot use 
bfd),AC_MSG_RESULT(cannot use bfd)),
                                AC_MSG_RESULT(cannot use bfd))


This check will always erroneously return 'no' as I didn't define
IN_GCC in the test.  I'll upload a patch with this included now.
Please let me know if it distinguishes between your redhat boxes.

Take care,

root <address@hidden> writes:

> Camm,
> 
> I've fixed the GCL build in the correct place. The patch files are
> attached. Basically, the problem is that acconfig.h and gclincl.h.in
> both include the line:
>   #define IN_GCC
> just before including /usr/include/bfd.h. 
> bfd.h includes /usr/include/ansidecl.h.
> ansidecl.h has
>   #ifndef IN_GCC
>   #define CONST const
>   #endif
> which means that the CONST redefinition does not occur during build.
> 
> This is reasonable behavior but the current system needs the CONST
> redefinition in order to compile correctly because my copy of bfd.h
> uses uppercase CONST. However, we can't just remove the IN_GCC
> definition as this also breaks the system. So the solution is to place
> the needed CONST redefinition inline (the lines marked with + in
> acconfig.h and gclincl.h.in).
>   
> By the way, you can't test for this in configure because during
> configure the IN_GCC definition does not exist so CONST gets
> rewritten to const by default. That was the source of confusion.
> 
> It took a while to find the correct place to do this but the system
> builds cleanly from scratch now.
> 
> Tim
> 
> --- /home/gcl/acconfig.h      Wed Jun 12 22:26:01 2002
> +++ acconfig.h        Sun Jun 16 23:22:28 2002
> @@ -139,6 +139,7 @@
>  #undef HAVE_LIBBFD
>  #ifdef HAVE_LIBBFD
>  #define IN_GCC
> +#define CONST const
>  #include <bfd.h>
>  #include <bfdlink.h>
>  #endif
> 
> --- /home/gcl/h/gclincl.h.in  Wed Jun 12 22:26:01 2002
> +++ h/gclincl.h.in    Sun Jun 16 23:22:43 2002
> @@ -91,6 +91,7 @@
>  #undef HAVE_LIBBFD
>  #ifdef HAVE_LIBBFD
>  #define IN_GCC
> +#define CONST const
>  #include <bfd.h>
>  #include <bfdlink.h>
>  #endif
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]