[patch] GDB fails to compile GNU/Hurd, MAXPATHELEN/PATH_MAX issues.
Alfred M. Szmidt
ams@kemisten.nu
Fri Feb 22 15:04:00 GMT 2002
Hi,
The following will make compiling GDB fail on GNU/Hurd, as it
doesn't define the MAXPATHLEN and PATH_MAX values.
2002-01-19 Andrew Cagney <ac131313@redhat.com>
* utils.c: Include <sys/param.h> for MAXPATHLEN.
(gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined.
And here is the patch to fix the problem noted above. I didn't bother
sending the regenerate parts of configure and config.in as it would just
make a lot of noise.
2002-02-22 Alfred M. Szmidt <ams@kemisten.nu>
* configure.in: (AC_CHECK_FUNCS) Added test for canonicalize_file_name
Regenerated.
* config.h.in: Regenerated.
* utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is defined
use canonicalize_file_name.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.80
diff -u -p -r1.80 configure.in
--- configure.in 2002/02/14 05:31:45 1.80
+++ configure.in 2002/02/22 17:19:01
@@ -131,8 +131,8 @@ AC_HEADER_STAT
AC_C_CONST
-AC_CHECK_FUNCS(bcopy btowc bzero isascii poll realpath sbrk setpgid setpgrp \
- sigaction sigprocmask sigsetmask)
+AC_CHECK_FUNCS(bcopy btowc bzero canonicalize_file_name isascii poll
+ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask )
AC_FUNC_ALLOCA
AC_FUNC_VFORK
dnl AC_FUNC_SETPGRP does not work when cross compiling
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.64
diff -u -p -r1.64 utils.c
--- utils.c 2002/02/13 06:06:26 1.64
+++ utils.c 2002/02/22 17:19:02
@@ -2526,7 +2526,9 @@ string_to_core_addr (const char *my_stri
char *
gdb_realpath (const char *filename)
{
-#ifdef HAVE_REALPATH
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ return canonicalize_file_name (filename);
+#elif defined (HAVE_REALPATH)
#if defined (PATH_MAX)
char buf[PATH_MAX];
#elif defined (MAXPATHLEN)
--
Alfred M. Szmidt
More information about the Gdb-patches
mailing list