Re: Need advice if changes to file_5.04-6 enabling build on GNU/Hurd are OK?
On Tue, 2011-02-08 at 23:48 +0000, Emilio Pozuelo Monfort wrote:
> On 08/02/11 23:35, Svante Signell wrote:
> > On Tue, 2011-02-08 at 14:58 -0800, Roland McGrath wrote:
> >> Many other systems have asprintf, and all GNU systems do.
> >> I doubt there is any Debian variant whose libc lacks it.
> >> For the upstream package, the right approach to portability
> >> is to use an autoconf check for the existence of asprintf.
> >> Likewise for getline.
> > Thanks you your feedback. I have just started trying to contribute to
> > make more Debian packages building under GNU/Hurd, I'm still on the
> > steep learning curve. Any pointers on how to add checks in autoconf for
> > asprintf and getline?
> AC_CHECK_FUNC. See the autoconf info manual for the exact syntax.
I can add a check for getline in configure, and a check for asprintf was
already present. However I could not change configure.ac since it was
generated by automake-1.10 and 1.11.1 is the current version. Likewise
autoconf-2.62 was used and the current version is 2.67.
Trying with the current tools caused errors even after upgrading the
build files. Also installing automake1.10 was problematic. Creating new
versions of Makefile.in created problems, since at least one patch is
against Makefile.in, not Makefile.am.
Looks like creating new build files using updated autotools is a
separate matter, especially with the need for modifying some of the
The pattern I used for the patch was
+ char * subfn;
+ char subfn[MAXPATHLEN];
+ char **filearr = NULL, *mfn;
+ (void)asprintf (&subfn, "%s/%s",
+ fn, d->d_name);
+ (void)snprintf (subfn, sizeof(subfn), "%s/%s",
+ fn, d->d_name);
Should I use #ifdef HAVE_ASPRINTF and #ifdef HAVE_GETLIE instead?
What about the header file: file.h?
+/* defines __GLIBC__ */
+/* Defines MAXPATHLEN */