canonicalize-lgpl: use native realpath if it works
authorEric Blake <ebb9@byu.net>
Thu, 10 Sep 2009 21:44:15 +0000 (15:44 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 18 Sep 2009 01:16:26 +0000 (19:16 -0600)
commit240faa59e81adc07c998eca0eccbee649a39af90
treea49f0cb6137097053abb5898422f1c8250c7e9ea
parent99ad8ac789556142ef090fcaefae36aabef00ca4
canonicalize-lgpl: use native realpath if it works

Forward-looking to when more platforms comply with POSIX 2008,
but don't provide glibc extensions.  For example, this could
fix // handling in cygwin 1.7 (well, if cygwin didn't have bugs
in .. handling).  canonicalize can't use native realpath, for
the same reason that it does not use resolvepath.

* lib/canonicalize-lgpl.c (realpath): Guard with
FUNC_REALPATH_WORKS.
* lib/stdlib.in.h (realpath): Make declaration optional based on
HAVE_REALPATH.
* m4/canonicalize-lgpl.m4 (gl_CANONICALIZE_LGPL): Check whether
native realpath works.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide default.
* modules/stdlib (Makefile.am): Substitute witness.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/canonicalize-lgpl.c
lib/stdlib.in.h
m4/canonicalize-lgpl.m4
m4/stdlib_h.m4
modules/stdlib