[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] [GCL, Axiom] Confusion again
From: |
root |
Subject: |
[Gcl-devel] [GCL, Axiom] Confusion again |
Date: |
Sun, 16 Jun 2002 21:54:57 -0400 |
Camm,
Ok, I'll bite. I previously tried to compile GCL and I found out
that /usr/include/bfd.h has an uppercase CONST which was causing
the compile of main.c to fail. I fixed this with a patch to gclincl.h
which is a file generated by configure. I sent you that patch.
However, the correct way to fix this is to change configure.in.
I read up on the autoconf process and figured out how to check for
conditions and add defines to gclinst.h.
I added a test to egrep /usr/include/bfd.h for CONST and, if it was
found, to add a line that says:
#define CONST const
to the generated gclincl.h file.
Sounds simple enough, right? Well, there is a subtle problem that I
don't yet understand. The way that configure checks for the uppercase
CONST in /usr/include/bdf.h is that it creates a file called conftest.c
which reads:
#line 3404 "configure"
#include "confdefs.h"
#include </usr/include/bfd.h>
confdefs.h does not include the symbol CONST or const.
/usr/include/bfd.h includes the uppercase CONST symbol.
Next configure does
gcc -E conftest.c | egrep CONST
curiously, the gcc -E will expand all include files as you would expect
but the expanded output changes the uppercase CONST into a lowercase
const. I checked everywhere and there are no #define CONST const anywhere.
So this has two effects. First, the egrep fails to find anything and so
the #define I want to add is never added. Second, I'm puzzled as hell.
gcc -E isn't supposed to CHANGE the include file, just include it.
If I grep /usr/include/bfd.h for CONST I find it.
If I create a file (foo.c) that just does
#include </usr/include/bfd.h>
and then do
gcc -E foo.c
the uppercase CONST has been changed.
Why does this happen here but fail during the compile of main.c?
Tim
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gcl-devel] [GCL, Axiom] Confusion again,
root <=