* [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
@ 2009-08-03 21:35 Pedro Lamarão
2009-08-26 22:24 ` Jason Merrill
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Lamarão @ 2009-08-03 21:35 UTC (permalink / raw)
To: gcc
Current trunk (revision 150381) fails to bootstrap with the following
configuration:
[pedro.lamarao@larissa trunk-obj]$ ../trunk/configure
--prefix=/opt/gcc-4.5 --enable-bootstrap --enable-shared
--enable-threads=posix --enable-checking --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions
--enable-languages=c,c++ --enable-build-with-cxx --with-tune=generic
--with-arch=i586 --build=i586-redhat-linux
giving the following error:
g++ -I../../trunk/libcpp -I. -I../../trunk/libcpp/../include
-I../../trunk/libcpp/include -g -W -Wall -Wwrite-strings
-Wmissing-format-attribute -pedantic -Wno-long-long
-I../../trunk/libcpp -I. -I../../trunk/libcpp/../include
-I../../trunk/libcpp/include -c -o charset.o -MT charset.o -MMD -MP -MF
.deps/charset.Tpo ../../trunk/libcpp/charset.c
In file included from ../../trunk/libcpp/system.h:342,
from ../../trunk/libcpp/charset.c:23:
../../trunk/libcpp/../include/libiberty.h:106: error: new declaration
âchar* basename(const char*)â
/usr/include/string.h:601: error: ambiguates old declaration âconst
char* basename(const char*)â
Am I missing something?
--
P.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-08-03 21:35 [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx Pedro Lamarão
@ 2009-08-26 22:24 ` Jason Merrill
2009-08-27 1:44 ` Ralf Wildenhues
0 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2009-08-26 22:24 UTC (permalink / raw)
To: Pedro Lamarão; +Cc: gcc
On 08/03/2009 04:09 PM, Pedro Lamarão wrote:
> Current trunk (revision 150381) fails to bootstrap with the following
> configuration:
> .../../trunk/libcpp/../include/libiberty.h:106: error: new declaration
> âchar* basename(const char*)â
> /usr/include/string.h:601: error: ambiguates old declaration âconst
> char* basename(const char*)â
The problem is that AC_CHECK_DECLS gets confused by overloaded
functions, and glibc 2.10 has overloaded declarations of basename and
some other string functions for const-correctness.
Jason
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-08-26 22:24 ` Jason Merrill
@ 2009-08-27 1:44 ` Ralf Wildenhues
2009-08-27 2:44 ` Pedro Lamarão
2009-08-28 3:05 ` Jason Merrill
0 siblings, 2 replies; 9+ messages in thread
From: Ralf Wildenhues @ 2009-08-27 1:44 UTC (permalink / raw)
To: Jason Merrill; +Cc: Pedro Lamarão, gcc
* Jason Merrill wrote on Wed, Aug 26, 2009 at 10:32:05PM CEST:
> On 08/03/2009 04:09 PM, Pedro Lamarão wrote:
> >Current trunk (revision 150381) fails to bootstrap with the following
> >configuration:
>
> >.../../trunk/libcpp/../include/libiberty.h:106: error: new declaration
> >âchar* basename(const char*)â
> >/usr/include/string.h:601: error: ambiguates old declaration âconst
> >char* basename(const char*)â
>
> The problem is that AC_CHECK_DECLS gets confused by overloaded
> functions, and glibc 2.10 has overloaded declarations of basename
> and some other string functions for const-correctness.
Could you show the config.log snippet that shows the failed test?
Is this a new error due to the autotools upgrade, or new due to
glibc 2.10?
Thanks,
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-08-27 1:44 ` Ralf Wildenhues
@ 2009-08-27 2:44 ` Pedro Lamarão
2009-09-10 20:06 ` Ralf Wildenhues
2009-08-28 3:05 ` Jason Merrill
1 sibling, 1 reply; 9+ messages in thread
From: Pedro Lamarão @ 2009-08-27 2:44 UTC (permalink / raw)
To: Jason Merrill, Pedro Lamarão, gcc
2009/8/26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
>> >.../../trunk/libcpp/../include/libiberty.h:106: error: new declaration
>> >‘char* basename(const char*)’
>> >/usr/include/string.h:601: error: ambiguates old declaration ‘const
>> >char* basename(const char*)’
>>
>> The problem is that AC_CHECK_DECLS gets confused by overloaded
>> functions, and glibc 2.10 has overloaded declarations of basename
>> and some other string functions for const-correctness.
>
> Could you show the config.log snippet that shows the failed test?
> Is this a new error due to the autotools upgrade, or new due to
> glibc 2.10?
I think this is new in glibc 2.10, for the reasons given by Jason Merrill above.
I've discussed this problem with Jerry Quinn before, and he had a
tentative patch that worked for me.
As I understand things, this patch is on hold waiting for a solution
to the bootstrap comparison problem being discussed in another thread.
I am waiting for a solution to these problems to continue work on the
std::sort gcc-in-cxx subproject; keeping all these patches up to date
with trunk is too difficult for me right now.
Currently, I have a patch to an old revision of the trunk.
--
P.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-08-27 1:44 ` Ralf Wildenhues
2009-08-27 2:44 ` Pedro Lamarão
@ 2009-08-28 3:05 ` Jason Merrill
1 sibling, 0 replies; 9+ messages in thread
From: Jason Merrill @ 2009-08-28 3:05 UTC (permalink / raw)
To: Pedro Lamarão, gcc
On 08/26/2009 05:36 PM, Ralf Wildenhues wrote:
> * Jason Merrill wrote on Wed, Aug 26, 2009 at 10:32:05PM CEST:
>> The problem is that AC_CHECK_DECLS gets confused by overloaded
>> functions, and glibc 2.10 has overloaded declarations of basename
>> and some other string functions for const-correctness.
>
> Could you show the config.log snippet that shows the failed test?
> Is this a new error due to the autotools upgrade, or new due to
> glibc 2.10?
The latter.
configure:5483: checking whether basename is declared
configure:5483: g++ -c -g conftest.cpp >&5
conftest.cpp: In function 'int main()':
conftest.cpp:77: error: void cast cannot resolve address of overloaded
function
configure:5483: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cpplib"
| #define PACKAGE_TARNAME "cpplib"
| #define PACKAGE_VERSION " "
| #define PACKAGE_STRING "cpplib "
| #define PACKAGE_BUGREPORT "gcc-bugs@gcc.gnu.org"
| #define PACKAGE_URL ""
| #define TIME_WITH_SYS_TIME 1
| #define STRING_WITH_STRINGS 1
| #define HAVE_LOCALE_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_OBSTACK 1
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define HAVE_CLEARERR_UNLOCKED 1
| #define HAVE_FEOF_UNLOCKED 1
| #define HAVE_FERROR_UNLOCKED 1
| #define HAVE_FFLUSH_UNLOCKED 1
| #define HAVE_FGETC_UNLOCKED 1
| #define HAVE_FGETS_UNLOCKED 1
| #define HAVE_FILENO_UNLOCKED 1
| #define HAVE_FPUTC_UNLOCKED 1
| #define HAVE_FPUTS_UNLOCKED 1
| #define HAVE_FREAD_UNLOCKED 1
| #define HAVE_FWRITE_UNLOCKED 1
| #define HAVE_GETCHAR_UNLOCKED 1
| #define HAVE_GETC_UNLOCKED 1
| #define HAVE_PUTCHAR_UNLOCKED 1
| #define HAVE_PUTC_UNLOCKED 1
| #define HAVE_DECL_ABORT 1
| #define HAVE_DECL_ASPRINTF 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| #ifndef basename
| (void) basename;
| #endif
|
| ;
| return 0;
| }
configure:5483: result: no
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-08-27 2:44 ` Pedro Lamarão
@ 2009-09-10 20:06 ` Ralf Wildenhues
2009-09-10 20:23 ` Pedro Lamarão
0 siblings, 1 reply; 9+ messages in thread
From: Ralf Wildenhues @ 2009-09-10 20:06 UTC (permalink / raw)
To: Pedro Lamarão; +Cc: Jason Merrill, gcc
* Pedro Lamarão wrote on Thu, Aug 27, 2009 at 12:24:07AM CEST:
> 2009/8/26 Ralf Wildenhues:
>
> >> >.../../trunk/libcpp/../include/libiberty.h:106: error: new declaration
> >> >âchar* basename(const char*)â
> >> >/usr/include/string.h:601: error: ambiguates old declaration âconst
> >> >char* basename(const char*)â
> >>
> >> The problem is that AC_CHECK_DECLS gets confused by overloaded
> >> functions, and glibc 2.10 has overloaded declarations of basename
> >> and some other string functions for const-correctness.
> >
> > Could you show the config.log snippet that shows the failed test?
> > Is this a new error due to the autotools upgrade, or new due to
> > glibc 2.10?
>
> I think this is new in glibc 2.10, for the reasons given by Jason Merrill above.
> I've discussed this problem with Jerry Quinn before, and he had a
> tentative patch that worked for me.
> As I understand things, this patch is on hold waiting for a solution
> to the bootstrap comparison problem being discussed in another thread.
>
> I am waiting for a solution to these problems to continue work on the
> std::sort gcc-in-cxx subproject; keeping all these patches up to date
> with trunk is too difficult for me right now.
> Currently, I have a patch to an old revision of the trunk.
Well, can you post the patch, or did I somehow miss it on the list?
I'd be particularly interested if it tries to fix the Autoconf test
in some sensible way.
Thanks,
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-09-10 20:06 ` Ralf Wildenhues
@ 2009-09-10 20:23 ` Pedro Lamarão
0 siblings, 0 replies; 9+ messages in thread
From: Pedro Lamarão @ 2009-09-10 20:23 UTC (permalink / raw)
To: Pedro Lamarão, Jason Merrill, gcc
2009/9/10 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
> * Pedro Lamarão wrote on Thu, Aug 27, 2009 at 12:24:07AM CEST:
>> 2009/8/26 Ralf Wildenhues:
>> I think this is new in glibc 2.10, for the reasons given by Jason Merrill above.
>> I've discussed this problem with Jerry Quinn before, and he had a
>> tentative patch that worked for me.
>> As I understand things, this patch is on hold waiting for a solution
>> to the bootstrap comparison problem being discussed in another thread.
>>
>> I am waiting for a solution to these problems to continue work on the
>> std::sort gcc-in-cxx subproject; keeping all these patches up to date
>> with trunk is too difficult for me right now.
>> Currently, I have a patch to an old revision of the trunk.
>
> Well, can you post the patch, or did I somehow miss it on the list?
> I'd be particularly interested if it tries to fix the Autoconf test
> in some sensible way.
I don't have it with me right now, but the solution is basically to
replace AC_CHECK_DECL(basename) with
AC_CHECK_FUNC(basename) in configure.ac.
--
P.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
2009-09-13 17:41 Jerry Quinn
@ 2009-09-14 2:25 ` Ian Lance Taylor
0 siblings, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2009-09-14 2:25 UTC (permalink / raw)
To: Jerry Quinn; +Cc: jason, Ralf.Wildenhues, pedro.lamarao, gcc
Jerry Quinn <jlquinn@optonline.net> writes:
> Index: include/libiberty.h
> ===================================================================
> --- include/libiberty.h (revision 149964)
> +++ include/libiberty.h (working copy)
> @@ -100,7 +100,7 @@
> declaration without arguments. If it is 0, we checked and failed
> to find the declaration so provide a fully prototyped one. If it
> is 1, we found it so don't provide any declaration at all. */
> -#if !HAVE_DECL_BASENAME
> +#if !HAVE_BASENAME
> #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
> extern char *basename (const char *);
> #else
This is a tough change to make. Several different packages use
libiberty.h, and they are currently responsible for ensuring that
HAVE_DECL_BASENAME is declared correctly before libiberty.h is
#included. Changing this means looking at those packages and, most
likely, changing them too.
It may be better to test whether basename exists as you suggest, but to
define HAVE_DECL_BASENAME based on HAVE_BASENAME.
(By the way, you don't need to send diffs to generate files like
configure and config.in, that just clutters up the patch. It's
sufficient to include a reminder that those files need to be
regenerated.)
Ian
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx
@ 2009-09-13 17:41 Jerry Quinn
2009-09-14 2:25 ` Ian Lance Taylor
0 siblings, 1 reply; 9+ messages in thread
From: Jerry Quinn @ 2009-09-13 17:41 UTC (permalink / raw)
To: jason, Ralf.Wildenhues, pedro.lamarao; +Cc: gcc
Ralf Wildenhues wrote:
> * Pedro LamarÃo wrote on Thu, Aug 27, 2009 at 12:24:07AM CEST:
> > 2009/8/26 Ralf Wildenhues:
> >
> > >> The problem is that AC_CHECK_DECLS gets confused by overloaded
> > >> functions, and glibc 2.10 has overloaded declarations of basename
> > >> and some other string functions for const-correctness.
> > >
> > > Could you show the config.log snippet that shows the failed test?
> > > Is this a new error due to the autotools upgrade, or new due to
> > > glibc 2.10?
> >
> > I think this is new in glibc 2.10, for the reasons given by Jason Merrill above.
> > I've discussed this problem with Jerry Quinn before, and he had a
> > tentative patch that worked for me.
> > As I understand things, this patch is on hold waiting for a solution
> > to the bootstrap comparison problem being discussed in another thread.
> >
> > I am waiting for a solution to these problems to continue work on the
> > std::sort gcc-in-cxx subproject; keeping all these patches up to date
> > with trunk is too difficult for me right now.
> > Currently, I have a patch to an old revision of the trunk.
> Well, can you post the patch, or did I somehow miss it on the list?
> I'd be particularly interested if it tries to fix the Autoconf test
> in some sensible way.
Here's the patch I sent Pedro:
Index: gcc/configure
===================================================================
--- gcc/configure (revision 149964)
+++ gcc/configure (working copy)
@@ -10650,8 +10650,9 @@
+
for ac_func in times clock kill getrlimit setrlimit atoll atoq \
- sysconf strsignal getrusage nl_langinfo \
+ sysconf strsignal getrusage nl_langinfo basename \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
do
@@ -12673,11 +12674,10 @@
-
for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \
strsignal strstr strverscmp \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
- free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
+ free getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
do
ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
Index: gcc/config.in
===================================================================
--- gcc/config.in (revision 149964)
+++ gcc/config.in (working copy)
@@ -321,6 +321,12 @@
#endif
+/* Define if your assembler supports LWSYNC instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_LWSYNC
+#endif
+
+
/* Define if your assembler supports mfcr field. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_MFCRF
@@ -351,23 +357,18 @@
#endif
-/* Define if your assembler supports popcntb instruction. */
+/* Define if your assembler supports popcntb field. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_POPCNTB
#endif
-/* Define if your assembler supports popcntd instruction. */
+/* Define if your assembler supports POPCNTD instructions. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_POPCNTD
#endif
-/* Define if your assembler supports lwsync instruction. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_AS_LWSYNC
-#endif
-
/* Define if your assembler supports .register. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_REGISTER_PSEUDO_OP
@@ -430,6 +431,12 @@
#endif
+/* Define to 1 if you have the `basename' function. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_BASENAME
+#endif
+
+
/* Define to 1 if you have the `clearerr_unlocked' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_CLEARERR_UNLOCKED
@@ -480,13 +487,6 @@
#endif
-/* Define to 1 if we found a declaration for 'basename', otherwise define to
- 0. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_DECL_BASENAME
-#endif
-
-
/* Define to 1 if we found a declaration for 'calloc', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 149964)
+++ gcc/configure.ac (working copy)
@@ -1016,7 +1016,7 @@
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \
- sysconf strsignal getrusage nl_langinfo \
+ sysconf strsignal getrusage nl_langinfo basename \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
gcc_UNLOCKED_FUNCS)
@@ -1068,7 +1068,7 @@
gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
strsignal strstr strverscmp \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
- free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[
+ free getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[
#include "ansidecl.h"
#include "system.h"])
Index: include/libiberty.h
===================================================================
--- include/libiberty.h (revision 149964)
+++ include/libiberty.h (working copy)
@@ -100,7 +100,7 @@
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
-#if !HAVE_DECL_BASENAME
+#if !HAVE_BASENAME
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
extern char *basename (const char *);
#else
Index: libcpp/configure
===================================================================
--- libcpp/configure (revision 149964)
+++ libcpp/configure (working copy)
@@ -4330,7 +4330,109 @@
done
+
+for ac_func in basename
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+else
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4730,8 +4832,110 @@
done
+
+for ac_func in basename
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+fi
+done
+
+fi
+
# Checks for typedefs, structures, and compiler characteristics.
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
@@ -6341,76 +6545,6 @@
fi
-echo "$as_me:$LINENO: checking whether basename is declared" >&5
-echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_basename+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef basename
- char *p = (char *) basename;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_have_decl_basename=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_have_decl_basename=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5
-echo "${ECHO_T}$ac_cv_have_decl_basename" >&6
-if test $ac_cv_have_decl_basename = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_BASENAME 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_BASENAME 0
-_ACEOF
-
-
-fi
echo "$as_me:$LINENO: checking whether errno is declared" >&5
echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_errno+set}" = set; then
Index: libcpp/configure.ac
===================================================================
--- libcpp/configure.ac (revision 149964)
+++ libcpp/configure.ac (working copy)
@@ -59,10 +59,12 @@
AC_LANG(C)
AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
stdlib.h strings.h string.h sys/file.h unistd.h)
+ AC_CHECK_FUNCS(basename)
else
AC_LANG(C++)
AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
stdlib.h strings.h string.h sys/file.h unistd.h)
+ AC_CHECK_FUNCS(basename)
fi
# Checks for typedefs, structures, and compiler characteristics.
@@ -81,7 +83,7 @@
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
-AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno getopt \
+AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf errno getopt \
libcpp_UNLOCKED_FUNCS vasprintf)))
# Checks for library functions.
Index: libcpp/config.in
===================================================================
--- libcpp/config.in (revision 149964)
+++ libcpp/config.in (working copy)
@@ -22,6 +22,9 @@
*/
#undef HAVE_ALLOCA_H
+/* Define to 1 if you have the `basename' function. */
+#undef HAVE_BASENAME
+
/* Define to 1 if you have the `clearerr_unlocked' function. */
#undef HAVE_CLEARERR_UNLOCKED
@@ -33,10 +36,6 @@
don't. */
#undef HAVE_DECL_ASPRINTF
-/* Define to 1 if you have the declaration of `basename', and to 0 if you
- don't. */
-#undef HAVE_DECL_BASENAME
-
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_CLEARERR_UNLOCKED
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-09-14 2:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 21:35 [gcc-in-cxx] Trunk fails to bootstrap with --enable-build-with-cxx Pedro Lamarão
2009-08-26 22:24 ` Jason Merrill
2009-08-27 1:44 ` Ralf Wildenhues
2009-08-27 2:44 ` Pedro Lamarão
2009-09-10 20:06 ` Ralf Wildenhues
2009-09-10 20:23 ` Pedro Lamarão
2009-08-28 3:05 ` Jason Merrill
2009-09-13 17:41 Jerry Quinn
2009-09-14 2:25 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).