[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
autoconf-2.13: AC_C_{CONST,INLINE} broken under g++ (gcc-2.95.2)?
From: |
Adam J. Richter |
Subject: |
autoconf-2.13: AC_C_{CONST,INLINE} broken under g++ (gcc-2.95.2)? |
Date: |
Wed, 21 Feb 2001 02:27:37 -0800 |
Under autoconf-2.13 and gcc-2.95.2, AC_C_CONST and AC_C_INLINE
will incorrectly return a negative result if called after AC_PROG_CXX.
The reason for this is that AC_PROG_CXX turns the compiler
by AC_TRY_COMPILE into the C++ compiler, which has stricter standards
than the C compiler. In particular, the section of the AC_C_CONST
test case that is valid C and invalid C++ in autoconf-2.13/acspecific.m4 is:
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x;
I have not tracked down the offending code in the AC_C_INLINE
test, but the misbehavior seems to be the same.
There are a number of possible fixes, and I'm not sure
which one is right:
1. Bracket those two lines in the AC_C_CONST test with
#ifndef __cplusplus...#endif.
2. Change AC_TRY_COMPILE to always use the C compiler. This
may break existing users of autoconf.
3. Create a new macro AC_TRY_C_COMPILE that will always use the
C compiler and have AC_C_INLINE and AC_C_CONST use it.
Attempting to use ./configure on "jade" at
ftp://sourceware.cygnus.com/pub/docbook-tools/docware/SOURCES/jade.tgz
exposed the problem. So, I am cc'ing this message to the jade maintainers.
I believe the correct fix for jade is to *delete* AC_C_CONST line from
jade/config/configure.in, because AC_C_CONST is only for that can
successfully compile with "const" defined to be the empty string.
In jade's case, that causes the compilation to bomb out, so the only
effect of AC_C_CONST. I have attached a suggested patch for jade below.
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
address@hidden \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
--- jade/config/configure.in Sat Nov 28 13:12:30 1998
+++ jade.hacked/config/configure.in Wed Feb 21 02:22:43 2001
@@ -40,6 +40,7 @@
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
+AC_C_INLINE
AC_PROG_CXX
AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
AC_PATH_PROGS(PERL, perl, perl)
@@ -76,8 +77,6 @@
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
-AC_C_CONST
-AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_CACHE_CHECK(for sig_atomic_t in signal.h,
- autoconf-2.13: AC_C_{CONST,INLINE} broken under g++ (gcc-2.95.2)?,
Adam J. Richter <=