1# canonicalize.m4 serial 2 (gettext-0.13)
2dnl Copyright (C) 2003 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License.  As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9AC_DEFUN([gl_CANONICALIZE],
10[
11  dnl Do this replacement check manually because the file name is shorter
12  dnl than the function name.
13  AC_CHECK_FUNCS(canonicalize_file_name)
14  if test $ac_cv_func_canonicalize_file_name = no; then
15    AC_LIBOBJ(canonicalize)
16    AC_DEFINE([realpath], [rpl_realpath],
17      [Define to a replacement function name for realpath().])
18    gl_PREREQ_CANONICALIZE
19  fi
20])
21
22# Prerequisites of lib/canonicalize.c.
23AC_DEFUN([gl_PREREQ_CANONICALIZE],
24[
25  AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
26  AC_CHECK_FUNCS(getcwd readlink)
27])
28