This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR15824: Broken configure test in libcpp
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Nov 2004 06:50:58 -0700 (MST)
- Subject: Re: [PATCH] PR15824: Broken configure test in libcpp
On Tue, 23 Nov 2004, Zack Weinberg wrote:
> Roger Sayle <roger@eyesopen.com> writes:
> > My suggested fix below is to completely ignore "ansidecl.h" and
> > the not yet generated "system.h", and directly include <sys/types.h>
> > as described in this test's commentary. If sys/types.h doesn't
> > exist, we're no worse off than we currently are, but on AIX and
> > Tru64, this simplified test is sufficient to do the right thing.
> >
> > Ok for mainline?
>
> Yes, this is OK. I worry a little about systems where some other
> header is the one that defines uchar, but let's cross that bridge when
> we discover it.
Many thanks.
I apologise for teasing a second review out of you, but the form of
the patch below was dependent upon the solution chosen for PR15824.
Now that libcpp is fixed, there is a related problem in the gcc/
directory caused by the #include "../libcpp/internal.h" in the file
c-ppoutput.c. There's now a warning/bootstrap failure as libcpp's
internal.h, includes libcpp/include/cpp-id-data.h which contains the
test for HAVE_UCHAR. Unfortunately, HAVE_UCHAR is only in libcpp's
config.h, but not in gcc's auto-host.h.
My proposed solution in the patch below is to copy the configure
test for HAVE_UCHAR from libcpp's configure.ac, and repeat the
test in the gcc directory's configure.
Clearly, there's an aspect of duplication and potential divergence
that is a concern. However, with my limited autoconf knowledge
(and the lack of include guards on config.h) this seems like the
appropriate approach.
The following patch bas been tested on powerpc-ibm-aix5.2.0.0 with
a top-level "make".
Ok for mainline?
2004-11-24 Roger Sayle <roger@eyesopen.com>
* configure.ac: Copy HAVE_UCHAR test from libcpp/configure.ac.
* configure, config.in: Regenerate.
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.84
diff -c -3 -p -r2.84 configure.ac
*** configure.ac 22 Nov 2004 22:26:06 -0000 2.84
--- configure.ac 24 Nov 2004 14:42:58 -0000
*************** if test $gcc_cv_type_clock_t = yes; then
*** 1095,1100 ****
--- 1095,1112 ----
[Define if <time.h> defines clock_t.])
fi
+ AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
+ [AC_TRY_COMPILE([
+ #include <sys/types.h>
+ ],
+ [if ((uchar *)0) return 0;
+ if (sizeof(uchar)) return 0;],
+ ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
+ if test $ac_cv_type_uchar = yes; then
+ AC_DEFINE(HAVE_UCHAR, 1,
+ [Define if <sys/types.h> defines \`uchar'.])
+ fi
+
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833